WO2023159771A1 - 基于rpa和ai的发票处理方法、装置、设备和介质 - Google Patents
基于rpa和ai的发票处理方法、装置、设备和介质 Download PDFInfo
- Publication number
- WO2023159771A1 WO2023159771A1 PCT/CN2022/091038 CN2022091038W WO2023159771A1 WO 2023159771 A1 WO2023159771 A1 WO 2023159771A1 CN 2022091038 W CN2022091038 W CN 2022091038W WO 2023159771 A1 WO2023159771 A1 WO 2023159771A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target attribute
- invoice
- attribute field
- field
- target
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title abstract description 37
- 238000000034 method Methods 0.000 claims abstract description 72
- 238000005516 engineering process Methods 0.000 claims abstract description 20
- 239000012634 fragment Substances 0.000 claims description 114
- 238000013473 artificial intelligence Methods 0.000 claims description 51
- 238000000605 extraction Methods 0.000 claims description 28
- 238000012545 processing Methods 0.000 claims description 28
- 238000012015 optical character recognition Methods 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 19
- 238000004801 process automation Methods 0.000 claims description 3
- 239000000284 extract Substances 0.000 description 31
- 230000008569 process Effects 0.000 description 23
- 238000012549 training Methods 0.000 description 11
- 230000006870 function Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 7
- 238000003491 array Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000003058 natural language processing Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/04—Billing or invoicing
Definitions
- the present disclosure relates to the fields of artificial intelligence (AI for short) and robotic process automation (RPA for short), and in particular to an invoice processing method, device, device and medium based on RPA and AI.
- AI artificial intelligence
- RPA robotic process automation
- RPA uses specific "robot software” to simulate human operations on computers and automatically execute process tasks according to rules.
- AI is a technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.
- Intelligent Document Processing is based on Optical Character Recognition (OCR for short), Computer Vision (CV for short), Natural Language Processing (NLP for short), knowledge map ( Knowledge Graph (KG for short) and other artificial intelligence technologies can identify, classify, extract, verify and process various documents, helping enterprises to realize the intelligentization and automation of document processing, a new generation of automation technology.
- OCR Optical Character Recognition
- CV Computer Vision
- NLP Natural Language Processing
- Knowledge Graph KG for short
- other artificial intelligence technologies can identify, classify, extract, verify and process various documents, helping enterprises to realize the intelligentization and automation of document processing, a new generation of automation technology.
- invoices For enterprises, they may receive invoices in different formats. For example, when the invoice language is different, the invoice format may be different, or for the same invoice language, the invoice format may also be different. For example, the invoice language used in different regions is the same, but Each region issues invoices according to different invoice formats. In related technologies, the content of the invoice is identified and extracted in the following ways:
- the content of invoices in different formats can be identified, and the key information in the invoice content can be extracted, and the key information in the invoice content can be entered into the invoice system;
- the method of self-defined identification model is adopted to identify and extract key information of invoice contents in different formats.
- the above-mentioned first method is only applicable to invoices with a fixed format, and the applicability is not high;
- the above-mentioned second method is to manually identify and enter the key information in the invoice content, which is not only inefficient, but also error-prone;
- the above-mentioned The third method is only applicable to a limited number of invoice formats. When the number of invoice formats is large, it takes a lot of manpower to mark the training samples, which is time-consuming and labor-intensive.
- the present disclosure aims to solve one of the technical problems in the related art at least to a certain extent.
- this disclosure proposes an invoice processing method, device, device, and medium based on RPA and AI, so as to automatically identify the invoice content of the invoice to be identified through the RPA robot, and automatically extract and enter the target attribute field and The corresponding target attribute value, on the one hand, can reduce the amount of manual participation, free up human resources, and reduce labor costs;
- the accuracy of invoice content entry on the other hand, there is no restriction on the invoice format of the invoice to be identified, which can improve the flexibility and adaptability of the method.
- the embodiment of the first aspect of the present disclosure proposes an invoice processing method based on RPA and AI, and the method is executed by an RPA robot, including:
- OCR optical character recognition
- Each of the target attribute fields and the target attribute value corresponding to each of the target attribute fields are correspondingly stored.
- the embodiment of the second aspect of the present disclosure proposes an invoice processing device based on RPA and AI, which is applied to RPA robots, including:
- the first identification module is used to obtain the invoice to be identified, and to identify the invoice content of the invoice to be identified based on the optical character recognition OCR technology;
- An extraction module configured to extract each target attribute field and the target attribute value corresponding to each target attribute field from the invoice content based on a set rule
- a storage module configured to correspondingly store each of the target attribute fields and the target attribute value corresponding to each of the target attribute fields.
- the embodiment of the third aspect of the present disclosure proposes an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor.
- the processor executes the computer program, it realizes the present disclosure.
- the embodiment of the fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method as described in the above-mentioned embodiment of the first aspect of the present disclosure is implemented.
- the embodiment of the fifth aspect of the present disclosure provides a computer program product, including a computer program.
- the computer program is executed by a processor, the method as described in the above-mentioned embodiment of the first aspect of the present disclosure is implemented.
- the RPA robot Obtain the invoice to be recognized through the RPA robot, and identify the invoice content of the invoice to be recognized based on the optical character recognition OCR technology; based on the set rules, extract each target attribute field and the target attribute value corresponding to each target attribute field from the invoice content; Each target attribute field and the target attribute value corresponding to each target attribute field are correspondingly stored.
- the RPA robot automatically identifies the invoice content of the invoice to be identified, and automatically extracts and enters the target attribute field and its corresponding target attribute value in the invoice content. On the one hand, it can reduce the amount of manual participation, release human resources, and reduce manpower.
- FIG. 1 is a schematic flowchart of an invoice processing method based on RPA and AI provided by an embodiment of the present disclosure.
- Fig. 2 is a schematic flowchart of an invoice processing method based on RPA and AI provided by an embodiment of the present disclosure.
- Fig. 3 is a schematic diagram of an invoice provided by an embodiment of the present disclosure.
- Fig. 4 is a schematic diagram of an invoice provided by an embodiment of the present disclosure.
- Fig. 5 is a schematic diagram of an invoice provided by an embodiment of the present disclosure.
- FIG. 6 is a schematic flowchart of an invoice processing method based on RPA and AI provided by an embodiment of the present disclosure.
- Fig. 7 is a schematic flowchart of an invoice processing method based on RPA and AI provided by an embodiment of the present disclosure.
- Fig. 8 is a schematic flowchart of an invoice processing method based on RPA and AI provided by an embodiment of the present disclosure.
- FIG. 9 is a fourth schematic diagram of an invoice provided by an embodiment of the present disclosure.
- Fig. 10 is a schematic structural diagram of an invoice processing device based on RPA and AI provided by an embodiment of the present disclosure.
- FIG. 11 shows a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure.
- Invoice formats can be varied, and extracting and entering key information in the invoice content is a crucial work in finance.
- IDP Intelligent Document Processing
- AI Artificial Intelligence
- the first method is to manually identify the key information of the invoice content.
- the second method is to identify the key information of the invoice content by using a custom identification model.
- the invoice content can be identified through the custom template recognition model in the customized AI capability.
- the training samples can be marked manually, and the self-defined template recognition model can be trained by using the marked training samples, so as to identify the key information in the invoice content through the trained custom template recognition model.
- the above-mentioned second method is only applicable to a limited number of invoice formats, and when the number of invoice formats is large, it takes a lot of manpower to label the training samples, which is time-consuming and labor-intensive. Moreover, when the model recognizes the invoice format and When the formats of the training samples are different, the model recognition will fail.
- the present disclosure proposes an invoice processing method, device, device and medium based on RPA and AI.
- invoice refers to the business vouchers issued and received by all units and individuals in the process of buying and selling commodities, providing or receiving services, and engaging in other business activities.
- An invoice is the original document of costs, expenses or revenue incurred.
- invoice to be identified refers to an invoice that needs to be identified.
- the number of invoices to be identified can be at least one.
- the invoice formats of each invoice to be identified can be the same or different, and this disclosure does not limit this . That is, in this disclosure, the invoice format of the invoice to be identified is not limited.
- the language of the invoice to be identified is not limited, for example, the language of the invoice to be identified may be non-Chinese, and/or the language of the invoice to be identified may also be Chinese.
- OCR Optical Character Recognition
- “Invoice content” may include the name of the invoice, invoice code and number, copy and purpose, customer name, bank and account number, business (product) name or business item, unit of measurement, quantity, unit price, amount, and drawer , billing date, billing unit (individual) name (seal), billing person, billing date, payment deadline, etc.
- Target attribute field refers to the attribute field in the invoice to be identified.
- the target attribute field can include invoice number (Invoice Id), invoice date (Invoice Date), invoice time (Invoice Time), payment due date (Due Date), total cost (Invoice Total) and so on.
- the target attribute field is only exemplary, but the disclosure is not limited thereto.
- the target attribute field may also include Other attribute fields, for example, in order to distinguish the order numbers of the sales and purchase parties, the target attribute field can also include Purchase Order No (PO No for short) and Dell Order No (Dell Order No), etc., or, the target attribute field It can also include mailboxes (such as Sales Person Email), contact numbers, etc., which are not limited in this disclosure.
- Target attribute value refers to the attribute value corresponding to the target attribute field in the invoice to be identified or the content of the invoice.
- the characters contained in the target attribute value can include numbers, letters and preset symbols (such as ".”, "-", “_”, “/”, “@” etc.) at least one of.
- the target attribute field when the target attribute field is an invoice number, its corresponding target attribute value may be, for example, 11092318, MY-001 or W477-19007870.
- its corresponding target attribute value can be, for example, 2021.01.08, 2021-01-08, 08/01/2021 or 08-Jan-2021.
- its corresponding target attribute value When the target attribute field is billing time, its corresponding target attribute value may be, for example, 0:33:10AM or 1:33:10PM.
- the corresponding target attribute value When the target attribute field is the payment deadline, the corresponding target attribute value may be, for example, 2021.05.08, 2021-05-08, 08/01/2021 or 08- May-2021.
- target attribute field When the target attribute field is the total cost, its corresponding target attribute value may be, for example, 4500.00.
- the target attribute field is an email address (such as Sales Person Email)
- its corresponding target attribute value for example, can be XX_xx@xxxxxx.com.
- Setting rules refer to pre-set extraction rules, which are used to extract target attribute fields and target attribute values in invoices to be identified or invoice contents.
- the "first rule table” refers to a pre-set rule table, which is used to extract the target attribute field in the invoice to be recognized or the content of the invoice.
- the first rule table has a one-to-one correspondence with the target attribute fields, and the first rule table can be obtained according to the statistics of the corresponding target attribute fields in the invoices to be identified in different formats.
- First feature field refers to a feature field included in the first rule table, where the first feature field matches the semantics of the target attribute field corresponding to the first rule table. For example, take the invoice language of the invoice to be identified as an example in English, assuming that the target attribute field is Invoice Id (invoice number), then the first feature field in the first rule table corresponding to the target attribute field can be "Invoice No .”, “Invoice#”, “INVOICE#”, etc.
- Target text segment refers to the text segment to which the target attribute field belongs or is located in the invoice content corresponding to the invoice to be identified. Wherein, the same text segment contains characters adjacent to each other, and/or contains characters separated by a first set number (such as 1 or 2, etc.) of spaces.
- “Second feature field” refers to a preset feature field, and the second feature field is specifically a field that matches the semantics of the supplier.
- the second feature field can be "Ltd (that is, a limited company)", “SBN BHD (Sendirian Berhad, a private limited company)”, “SBN BHD”, “LTD "etc.
- “Second rule table” refers to a preset rule table, and the second rule table includes at least one second feature field.
- FIG. 1 is a schematic flowchart of an invoice processing method based on RPA and AI provided by an embodiment of the present disclosure.
- the invoice processing method based on RPA and AI provided by the embodiments of the present disclosure can be applied to an RPA robot, and the RPA robot can run on any electronic device with computing capability.
- the electronic device may be a personal computer, a mobile terminal, etc.
- the mobile terminal is, for example, a mobile phone, a tablet computer, a personal digital assistant, and other hardware devices with various operating systems.
- the RPA and AI-based invoice processing method may include the following steps:
- Step 101 acquire the invoice to be identified, and identify the invoice content of the invoice to be identified based on the OCR technology.
- the invoice content of the invoice to be identified is related to the invoice format of the invoice to be identified and/or the invoice language adopted by the invoice to be identified.
- the content of the invoice may be different, and/or Or, when the languages of the invoices to be identified are different, the contents of the invoices may also be different. For example, the content of the invoice whose language is English may be different from the content of the invoice whose language is Chinese, etc.
- the content of the invoice can be several items in the examples listed above
- the invoice format of the invoice to be identified is format 2
- the content of the invoice may not only include several items in the examples listed above, but also include email address, contact number, etc., which is not limited in the present disclosure.
- the invoices to be identified may be stored in the invoice system, and the RPA robot may log in to the invoice system to obtain the invoices to be processed from the invoice system.
- the invoice to be recognized is usually in Portable Document Format (PDF for short), or Open Fixed-layout Document (OFD for short), or image file format (such as JPG format or JPEG (Joint Photographic Experts Group , Joint Photographic Experts Group) format) are stored in the invoice system.
- PDF Portable Document Format
- OFD Open Fixed-layout Document
- image file format such as JPG format or JPEG (Joint Photographic Experts Group , Joint Photographic Experts Group) format
- the RPA robot After the RPA robot obtains the invoice to be recognized, it can perform character recognition on the invoice to be recognized based on the OCR technology in AI technology to identify the invoice content of the invoice to be recognized. For example, the invoice to be identified can be scanned based on the OCR component, and the invoice content of the invoice to be identified can be identified.
- the invoice to be identified can also be manually uploaded or sent to the device where the RPA robot is located.
- business personnel can scan the paper invoice to obtain the invoice to be identified in PDF format. Invoices, or, business personnel can take pictures of paper invoices through image acquisition devices (such as cameras, mobile terminals, etc.), to obtain invoices to be identified in image file format.
- image acquisition devices such as cameras, mobile terminals, etc.
- business personnel can upload or send the invoice to be identified to the device where the RPA robot is located.
- the RPA robot obtains the invoice to be recognized uploaded or sent by the business personnel, it can also perform character recognition on the invoice to be recognized based on OCR technology to identify the invoice content of the invoice to be recognized.
- Step 102 based on the set rule, extract each target attribute field and the target attribute value corresponding to each target attribute field from the invoice content.
- the set rule may be a preset rule.
- the target attribute field refers to the attribute field in the invoice to be identified.
- the target attribute value refers to the attribute value corresponding to the target attribute field in the invoice to be identified or invoice content.
- the RPA robot can extract each target attribute field and the target attribute value corresponding to each target attribute field from the invoice content based on the set rule.
- Step 103 correspondingly storing each target attribute field and the target attribute value corresponding to each target attribute field.
- the RPA robot can store each target attribute field and the target attribute value corresponding to each target attribute field.
- the RPA robot can store each target attribute field and the target attribute value corresponding to each target attribute field, Correspondingly stored in the target file, or, each target attribute field and the target attribute value corresponding to each target attribute field may also be correspondingly stored in the invoice system, etc., which is not limited in the present disclosure.
- the target file may be a file in a document format such as Word or Excel.
- the invoice to be recognized is obtained by the RPA robot, and the invoice content of the invoice to be recognized is identified based on the optical character recognition (OCR) technology; based on the set rules, each target is extracted from the invoice content The attribute field and the target attribute value corresponding to each target attribute field; each target attribute field and the target attribute value corresponding to each target attribute field are correspondingly stored. Therefore, the RPA robot automatically identifies the invoice content of the invoice to be identified, and automatically extracts and enters the target attribute field in the invoice content and the target attribute value corresponding to the target attribute field. On the one hand, it can reduce the amount of manual participation and release human resources.
- OCR optical character recognition
- the present disclosure also proposes an invoice processing method based on RPA and AI.
- FIG. 2 is a schematic flowchart of another RPA and AI-based invoice processing method provided by an embodiment of the present disclosure.
- the RPA and AI-based invoice processing method may include the following steps:
- Step 201 acquire the invoice to be identified, and identify the invoice content of the invoice to be identified based on the OCR technology.
- step 201 For the execution process of step 201, reference may be made to the execution process of any embodiment of the present disclosure, and details are not repeated here.
- Step 202 for each target attribute field, obtain a first rule table matching the target attribute field, wherein the first rule table includes at least one first feature field.
- each target attribute field has a corresponding first rule table, wherein the first rule table may be a preset rule table, or, considering that the format of the invoice to be recognized in actual applications may occur Change, when the format of the invoice to be identified changes, the attribute fields in the invoice to be identified may also change. Therefore, in this disclosure, in order to improve the accuracy and reliability of the extraction results of the target attribute field, the first rule table can also be Dynamic adjustments are made according to actual application requirements, which is not limited in the present disclosure.
- the first rule table may include at least one feature field, which is recorded as the first feature field in this disclosure, and each first feature field in the first rule table is obtained according to the statistics of the attribute fields in the invoices to be identified in different formats .
- the first feature fields that semantically match the invoice number Invoice Id can include "Invoice No.”, "Invoice#”, “INVOICE#”, “INVOICE:”, etc. Etc., that is, as long as the invoice number Invoice Id can be represented, it can be used as the first characteristic field of the invoice number Invoice Id, and this disclosure does not limit it.
- the invoice language of the invoice to be identified is exemplified in English.
- the target attribute field is the invoice number Invoice Id
- the first rule table corresponding to the invoice number can be shown in Table 1:
- the RPA robot may obtain a first rule table matching the target attribute field, wherein the first rule table includes at least one first characteristic field.
- Step 203 based on the first rule table, extract the target attribute field including the first feature field in the first rule table from the invoice content.
- the RPA robot may extract the target attribute field including the first characteristic field in the first rule table from the invoice content based on the first rule table.
- the RPA robot can extract the first rule table from the invoice content according to the first rule table corresponding to the invoice number Invoice Id, such as Table 1
- the target attribute field of the first feature field in , for example, assuming that the invoice content contains the first feature field "Invoice No.” in the first rule table, the RPA robot can extract the target from the invoice content based on the first rule table Attribute field "Invoice No.”. That is to say, in the present disclosure, the target attribute field extracted by the RPA robot is the same as one of the first feature fields in the first rule table.
- Step 204 extracting the target attribute value corresponding to the target attribute field from the content of the invoice.
- the RPA robot may continue to extract the target attribute value corresponding to the target attribute field from the invoice content.
- Step 205 correspondingly storing each target attribute field and the target attribute value corresponding to each target attribute field.
- step 205 For the execution process of step 205, reference may be made to the execution process of any embodiment of the present disclosure, and details are not repeated here.
- the invoice processing method based on RPA and AI in the embodiment of the present disclosure obtains the first rule table matching the target attribute field for each target attribute field, wherein the first rule table contains at least one first characteristic field; based on The first rule table extracts the target attribute field including the first characteristic field in the first rule table from the invoice content; extracts the target attribute value corresponding to the target attribute field from the invoice content. Therefore, based on the first rule table corresponding to each target attribute field, each target attribute field is extracted from the invoice content, which is easy to operate and easy to implement, and also improves the identification efficiency of the target attribute field.
- the typesetting format of each target attribute field in the invoice content and the target attribute value corresponding to each target attribute field includes the following three situations:
- the target attribute field and the corresponding target attribute value are adjacently arranged and located in the same text segment, wherein the same text segment contains characters adjacent to each other, and /or, contain each character whose interval is the first set number (such as 1 or 2, etc.) of spaces.
- the target attribute field and the corresponding target attribute value are not located in the same text segment, that is, the text segment to which the target attribute field belongs is different from the text segment to which the corresponding target attribute value belongs, and
- the target attribute field and the corresponding target attribute value are located on the same row, that is, the target attribute field and the corresponding target attribute value are arranged left and right.
- the distance between different text fragments in the invoice to be recognized needs to be greater than the set distance threshold , for example, a second set number (such as 6, 7, 8, etc.) of spaces is required between the target attribute field and the corresponding target attribute value.
- the target attribute field and the corresponding target attribute value are not located in the same text segment, and the target attribute field and the corresponding target attribute value are located in the same column, that is, the target attribute field and the corresponding target attribute value
- the target attribute value belongs to the top-bottom arrangement.
- FIG. 6 is a schematic flowchart of another RPA and AI-based invoice processing method provided by an embodiment of the present disclosure.
- the RPA and AI-based invoice processing method may include the following steps:
- Step 601 acquire the invoice to be identified, and identify the invoice content of the invoice to be identified based on the OCR technology.
- Step 602 for each target attribute field, obtain a first rule table matching the target attribute field, wherein the first rule table includes at least one first characteristic field.
- Step 603 based on the first rule table, extract the target attribute field including the first feature field in the first rule table from the invoice content.
- step 601 to step 603 reference may be made to the execution process of any embodiment of the present disclosure, and details are not repeated here.
- Step 604 from the content of the invoice, determine the target text segment where the target attribute field is located.
- the same text segment contains adjacent characters, and/or contains characters separated by a first set number of spaces (such as 1 or 2, etc.). Wherein, the first set number is a smaller value.
- the target text segment refers to the text segment to which the target attribute field belongs or is located in the invoice content.
- the target text segment of the target attribute field in the invoice content can be "Billing date: May 3, 2016", or "Invoice Date: 03-May-2016” .
- the RPA robot can determine the target text segment where the target attribute field is located from the invoice content.
- Step 605 identifying whether there are characters other than the target attribute field in the target text segment.
- the RPA robot may perform a string comparison between each character in the target text segment and each character corresponding to the target attribute field, so as to determine whether there are other characters in the target text segment except the target attribute field.
- the character string corresponding to the target text segment can be compared with the character string corresponding to the target attribute field. During the comparison, the starting point of the character string corresponding to the target attribute field in the target text segment can be identified.
- the start position and the end position according to the start position and the end position, determine whether there are other character positions in the target text segment except the start position to the end position, and determine the target text if there are other character positions Other characters than the target attribute field are present in the fragment.
- the target text fragment is "Billing date: May 3, 2016”
- the target attribute field is "Billing date:”.
- the target attribute field "Billing Date: "The corresponding character string in the target text fragment "Invoicing date: May 3, 2016” has a start position of 0 and an end position of 8. According to the start position and end position, determine the target There are other character positions in the text segment except the start position to the end position, and it is determined that other characters corresponding to other character positions in the target text segment are "May 3, 2016".
- Step 606 if there are other characters in the target text fragment except the target attribute field, use other characters as the target attribute value corresponding to the target attribute field.
- the other characters may be used as the target attribute value corresponding to the target attribute field.
- Step 607 correspondingly store each target attribute field and the target attribute value corresponding to each target attribute field.
- step 607 For the execution process of step 607, reference may be made to the execution process of any embodiment of the present disclosure, and details are not repeated here.
- the invoice processing method based on RPA and AI in the embodiment of the present disclosure determines the target text segment where the target attribute field is located from the invoice content; identifies whether there are other characters in the target text segment except the target attribute field; If there are characters other than the target attribute field in the fragment, use other characters as the target attribute value corresponding to the target attribute field. Therefore, when the target attribute field and the corresponding target attribute value are located in the same text segment, using characters other than the target attribute field in the text segment as the target attribute value corresponding to the target attribute field can not only realize the invoice content Accurate extraction of the target attribute value corresponding to the target attribute field in the target attribute field can also improve the extraction efficiency of the target attribute value.
- the present disclosure also proposes an invoice processing method based on RPA and AI. The above process will be described in detail below with reference to FIG. 7 .
- FIG. 7 is a schematic flowchart of another RPA and AI-based invoice processing method provided by an embodiment of the present disclosure.
- the RPA and AI-based invoice processing method may include the following steps:
- Step 701 acquire the invoice to be identified, and identify the invoice content of the invoice to be identified based on the OCR technology.
- Step 702 for each target attribute field, obtain a first rule table matching the target attribute field, wherein the first rule table includes at least one first characteristic field.
- Step 703 based on the first rule table, extract the target attribute field including the first feature field in the first rule table from the invoice content.
- Step 704 from the content of the invoice, determine the target text segment where the target attribute field is located.
- Step 705 identifying whether there are characters other than the target attribute field in the target text segment.
- step 701 to step 705 For the execution process of step 701 to step 705, reference may be made to the execution process of any embodiment of the present disclosure, and details are not repeated here.
- Step 706 in the case that there are no characters other than the target attribute field in the target text segment, starting from the first position of the target text segment in the invoice to be recognized, according to the set extraction direction, from the invoice to be recognized Extract other text fragments.
- the set extraction direction may be a preset direction, for example, the set extraction direction may be a direction from left to right, a direction from top to bottom, etc., which is not limited in the present disclosure.
- the RPA robot can start from the first position of the target text segment in the invoice to be recognized, and extract direction to extract additional text fragments from the invoice content.
- a coordinate system may be established on the invoice to be recognized, and the first position of the target text segment in the invoice to be recognized is determined according to the established coordinate system.
- the established coordinate system can be an image coordinate system, wherein the coordinate origin in the image coordinate system can be the center point of the invoice to be recognized, the horizontal axis (X-axis) is horizontal to the right, and the vertical axis (Y-axis) is horizontally downward , the unit is pixel. It should be noted that the above is only an example of the coordinate system as the image coordinate system.
- the above coordinate system can also be other coordinate systems, for example, it can be a pixel coordinate system, wherein the coordinate origin in the pixel coordinate system can be The upper left corner of the invoice to be identified, the X-axis is horizontally to the right, and the Y-axis is horizontally downward, the unit is pixel, or, the coordinate origin in the above coordinate system can be the upper right corner of the invoice to be identified, the X-axis is horizontally to the left, and the Y-axis is Horizontally downward, the unit is pixel, or, the coordinate origin in the above coordinate system can also be the lower left corner of the invoice to be recognized, the X axis is horizontally to the right, and the Y axis is horizontally upward, and the unit is pixel, or, in the above coordinate system
- the coordinate origin can be the lower right corner of the invoice to be recognized, the X axis is horizontal to the left, and the Y axis is horizontal to upward, and the unit is pixel, etc., which is not limited
- the present disclosure uses the coordinate system as a pixel coordinate system for illustration in the following.
- the first position of the target text segment in the above-mentioned coordinate system can be determined according to the coordinate positions of each character in the target text segment in the above-mentioned coordinate system, for example, the coordinate positions of each character in the target text segment can be averaged, The average coordinates are used as the first position of the target text fragment, or the coordinate position of the middle character in the target text fragment can be used as the first position of the target text fragment, or the coordinates of the first character in the target text fragment can be used position as the first position of the target text segment, or the coordinate position of the last character in the target text segment may be used as the first position of the target text segment, etc., and this disclosure is not limited thereto.
- the center position of the target text segment in the invoice to be recognized can be used as the first position, and starting from the first position, the RPA robot Other text fragments except the target text fragment can be extracted from the invoice to be recognized according to the set extraction direction.
- the target attribute field as the billing date as an example, assuming that the target attribute field and the corresponding target attribute value are arranged left and right, as shown in area 41 in Figure 4, that is, the target attribute field "INVOICE#" corresponds to The target attribute value "MY-001" in the invoice to be recognized is presented as:
- the RPA robot can calculate the coordinate position of each character in the target text segment where the target attribute field is located, and determine the first position of the target text segment according to the coordinate position of each character in the target text segment. In the left-to-right direction, other text fragments "MY-001" other than the target text fragment are extracted from the invoice content.
- Step 707 judging whether the format of other text fragments matches the target attribute field.
- format of the other text fragments may match the target attribute field, or may not match the target attribute field.
- the characters contained in the target attribute value corresponding to the target attribute field can include at least one of numbers, letters, and preset symbols.
- the attribute value corresponding to the invoice number can contain only numbers, or a combination of numbers and letters, or a combination of numbers, letters and preset symbols, if the characters contained in other text fragments are numbers, or A combination of numbers and letters, or a combination of numbers, letters, and preset symbols, is determined to match the format of the target attribute field, and if other text fragments contain only letters, or other text fragments contain characters from other languages, then it is determined that its format does not match the target attribute field.
- the characters contained in the attribute value corresponding to the total cost can be only numbers, or a combination of numbers and preset symbols (such as currency symbols), if the characters contained in other text fragments are digits, or a combination of digits and preset symbols, is determined to match the format of the target attribute field, and if the other text fragment contains characters only letters, or other text fragments contain characters from other languages, its format is determined to match the target Attribute fields do not match.
- the RPA robot can determine whether the format of other text fragments matches the target attribute field.
- Step 708 if the format of the other text segment matches the target attribute field, use the other text segment as the target attribute value corresponding to the target attribute field.
- the other text fragments are the text fragments where the target attribute value corresponding to the target attribute field is located. Therefore, other text fragments can be used as the target attribute field The corresponding target attribute value.
- the RPA robot can be controlled to start from the position of the above-mentioned other text fields in the invoice to be recognized, and follow the set Extraction direction, extracting candidate text fragments other than other text fragments from the invoice to be identified, and judging whether the format of the candidate text fragment matches the target attribute field, when it is judged that the format of the candidate text fragment matches the target attribute field, you can Use the candidate text segment as the target attribute value corresponding to the target attribute field, and when it is judged that the format of the candidate text segment does not match the target attribute field, you can continue to extract the candidate text segment from the electronic file according to the set extraction direction until the format of the text fragment matches the target attribute field, the text fragment can be used as the target attribute value corresponding to the target attribute field.
- the relationship between the location of other text fragments and the location of the target attribute field can be further judged, only When the location of other text fragments and the location of the target attribute field satisfy the second and third conditions above, other text fragments can be used as the target attribute value corresponding to the target attribute field.
- the second position of other text fragments in the invoice to be recognized can be further determined; the abscissa and the second position of the target text fragment at the first position
- the difference between the abscissas of the positions is less than the first difference threshold, and the difference between the ordinates of the first position and the ordinates of the second position is less than the second difference threshold
- other text fragments are corresponding to the target attribute field , where the first difference threshold is smaller than the second difference threshold.
- both the first difference threshold and the second difference threshold are preset, the first difference threshold is a smaller value, and the first difference threshold is smaller than the second difference threshold.
- the second position of other text fragments in the invoice to be recognized can be further determined, wherein the second position is determined in the same manner as the first position
- the difference between the abscissa of the first position and the abscissa of the second position can be calculated, for example, the difference can be the abscissa of the first position and the abscissa of the second position
- the difference between the abscissas of the two positions or the absolute value of the difference, or the square of the difference, etc.
- the difference between the ordinate of the first position and the ordinate of the second position may be further calculated, such as , the difference can be the difference between the ordinate of the first position and the ordinate of the second position, or the absolute value of the difference, or the square of the difference, etc.
- this situation is the above-mentioned third situation, that is, the position where the target attribute field is located and the target
- the positions of the target attribute values corresponding to the attribute fields are arranged up and down, satisfying one of the above three situations, so that other text fragments can be used as the target attribute values corresponding to the target attribute fields.
- the second position of other text fragments where each attribute value is located can be combined with The first position of the target text fragment where the target attribute field is located is matched, only the difference between the abscissa between the first position and the second position is small, and the difference between the ordinate between the first position and the second position Only when the difference is small, the other text segment corresponding to the second position is used as the target attribute value corresponding to the target attribute field.
- the abscissa between the first position and the second position can be equal, or the difference between the abscissa is small, and since the target attribute field and the target attribute value are located at Different rows or adjacent rows, therefore, the difference between the ordinates between the first position and the second position may be greater than the difference between the abscissas.
- the second position of the other text fragment in the invoice to be recognized can be further determined; the first position of the target text fragment where the target attribute field is located If the difference between the ordinate of the , and the ordinate of the second position is less than the third difference threshold, and the difference between the abscissa of the first position and the abscissa of the second position is less than the fourth difference threshold, the other text The segment serves as the target attribute value corresponding to the target attribute field; wherein, the third difference threshold is smaller than the fourth difference threshold.
- both the third difference threshold and the fourth difference threshold are preset, the third difference threshold is a smaller value, and the third difference threshold is smaller than the fourth difference threshold.
- the third difference threshold may be the same as the first difference threshold, or the third difference threshold may also be different from the first difference threshold, and correspondingly, the fourth difference threshold may be the same as the second difference threshold, or, The four difference thresholds may also be different from the second difference threshold (for example, the fourth difference threshold may be greater than the second difference threshold), which is not limited in the present disclosure.
- the second position of the other text fragment in the invoice to be recognized may be further determined.
- the difference between the ordinate of the first position and the ordinate of the second position can be calculated, after determining the ordinate of the first position and the ordinate of the second position.
- the difference between the abscissa of the first position and the abscissa of the second position can be further calculated, and the abscissa of the first position and the abscissa of the second position can be determined
- the difference between is less than the fourth difference threshold, it can be determined that this situation is the second situation above, that is, the position where the target attribute field is located and the position where the target attribute value corresponding to the target attribute field is located are arranged left and right, One of the above three situations is met. Therefore, other text fragments can be used as the target attribute value
- the second position of other text fragments where each attribute value is located can be combined with The first position of the target text fragment where the target attribute field is located is matched, only the difference between the ordinate between the first position and the second position is small, and the difference between the abscissa between the first position and the second position Only when the difference is small, the other text segment corresponding to the second position is used as the target attribute value corresponding to the target attribute field.
- the vertical coordinates between the first position and the second position can be equal, but since the target attribute field and the target attribute value are located in different columns or adjacent columns, therefore, The difference between the abscissas between the first position and the second position may be greater than the difference between the ordinates.
- Step 709 correspondingly store each target attribute field and the target attribute value corresponding to each target attribute field.
- step 709 For the execution process of step 709, reference may be made to the execution process of any embodiment of the present disclosure, and details are not repeated here.
- the first position of the target attribute field in the invoice to be recognized is used as the starting point , according to the set extraction direction, extract other text fragments from the invoice to be recognized; judge whether the format of other text fragments matches the target attribute field; if the format of other text fragments matches the target attribute field, use other text fragments as The target attribute value corresponding to the target attribute field. Therefore, if there are no characters other than the target attribute field in the target text segment, the target attribute value corresponding to the target attribute field can be effectively identified by extracting other text segments from the invoice to be recognized.
- the invoice to be identified may also include other fields, such as the field corresponding to the supplier.
- the present disclosure also proposes an invoice processing method based on RPA and AI. The above process will be described in detail below with reference to FIG. 8 .
- FIG. 8 is a schematic flowchart of another RPA and AI-based invoice processing method provided by an embodiment of the present disclosure.
- the invoice processing method based on RPA and AI may also include the following steps:
- Step 801 identifying at least one candidate text segment containing the set second feature field from the invoice content.
- the second characteristic field refers to a field that matches the semantics of the provider.
- the second feature field may be "Limited Limited Company (Ltd)", or “Private Limited Company (Sendirian Berhad, SBN BHD)", or “SBN BHD”, or “LTD” and so on.
- the second feature field is preset, and the number of the second feature field may be one, or may be multiple, which is not limited in the present disclosure.
- the candidate text segment is a text segment including the set second feature field.
- the number of candidate text segments may be one, or may be multiple, which is not limited in the present disclosure.
- the RPA robot may identify at least one candidate text segment including the set second feature field from the invoice content. For example, the RPA robot can identify a text segment containing the set second feature field from the invoice content, and use the identified text segment as a candidate text segment.
- the feature fields that match the semantics of the supplier can be counted in advance according to different formats of invoices to be identified, and at least one second feature field can be obtained, and based on the at least one second feature field A second rule table is established, that is, the second rule table includes at least one second feature field. Therefore, the RPA robot can identify at least one candidate text segment containing the second feature field from the invoice content based on the pre-established second rule table.
- the second rule table may be as shown in Table 2:
- Step 802 determine a third position of at least one candidate text segment in the invoice to be recognized.
- the RPA robot may determine a third position of at least one candidate text segment in the invoice to be recognized, where the determination method of the third position is similar to the determination mode of the first position, which will not be repeated here.
- Step 803 according to the third position of the at least one candidate text segment, determine the text segment corresponding to the supplier from the at least one candidate text segment, and store the text segment corresponding to the supplier.
- the RPA robot can determine the text segment corresponding to the supplier from the at least one candidate text segment according to the third position of the at least one candidate text segment, so that the RPA robot can store the text segment corresponding to the supplier.
- the position of the text segment of the supplier in the invoice content may be the same or different.
- the RPA robot can identify the format of the invoice to be identified, and determine the format of the invoice to be identified Finally, the RPA robot can query the above corresponding relationship according to the format of the invoice to be identified, determine the position of the text segment of the supplier corresponding to the format of the invoice to be identified (subsequently referred to as the target position), and place the third position of each candidate text segment The position is matched with the target position, and the candidate text segment matching the third position with the target position is used as the text segment where the supplier is located, and the RPA robot is controlled to store the text segment corresponding to the above-mentioned supplier.
- the RPA robot can identify from the invoice content that the candidate text segment containing the second feature field can be "xxxxxxSBN BHD" shown in area 91.
- the RPA robot can determine the third position of the candidate text segment "xxxxxxSBN BHD” in the invoice, and judge whether the ordinate of the third position is smaller than the set threshold, and if so, determine that the candidate segment is located at the upper part of the invoice to be recognized.
- it can be determined that the candidate text segment "xxxxxxSBN BHD” is the text segment corresponding to the supplier, and then the RPA robot can store the text segment corresponding to the supplier.
- the RPA robot can judge that the candidate segment 1 is located in the upper part of the invoice to be recognized, and the candidate segment 2 is located in the middle of the invoice to be recognized.
- the text segment where the supplier is located is located on the upper part of the invoice to be identified. Based on this principle, the RPA robot can determine that the candidate text segment 1 "xxxxxxSBN BHD" is the text segment corresponding to the supplier, and then RPA bots can store text snippets corresponding to suppliers.
- the RPA robot is used to identify at least one candidate text segment containing the set second feature field from the invoice content; determine at least one candidate text segment in the invoice to be identified
- the third position according to the third position of the at least one candidate text segment, determine the text segment corresponding to the supplier from the at least one candidate text segment, and store the text segment corresponding to the supplier. Therefore, the RPA robot can effectively and accurately identify the text fragment corresponding to the supplier in the invoice content according to the set second feature field, and store the text fragment corresponding to the supplier, which can improve the richness of invoice content entry.
- the invoice processing of an enterprise is used as an example for illustration, wherein, there are more than 2,000 types of invoices of the enterprise, and new invoice formats will be added continuously;
- the invoice language of the enterprise can be There are many kinds, and the present disclosure takes the invoice language as English for example.
- the format of the enterprise invoice is the image format supported by general invoice recognition, such as JPG format, JPEG format, etc.
- the number of pages of the enterprise invoice can be 1 page, or it can be multiple pages. If the invoice to be recognized has multiple pages, it can be turned manually, or The automatic page turning of the invoice to be recognized can be controlled through the program, so as to control the RPA robot to recognize the invoice content corresponding to each page, which is not limited in the present disclosure.
- the steps for identifying enterprise invoices can be:
- the fields that need to be identified in this example include Vendor Name, Invoice Id, Invoice Date, Due Date, Invoice Total, etc.
- invoices with different formats from a large number of enterprise invoices as invoices to be processed to be identified. In this example, 30 invoices to be recognized in different formats are selected.
- the invoices to be recognized are picture files in JPG format, and one picture contains one invoice.
- the Vendor Name usually contains the following fixed characters: "LTD.”, “LTD”, “SDN BHD”, “SDN.BHD.”, “BHD”, “ BHD.”, “Sdn.Bhd.”, etc., the above-mentioned fixed characters can be used as the second feature field, and the second rule table is established according to these second feature fields, as shown in FIG. 2 .
- the vendor usually appears on the upper part and the upper left corner of the invoice.
- the vendor information can be identified based on this feature, that is, the vendor name can be identified based on each invoice in the same invoice to be identified.
- the position of the candidate text fragment is to determine the text fragment of the supplier from the candidate text fragments in the same invoice to be recognized.
- the rule of the invoice number is the invoice number + the value of the invoice number.
- the invoices to be identified in different formats are counted, and the fields that match the semantics of the invoice number include: "Invoice No.”, "Invoice#", " INVOICE#” and so on, the above fields can be used as the first feature field, and the first rule table can be established according to the first feature field, as shown in Table 1.
- each character corresponding to the invoice number (Invoice Id) field, and each character corresponding to the invoice number (Invoice Id) value corresponding to the invoice number (Invoice Id) field are located in the same text segment, as shown in area 31 in Figure 3 shown. There are a total of 14 invoices to be identified that meet this situation.
- the position of the invoice number (Invoice Id) field is adjacent to the position of the value of the invoice number (Invoice Id) corresponding to the invoice number (Invoice Id) field, and they are on the same line, but the invoice number (Invoice Id)
- the distance between the location of the Id) field and the location of the Invoice Id value is greater than the set distance, that is, the Invoice Id field and the value of the Invoice Id are arranged left and right, such as Indicated by area 41 in FIG. 4 .
- the location of the invoice number (Invoice Id) field is not on the same line as the location of the invoice number (Invoice Id) value corresponding to the invoice number (Invoice Id) field, and can be separated by multiple lines, that is, the invoice number The (Invoice Id) field and the value of the invoice number (Invoice Id) are arranged up and down, as shown in area 51 in Figure 5. There are 4 invoices to be identified that meet this situation.
- the invoice number (Invoice Id) field containing the first characteristic field in the first rule table can be extracted from the invoice content, and the invoice number (Invoice Id) can be determined
- the target text fragment where the field resides In the case where there are characters other than the Invoice Id field in the target text fragment where the Invoice Id field is located, the first case is satisfied, and other characters can be used as the Invoice Id
- the position of other text fragments can be further judged to determine whether it meets the above second or third situation, for example, In the second case, between the position of other text fragments and the position of the invoice number (Invoice Id) field, the difference in abscissa is less than 45, and the difference in ordinate is less than 5 (that is, in the embodiment of FIG. 7 above, the fourth difference The threshold can be 45, and the second difference threshold can be 5), then it is determined that other text fragments are the text fragments where the value of the invoice number (Invoice Id) is located.
- the difference in abscissa is less than 5, and the difference in ordinate is less than 30 (that is, in the embodiment of FIG. 7 above, the third difference The threshold can be 30, and the first difference threshold can be 5), then it is determined that other text fragments are the text fragments where the value of the invoice number (Invoice Id) is located.
- the RPA robot can call the rule algorithm of each field, extract each field (supplier, invoice number, billing date, billing time, payment deadline, total cost, etc.), and extract each attribute field Corresponding attribute values, and write the extracted information into an Excel table.
- custom template recognition model can only recognize limited types of invoice formats, and when adding invoice formats, it needs to spend manpower to continuously label and train training samples.
- the processing device corresponds to the RPA and AI-based invoice processing method provided by the embodiments of FIGS.
- the invoice processing device will not be described in detail in the embodiments of the present disclosure.
- Fig. 10 is a schematic structural diagram of an invoice processing device based on RPA and AI provided by an embodiment of the present disclosure.
- the RPA and AI-based invoice processing device 1000 is applied to an RPA robot, and may include: a first identification module 1001 , an extraction module 1002 and a storage module 1003 .
- the first identification module 1001 is configured to acquire the invoice to be identified, and identify the invoice content of the invoice to be identified based on the optical character recognition (OCR) technology.
- OCR optical character recognition
- the extraction module 1002 is configured to extract each target attribute field and the target attribute value corresponding to each target attribute field from the invoice content based on the set rule.
- the storage module 1003 is used for correspondingly storing each target attribute field and the target attribute value corresponding to each target attribute field.
- the target attribute field includes: at least one of invoice number, billing date, billing time, payment deadline and total cost; the extraction module 1002 is configured to: for each The target attribute field is used to obtain the first rule table matching the target attribute field, wherein the first rule table contains at least one first feature field; based on the first rule table, the first rule table is extracted from the invoice content and contains the first rule table in the first rule table.
- a target attribute field of a feature field; the target attribute value corresponding to the target attribute field is extracted from the invoice content.
- the extraction module 1002 is configured to: determine the target text segment where the target attribute field is located from the invoice content; identify whether there is a target text segment other than the target attribute field Other characters; if there are other characters in the target text fragment except for the target attribute field, use other characters as the target attribute value corresponding to the target attribute field.
- the extraction module 1002 is further configured to: if there are no other characters in the target text segment except the target attribute field, use the target text segment in the invoice to be recognized
- the first position in is the starting point, according to the set extraction direction, extract other text fragments from the invoice to be recognized; judge whether the format of other text fragments matches the target attribute field; when the format of other text fragments matches the target attribute field Next, use other text fragments as the target attribute value corresponding to the target attribute field.
- the extraction module 1002 is configured to: determine the second position of the other text fragment in the invoice to be recognized when the format of the other text fragment matches the target attribute field; Where the difference between the abscissa of the first position and the abscissa of the second position is less than a first difference threshold, and the difference between the ordinate of the first position and the ordinate of the second position is less than a second difference threshold , using other text fragments as target attribute values corresponding to the target attribute field; wherein, the first difference threshold is smaller than the second difference threshold.
- the difference between the ordinate of the first position and the ordinate of the second position is less than a third difference threshold, and the difference between the abscissa of the first position and the abscissa of the second position is less than a fourth difference threshold
- the third difference threshold is smaller than the fourth difference threshold
- the RPA and AI-based invoice processing method apparatus 1000 may further include: a second identification module, a determination module, and a processing module.
- the second identification module is configured to identify at least one candidate text segment containing the set second feature field from the invoice content.
- a determining module configured to determine a third position of at least one candidate text segment in the invoice to be recognized.
- the processing module is configured to determine the text segment corresponding to the supplier from the at least one candidate text segment according to the third position of the at least one candidate text segment, and store the text segment corresponding to the supplier.
- the second identification module is configured to: identify at least one candidate text segment containing the second feature field from the invoice content based on the second rule table; wherein, the second rule The table contains at least one second feature field.
- the invoice processing device based on RPA and AI in the embodiment of the present disclosure obtains the invoice to be recognized through the RPA robot, and identifies the invoice content of the invoice to be recognized based on the optical character recognition OCR technology; based on the set rules, extracts each target from the invoice content The attribute field and the target attribute value corresponding to each target attribute field; each target attribute field and the target attribute value corresponding to each target attribute field are correspondingly stored. Therefore, the RPA robot automatically identifies the invoice content of the invoice to be identified, and automatically extracts and enters the target attribute field in the invoice content and the target attribute value corresponding to the target attribute field. On the one hand, it can reduce the amount of manual participation and release human resources.
- an embodiment of the present disclosure also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor.
- the processor executes the computer program, the The invoice processing method based on RPA and AI as described in any of the foregoing method embodiments.
- the embodiments of the present disclosure also propose a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method based on An RPA and AI approach to invoice processing.
- the embodiment of the present disclosure also proposes a computer program product, when the instruction processor in the computer program product executes, realizes the invoice processing based on RPA and AI as described in any one of the foregoing method embodiments method.
- FIG. 11 shows a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure.
- the electronic device 12 shown in FIG. 11 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
- electronic device 12 takes the form of a general-purpose computing device.
- Components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16 , system memory 28 , bus 18 connecting various system components including memory 28 and processing unit 16 .
- Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures.
- these architectures include but are not limited to Industry Standard Architecture (Industry Standard Architecture; hereinafter referred to as: ISA) bus, Micro Channel Architecture (Micro Channel Architecture; hereinafter referred to as: MAC) bus, enhanced ISA bus, video electronics Standards Association (Video Electronics Standards Association; hereinafter referred to as: VESA) local bus and Peripheral Component Interconnection (hereinafter referred to as: PCI) bus.
- Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12 and include both volatile and nonvolatile media, removable and non-removable media.
- the memory 28 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (Random Access Memory; hereinafter referred to as: RAM) 30 and/or a cache memory 32 .
- RAM Random Access Memory
- the electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media.
- storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 11, commonly referred to as a "hard drive").
- a disk drive for reading and writing to a removable non-volatile disk may be provided, as well as a disk drive for a removable non-volatile disk (such as a CD-ROM (Compact Disk).
- CD-ROM Compact Disk
- Disc ReadOnly Memory hereinafter referred to as: CD-ROM
- DVD-ROM digital multi-purpose read-only disc
- each drive may be connected to bus 18 via one or more data media interfaces.
- Memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present disclosure.
- a program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data , each or some combination of these examples may include implementations of network environments.
- the program modules 42 generally perform the functions and/or methods of the embodiments described in this disclosure.
- the electronic device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 12, and/or communicate with Any device (eg, network card, modem, etc.) that enables the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interface 22 .
- the electronic device 12 can also communicate with one or more networks (such as a local area network (Local Area Network; hereinafter referred to as: LAN), a wide area network (Wide Area Network; hereinafter referred to as: WAN) and/or a public network, such as the Internet, through the network adapter 20.
- networks such as a local area network (Local Area Network; hereinafter referred to as: LAN), a wide area network (Wide Area Network; hereinafter referred to as: WAN) and/or a public network, such as the Internet, through
- network adapter 20 communicates with other modules of electronic device 12 via bus 18 .
- other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
- the processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28 , such as implementing the methods mentioned in the foregoing embodiments.
- first and second are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features.
- the features defined as “first” and “second” may explicitly or implicitly include at least one of these features.
- “plurality” means at least two, such as two, three, etc., unless otherwise specifically defined.
- a "computer-readable medium” may be any device that can contain, store, communicate, propagate or transmit a program for use in or in conjunction with an instruction execution system, device or device.
- computer-readable media include the following: electrical connection with one or more wires (electronic device), portable computer disk case (magnetic device), random access memory (RAM), Read Only Memory (ROM), Erasable and Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM).
- the computer-readable medium may even be paper or other suitable medium on which the program can be printed, as it may be possible, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or other suitable processing if necessary.
- the program is processed electronically and stored in computer memory.
- various parts of the present disclosure may be implemented in hardware, software, firmware or a combination thereof.
- various steps or methods may be implemented by software or firmware stored in memory and executed by a suitable instruction execution system.
- a suitable instruction execution system For example, if implemented in hardware as in another embodiment, it can be implemented by any one or a combination of the following techniques known in the art: a discrete Logic circuits, ASICs with suitable combinational logic gates, Programmable Gate Arrays (PGA), Field Programmable Gate Arrays (FPGA), etc.
- each functional unit in each embodiment of the present disclosure may be integrated into one processing module, each unit may exist separately physically, or two or more units may be integrated into one module.
- the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium.
- the storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, and the like.
Landscapes
- Business, Economics & Management (AREA)
- Development Economics (AREA)
- Accounting & Taxation (AREA)
- Economics (AREA)
- Finance (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Character Input (AREA)
Abstract
本公开提出一种基于RPA和AI的发票处理方法、装置、设备和介质,涉及AI和RPA领域,其中,方法包括:RPA机器人基于OCR技术,识别待识别发票的发票内容;基于设定规则,从发票内容中提取各目标属性字段和各目标属性字段对应的目标属性值;将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。
Description
相关申请的交叉引用
本申请基于申请号为202210178839.9、申请日为2022年02月25日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
本公开涉及人工智能(Artificial Intelligence,简称AI)和机器人流程自动化(Robotic Process Automation,简称RPA)领域,尤其涉及一种基于RPA和AI的发票处理方法、装置、设备和介质。
RPA是通过特定的“机器人软件”,模拟人在计算机上的操作,按规则自动执行流程任务。
AI是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门技术科学。
智能文档处理(Intelligent Document Processing,简称IDP)是基于光学字符识别(Optical Character Recognition,简称OCR)、计算机视觉(Computer Vision,简称CV)、自然语言处理(Natural Language Processing,简称NLP)、知识图谱(Knowledge Graph,简称KG)等人工智能技术,对各类文档进行识别、分类、抽取、校验等处理,帮助企业实现文档处理工作的智能化和自动化的新一代自动化技术。
对于企业而言,可能接收到不同格式的发票,比如,当发票语言不同时,发票格式可能不同,或者,对于同一发票语言,发票格式也可能不同,例如,不同地区采用的发票语言相同,但是各地区按照不同的发票格式开具发票。在相关技术中,通过以下几种方式,对发票内容进行识别和提取:
第一,通过IDP模型对格式固定统一的发票进行内容识别和提取;
第二,通过人工阅读发票的方式,来实现对不同格式的发票内容进行识别,并提取发票内容中的关键信息,将发票内容中的关键信息录入至发票系统;
第三,采用自定义识别模型的方式,对不同格式的发票内容进行关键信息识别和提取。
然而上述第一种方式,只适用于格式固定的发票,适用性不高;上述第二种方式,由人工识别并录入发票内容中关键信息的方式,不仅效率较低,而且还易出错;上述第三种方式,只适用于有限的发票格式种类,当发票格式种类数量较大时,需要耗费大量人力对训练样本进行标注,耗时耗力。
发明内容
本公开旨在至少在一定程度上解决相关技术中的技术问题之一。
为此,本公开提出一种基于RPA和AI的发票处理方法、装置、设备和介质,以实现通过RPA机器人自动识别待识别发票的发票内容,并自动提取和录入发票内容中的目标属性字段和其对应的目标属性值,一方面,可以降低人工参与量,释放人力资源,降低人力成本,另一方面,可以提高发票内容的识别效率和录入效率,还可以避免人工录入易出错的情况,提升发票内容录入的准确性,又一方面,对待识别发票的发票格式不做限制,可以提升该方法的灵活性和适应性。
本公开第一方面实施例提出了一种基于RPA和AI的发票处理方法,所述方法由RPA机器人执行,包括:
获取待识别发票,并基于光学字符识别OCR技术,识别所述待识别发票的发票内容;
基于设定规则,从所述发票内容中提取各目标属性字段和各所述目标属性字段对应的目标属性值;
将各所述目标属性字段和各所述目标属性字段对应的目标属性值进行对应存储。
本公开第二方面实施例提出了一种基于RPA和AI的发票处理装置,应用于RPA机器人,包括:
第一识别模块,用于获取待识别发票,并基于光学字符识别OCR技术,识别所述待识别发票的发票内容;
提取模块,用于基于设定规则,从所述发票内容中提取各目标属性字段和各所述目标属性字段对应的目标属性值;
存储模块,用于将各所述目标属性字段和各所述目标属性字段对应的目标属性值进行对应存储。
本公开第三方面实施例提出了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如本公开上述第一方面实施例所述的方法。
本公开第四方面实施例提出了一种非临时性计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如本公开上述第一方面实施例所述的方法。
本公开第五方面实施例提出了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现如本公开上述第一方面实施例所述的方法。
本公开实施例所提供的技术方案包含如下的有益效果:
通过RPA机器人获取待识别发票,并基于光学字符识别OCR技术,识别待识别发票的发票内容;基于设定规则,从发票内容中提取各目标属性字段和各目标属性字段对应的目标属性值;将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。由此,通过RPA机器人自动识别待识别发票的发票内容,并自动提取和录入发票内容中的目标属性字段和其对应的目标属性值,一方面,可以降低人工参与量,释放人力资源,降低人力成本;另一方面,可以提高发票内容的识别效率和录入效率,还可以避免人工录入易出错的情况,提升发票内容录入的准确性;又一方面,对待识别发票的发票格式不做限制,可以提升该方法的灵活性和适应性;再一方面,基于规则识别并提取发票内容中的属性字段和属性值,在新增发票格式时,只需修改规则算法即可,而无需花费大量人力不断地对训练样本进行标注和训练,可以降低人工参与量,释放人力资源。
本公开附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本公开的实践了解到。
本公开上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1为本公开实施例所提供的一种基于RPA和AI的发票处理方法的流程示意图。
图2为本公开实施例所提供的一种基于RPA和AI的发票处理方法的流程示意图。
图3为本公开实施例所提供的一种发票示意图。
图4为本公开实施例所提供的一种发票示意图。
图5为本公开实施例所提供的一种发票示意图。
图6为本公开实施例所提供的一种基于RPA和AI的发票处理方法的流程示意图。
图7为本公开实施例所提供的一种基于RPA和AI的发票处理方法的流程示意图。
图8为本公开实施例所提供的一种基于RPA和AI的发票处理方法的流程示意图。
图9为本公开实施例所提供的一种发票示意图四。
图10为本公开实施例所提供的一种基于RPA和AI的发票处理装置的结构示意图。
图11示出了适于用来实现本公开实施方式的示例性电子设备的框图。
下面详细描述本公开的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本公开,而不能理解为对本公开的限制。
发票格式可以是多种多样的,而将发票内容中的关键信息进行提取和录入是财务方面一项至关重要的工作。针对格式固定统一的发票,较容易训练出一个识别准确率较高的智能文档处理(Intelligent Document Processing,简称IDP)模型,比如预训练人工智能(Artificial Intelligence,简称AI)能力中的通用多票据识别模型。
针对格式不固定的发票,可以采用以下两种方式,来实现对发票内容进行识别:
第一种,采用人工方式,对发票内容进行关键信息识别。
但是上述第一种人工识别的方式,不仅费时费力、效率较低,而且不利于企业的发展。
第二种,采用自定义识别模型的方式,对发票内容进行关键信息识别。比如,可以通过定制化AI能 力中的自定义模板识别模型,对发票内容进行识别。具体地,可以通过人工标注训练样本,并采用标注后的训练样本对自定义模板识别模型进行训练,以通过训练后的自定义模板识别模型,识别发票内容中的关键信息。
但是上述第二种方式,只适用于有限的发票格式种类,而当发票格式种类数量较大时,需要耗费大量人力对训练样本进行标注,耗时耗力,并且,当模型识别的发票格式与训练样本的格式不同时,会导致模型识别失败。
针对上述问题,本公开提出了一种基于RPA和AI的发票处理方法、装置、设备和介质。
下面参考附图描述本公开实施例的基于RPA和AI的发票处理方法、装置、设备和介质。在具体描述本公开实施例之前,为了便于理解,首先对常用技术词进行介绍:
“发票(invoice)”,是指一切单位和个人在购销商品、提供或接受服务以及从事其他经营活动中,所开具和收取的业务凭证。发票是发生的成本、费用或收入的原始凭证。
“待识别发票”,是指需要进行识别的发票。本公开中,待识别发票的个数可以为至少一个,当待识别发票的个数为多个时,各待识别发票的发票格式可以相同,或者也可以不同,本公开对此并不做限制。即本公开中,对待识别发票的发票格式不作限定。
此外,本公开中,对待识别发票的发票语言也不作限制,比如,待识别发票的发票语言可以为非中文,和/或,待识别发票的发票语言也可以为中文。
“光学字符识别(Optical Character Recognition,简称OCR)”,是指电子设备检查纸上打印的字符,通过检测暗、亮的模式确定其形状,然后用字符识别方法将形状翻译成计算机文字的过程;即,针对印刷体字符,采用光学的方式将纸质文档中的文字转换成为黑白点阵的图像文件,并通过识别软件将图像中的文字转换成文本格式,供文字处理软件进一步编辑加工的技术。
“发票内容”,可以包括发票的名称、发票代码和号码、联次及用途、客户名称、开户银行及账号、商(产)品名称或经营项目、计量单位、数量、单价、金额、开票人、开票日期、开票单位(个人)名称(章)、开票人、开票日期、支付截止日期等。
“目标属性字段”,是指待识别发票中的属性字段。比如,目标属性字段可以包括发票号(Invoice Id)、开票日期(Invoice Date)、开票时间(Invoice Time)、支付截止日期(Due Date)、费用总计(Invoice Total)等等。
应当理解的是,上述目标属性字段仅是示例性的,但本公开并不限于此,实际应用时,对于不同格式和/或采用不同发票语言的待识别发票而言,目标属性字段还可以包括其他属性字段,比如,为了区分销售和采购双方的订单号,目标属性字段还可以包括采购订单号(Purchase Order No,简称PO No)和戴尔订单号(Dell Order No)等,或者,目标属性字段还可以包括为邮箱(比如销售私人邮箱Sales Person Email)、联系电话等等,本公开对此不做限制。
“目标属性值”,是指目标属性字段在待识别发票或发票内容中对应的属性值。以待识别发票所采用的发票语言为英文进行示例,目标属性值中包含的字符可以包括数字、字母和预设符号(比如“.”、“-”、“_”“/”、“@”等)中的至少一项。
举例而言,当目标属性字段是发票号时,其对应的目标属性值,比如可以为11092318、MY-001或W477-19007870。当目标属性字段是开票日期时,其对应的目标属性值,比如可以为2021.01.08、2021-01-08、08/01/2021或08-Jan-2021。当目标属性字段是开票时间时,其对应的目标属性值,比如可以为0:33:10AM或1:33:10PM。当目标属性字段是支付截止日期时,其对应的目标属性值,比如可以为2021.05.08、2021-05-08、08/05/2021或08-May-2021。当目标属性字段是费用总计时,其对应的目标属性值,比如可以为4500.00。当目标属性字段为邮箱(比如销售私人邮箱Sales Person Email)时,其对应的目标属性值,比如可以为XX_xx@xxxxxx.com。
“设定规则”,是指预先设定的提取规则,用于提取待识别发票或发票内容中的目标属性字段和目标属性值。
“第一规则表”,是指预先设定的规则表,用于提取待识别发票或发票内容中的目标属性字段。其中,第一规则表与目标属性字段是一一对应的,第一规则表可以根据不同格式的待识别发票中对应的目标属性字段统计得到。
“第一特征字段”,是指第一规则表中包含的特征字段,其中,第一特征字段与第一规则表对应的目标属性字段的语义匹配。举例而言,以待识别发票的发票语言为英文进行示例,假设目标属性字段为Invoice Id(发票号),则该目标属性字段对应的第一规则表中的第一特征字段可以为“Invoice No.”、“Invoice#”、“INVOICE#”等。
“目标文本片段”,是指目标属性字段在待识别发票对应的发票内容中所属或所在的文本片段。其中,同一个文本片段内包含位置相邻的各个字符,和/或,包含间隔为第一设定个数(比如1或2等)空格的各字符。
“第二特征字段”,是指预先设定的特征字段,该第二特征字段具体为与供应商语义匹配的字段。举例而言,以待识别发票的发票语言为英文进行示例,第二特征字段可以为“Ltd(即有限公司)”、“SBN BHD(SendirianBerhad,私人有限公司)”、“SBN BHD”、“LTD”等等。
“第二规则表”,是指预先设定的规则表,该第二规则表中包括至少一个第二特征字段。
图1为本公开实施例所提供的一种基于RPA和AI的发票处理方法的流程示意图。
本公开实施例提供的基于RPA和AI的发票处理方法,可应用于RPA机器人,该RPA机器人可以运行在任一具有计算能力的电子设备中。其中,该电子设备可以是个人电脑、移动终端等,移动终端例如为手机、平板电脑、个人数字助理等具有各种操作系统的硬件设备。
如图1所示,该基于RPA和AI的发票处理方法可以包括以下步骤:
步骤101,获取待识别发票,并基于OCR技术,识别待识别发票的发票内容。
在本公开实施例中,待识别发票的发票内容与待识别发票的发票格式和/或待识别发票所采用的发票语言相关,当待识别发票的发票格式不同时,发票内容可以不同,和/或,当待识别发票所采用的发票语言不同时,发票内容也可以不同。比如,发票语言为英文的发票内容可以不同于发票语言为中文的发票内容等,再比如,当待识别发票的发票格式为格式1时,发票内容可以是上述所列举的例子中的几项,当待识别发票的发票格式为格式2时,发票内容不仅可以包括上述所列举的例子中的几项,还可以包括邮箱、联系电话等等,本公开对此不做限制。
在本公开实施例的一种可能的实现方式中,待识别发票可以存储于发票系统中,RPA机器人可以登录发票系统,以从发票系统中获取待处理的待识别发票。
其中,待识别发票通常以可携带文档格式(Portable Document Format,简称PDF),或者版式文档格式(Open Fixed-layout Document,简称OFD),或者图像文件格式(比如JPG格式或JPEG(Joint Photographic Experts Group,联合图像专家组)格式)存储于发票系统中。
RPA机器人在获取待识别发票后,可以基于AI技术中的OCR技术,对待识别发票进行字符识别,以识别待识别发票的发票内容。比如,可以基于OCR组件扫描待识别发票,识别待识别发票的发票内容。
在本公开实施例的另一种可能的实现方式中,也可以通过人工上传或发送待识别发票至RPA机器人所在的设备,比如,业务人员可以对纸质发票进行扫描,得到PDF格式的待识别发票,或者,业务人员可以通过图像采集设备(比如相机、移动终端等)对纸质发票进行拍照,得到图像文件格式的待识别发票。业务人员在获取到待识别发票后,可以将待识别发票上传或发送至RPA机器人所在的设备。RPA机器人在获取到业务人员上传或发送的待识别发票后,同样可以基于OCR技术,对待识别发票进行字符识别,以识别待识别发票的发票内容。
步骤102,基于设定规则,从发票内容中提取各目标属性字段和各目标属性字段对应的目标属性值。
在本公开实施例中,设定规则可以是预先设定的规则。
在本公开实施例中,目标属性字段指的是待识别发票中的属性字段待识别发票。
在本公开实施例中,目标属性值是指目标属性字段在待识别发票或发票内容中对应的属性值。
在本公开实施例中,RPA机器人可以基于设定规则,从发票内容中提取各目标属性字段和各目标属性字段对应的目标属性值。
步骤103,将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。
在本公开实施例中,RPA机器人可以将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储,比如,RPA机器人可以将各目标属性字段和各目标属性字段对应的目标属性值,对应存储至目标文件中,或者,也可以将各目标属性字段和各目标属性字段对应的目标属性值,对应存储至发票系统, 等等,本公开对此不做限制。
其中,对目标文件的文档格式不做限制,比如,目标文件可以为Word、Excel等文档格式的文件。
本公开实施例的基于RPA和AI的发票处理方法,通过RPA机器人获取待识别发票,并基于光学字符识别OCR技术,识别待识别发票的发票内容;基于设定规则,从发票内容中提取各目标属性字段和各目标属性字段对应的目标属性值;将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。由此,通过RPA机器人自动识别待识别发票的发票内容,并自动提取和录入发票内容中的目标属性字段和目标属性字段对应的目标属性值,一方面,可以降低人工参与量,释放人力资源,降低人力成本;另一方面,可以提高发票内容的识别效率和录入效率,并且,还可以避免人工录入易出错的情况,提升发票内容录入的准确性和可靠性;又一方面,对待识别发票的发票格式不做限制,可以提升该方法的灵活性和适应性;再一方面,基于规则识别并提取发票内容中的属性字段和属性值,在新增发票格式时,只需修改规则算法即可,而无需花费大量人力不断地对训练样本进行标注和训练,可以降低人工参与量,释放人力资源。为了清楚说明本公开任一实施例中RPA机器人是如何提取得到各目标属性字段和各目标属性字段对应的目标属性值的,本公开还提出一种基于RPA和AI的发票处理方法。
图2为本公开实施例所提供的另一种基于RPA和AI的发票处理方法的流程示意图。
如图2所示,该基于RPA和AI的发票处理方法可以包括以下步骤:
步骤201,获取待识别发票,并基于OCR技术,识别待识别发票的发票内容。
步骤201的执行过程可以参见本公开任一实施例的执行过程,在此不做赘述。
步骤202,针对每个目标属性字段,获取与目标属性字段匹配的第一规则表,其中,第一规则表中包含至少一个第一特征字段。
在本公开实施例中,每个目标属性字段均具有对应的第一规则表,其中,第一规则表可以为预先设定的规则表,或者,考虑到实际应用中待识别发票的格式可能发生变化,当待识别发票的格式发生变化时,待识别发票中的属性字段也可能发生变化,因此,本公开中,为了提升目标属性字段提取结果的准确性和可靠性,第一规则表还可以根据实际应用需求进行动态调整,本公开对此并不做限制。
其中,第一规则表中可以包括至少一个特征字段,本公开中记为第一特征字段,第一规则表中的各第一特征字段是根据不同格式的待识别发票中的属性字段统计得到的。
在本公开实施例中,第一规则表中的各第一特征字段的语义与该第一规则表对应的目标属性字段的语义匹配,即第一规则表中的各第一特征字段能够表征该第一规则表对应的目标属性字段。举例说明,当目标属性字段为发票号Invoice Id时,与发票号Invoice Id语义匹配的各第一特征字段可以包括“Invoice No.”、“Invoice#”、“INVOICE#”、“INVOICE:”等等,即只要能够表征发票号Invoice Id,均可以作为发票号Invoice Id的第一特征字段,本公开对此不做限制。
作为一种示例,以待识别发票的发票语言为英文进行示例性说明,假设目标属性字段为发票号Invoice Id,则发票号对应的第一规则表可以如表1所示:
表1第一规则表
序号 | 第一特征字段(前置为“发票”字样) |
1 | Invoice# |
2 | Invoice No. |
3 | INVOICE# |
4 | Invoice No: |
5 | TaxReg.No.: |
6 | INVOICE: |
7 | Sales Invoice |
8 | Doc No. |
9 | Invoice number: |
10 | OUR INVOICE NO.: |
11 | Invoice No |
12 | Invoice No# |
13 | NO.: |
14 | Purchase Invoice |
15 | NO. |
16 | Invoice |
在本公开实施例中,针对每个目标属性字段,RPA机器人可以获取与目标属性字段匹配的第一规则表,其中,第一规则表中包含至少一个第一特征字段。
步骤203,基于第一规则表,从发票内容中提取包含第一规则表中的第一特征字段的目标属性字段。
在本公开实施例中,RPA机器人可以基于第一规则表,从发票内容中提取包含第一规则表中的第一特征字段的目标属性字段。
仍以上述例子进行示例性说明,当目标属性字段为发票号Invoice Id时,RPA机器人可以根据该发票号Invoice Id对应的第一规则表,例如表1,从发票内容中提取包含第一规则表中的第一特征字段的目标属性字段,比如,假设发票内容中包含第一规则表中的第一特征字段“Invoice No.”,则RPA机器人基于第一规则表,可以从发票内容中提取目标属性字段“Invoice No.”。也就是说,本公开中,RPA机器人所提取的目标属性字段与第一规则表中的其中一个第一特征字段相同。
步骤204,从发票内容中提取目标属性字段对应的目标属性值。
在本公开实施例中,RPA机器人在从发票内容中提取目标属性字段后,可以继续从发票内容中提取目标属性字段对应的目标属性值。
步骤205,将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。
步骤205的执行过程可以参见本公开任一实施例的执行过程,在此不做赘述。
本公开实施例的基于RPA和AI的发票处理方法,通过针对每个目标属性字段,获取与目标属性字段匹配的第一规则表,其中,第一规则表中包含至少一个第一特征字段;基于第一规则表,从发票内容中提取包含第一规则表中的第一特征字段的目标属性字段;从发票内容中提取目标属性字段对应的目标属性值。由此,基于各目标属性字段对应的第一规则表,从发票内容中提取各目标属性字段,操作简单且易于实现,并且,还提升目标属性字段的识别效率。
需要解释的是,在实际应用场景中,发票内容中各目标属性字段和各目标属性字段对应的目标属性值的排版格式包含以下三种情形:
第一种情形,如图3中区域31所示,目标属性字段和对应的目标属性值相邻排布,且位于同一文本片段中,其中,同一文本片段内包含位置相邻的各个字符,和/或,包含间隔为第一设定个数(比如1或2等)空格的各字符。
第二种情形,如图4中区域41所示,目标属性字段和对应的目标属性值未位于同一文本片段,即目标属性字段所属的文本片段与对应的目标属性值所属的文本片段不同,且目标属性字段与对应的目标属性值位于同一行,即目标属性字段和对应的目标属性值属于左右排布。可以理解的是,为了便于人工查看或审核发票内容,一般情况下,当目标属性字段和对应的目标属性值左右排布时,待识别发票中不同文本片段之间的距离需要大于设定距离阈值,比如,目标属性字段和对应的目标属性值之间需要间隔第二设定个数(比如6、7、8等)的空格。
第三种情形,如图5中区域51所示,目标属性字段和对应的目标属性值未位于同一文本片段,且目标属性字段与对应的目标属性值位于同一列,即目标属性字段和对应的目标属性值属于上下排布。
在上述第一种情形下,为了清楚说明RPA机器人是如何从发票内容中提取目标属性字段对应的目标属性值的,本公开还提出一种基于RPA和AI的发票处理方法,下面结合图6,对上述过程进行详细说明。
图6为本公开实施例所提供的另一种基于RPA和AI的发票处理方法的流程示意图。
如图6所示,该基于RPA和AI的发票处理方法可以包括以下步骤:
步骤601,获取待识别发票,并基于OCR技术,识别待识别发票的发票内容。
步骤602,针对每个目标属性字段,获取与目标属性字段匹配的第一规则表,其中,第一规则表中包含至少一个第一特征字段。
步骤603,基于第一规则表,从发票内容中提取包含第一规则表中的第一特征字段的目标属性字段。
步骤601至步骤603的执行过程可以参见本公开任一实施例的执行过程,在此不做赘述。
步骤604,从发票内容中,确定目标属性字段所在的目标文本片段。
在本公开实施例中,同一个文本片段内包含位置相邻的各个字符,和/或,包含间隔为第一设定个数(比如1或2等)空格的各字符。其中,第一设定个数为较小的取值。
在本公开实施例中,目标文本片段指的是目标属性字段在发票内容中所属或所在的文本片段。例如,以目标属性字段为开票日期进行示例,该目标属性字段在发票内容中所在的目标文本片段可以为“开票日期:2016年5月3日”,或“Invoice Date:03-May-2016”。
在本公开实施例中,RPA机器人可以从发票内容中,确定目标属性字段所在的目标文本片段。
步骤605,识别目标文本片段内是否存在除目标属性字段之外的其他字符。
在本公开实施例中,RPA机器人可以对目标文本片段中的各字符和目标属性字段对应的各字符进行字符串比对,以确定目标文本片段中是否存在除目标属性字段之外的其他字符。
举例而言,可以将目标文本片段对应的字符串和目标属性字段对应的字符串进行字符串比对,在比对的过程中,可以标识目标属性字段对应的字符串在目标文本片段中的起始位置和结束位置,根据起始位置和结束位置,确定目标文本片段中是否存在除起始位置至结束位置之外的其他字符位置,并在确定存在其他字符位置的情况下,可以确定目标文本片段中存在除目标属性字段之外的其他字符。
比如,目标本文片段为“开票日期:2016年5月3日”,目标属性字段为“开票日期:”,通过对目标本文片段和目标属性字段进行字符串比对,识别到目标属性字段“开票日期:”对应的字符串在目标本文片段“开票日期:2016年5月3日”对应的字符串中的起始位置为0,结束位置为8,根据起始位置和结束位置,确定该目标文本片段中存在除起始位置至结束位置之外的其他字符位置,并确定目标文本片段中的其他字符位置处对应的其他字符为“2016年5月3日”。
需要解释的是,在对目标文本片段中各字符和目标属性字段对应的各字符进行字符串比对的过程中,根据起始位置和结束位置,确定目标文本片段中不存在除起始位置至结束位置之外的其他字符位置时,可以确定目标文本中不存在除目标属性字段之外的其他字符。
步骤606,在目标文本片段内存在除目标属性字段之外的其他字符的情况下,将其他字符作为目标属性字段对应的目标属性值。
在本公开实施例中,在目标文本片段内存在除目标属性字段之外的其他字符的情况下,可以将其他字符作为目标属性字段对应的目标属性值。
步骤607,将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。
步骤607的执行过程可以参见本公开任一实施例的执行过程,在此不做赘述。
本公开实施例的基于RPA和AI的发票处理方法,通过从发票内容中,确定目标属性字段所在的目标文本片段;识别目标文本片段内是否存在除目标属性字段之外的其他字符;在目标文本片段内存在除目标属性字段之外的其他字符的情况下,将其他字符作为目标属性字段对应的目标属性值。由此,在目标属性字段和对应的目标属性值位于同一文本片段时,将该文本片段中除目标属性字段之外的其他字符,作为目标属性字段对应的目标属性值,不仅能够实现对发票内容中目标属性字段对应的目标属性值进行准确提取,还可以提升目标属性值的提取效率。
可以理解的是,上述实施例中,在将目标文本片段中的各字符和目标属性字段中的各字符进行字符串比对时,还可能存在以下情形:目标文本片段中未存在除目标属性字段之外的其他字符。
当目标文本片段内不存在除目标属性字段之外的其他字符,即上述第二种或第三种情形时,为了清楚说明RPA机器人是如何从发票内容中提取目标属性字段对应的目标属性值的,本公开还提出一种基于RPA和AI的发票处理方法,下面结合图7,对上述过程进行详细说明。
图7为本公开实施例所提供的另一种基于RPA和AI的发票处理方法的流程示意图。
如图7所示,该基于RPA和AI的发票处理方法可以包括以下步骤:
步骤701,获取待识别发票,并基于OCR技术,识别待识别发票的发票内容。
步骤702,针对每个目标属性字段,获取与目标属性字段匹配的第一规则表,其中,第一规则表中包含至少一个第一特征字段。
步骤703,基于第一规则表,从发票内容中提取包含第一规则表中的第一特征字段的目标属性字段。
步骤704,从发票内容中,确定目标属性字段所在的目标文本片段。
步骤705,识别目标文本片段内是否存在除目标属性字段之外的其他字符。
步骤701至步骤705的执行过程可以参见本公开任一实施例的执行过程,在此不做赘述。
步骤706,在目标文本片段内未存在除目标属性字段之外的其他字符的情况下,以目标文本片段在待识别发票中的第一位置为起点,按照设定提取方向,从待识别发票中提取其他文本片段。
在本公开实施例中,设定提取方向可以为预先设定的方向,比如,设定提取方向可以为从左向右的方向、从上到下的方向等,本公开对此不做限制。
在本公开实施例中,在目标文本片段内未存在除目标属性字段之外的其他字符的情况下,RPA机器人可以以目标文本片段在待识别发票中的第一位置为起点,按照设定提取方向,从发票内容中提取其他文本片段。
其中,可以在待识别发票上建立坐标系,根据建立的坐标系,确定目标文本片段在待识别发票中的第一位置。例如,建立的坐标系可以为图像坐标系,其中,图像坐标系中的坐标原点,可以为待识别发票的中心点,横轴(X轴)水平向右,纵轴(Y轴)水平向下,单位是像素。需要说明的是,上述仅以坐标系为图像坐标系进行示例,实际应用时,上述坐标系也可以为其他坐标系,比如可以为像素坐标系,其中,像素坐标系中的坐标原点,可以为待识别发票的左上角,X轴水平向右,Y轴水平向下,单位是像素,或者,上述坐标系中的坐标原点,可以为待识别发票的右上角,X轴水平向左,Y轴水平向下,单位是像素,或者,上述坐标系中的坐标原点,还可以为待识别发票的左下角,X轴水平向右,Y轴水平向上,单位是像素,或者,上述坐标系中的坐标原点,可以为待识别发票的右下角,X轴水平向左,Y轴水平向上,单位是像素,等等,本公开对此并不作限制。
为了便于计算和说明,本公开后续以坐标系为像素坐标系进行示例说明。
其中,目标文本片段在上述坐标系中的第一位置,可以根据目标文本片段中各字符在上述坐标系中的坐标位置确定,比如,可以将目标文本片段中各字符的坐标位置求取平均,将平均坐标作为目标文本片段的第一位置,或者,可以将目标文本片段中的中间字符的坐标位置,作为目标文本片段的第一位置,或者,可以将目标文本片段中的首个字符的坐标位置,作为目标文本片段的第一位置,或者,可以将目标文本片段中的最后一个字符的坐标位置,作为目标文本片段的第一位置,等等,本公开对此并不做限制。
举例说明,在目标文本片段内未存在除目标属性字段之外的其他字符的情况下,可以将待识别发票中目标文本片段的中心位置作为第一位置,以该第一位置为起点,RPA机器人可以按照设定提取方向,从待识别发票中提取除目标文本片段之外的其他文本片段。
比如,以目标属性字段为开票日期进行示例,假设目标属性字段和对应的目标属性值的排布形式为左右排布,如图4中区域41所示,即目标属性字段“INVOICE#”与对应的目标属性值“MY-001”,在待识别发票中的呈现形式为:
“INVOICE# MY-001”;
RPA机器人可以计算目标属性字段所在的目标文本片段中各字符的坐标位置,根据目标文本片段中各字符的坐标位置,确定该目标文本片段的第一位置,以该第一位置为起点,按照从左向右的方向,从发票内容中提取除目标文本片段之外的其他文本片段“MY-001”。
步骤707,判断其他文本片段的格式是否与目标属性字段匹配。
可以理解的是,其他文本片段的格式可以与目标属性字段匹配,或者,也可以与目标属性字段不匹配。
举例说明,假设待识别发票所采用的发票语言为英文,目标属性字段对应的目标属性值中包含的字符可以包括数字、字母和预设符号中的至少一项,比如,当目标属性字段为发票号时,发票号对应的属性值所包含的字符可以仅为数字,或者为数字和字母的组合,或者为数字、字母和预设符号的组合,如果其他文本片段包含的字符为数字,或者为数字和字母的组合,或者为数字、字母和预设符号的组合,则确定其格式与目标属性字段匹配,而如果其他文本片段包含的字符仅为字母,或者其他文本片段包含其他语言的字符,则确定其格式与目标属性字段不匹配。
再例如,当目标属性字段为费用总计时,费用总计对应的属性值所包含的字符可以仅为数字,或者为数字和预设符号(比如货币符号)的组合,如果其他文本片段包含的字符为数字,或者为数字和预设 符号的组合,则确定其格式与目标属性字段匹配,而如果其他文本片段包含的字符仅为字母,或者其他文本片段包含其他语言的字符,则确定其格式与目标属性字段不匹配。
在本公开实施例中,RPA机器人可以判断其他文本片段的格式是否与目标属性字段匹配。
步骤708,在其他文本片段的格式与目标属性字段匹配的情况下,将其他文本片段作为目标属性字段对应的目标属性值。
在本公开实施例中,在其他文本片段的格式与目标属性字段匹配时,可以确定其他文本片段是目标属性字段对应的目标属性值所在的文本片段,因此,可以将其他文本片段作为目标属性字段对应的目标属性值。
应当理解的是,还可能存在其他文本片段的格式与目标属性字段不匹配的情况,在这种情况下,可以控制RPA机器人以上述其他文本字段在待识别发票中的位置为起点,按照设定提取方向,从待识别发票中提取除其他文本片段之外的候选文本片段,并判断候选文本片段的格式是否与目标属性字段匹配,当判断出候选文本片段的格式与目标属性字段匹配时,可以将该候选文本片段作为目标属性字段对应的目标属性值,而当判断出候选文本片段的格式与目标属性字段不匹配时,可以继续按照设定提取方向从电子文件中提取除候选文本片段之外的文本片段,直至上述文本片段的格式与目标属性字段匹配时,可以将该文本片段作为目标属性字段对应的目标属性值。
在本公开的一种可能的实现方式中,在其他文本片段的格式与目标属性字段匹配的情况下,还可以进一步判断其他文本片段所在的位置和目标属性字段所在的位置之间的关系,只有当其他文本片段所在的位置和目标属性字段所在的位置满足上述第二种情形和第三种情形,才可以将其他文本片段作为目标属性字段对应的目标属性值。
作为一种示例,在其他文本片段的格式与目标属性字段匹配的情况下,可以进一步确定其他文本片段在待识别发票中的第二位置;在目标文本片段的第一位置的横坐标和第二位置的横坐标之间的差异小于第一差异阈值,且第一位置的纵坐标和第二位置的纵坐标之间的差异小于第二差异阈值的情况下,将其他文本片段作为目标属性字段对应的目标属性值,其中,第一差异阈值小于第二差异阈值。
其中,第一差异阈值和第二差异阈值均为预先设定的,第一差异阈值为较小的取值,且第一差异阈值小于第二差异阈值。
在本公开中,在其他文本片段的格式与目标属性字段匹配的情况下,可以进一步确定其他文本片段在待识别发票中的第二位置,其中,第二位置的确定方式与第一位置的确定方式类似,此处不作赘述。在确定其他文本片段在待识别发票中的第二位置之后,可以计算第一位置的横坐标和第二位置的横坐标之间的差异,比如,该差异可以为第一位置的横坐标和第二位置的横坐标之间的差值,或者为差值的绝对值,或者为差值的平方等。在确定第一位置的横坐标和第二位置的横坐标之间的差异小于第一差异阈值的情况下,可以进一步计算第一位置的纵坐标和第二位置的纵坐标之间的差异,比如,该差异可以为第一位置的纵坐标和第二位置的纵坐标之间的差值,或者为差值的绝对值,或者为差值的平方等。在确定第一位置的纵坐标和第二位置的纵坐标之间的差异小于第二差异阈值的情况下,可以确定此种情形为上述第三种情形,即目标属性字段所在的位置和该目标属性字段对应的目标属性值所在的位置为上下排布,满足上述三种情形中的一种,从而可以将其他文本片段作为目标属性字段对应的目标属性值。
也就是说,本公开中,考虑到同一列中可能存在多个属性值,然而与目标属性字段匹配的目标属性值只有一个,因此,可以将各个属性值所在的其他文本片段的第二位置与目标属性字段所在的目标文本片段的第一位置进行匹配,只有第一位置和第二位置之间的横坐标之间的差异较小,且第一位置和第二位置之间的纵坐标之间的差异较小的情况下,才将该第二位置对应的其他文本片段作为目标属性字段对应的目标属性值。
其中,在目标属性字段和目标属性值上下排布时,第一位置和第二位置之间的横坐标可以相等,或者横坐标之间的差异较小,而由于目标属性字段和目标属性值位于不同行或相邻行,因此,第一位置和第二位置之间的纵坐标之间的差异可以大于横坐标之间的差异。
作为另一种示例,在其他文本片段的格式与目标属性字段匹配的情况下,可以进一步确定其他文本片段在待识别发票中的第二位置;在目标属性字段所在的目标文本片段的第一位置的纵坐标和第二位置的纵坐标之间的差异小于第三差异阈值,且第一位置的横坐标和第二位置的横坐标之间的差异小于第四 差异阈值的情况下,将其他文本片段作为目标属性字段对应的目标属性值;其中,第三差异阈值小于第四差异阈值。
其中,第三差异阈值和第四差异阈值均为预先设定的,第三差异阈值为较小的取值,且第三差异阈值小于第四差异阈值。需要说明的是,第三差异阈值可以与第一差异阈值相同,或者,第三差异阈值也可以与第一差异阈值不同,相应的,第四差异阈值可以与第二差异阈值相同,或者,第四差异阈值也可以与第二差异阈值不同(比如第四差异阈值可以大于第二差异阈值),本公开对此并不做限制。
在本公开中,在其他文本片段的格式与目标属性字段匹配的情况下,可以进一步确定其他文本片段在待识别发票中的第二位置。在确定其他文本片段在待识别发票中的第二位置之后,可以计算第一位置的纵坐标和第二位置的纵坐标之间的差异,在确定第一位置的纵坐标和第二位置的纵坐标之间的差异小于第三差异阈值的情况下,可以进一步计算第一位置的横坐标和第二位置的横坐标之间的差异,在确定第一位置的横坐标和第二位置的横坐标之间的差异小于第四差异阈值的情况下,可以确定此种情形为上述第二种情形,即目标属性字段所在的位置和该目标属性字段对应的目标属性值所在的位置为左右排布,满足上述三种情形中的一种。从而可以将其他文本片段作为目标属性字段对应的目标属性值。
也就是说,本公开中,考虑到同一行中可能存在多个属性值,然而与目标属性字段匹配的目标属性值只有一个,因此,可以将各个属性值所在的其他文本片段的第二位置与目标属性字段所在的目标文本片段的第一位置进行匹配,只有第一位置和第二位置之间的纵坐标之间的差异较小,且第一位置和第二位置之间的横坐标之间的差异较小的情况下,才将该第二位置对应的其他文本片段作为目标属性字段对应的目标属性值。
其中,在目标属性字段和目标属性值左右排布时,第一位置和第二位置之间的纵坐标可以相等,但是,由于目标属性字段和目标属性值位于不同列或相邻列,因此,第一位置和第二位置之间的横坐标之间的差异可以大于纵坐标之间的差异。
步骤709,将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。
步骤709的执行过程可以参见本公开任一实施例的执行过程,在此不做赘述。
本公开实施例的基于RPA和AI的发票处理方法,通过在目标文本片段内未存在除目标属性字段之外的其他字符的情况下,以目标属性字段在待识别发票中的第一位置为起点,按照设定提取方向,从待识别发票中提取其他文本片段;判断其他文本片段的格式是否与目标属性字段匹配;在其他文本片段的格式与目标属性字段匹配的情况下,将其他文本片段作为目标属性字段对应的目标属性值。由此,在目标文本片段内不存在除目标属性字段之外的其他字符的情况下,可以通过从待识别发票中提取其他文本片段的方式,来有效识别目标属性字段对应的目标属性值。且,通过对其他文本片段的格式进行校验,只有在其他文本片段的格式与目标属性字段匹配的情况下,才将其他文本片段作为目标属性字段对应的目标属性值,可以提升目标属性字段对应的目标属性值提取结果的准确性和可靠性。
需要说明的是,待识别发票中除了可以包括一些属性字段之外,还可能包括其他字段,比如供应商所对应的字段,为了清楚说明本公开中RPA机器人是如何识别得到发票内容中的供应商所对应的字段的,本公开还提出一种基于RPA和AI的发票处理方法。下面结合图8,对上述过程进行详细说明。
图8为本公开实施例所提供的另一种基于RPA和AI的发票处理方法的流程示意图。
如图8所示,在上述任一实施例的基础上,该基于RPA和AI的发票处理方法还可以包括以下步骤:
步骤801,从发票内容中,识别包含设定的第二特征字段的至少一个候选文本片段。
在本公开实施例中,第二特征字段指的是与供应商语义匹配的字段。比如,第二特征字段可以为“有限公司(简称Ltd)”,或“私人有限公司(SendirianBerhad,简称SBN BHD)”,或“SBN BHD”,或“LTD”等等。其中,第二特征字段为预先设定的,且第二特征字段的个数可以为一个,或者也可以为多个,本公开对此不做限制。
在本公开实施例中,候选文本片段为包含设定的第二特征字段的文本片段。其中,候选文本片段的个数可以为一个,或者也可以为多个,本公开对此不做限制。
在本公开实施例中,RPA机器人可以从发票内容中,识别包含设定的第二特征字段的至少一个候选文本片段。比如,RPA机器人可以从发票内容中,识别包含设定的第二特征字段的文本片段,并将识别得到的文本片段作为候选文本片段。
在本公开实施例的一种可能的实现方式中,可以预先根据不同格式的待识别发票,统计与供应商语 义匹配的特征字段,得到至少一个第二特征字段,并根据至少一个第二特征字段建立第二规则表,即第二规则表中包含至少一个第二特征字段。从而,RPA机器人可以基于预先建立的第二规则表,从发票内容中识别包含第二特征字段的至少一个候选文本片段。
作为一种示例,以待识别发票的发票语言为英文进行示例性说明,第二规则表可以如表2所示:
表2第二规则表
序号 | 第二特征字段(包含“公司”字样) |
1 | LTD. |
2 | LTD |
3 | SDN BHD |
4 | SDN.BHD. |
5 | BHD |
6 | BHD. |
7 | Sdn.Bhd. |
步骤802,确定至少一个候选文本片段在待识别发票中的第三位置。
在本公开实施例中,RPA机器人可以确定至少一个候选文本片段在待识别发票中的第三位置,其中,第三位置的确定方式与第一位置的确定方式类似,在此不做赘述。
步骤803,根据至少一个候选文本片段的第三位置,从至少一个候选文本片段中确定供应商对应的文本片段,并存储供应商对应的文本片段。
在本公开实施例中,RPA机器人可以根据至少一个候选文本片段的第三位置,从至少一个候选文本片段中确定供应商对应的文本片段,从而RPA机器人可以存储供应商对应的文本片段。
需要说明的是,对于不同格式的发票,发票内容中供应商所在文本片段的位置可以相同,也可以不相同,在本公开实施例的一种可能的实现方式中,可以预先针对不同格式的发票,统计供应商所在文本片段的位置,并建立发票格式与供应商所在文本片段的位置之间的对应关系,从而本公开中,RPA机器人可以识别待识别发票的格式,在确定待识别发票的格式后,RPA机器人可以根据待识别发票的格式,查询上述对应关系,确定与待识别发票的格式对应的供应商所在文本片段的位置(后续称为目标位置),并将各候选文本片段的第三位置与目标位置进行匹配,将第三位置与目标位置匹配的候选文本片段,作为供应商所在的文本片段,并控制RPA机器人存储上述供应商对应的文本片段。
比如,以待识别发票如图9所示,第二特征字段为“SBN BHD”进行示例,其中,图9所示的待识别发票对应的布局格式中,供应商所在的文本片段位于发票的上部。RPA机器人可以根据表2中的第二特征字段“SBN BHD”,从发票内容中,识别包含该第二特征字段的候选文本片段可以为区域91中所示的“xxxxxxSBN BHD”。RPA机器人可以确定该候选文本片段“xxxxxxSBN BHD”在发票中的第三位置,并判断第三位置的纵坐标是否小于设定阈值,若是,则确定该候选片段位于待识别发票的上部,此时,可以确定该候选文本片段“xxxxxxSBN BHD”为供应商对应的文本片段,进而RPA机器人可以存储供应商对应的文本片段。
再比如,以待识别发票如图9所示,第二特征字段为“SBN BHD”和“LTD”进行示例,RPA机器人可以根据第二特征字段“SBN BHD”和“LTD”,从发票内容中,识别包含第二特征字段的候选文本片段1为区域91中所示的“xxxxxxSBN BHD”,和候选文本片段2为区域92中所示的“xxxxxxx LTD”,并分别确定候选文本片段1“xxxxxxSBN BHD”在发票中的第三位置1,和候选文本片段2“xxxxxxx LTD”在发票中的第三位置2。RPA机器人可以根据第三位置1和第三位置2,判断候选片段1位于待识别发票的上部,候选片段2位于待识别发票的中部。在这张待识别发票对应的布局格式中,供应商所在的文本片段位于待识别发票的上部,基于此原理,RPA机器人可以确定候选文本片段1“xxxxxxSBN BHD”为供应商对应的文本片段,进而RPA机器人可以存储供应商对应的文本片段。
本公开实施例的基于RPA和AI的发票处理方法,通过RPA机器人从发票内容中,识别包含设定的第二特征字段的至少一个候选文本片段;确定至少一个候选文本片段在待识别发票中的第三位置;根据至少一个候选文本片段的第三位置,从至少一个候选文本片段中确定供应商对应的文本片段,并存储供应商对应的文本片段。由此,RPA机器人可以根据设定的第二特征字段,有效且准确地识别发票内容中 供应商对应的文本片段,并存储该供应商对应的文本片段,可以提升发票内容录入的丰富性。
在本公开的任一实施例中,以处理某企业的发票进行示例性说明,其中,该企业的发票种类大概有2000多种,且会不断增加新的发票格式;该企业的发票语言可以为多种,本公开以发票语言为英文进行示例。
第一,为了实现对发票内容进行有效识别,可以满足以下前置条件:
1.企业发票的格式为通用发票识别支持的图片格式,如JPG格式、JPEG格式等。
2.如果企业发票的格式为PDF格式,则该企业发票的页数可以为1页,或者也可以为多页,在待识别发票为多页的情况下,可以通过人工翻页,或者,也可以通过程序控制待识别发票自动翻页,以控制RPA机器人识别各页对应的发票内容,本公开对此并不做限制。
第二,识别企业发票的步骤可以为:
一、确定客户需要识别的字段。本次示例需要识别的字段有供应商(Vendor Name)、发票号(Invoice Id)、开票日期(Invoice Date)、支付截止日期(Due Date)、费用总计(Invoice Total)等。
二、从大量企业发票中选取格式不同的发票作为待处理的待识别发票。本次示例选择30张不同格式的待识别发票,待识别发票为JPG格式的图片文件,其中,一张图片包含一张发票。
三、以识别供应商(Vendor Name)字段为目标,对30张待识别发票进行分析统计。
1)对于发票语言为英文的待识别发票,供应商(Vendor Name)通常包含以下固定字符:“LTD.”、“LTD”、“SDN BHD”、“SDN.BHD.”、“BHD”、“BHD.”、“Sdn.Bhd.”等等,可以将上述固定字符作为第二特征字段,并根据这些第二特征字段建立第二规则表,如图2所示。
2)可以基于第二规则表,确定各待识别发票中包含第二特征字段的各候选文本片段,并确定各候选文本片段所在的位置,即各候选文本片段在待识别发票中的位置。
3)供应商(Vendor Name)通常出现在发票的上部以及左上角位置,在发票中包含多个公司信息时,可以基于此种特征,识别供应商信息,即可以根据同一张待识别发票中各候选文本片段所在的位置,从同一张待识别发票中的各候选文本片段中,确定供应商所在的文本片段。
四、以识别属性字段为发票号(Invoice Id)字段为目标,对30张待识别发票进行分系统计。
1)发票内容中,发票号的规律是发票号+发票号值,对不同格式的待识别发票进行统计,确定与发票号语义匹配的字段包括:“Invoice No.”、“Invoice#”、“INVOICE#”等等,可以将上述字段作为第一特征字段,并根据第一特征字段建立第一规则表,如表1所示。
2)基于第一规则表,将这30张待识别发票中的发票号分为以下三种情形:
第一种情形,发票号(Invoice Id)字段对应的各字符,和该发票号(Invoice Id)字段对应的发票号(Invoice Id)值对应的各字符位于同一文本片段,如图3中区域31所示。满足此种情形的待识别发票一共有14张。
第二种情形,发票号(Invoice Id)字段所在的位置,和该发票号(Invoice Id)字段对应的发票号(Invoice Id)值所在的位置相邻,且在同一行,但是发票号(Invoice Id)字段所在的位置和该发票号(Invoice Id)值所在的位置之间的距离大于设定距离,即发票号(Invoice Id)字段和该发票号(Invoice Id)值属于左右排布,如图4中区域41所示。满足此种情形的待识别发票一共有12张。
第三种情形,发票号(Invoice Id)字段所在的位置,和该发票号(Invoice Id)字段对应的发票号(Invoice Id)值所在的位置不在同一行,且可以相距多行,即发票号(Invoice Id)字段和该发票号(Invoice Id)值属于上下排布,如图5中区域51所示。满足此种情形的待识别发票一共有4张。
因此,针对每一张待识别发票,基于第一规则表,可以从发票内容中提取包含第一规则表中的第一特征字段的发票号(Invoice Id)字段,并确定发票号(Invoice Id)字段所在的目标文本片段。在判断发票号(Invoice Id)字段所在的目标文本片段中,存在发票号(Invoice Id)字段之外其他字符的情况下,即满足第一种情形,可以将其他字符作为发票号(Invoice Id)字段对应的发票号(Invoice Id)值。
例如,可以在目标文本片段中确定发票号(Invoice Id)字段中的最后一个字符,在上述最后一个字符后设置分隔符,并根据该分隔符对目标文本片段进行分割,得到位于发票号(Invoice Id)字段右侧的发票号(Invoice Id)值。
当发票号(Invoice Id)字段所在的目标文本片段中,不存在发票号(Invoice Id)字段之外其他字符 的情况下,以发票号(Invoice Id)字段在待识别发票中的位置为起点,按照从左到右的方向,对其他文本片段进行遍历查找。其中,当其他文本片段的格式与发票号(Invoice Id)字段匹配时,可以确定其他文本片段为发票号(Invoice Id)值所在的文本片段;与之相反的,当其他文本片段的格式与发票号(Invoice Id)字段不匹配时,可以继续按照从左到右的方向,对其他文本片段的下一文本片段进行遍历查找,直至确定某一文本片段的格式与发票号(Invoice Id)字段匹配时,可以停止遍历,并将该文本片段作为发票号(Invoice Id)值所在的文本片段。
其中,在其他文本片段的格式与发票号(Invoice Id)字段匹配的情况下,可以进一步对其他文本片段所在的位置进行判断,确定其是否满足以上第二种情形或第三种情形,比如,在第二种情形下,其他文本片段所在的位置与发票号(Invoice Id)字段所在的位置之间,横坐标相差小于45,纵坐标相差小于5(即上述图7实施例中,第四差异阈值可以为45,第二差异阈值可以为5),则判定其他文本片段为发票号(Invoice Id)值所在的文本片段。
在第三种情形下,其他文本片段所在的位置与发票号(Invoice Id)字段所在的位置之间,横坐标相差小于5,纵坐标相差小于30(即上述图7实施例中,第三差异阈值可以为30,第一差异阈值可以为5),则判定其他文本片段为发票号(Invoice Id)值所在的文本片段。
五、对于其他目标属性字段,比如开票日期(Invoice Date)、开票时间(Invoice Time)、支付截止日期(Due Date)、费用总计(Invoice Total)等属性字段的识别,可以采用与发票号(Invoice Id)类似的识别方法,找到各目标属性字段对应的目标属性值。
综上,本公开中,可以对各待识别发票进行情形分类,先处理占比最多的情形,在待识别发票中对属性字段的属性值进行字符串查找和遍历,并编写对应的规则算法,再处理占比较少的情形,特殊情况下,为了节省资源占用,提升处理效率,可以放弃处理占比特别少的情形。可以将符合规则的字符串进行验证,如发票号值包括数字,日期具有特定的日期格式等,将通过验证的字符串,作为对应属性字段的属性值。
通过编写各个字段对应的规则算法,RPA机器人可以调用每个字段的规则算法,提取各字段(供应商、发票号、开票日期、开票时间、支付截止日期、费用总计等),并提取各属性字段对应的属性值,并将提取的信息写入Excel表格中。
基于本公开的基于RPA和AI的发票处理方法,在处理多种格式的待识别发票时,至少可以体现以下优点:
1.为通用发票的识别提供一种解决方案,基于本公开的方法,可以自动识别和提取不同格式的待识别发票中的关键字段信息。
2.解决自定义模板识别模型的方式,只能识别有限的发票格式种类,且新增发票格式时又需要花费人力不断地对训练样本进行标注和训练的问题。
3.采用本公开的基于规则识别发票信息的方式,在新增发票格式种类时,只需要修改规则表和/或规则算法即可,无需花费大量人力不断地对训练样本进行标注和训练,可以降低人工参与量,释放人力资源。
与上述图1至图8实施例提供的基于RPA和AI的发票处理方法相对应,本公开还提供一种基于RPA和AI的发票处理装置,由于本公开实施例提供的基于RPA和AI的发票处理装置与上述图1至图8实施例提供的基于RPA和AI的发票处理方法相对应,因此基于RPA和AI的发票处理方法的实施方式也适用于本公开实施例提供的基于RPA和AI的发票处理装置,在本公开实施例中不再详细描述。
图10为本公开实施例提供的一种基于RPA和AI的发票处理装置的结构示意图。
如图10所示,该基于RPA和AI的发票处理装置1000应用于RPA机器人,可以包括:第一识别模块1001、提取模块1002及存储模块1003。
其中,第一识别模块1001,用于获取待识别发票,并基于光学字符识别OCR技术,识别待识别发票的发票内容。
提取模块1002,用于基于设定规则,从发票内容中提取各目标属性字段和各目标属性字段对应的目标属性值。
存储模块1003,用于将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。
在本公开实施例的一种可能的实现方式中,目标属性字段包括:发票号、开票日期、开票时间、支付截止日期和费用总计中的至少一项;提取模块1002,用于:针对每个目标属性字段,获取与目标属性字段匹配的第一规则表,其中,第一规则表中包含至少一个第一特征字段;基于第一规则表,从发票内容中提取包含第一规则表中的第一特征字段的目标属性字段;从发票内容中提取目标属性字段对应的目标属性值。
在本公开实施例的一种可能的实现方式中,提取模块1002,用于:从发票内容中,确定目标属性字段所在的目标文本片段;识别目标文本片段内是否存在除目标属性字段之外的其他字符;在目标文本片段内存在除目标属性字段之外的其他字符的情况下,将其他字符作为目标属性字段对应的目标属性值。
在本公开实施例的一种可能的实现方式中,提取模块1002,还用于:在目标文本片段内未存在除目标属性字段之外的其他字符的情况下,以目标文本片段在待识别发票中的第一位置为起点,按照设定提取方向,从待识别发票中提取其他文本片段;判断其他文本片段的格式是否与目标属性字段匹配;在其他文本片段的格式与目标属性字段匹配的情况下,将其他文本片段作为目标属性字段对应的目标属性值。
在本公开实施例的一种可能的实现方式中,提取模块1002,用于:在其他文本片段的格式与目标属性字段匹配的情况下,确定其他文本片段在待识别发票中的第二位置;在第一位置的横坐标和第二位置的横坐标之间的差异小于第一差异阈值,且第一位置的纵坐标和第二位置的纵坐标之间的差异小于第二差异阈值的情况下,将其他文本片段作为目标属性字段对应的目标属性值;其中,第一差异阈值小于第二差异阈值。或者,在第一位置的纵坐标和第二位置的纵坐标之间的差异小于第三差异阈值,且第一位置的横坐标和第二位置的横坐标之间的差异小于第四差异阈值的情况下,将其他文本片段作为目标属性字段对应的目标属性值;其中,第三差异阈值小于第四差异阈值。
在本公开实施例的一种可能的实现方式中,该基于RPA和AI的发票处理方法装置1000还可以包括:第二识别模块、确定模块和处理模块。第二识别模块,用于从发票内容中,识别包含设定的第二特征字段的至少一个候选文本片段。
确定模块,用于确定至少一个候选文本片段在待识别发票中的第三位置。
处理模块,用于根据至少一个候选文本片段的第三位置,从至少一个候选文本片段中确定供应商对应的文本片段,并存储供应商对应的文本片段。
在本公开实施例的一种可能的实现方式中,第二识别模块,用于:基于第二规则表,从发票内容中识别包含第二特征字段的至少一个候选文本片段;其中,第二规则表中包含至少一个第二特征字段。
本公开实施例的基于RPA和AI的发票处理装置,通过RPA机器人获取待识别发票,并基于光学字符识别OCR技术,识别待识别发票的发票内容;基于设定规则,从发票内容中提取各目标属性字段和各目标属性字段对应的目标属性值;将各目标属性字段和各目标属性字段对应的目标属性值进行对应存储。由此,通过RPA机器人自动识别待识别发票的发票内容,并自动提取和录入发票内容中的目标属性字段和目标属性字段对应的目标属性值,一方面,可以降低人工参与量,释放人力资源,降低人力成本;另一方面,可以提高发票内容的识别效率和录入效率,并且,还可以避免人工录入易出错的情况,提升发票内容录入的准确性;又一方面,对待识别发票的发票格式不做限制,可以提升该方法的灵活性和适应性;再一方面,基于规则识别并提取发票内容中的属性字段和属性值,在新增发票格式时,只需修改规则算法即可,而无需花费大量人力不断地对训练样本进行标注和训练,可以降低人工参与量,释放人力资源。
为了实现上述实施例,本公开实施例还提出一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如前述任一方法实施例所述的基于RPA和AI的发票处理方法。
为了实现上述实施例,本公开实施例还提出一种非临时性计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如前述任一方法实施例所述的基于RPA和AI的发票处理方法。
为了实现上述实施例,本公开实施例还提出一种计算机程序产品,当所述计算机程序产品中的指令处理器执行时,实现如前述任一方法实施例所述的基于RPA和AI的发票处理方法。
图11示出了适于用来实现本公开实施方式的示例性电子设备的框图。图11显示的电子设备12仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图11所示,电子设备12以通用计算设备的形式表现。电子设备12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,系统存储器28,连接不同系统组件(包括存储器28和处理单元16)的总线18。
总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry Standard Architecture;以下简称:ISA)总线,微通道体系结构(Micro Channel Architecture;以下简称:MAC)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association;以下简称:VESA)局域总线以及外围组件互连(Peripheral Component Interconnection;以下简称:PCI)总线。
电子设备12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。
存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory;以下简称:RAM)30和/或高速缓存存储器32。电子设备12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图11未显示,通常称为“硬盘驱动器”)。尽管图11中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如:光盘只读存储器(Compact Disc ReadOnly Memory;以下简称:CD-ROM)、数字多功能只读光盘(Digital Video DiscRead Only Memory;以下简称:DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本公开各实施例的功能。
具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本公开所描述的实施例中的功能和/或方法。
电子设备12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该电子设备12交互的设备通信,和/或与使得该电子设备12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,电子设备12还可以通过网络适配器20与一个或者多个网络(例如局域网(Local Area Network;以下简称:LAN),广域网(Wide Area Network;以下简称:WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与电子设备12的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
处理单元16通过运行存储在存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现前述实施例中提及的方法。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本公开的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本公开的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本公开的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式 或按相反的顺序,来执行功能,这应被本公开的实施例所属技术领域的技术人员所理解。
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。
应当理解,本公开的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本公开各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本公开的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本公开的限制,本领域的普通技术人员在本公开的范围内可以对上述实施例进行变化、修改、替换和变型。
Claims (15)
- 一种基于机器人流程自动化RPA和人工智能AI的发票处理方法,其中,所述方法由RPA机器人执行,包括:获取待识别发票,并基于光学字符识别OCR技术,识别所述待识别发票的发票内容;基于设定规则,从所述发票内容中提取各目标属性字段和各所述目标属性字段对应的目标属性值;将各所述目标属性字段和各所述目标属性字段对应的目标属性值进行对应存储。
- 根据权利要求1所述的方法,其中,所述目标属性字段包括:发票号、开票日期、开票时间、支付截止日期和费用总计中的至少一项;所述基于设定规则,从所述发票内容中提取各目标属性字段和各所述目标属性字段对应的目标属性值,包括:针对每个所述目标属性字段,获取与所述目标属性字段匹配的第一规则表,其中,所述第一规则表中包含至少一个第一特征字段;基于所述第一规则表,从所述发票内容中提取包含所述第一规则表中的第一特征字段的所述目标属性字段;从所述发票内容中提取所述目标属性字段对应的目标属性值。
- 根据权利要求2所述的方法,其中,所述从所述发票内容中提取所述目标属性字段对应的目标属性值,包括:从所述发票内容中,确定所述目标属性字段所在的目标文本片段;识别所述目标文本片段内是否存在除所述目标属性字段之外的其他字符;在所述目标文本片段内存在除所述目标属性字段之外的其他字符的情况下,将所述其他字符作为所述目标属性字段对应的目标属性值。
- 根据权利要求3所述的方法,其中,所述从所述发票内容中提取所述目标属性字段对应的目标属性值,还包括:在所述目标文本片段内未存在除所述目标属性字段之外的其他字符的情况下,以所述目标文本片段在所述待识别发票中的第一位置为起点,按照设定提取方向,从所述待识别发票中提取其他文本片段;判断所述其他文本片段的格式是否与所述目标属性字段匹配;在所述其他文本片段的格式与所述目标属性字段匹配的情况下,将所述其他文本片段作为所述目标属性字段对应的目标属性值。
- 根据权利要求4所述的方法,其中,所述在所述其他文本片段的格式与所述目标属性字段匹配的情况下,将所述其他文本片段作为所述目标属性字段对应的目标属性值,包括:在所述其他文本片段的格式与所述目标属性字段匹配的情况下,确定所述其他文本片段在所述待识别发票中的第二位置;在所述第一位置的横坐标和所述第二位置的横坐标之间的差异小于第一差异阈值,且所述第一位置的纵坐标和所述第二位置的纵坐标之间的差异小于第二差异阈值的情况下,将所述其他文本片段作为所述目标属性字段对应的目标属性值;其中,所述第一差异阈值小于所述第二差异阈值;或者,在所述第一位置的纵坐标和所述第二位置的纵坐标之间的差异小于第三差异阈值,且所述第一位置的横坐标和所述第二位置的横坐标之间的差异小于第四差异阈值的情况下,将所述其他文本片段作为所述目标属性字段对应的目标属性值;其中,所述第三差异阈值小于所述第四差异阈值。
- 根据权利要求1-5中任一项所述的方法,其中,所述方法还包括:从所述发票内容中,识别包含设定的第二特征字段的至少一个候选文本片段;确定所述至少一个候选文本片段在所述待识别发票中的第三位置;根据所述至少一个候选文本片段的第三位置,从所述至少一个候选文本片段中确定供应商对应的文本片段,并存储所述供应商对应的文本片段。
- 根据权利要求6所述的方法,其中,所述从所述发票内容中,识别包含设定的第二特征字段的至 少一个候选文本片段,包括:基于第二规则表,从所述发票内容中识别包含所述第二特征字段的至少一个候选文本片段;其中,所述第二规则表中包含至少一个所述第二特征字段。
- 一种基于机器人流程自动化RPA和人工智能AI的发票处理装置,应用于RPA机器人,包括:第一识别模块,用于获取待识别发票,并基于光学字符识别OCR技术,识别所述待识别发票的发票内容;提取模块,用于基于设定规则,从所述发票内容中提取各目标属性字段和各所述目标属性字段对应的目标属性值;存储模块,用于将各所述目标属性字段和各所述目标属性字段对应的目标属性值进行对应存储。
- 根据权利要求8所述的装置,其中,所述目标属性字段包括:发票号、开票日期、开票时间、支付截止日期和费用总计中的至少一项;所述提取模块,用于:针对每个所述目标属性字段,获取与所述目标属性字段匹配的第一规则表,其中,所述第一规则表中包含至少一个第一特征字段;基于所述第一规则表,从所述发票内容中提取包含所述第一规则表中的第一特征字段的所述目标属性字段;从所述发票内容中提取所述目标属性字段对应的目标属性值。
- 根据权利要求9所述的装置,其中,所述提取模块,用于:从所述发票内容中,确定所述目标属性字段所在的目标文本片段;识别所述目标文本片段内是否存在除所述目标属性字段之外的其他字符;在所述目标文本片段内存在除所述目标属性字段之外的其他字符的情况下,将所述其他字符作为所述目标属性字段对应的目标属性值。
- 根据权利要求10所述的装置,其中,所述提取模块,还用于:在所述目标文本片段内未存在除所述目标属性字段之外的其他字符的情况下,以所述目标文本片段在所述待识别发票中的第一位置为起点,按照设定提取方向,从所述待识别发票中提取其他文本片段;判断所述其他文本片段的格式是否与所述目标属性字段匹配;在所述其他文本片段的格式与所述目标属性字段匹配的情况下,将所述其他文本片段作为所述目标属性字段对应的目标属性值。
- 根据权利要求11所述的装置,其中,所述提取模块,用于:在所述其他文本片段的格式与所述目标属性字段匹配的情况下,确定所述其他文本片段在所述待识别发票中的第二位置;在所述第一位置的横坐标和所述第二位置的横坐标之间的差异小于第一差异阈值,且所述第一位置的纵坐标和所述第二位置的纵坐标之间的差异小于第二差异阈值的情况下,将所述其他文本片段作为所述目标属性字段对应的目标属性值;其中,所述第一差异阈值小于所述第二差异阈值;或者,在所述第一位置的纵坐标和所述第二位置的纵坐标之间的差异小于第三差异阈值,且所述第一位置的横坐标和所述第二位置的横坐标之间的差异小于第四差异阈值的情况下,将所述其他文本片段作为所述目标属性字段对应的目标属性值;其中,所述第三差异阈值小于所述第四差异阈值。
- 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1-7中任一项所述的方法。
- 一种非临时性计算机可读存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现如权利要求1-7中任一项所述的方法。
- 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1-7中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210178839.9A CN114612905A (zh) | 2022-02-25 | 2022-02-25 | 基于rpa和ai的发票处理方法、装置、设备和介质 |
CN202210178839.9 | 2022-02-25 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023159771A1 true WO2023159771A1 (zh) | 2023-08-31 |
Family
ID=81858261
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/091038 WO2023159771A1 (zh) | 2022-02-25 | 2022-05-05 | 基于rpa和ai的发票处理方法、装置、设备和介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114612905A (zh) |
WO (1) | WO2023159771A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117408631A (zh) * | 2023-10-18 | 2024-01-16 | 江苏泰坦智慧科技有限公司 | 操作票的生成方法、装置及存储介质 |
CN118015024A (zh) * | 2024-02-19 | 2024-05-10 | 广州融智共创科技有限公司 | 一种基于企业财税的pdf动态切割方法、系统、设备及介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795525A (zh) * | 2019-09-17 | 2020-02-14 | 腾讯科技(深圳)有限公司 | 文本结构化方法、装置、电子设备及计算机可读存储介质 |
US20200310844A1 (en) * | 2019-03-31 | 2020-10-01 | Automation Anywhere, Inc. | Robotic process automation system with device user impersonation |
CN111931777A (zh) * | 2020-06-30 | 2020-11-13 | 北京来也网络科技有限公司 | 一种基于rpa的发票信息处理方法、装置及存储介质 |
CN112381087A (zh) * | 2020-08-26 | 2021-02-19 | 北京来也网络科技有限公司 | 结合rpa和ai的图像识别方法、装置、计算机设备和介质 |
CN114331316A (zh) * | 2021-11-26 | 2022-04-12 | 北京来也网络科技有限公司 | 基于ai和rpa的订单信息录入方法、装置、设备和介质 |
-
2022
- 2022-02-25 CN CN202210178839.9A patent/CN114612905A/zh active Pending
- 2022-05-05 WO PCT/CN2022/091038 patent/WO2023159771A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200310844A1 (en) * | 2019-03-31 | 2020-10-01 | Automation Anywhere, Inc. | Robotic process automation system with device user impersonation |
CN110795525A (zh) * | 2019-09-17 | 2020-02-14 | 腾讯科技(深圳)有限公司 | 文本结构化方法、装置、电子设备及计算机可读存储介质 |
CN111931777A (zh) * | 2020-06-30 | 2020-11-13 | 北京来也网络科技有限公司 | 一种基于rpa的发票信息处理方法、装置及存储介质 |
CN112381087A (zh) * | 2020-08-26 | 2021-02-19 | 北京来也网络科技有限公司 | 结合rpa和ai的图像识别方法、装置、计算机设备和介质 |
CN114331316A (zh) * | 2021-11-26 | 2022-04-12 | 北京来也网络科技有限公司 | 基于ai和rpa的订单信息录入方法、装置、设备和介质 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117408631A (zh) * | 2023-10-18 | 2024-01-16 | 江苏泰坦智慧科技有限公司 | 操作票的生成方法、装置及存储介质 |
CN118015024A (zh) * | 2024-02-19 | 2024-05-10 | 广州融智共创科技有限公司 | 一种基于企业财税的pdf动态切割方法、系统、设备及介质 |
Also Published As
Publication number | Publication date |
---|---|
CN114612905A (zh) | 2022-06-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2017302250B2 (en) | Optical character recognition in structured documents | |
WO2023159771A1 (zh) | 基于rpa和ai的发票处理方法、装置、设备和介质 | |
WO2021042521A1 (zh) | 一种合同自动生成方法、计算机设备及计算机非易失性存储介质 | |
US9384389B1 (en) | Detecting errors in recognized text | |
CN110543592B (zh) | 信息搜索方法、装置以及计算机设备 | |
WO2021208696A1 (zh) | 用户意图分析方法、装置、电子设备及计算机存储介质 | |
WO2020082673A1 (zh) | 发票检验方法、装置、计算设备和存储介质 | |
CN111428599A (zh) | 票据识别方法、装置和设备 | |
US11341319B2 (en) | Visual data mapping | |
CN108764352A (zh) | 重复页面内容检测方法和装置 | |
WO2024055864A1 (zh) | 结合rpa和ai实现ia的分类模型的训练方法及装置 | |
CN115917613A (zh) | 文档中文本的语义表示 | |
CN111738252B (zh) | 图像中的文本行检测方法、装置及计算机系统 | |
CN113762303B (zh) | 图像分类方法、装置、电子设备及存储介质 | |
CN111914729A (zh) | 凭证关联方法、装置、计算机设备及存储介质 | |
WO2022222777A1 (zh) | 识别文档的方法和装置 | |
Wang et al. | Vrdu: A benchmark for visually-rich document understanding | |
WO2022247231A1 (zh) | 简历筛选方法、简历筛选装置、终端设备及存储介质 | |
CN112926700A (zh) | 针对目标图像的类别识别方法和装置 | |
CN117351505A (zh) | 信息码的识别方法、装置、设备及存储介质 | |
CN111177387A (zh) | 用户名单信息处理方法、电子装置及计算机可读存储介质 | |
CN114299520B (zh) | 一种基于双模型融合的供应商资质审核方法和审核装置 | |
CN114359928B (zh) | 一种电子发票识别方法、装置、计算机设备及存储介质 | |
US20100023517A1 (en) | Method and system for extracting data-points from a data file | |
Vishwanath et al. | Deep reader: Information extraction from document images via relation extraction and natural language |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22928042 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |