Methods, devices, electronic equipment and computer storage media for processing invoice information
By structuring the OCR recognition results of invoices and correcting keyword content using a standard thesaurus, the problem of insufficient accuracy of OCR technology in invoice recognition is solved, achieving more efficient and accurate extraction of invoice information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YANCHENG TIANYANCHAWEI TECH CO LTD
- Filing Date
- 2022-07-29
- Publication Date
- 2026-05-19
AI Technical Summary
Existing OCR technology suffers from insufficient accuracy in document recognition and is prone to character recognition errors.
By structuring the OCR recognition results of the invoices, keywords and keyword content are obtained, and candidate standard words are determined using a preset standard lexicon to correct the keyword content to be corrected, including the processing of address, amount and language category. Regular expressions and mapping relationships are used to improve recognition accuracy.
It improves the accuracy of invoice information recognition, ensuring that the acquired invoice information is closer to the standard vocabulary, thus improving recognition efficiency and accuracy.
Smart Images

Figure CN115223188B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and more particularly to a method, apparatus, electronic device, and computer storage medium for processing invoice information. Background Technology
[0002] Existing document information recognition generally relies on OCR (Optical Character Recognition) technology. This typically refers to the process of using electronic devices (such as scanners or digital cameras) to examine printed characters on paper, determining the shape of the characters by detecting light and dark patterns, and then translating the shapes into computer text using character recognition methods. In other words, for printed characters, optical methods are used to convert the text in paper documents into black and white dot matrix image files, and recognition software is used to convert the text in the image into text format, transforming unstructured document data into structured data to extract document information for further editing and processing by word processing software.
[0003] However, current OCR technology suffers from insufficient accuracy in recognizing invoices and is prone to character recognition errors. Therefore, there is an urgent need in the market for a processing method, device, electronic equipment, and computer storage medium that can improve the efficiency of invoice recognition. Summary of the Invention
[0004] The present invention provides a method, apparatus, electronic device and computer storage medium for processing invoice information, in order to overcome the above-mentioned technical problems existing in the related art.
[0005] According to a first aspect of the present invention, a method for processing invoice information is provided, specifically including the following steps: performing structured processing on the invoice based on the OCR recognition result of the invoice to obtain structured information corresponding to the invoice, the structured information including keywords in the invoice and keyword content corresponding to the keywords; obtaining a preset standard lexicon, the standard lexicon including standard words corresponding to different keywords; determining candidate standard words from the standard lexicon based on the keywords corresponding to the keyword content to be corrected; and using the candidate standard words to correct the keyword content to be corrected.
[0006] Optionally, candidate standard words are determined from the standard thesaurus based on the keywords corresponding to the keyword content to be corrected, including: selecting standard words from the standard thesaurus whose corresponding keywords are consistent with the keywords to which the keyword content to be corrected belongs as candidate standard words.
[0007] Optionally, candidate standard words are used to correct the keyword content to be corrected, including: if the keyword content to be corrected includes an address, the keyword content used to indicate the address is segmented according to the address segmentation rules to obtain multiple segmented address fragments; for each address fragment, the similarity between the address fragment and the candidate standard words is determined; if there is a standard word with a similarity greater than a set address threshold, the address fragment is replaced with a candidate standard word with a similarity greater than the threshold.
[0008] Optionally, the keyword content used to indicate the address is segmented according to the address segmentation rules to obtain multiple segmented address fragments, including: using regular expressions to segment at least one level of address fragment from the keyword content, such as provincial, municipal, district, and specific address levels.
[0009] Optionally, candidate standard terms are used to correct the keyword content to be corrected, including: if the keyword content to be corrected corresponds to a number, then based on the candidate standard terms of amount, the correspondence between the Chinese character amount and the numerical amount is determined; the string of Chinese character amount is obtained from the keyword content indicating the amount; and the string of Chinese character amount is corrected using the candidate standard terms of amount.
[0010] Optionally, the string of Chinese amount characters is corrected using candidate standard words of amount category, including: for each character in the string of Chinese amount characters, the top K predicted characters with the highest confidence in the OCR recognition results corresponding to each character are obtained; if the top K predicted characters contain candidate standard words of amount category, then the character is determined as the contained candidate standard words of amount category.
[0011] Optionally, using candidate standard terms to correct the keyword content to be corrected also includes: determining the string of numerical amounts in the keyword content to be corrected based on the corrected string of Chinese character amounts and the correspondence between Chinese character amounts and numerical amounts.
[0012] Optionally, candidate standard words are used to correct the keyword content to be corrected, including: if the keyword corresponding to the keyword content to be corrected belongs to the preset keywords, then the similarity between the keyword content to be corrected and the candidate standard words is calculated; and candidate standard words whose similarity meets the screening conditions are selected as the keyword content to be corrected.
[0013] Optionally, the invoice information processing method further includes: obtaining the mapping relationship between characters of a first language category and characters of a second language category, wherein the first language category and the second language category are different, and the first language category and the second language category include one of Chinese, English and numbers; for each character in the keyword content to be corrected, if the confidence level of the predicted character in the OCR recognition result of the current character is lower than the confidence level threshold, and it is determined that the language category of the current character does not meet the preset rule, then the current character is corrected according to the mapping relationship.
[0014] According to a second aspect of the present invention, a bill information processing apparatus is provided, specifically comprising: a first acquisition unit, configured to perform structured processing on the bill based on the OCR recognition result of the bill to obtain structured information corresponding to the bill, the structured information including keywords in the bill and keyword content corresponding to the keywords; a second acquisition unit, configured to acquire a preset standard lexicon, the standard lexicon including standard words corresponding to different keywords; a determination unit, configured to determine candidate standard words from the standard lexicon based on the keywords corresponding to the keyword content to be corrected; and an error correction unit, configured to correct the keyword content to be corrected using the candidate standard words.
[0015] A computer storage medium storing a computer-executable program, which is executed to implement the method of any of the embodiments of the present invention.
[0016] An electronic device includes a memory and a processor, wherein the memory stores a computer-executable program and the processor runs the computer-executable program to implement the method of any of the embodiments of the present invention.
[0017] In this embodiment of the invention, the bill is processed in a structured manner to obtain the structured information corresponding to the bill. The structured information specifically refers to the keywords in the bill and the keyword content corresponding to the keywords. Based on the keywords corresponding to the keyword content to be corrected, candidate standard words are determined in a preset standard word library. The candidate standard words are used to correct the keyword content to be corrected, so that the obtained bill information is closer to the standard word library and the accuracy of bill information recognition is improved. Attached Figure Description
[0018] Figure 1 A flowchart illustrating the steps of a bill information processing method provided in an embodiment of the present invention;
[0019] Figure 2 A flowchart illustrating the steps of another invoice information processing method provided in this embodiment of the invention;
[0020] Figure 3 A flowchart illustrating the steps of another invoice information processing method provided in this embodiment of the invention;
[0021] Figure 4 A flowchart illustrating the steps of another invoice information processing method provided in this embodiment of the invention;
[0022] Figure 5 This is a structural block diagram of a bill information processing device provided in an embodiment of the present invention;
[0023] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0024] To provide a clearer understanding of the technical features, objectives, and effects of the embodiments of the present invention, specific implementation methods of the embodiments of the present invention will now be described with reference to the accompanying drawings.
[0025] In this document, “illustrative” means “serving as an example, illustration or description”, and any illustration or implementation described herein as “illustrative” should not be construed as a more preferred or advantageous technical solution.
[0026] To keep the drawings concise, only the parts relevant to the invention are shown schematically in each figure, and they do not represent the actual structure of the product. Furthermore, for ease of understanding, in some figures, components with the same structure or function are shown only schematically, or only one or more are labeled.
[0027] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0028] Existing document information recognition generally relies on OCR (Optical Character Recognition) technology. This typically involves using electronic devices (such as scanners or digital cameras) to examine printed characters on paper, determining the character shape by detecting light and dark patterns, and then translating the shape into computer text using character recognition methods. In other words, for printed characters, optical methods are used to convert the text in a paper document into a black-and-white dot matrix image file, and recognition software converts the text in the image into text format, transforming unstructured document data into structured data to extract document information for further editing by word processing software. However, current OCR technology suffers from insufficient accuracy in document recognition, easily leading to character recognition errors. Therefore, this invention proposes a document information processing method, apparatus, electronic device, and computer storage medium to improve the accuracy of document information recognition.
[0029] Figure 1The flowchart of steps for a bill information processing method provided by an embodiment of the present invention. As Figure 1 shown, this embodiment mainly includes the following steps:
[0030] S101. According to the OCR recognition result of the bill, perform structured processing on the bill to obtain the structured information corresponding to the bill, where the structured information includes the keywords in the bill and the keyword content corresponding to the keywords;
[0031] In this embodiment, the OCR recognition result of the bill is the recognized characters, specifically including Chinese characters, numbers, English characters, and other characters. By performing structured processing on the recognition result, the structured information corresponding to the bill can be obtained. The structured information specifically includes the keywords in the bill and the keyword content corresponding to the keywords. Taking a passport as an example, the keywords include but are not limited to the date of birth, and the corresponding keyword content can be "XXXX year XX month XX day". By performing structured processing on the OCR recognition result of the bill, the content of the bill can be effectively integrated to facilitate improving the efficiency and accuracy of bill recognition.
[0032] S102. Obtain a preset standard word library, where the standard word library includes standard words corresponding to different keywords;
[0033] S103. Determine candidate standard words from the standard word library according to the keywords corresponding to the keyword content to be corrected;
[0034] In this embodiment, the standard word library may include the standard expressions of the keyword content corresponding to some categories of keywords. For example, the keyword content corresponding to keywords such as amount keywords and address keywords is relatively fixed and usually standardized content. Therefore, a preset standard word library can be established. The standard word library contains multiple standard words, and each standard word corresponds to at least one category of keywords. For example, if the keyword is "capital amount", the corresponding standard words include "one", "two", etc. In addition to the foregoing examples, the standard words may include Arabic numerals, capital amounts, provincial administrative regions, municipal administrative regions, etc., but are not limited thereto. According to the keywords in the bill structured information, find the standard word corresponding to the keyword in the standard word library as the candidate standard word.
[0035] S104. Use the candidate standard word to correct the keyword content to be corrected.
[0036] A feasible way to correct the keyword content is, for example: compare the candidate standard word with one or more words in the keyword content. If there are unmatched words, the unmatched words in the keyword content can be replaced with the candidate standard word.
[0037] In this embodiment of the invention, the bill is processed in a structured manner to obtain the structured information corresponding to the bill. The structured information includes keywords in the bill and the keyword content corresponding to the keywords. Based on the keywords corresponding to the keyword content to be corrected, candidate standard words are determined in a preset standard word library. The candidate standard words are used to correct the keyword content to be corrected, so that the obtained bill information is closer to the standard word library and the accuracy of bill information recognition is improved.
[0038] This embodiment mainly illustrates the specific implementation of step S103 above. This embodiment mainly includes: selecting standard words from the standard word library whose corresponding keywords are consistent with the keywords to be corrected as candidate standard words.
[0039] In this embodiment, by confirming the keywords corresponding to the keyword content to be corrected, it is ensured that the category of the candidate standard word is consistent with the keyword category, so as to ensure the accuracy of invoice information recognition.
[0040] Figure 2 This is a flowchart illustrating another method for processing invoice information provided by an embodiment of the present invention. This embodiment mainly shows a specific implementation of step S104 described above. For example... Figure 2 As shown, this embodiment mainly includes the following steps:
[0041] S121, If the keywords in the keyword content to be corrected include addresses, then the keyword content used to indicate addresses is segmented according to the address segmentation rules to obtain multiple segmented address fragments.
[0042] S122, For each address segment, determine the similarity between the address segment and the candidate standard words;
[0043] S123, if there is a standard word with a similarity greater than the set address threshold, then the address fragment is replaced with the candidate standard word with a similarity greater than the threshold.
[0044] In the above implementation, if the keyword content corresponds to an address, the keyword content is divided into multiple address fragments according to the address segmentation rules. Specifically, the keyword content can be divided into multiple address fragments based on keyword extraction or other methods. The obtained address fragments are compared with the candidate standard words confirmed in the standard thesaurus to obtain the similarity between the address fragments and the candidate standard words confirmed in the standard thesaurus. If the similarity is greater than a preset address threshold, the address fragments are replaced with candidate standard words. Specifically, the address threshold can be set to 0.6, or it can be set to 0.5, 0.7 or other values. This invention does not specifically limit this.
[0045] Specifically, in one implementation, regular expressions are used to segment the keyword content used to indicate the address to obtain at least one level of address fragment, including provincial, municipal, district, and specific address levels.
[0046] It should be noted that regular expressions, also known as regulated expressions (often abbreviated as regex, regexp, or RE in code), are a text pattern that includes ordinary characters (e.g., Beijing and its corresponding districts, such as Chaoyang District, Changping District, etc.) and special characters (called "metacharacters"), and are a concept in computer science. Regular expressions can be used to segment the keyword content to be corrected, obtaining at least one level of address fragments, including provincial, municipal, district, and specific address levels. This facilitates comparison of the obtained address fragments with standard words in a pre-defined standard dictionary, saving time in invoice information processing, improving the efficiency of invoice information processing, and increasing the accuracy of address information recognition in invoice information.
[0047] Figure 3 This is a flowchart illustrating another method for processing invoice information provided by an embodiment of the present invention. This embodiment mainly shows another specific implementation of step S104 described above. For example... Figure 3 As shown, this embodiment mainly includes the following steps:
[0048] S131, If the keyword content to be corrected corresponds to the keyword including amount, then based on the candidate standard words of amount, determine the correspondence between the Chinese character amount and the numerical amount.
[0049] S132, Obtain the string of Chinese characters for the amount from the keyword content indicating the amount;
[0050] S133, use candidate standard words of the amount category to correct the string of Chinese amount.
[0051] In the above implementation method, since the Chinese character structure of the amount is relatively complex and there are few Chinese characters corresponding to the amount, the string corresponding to the amount can be obtained from the keyword content indicating the amount first, and the string of the amount can be corrected by using the candidate standard words of the amount category, so as to improve the accuracy of the amount information recognition in the bill information.
[0052] In one specific implementation, candidate standard words of the amount category are used to correct the string of Chinese amount characters, including: for each character in the string of Chinese amount characters, the top K predicted characters with the highest confidence in the OCR recognition results corresponding to each character are obtained; if the top K predicted characters contain candidate standard words of the amount category, then the character is determined as the contained candidate standard words of the amount category.
[0053] Specifically, during the OCR recognition of bill information, for a string of Chinese character amounts, K predicted characters may be recognized. For example, for the Chinese character amount character "陆", its predicted characters may include: 陈, 陆, 陸, 阹, 阵, etc. Among the first K predicted characters, if there is the Chinese character amount "陆", then directly use "陆" in the predicted characters to replace the recognized Chinese character amount to ensure the accuracy of Chinese character amount recognition.
[0054] In a specific implementation, using the candidate standard words to correct the content of the keyword to be corrected further includes: determining the string of the numerical amount in the content of the keyword to be corrected according to the corrected string of the Chinese character amount and the corresponding relationship between the Chinese character amount and the numerical amount.
[0055] In the above implementation, according to the corrected string of the Chinese character amount and the corresponding relationship between the Chinese character amount and the numerical amount, determine the string of the amount number in the content of the keyword to be corrected, so as to ensure that the corrected Chinese character amount and the numerical amount correspond one by one, and further improve the accuracy of the bill recognition information.
[0056] Figure 4 This is the flowchart of the steps of another bill information processing method provided by the embodiment of the present invention. This embodiment mainly shows another specific implementation of the above step S104. As Figure 4 shown, this embodiment mainly includes the following steps:
[0057] S141, if the keyword corresponding to the content of the keyword to be corrected belongs to the preset keyword, calculate the similarity between the content of the keyword to be corrected and the candidate standard word;
[0058] S142, select the candidate standard word whose similarity meets the screening condition as the corrected content of the keyword.
[0059] In the above implementation, if the keyword corresponding to the content of the keyword to be corrected belongs to the preset keyword, for example, establish a standard word library for the English abbreviations of months (such as Jan, Feb, Mar, etc.), transaction types (purchase expenditure or consumption expenditure, transfer expenditure, etc.), invoice types (such as value-added tax special invoices, ordinary invoices, and professional invoices, etc.) and their corresponding specific contents, then calculate the similarity between the recognized content of the keyword to be corrected and the candidate standard word, and use the candidate standard word with a similarity greater than the preset similarity to replace the content of the keyword to be corrected to improve the accuracy of the bill information text recognition. The preset similarity can be set to 0.6, 0.7 or other values. For the specific setting of the specific value of the preset similarity, the present invention does not make a specific limitation.
[0060] In one specific implementation, the invoice information processing method further includes: obtaining the mapping relationship between characters of a first language category and characters of a second language category, wherein the first language category and the second language category are different, and the first language category and the second language category include one of Chinese, English and numbers; for each character in the keyword content to be corrected, if the confidence level of the predicted character in the OCR recognition result of the current character is lower than the confidence level threshold, and it is determined that the language category of the current character does not meet the preset rule, then the current character is corrected according to the mapping relationship.
[0061] The preset rules can be set by those skilled in the art according to actual needs, and are not limited here. For example, if the preceding character of any character in the keyword content to be corrected is the number 1 and the following character is the number 2, and the character is identified as the letter O, then it is considered to conform to the preset rules, and vice versa. This will not be elaborated here.
[0062] In the above implementation, the mapping relationship between characters of the first language category and characters of the second language category can be: O and 〇, o and 0, l and 1, z and 2, etc. The language category corresponding to the keyword content is determined according to the context of the keyword and the keyword content. Based on the mapping relationship, candidate standard words in the standard thesaurus are used to replace the strings in the keyword content to improve the accuracy of the invoice information. The confidence threshold can be set to 0.5, 0.6 or other values. The setting of the confidence threshold is determined based on the actual situation, and this invention does not limit it.
[0063] In one specific implementation, the method may further include:
[0064] The keyword content in the OCR recognition result is input into the preset training model for training to obtain the first training result;
[0065] The keyword content after correction using the candidate standard words is input into a preset training model for training to obtain a second training result.
[0066] Based on the comparison between the first and second training results, the final keyword content is determined.
[0067] Optionally, the preset training model can be an n-gram language model, where n is preferably 2, which can be called a bigram model. Those skilled in the art can choose according to actual needs; no limitation is made here. Before using the n-gram language model, it needs to be trained using historically correct ticket data, and the formula is as follows: Among them, P(W1, W2,..., Wm) represents the probability of the occurrence of W1W2…Wm, P(W1) represents the probability of the occurrence of "W1" in the training data, P(W2|W1) represents the probability that the word following "W1" is "W2" in the training data, and P(Wm|Wm-1) represents the probability that the word following "Wm-1" is "Wm" in the training data.
[0068] Specifically, if the address in the OCR recognition result is Room 1O2 of the building, and the address of the keyword content to be corrected using the candidate standard word is Room 102 of the building, then inputting Room 1O2 of the building and Room 102 of the building into the n-gram language model respectively gives the following results:
[0069] p(building, number 1, O, 2, room) = P(building) × P(number|building) × P(1|number) × P(O|1)) × P(2|O) × P(room|2), P(building, number 1, 0, 2, room) = P(building) × P(number|building) × P(1|number) × P(0|1)) × P(2|0) × P(room|2). Compare the two probabilities p(building, number 1, O, 2, room) and P(building, number 1, 0, 2, room), and select the training result with the larger probability as the final keyword content. Among them, P(building) represents the probability of the occurrence of the word "building" in the training data, P(number|building) represents the probability that the word following "building" is "number" in the training data, and so on, which will not be elaborated here.
[0070] Figure 5 As shown in the structural block diagram of a bill information processing device 500 provided by an embodiment of the present invention, Figure 5 the device specifically includes: a first acquisition unit 501, a second acquisition unit 502, a determination unit 503, and an error correction unit 504.
[0071] The first acquisition unit 501 is used to perform structured processing on the bill according to the OCR recognition result of the bill to obtain the structured information corresponding to the bill, and the structured information includes the keywords in the bill and the keyword content corresponding to the keywords; the second acquisition unit 502 is used to acquire a preset standard word library, and the standard word library includes standard words corresponding to different keywords; the determination unit 503 is used to determine candidate standard words from the standard word library according to the keywords corresponding to the keyword content to be corrected; the error correction unit 504 is used to correct the keyword content to be corrected using the candidate standard words.
[0072] In a specific implementation manner, the determination unit 503 is further used to select the standard words in the standard word library whose corresponding keywords are the same as the keywords to which the keyword content to be corrected belongs as candidate standard words.
[0073] In one specific implementation, if the keywords in the keyword content to be corrected include addresses, the ticket information processing device 500 further includes a segmentation unit and a comparison unit. The segmentation unit is used to segment the keyword content used to indicate the address according to the address segmentation rules to obtain multiple segmented address fragments. The comparison unit is used to determine the similarity between each address fragment and a candidate standard word. The correction unit 504 is also used to replace the address fragment with a candidate standard word whose similarity is greater than a set address threshold if there is a standard word whose similarity is greater than the threshold.
[0074] In one specific implementation, the segmentation unit is used to segment at least one level of address fragment from the keyword content based on regular expressions, including provincial, municipal, district, and specific address levels.
[0075] In one specific implementation, if the keyword content to be corrected corresponds to a keyword that includes amount, the first acquisition unit 501 is used to determine the correspondence between the Chinese character amount and the numerical amount based on the candidate standard words of the amount category; to obtain the string of Chinese amount from the keyword content indicating the amount; and the correction unit 504 is used to correct the string of Chinese amount using the candidate standard words of the amount category.
[0076] In one specific implementation, the determining unit 503 is used to obtain the top K predicted characters with the highest confidence in the OCR recognition results for each character in the string of Chinese amount; the error correction unit 504 is used to determine the character as the candidate standard word of the amount class if the top K predicted characters contain candidate standard words of the amount class.
[0077] In one specific implementation, the determining unit 503 is further used to determine the string of numerical amounts in the keyword content to be corrected based on the corrected string of Chinese amount and the correspondence between Chinese amount and numerical amount.
[0078] In one specific implementation, the bill information processing device 500 further includes a comparison unit, which is used to calculate the similarity between the keyword content to be corrected and the candidate standard words if the keyword corresponding to the keyword content to be corrected belongs to the preset keywords; the determination unit 503 is used to select the candidate standard words whose similarity meets the screening conditions as the keyword content to be corrected.
[0079] In one specific implementation, the second acquisition unit 502 is further used to acquire the mapping relationship between characters of the first language category and characters of the second language category. The first language category and the second language category are different, and the first language category and the second language category include one of Chinese, English and numbers. The comparison unit is used to correct the current character according to the mapping relationship if the confidence of the predicted character in the OCR recognition result of the current character is lower than the confidence threshold and it is determined that the language category of the current character does not meet the preset rule.
[0080] The bill information processing device 500 of this embodiment is used to implement other steps in the aforementioned bill information processing method embodiments, and has the beneficial effects of the corresponding method step embodiments, which will not be repeated here.
[0081] The bill information processing device in this embodiment obtains the structured information corresponding to the bill by performing structured processing on the bill. The structured information specifically refers to the keywords in the bill and the keyword content corresponding to the keywords. Based on the keywords corresponding to the keyword content to be corrected, candidate standard words are determined in a preset standard word library. The candidate standard words are used to correct the keyword content to be corrected, so that the obtained bill information is closer to the standard word library, thereby improving the accuracy of bill information text recognition.
[0082] A computer storage medium storing a computer-executable program, which is executed to implement the method of any of the embodiments of the present invention.
[0083] A computer program product includes a computer program that, when executed by a processor, implements the method of any one of the embodiments of the present invention.
[0084] An exemplary embodiment of the present invention also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform methods according to various embodiments of the present invention.
[0085] An exemplary embodiment of the present invention also provides a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform methods according to various embodiments of the present invention.
[0086] Reference Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the electronic device.
[0087] like Figure 6As shown, the electronic device may include: a processor 602, a communications interface 604, a memory 606 storing a program 610, and a communications bus 608.
[0088] The processor 602, communication interface 604, and memory 606 communicate with each other via communication bus 608.
[0089] Communication interface 608 is used for communication with other electronic devices or servers.
[0090] The processor 602 is used to execute programs, specifically the relevant steps in the above method embodiments.
[0091] Specifically, the program may include program code, which includes computer operation instructions.
[0092] Processor 602 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The smart device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0093] Memory 606 is used to store programs. Memory may include high-speed RAM and may also include non-volatile memory, such as at least one disk drive.
[0094] Specifically, the program can be used to enable the processor to execute the aforementioned ticket information processing method.
[0095] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0096] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0097] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0098] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0099] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0100] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.
[0101] This invention also provides a computer storage medium storing a computer executable program, which is run to implement any of the above-described methods for processing invoice information.
[0102] The above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and are not intended to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for processing invoice information, characterized in that, include: Based on the OCR recognition results of the invoice, the invoice is processed in a structured manner to obtain the structured information corresponding to the invoice. The structured information includes the keywords in the invoice and the keyword content corresponding to the keywords. Obtain a preset standard thesaurus, which includes standard terms corresponding to different keywords; Based on the keywords corresponding to the keywords to be corrected, candidate standard words are determined from the standard thesaurus; The candidate standard terms are used to correct the keyword content to be corrected, including: If the keywords in the keyword content to be corrected include addresses, then the keyword content used to indicate addresses is segmented according to address segmentation rules to obtain multiple segmented address fragments, including: using regular expressions to segment at least one level of address fragments from the keyword content, such as provincial, municipal, district, and specific address levels. For each of the address segments, determine the similarity between the address segment and the candidate standard word; If there is a standard word with a similarity greater than the set address threshold, then the address fragment is replaced with the candidate standard word with a similarity greater than the threshold. The keyword content from the OCR recognition result is input into a preset training model for training to obtain a first training result; the keyword content after being corrected by using the candidate standard words is input into the preset training model for training to obtain a second training result; and the final keyword content is determined in response to the comparison between the first training result and the second training result.
2. The method according to claim 1, characterized in that, The step of determining candidate standard words from the standard thesaurus based on the keywords corresponding to the keyword content to be corrected includes: From the standard thesaurus, select standard words whose corresponding keywords are consistent with the keywords to be corrected as candidate standard words.
3. The method according to claim 1 or 2, characterized in that, The step of correcting the keyword content to be corrected using the candidate standard words includes: If the keyword content to be corrected corresponds to a keyword that includes amount, then based on the candidate standard words of amount, the correspondence between the Chinese character amount and the numerical amount is determined; Extract the string of Chinese characters representing the amount from the keyword content indicating the amount; The string of Chinese monetary amounts is corrected using candidate standard terms of monetary amount.
4. The method according to claim 3, characterized in that, The correction of the Chinese amount string using candidate standard terms of amount category includes: For each character in the string containing Chinese amount information, obtain the top K predicted characters with the highest confidence in the OCR recognition results for each character; If the first K predicted characters contain candidate standard words of the amount category, then the character is determined as a candidate standard word of the amount category.
5. The method according to claim 3, characterized in that, The step of correcting the keyword content to be corrected using the candidate standard words also includes: Based on the corrected string of Chinese character amounts and the correspondence between the Chinese character amounts and the numerical amounts, the string of numerical amounts in the keyword content to be corrected is determined.
6. The method according to claim 1 or 2, characterized in that, The step of correcting the keyword content to be corrected using the candidate standard words includes: If the keyword corresponding to the keyword content to be corrected belongs to a preset keyword, then the keyword to be corrected is calculated. The similarity between the keyword content and the candidate standard words; Candidate standard words that meet the similarity screening criteria are selected as the keywords for correction.
7. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the mapping relationship between characters of a first language category and characters of a second language category, wherein the first language category and the second language category are different, and the first language category and the second language category include one of Chinese, English and numbers; For each character in the keyword content to be corrected, if the confidence level of the predicted character in the OCR recognition result of the current character is lower than the confidence level threshold, and it is determined that the language category of the current character does not meet the preset rule, then the current character is corrected according to the mapping relationship.
8. A bill information processing device, characterized in that, include: The first acquisition unit is used to perform structured processing on the invoice based on the OCR recognition result of the invoice, so as to obtain the structured information corresponding to the invoice. The structured information includes keywords in the invoice and the keyword content corresponding to the keywords. The second acquisition unit is used to acquire a preset standard vocabulary, which includes standard words corresponding to different keywords. The determining unit is used to determine candidate standard words from the standard thesaurus based on the keywords corresponding to the keyword content to be corrected; An error correction unit, used to correct the keyword content to be corrected using the candidate standard words, includes: If the keywords in the keyword content to be corrected include addresses, then the keyword content used to indicate addresses is segmented according to address segmentation rules to obtain multiple segmented address fragments, including: using regular expressions to segment at least one level of address fragments from the keyword content, such as provincial, municipal, district, and specific address levels. For each of the address segments, determine the similarity between the address segment and the candidate standard word; If there is a standard word with a similarity greater than the set address threshold, then the address fragment is replaced with the candidate standard word with a similarity greater than the threshold. The keyword content from the OCR recognition result is input into a preset training model for training to obtain a first training result; the keyword content after being corrected by using the candidate standard words is input into the preset training model for training to obtain a second training result; and the final keyword content is determined in response to the comparison between the first training result and the second training result.
9. A computer storage medium, characterized in that, The computer storage medium stores a computer-executable program, which is executed to implement the method of any one of claims 1-7.
10. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer-executable program and the processor running the computer-executable program to implement the method of any one of claims 1-7.