Method, apparatus and device for identifying phrases of an electronic invoice
By using graph data structure matching to identify fixed and non-fixed phrases in electronic invoices, the problem of low recognition accuracy and high cost in existing technologies is solved, achieving efficient, low-cost and highly interpretable electronic invoice phrase recognition.
Patent Information
- Application Number
- CN202510696803.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies cannot effectively automate the recognition of phrases in electronic invoices, resulting in low recognition accuracy, high cost, and poor interpretability.
By acquiring the character information of electronic invoices, the system uses graph data structure matching to identify fixed and non-fixed phrases, including constructing phrase graphs and invoice graphs, and combining character position information for matching to identify fixed and non-fixed phrases in electronic invoices.
It enables efficient and accurate recognition of phrases in electronic invoices, reduces recognition costs, and improves the interpretability of the recognition.
Smart Images

Figure CN123182233A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computer technology, and more specifically, to the field of data processing technology. Embodiments of this disclosure relate to methods, apparatus, electronic devices, computer-readable storage media, and computer program products for identifying phrases on electronic invoices. Background Technology
[0002] Electronic invoices are a product of the information age. They are payment vouchers issued and received electronically in the purchase and sale of goods, the provision or receipt of services, and other business activities. Electronic invoices exist in the form of electronic data and can be sent to the buyer via email, SMS, or other means. The buyer can print them or save them on an electronic device. Electronic invoices offer advantages such as convenience, speed, energy efficiency, ease of storage, and retrieval, and have gradually become a widely used form of invoice for both businesses and consumers.
[0003] Electronic invoices are similar in structure to traditional invoices, including key elements such as invoice name, invoice code, invoice number, invoice date, buyer information, seller information, product or service name, specifications, quantity, unit price, amount, tax rate, and tax amount. This information is typically arranged in a specific layout and presented as discrete characters on the electronic invoice. While humans can easily visually observe this information, there is currently no effective automated method to identify these characters and correctly assemble them into phrases from electronic invoices, thus automating the invoicing process. Summary of the Invention
[0004] The embodiments of this disclosure provide a low-cost, high-accuracy electronic invoice phrase recognition scheme.
[0005] According to a first aspect of this disclosure, a method for identifying phrases in an electronic invoice is provided. The method includes: acquiring character information of the electronic invoice, the character information including multiple characters and their positional information; identifying at least one fixed phrase in the electronic invoice based on matching the character information with a graph data structure, the graph data structure representing the fixed characters included in the fixed phrase in the invoice template and their positional information; and identifying at least one non-fixed phrase in the electronic invoice based on non-fixed characters other than the multiple fixed phrases. In this manner, the matching of characters and their positional information stored in the electronic invoice with a graph data structure can efficiently and accurately identify fixed and non-fixed phrases in the electronic invoice, and it features low cost and high interpretability.
[0006] In some embodiments of the first aspect, the graph data structure includes multiple phrase graphs, each phrase graph representing the positional information of multiple fixed characters in a fixed phrase in an invoice template, and identifying at least one fixed phrase in an electronic invoice includes: determining one or more matching fixed phrases by matching multiple characters and their positional information in the electronic invoice with the multiple phrase graphs. Based on this approach, multiple phrase graphs can be used to match characters and positional information in an electronic invoice, enhancing the reliability of fixed phrase identification.
[0007] In some embodiments of the first aspect, each vertex of the phrase graph represents the text information of fixed characters included in a fixed phrase within an invoice template, and the edges of the phrase graph represent the positional information of the fixed characters at the two vertices connected by the edge. The positional information can be the coordinates of these two characters, or it can be a metric calculated based on the coordinates, such as angle, slope, or distance. Based on this approach, converting the spatial information of fixed phrases in the invoice template into a phrase graph allows for a clear and intuitive construction of the structural model of the fixed phrases, providing an intuitive and efficient basis for identifying fixed phrases.
[0008] In some embodiments of the first aspect, determining one or more matching fixed phrases by matching multiple characters and positional information of an electronic invoice with multiple phrase graphs includes: for each phrase graph, based on multiple characters and their positional information in the electronic invoice, determining a fixed phrase that matches the phrase graph, wherein the positional information of the characters in the matched fixed phrase conforms to the positional information of multiple fixed characters in the fixed phrase represented by the phrase graph. For example, first, characters in the electronic invoice that are identical to nodes in the phrase graph are identified, and then the positional relationship of these characters is checked to see if it conforms to the positional information represented by the corresponding edges in the phrase graph. If characters are found in the electronic invoice that match both the textual information and the positional position of the edges of nodes in the phrase graph, then these characters can be considered to constitute a fixed phrase. Based on this method, it is possible to ensure that the positional information of the identified fixed phrase characters conforms to the requirements of the phrase graph, thereby improving the accuracy of fixed phrase recognition.
[0009] In some embodiments of the first aspect, each matched fixed phrase has positional information. The graph data structure also includes an invoice graph, which represents the positional information of multiple fixed phrases in the invoice template. Identifying at least one fixed phrase in an electronic invoice further includes: identifying at least one fixed phrase in the electronic invoice by matching one or more matched fixed phrases with the invoice graph. In some embodiments, it may be further required that the positional relationship between fixed phrases in the electronic invoice is consistent with the invoice template, making it advantageous to use the fixed phrases identified by matching with the invoice graph. Based on this approach, in cases where duplicate fixed phrases may be identified, the positional relationship between multiple fixed phrases can be further comprehensively considered to accurately identify the correct fixed phrases in the electronic invoice, thus improving the fixed phrase identification process.
[0010] In some embodiments of the first aspect, the vertices of the invoice graph represent the text information of fixed phrases in the invoice template, and the edges of the invoice graph represent the positional information of the fixed phrases at the two vertices connected by the edge. Based on this approach, the positional relationships of multiple fixed phrases in the invoice template can be clearly presented, providing a comprehensive reference framework for the accurate identification of fixed phrases.
[0011] In some embodiments of the first aspect, identifying at least one fixed phrase in an electronic invoice by matching one or more matching fixed phrases with an invoice image includes: determining, based on the invoice image, a combination of fixed phrases from the one or more matching fixed phrases, wherein the positional information of the fixed phrases in the combination conforms to the positional information of multiple fixed phrases represented by the invoice image. In this manner, the correct combination of matching fixed phrases can be determined based on the invoice image, ensuring that the positional information of the fixed phrases in the combination conforms to the requirements of the invoice image, thereby improving the completeness and accuracy of fixed phrase identification.
[0012] In some embodiments of the first aspect, the invoice template and the electronic invoice belong to the same category of invoice. Due to the diversity of electronic invoices, various electronic invoices have their own fixed phrases and layouts. Based on this approach, the relevance and applicability of the graph data structure construction can be guaranteed, providing a more suitable reference standard for electronic invoice phrase recognition.
[0013] In some embodiments of the first aspect, the method further includes: obtaining a predefined set of fixed phrases from the invoice template; obtaining fixed characters and their position information from the invoice template based on the predefined set of fixed phrases; and generating a graph data structure based on the obtained fixed characters and their position information. In this way, a graph data structure that meets the requirements can be generated by obtaining a predefined set of fixed phrases from the invoice template, providing a targeted template for phrase recognition in electronic invoices.
[0014] In some embodiments of the first aspect, identifying at least one non-fixed phrase in an electronic invoice based on non-fixed characters other than multiple fixed phrases in the electronic invoice includes: removing characters from the identified at least one fixed phrase from multiple characters in the electronic invoice to obtain non-fixed characters; splitting the non-fixed characters into lines based on their position information; and identifying at least one non-fixed phrase based on the split non-fixed characters. In this manner, by removing characters from fixed phrases and splitting non-fixed characters into lines, the characters of fixed phrases and non-fixed phrases can be effectively separated, thereby improving the accuracy of identifying non-fixed phrases.
[0015] In some embodiments of the first aspect, identifying at least one non-fixed word group based on the non-fixed characters after line breaks includes: determining the characters in each line that are not concatenated with the preceding character; and dividing the non-fixed characters in each line into multiple non-fixed word groups based on the characters that are not concatenated with the preceding character. In this manner, by determining the characters in each line that are not concatenated with the preceding character, non-fixed characters can be accurately divided into multiple non-fixed word groups, thus achieving effective identification and classification of non-fixed word groups.
[0016] In some embodiments of the first aspect, determining characters in each row that are not concatenated with the preceding character includes: inputting each row of characters into a graph neural network, performing a binary classification operation on each character in each row, the binary classification indicating whether the character is concatenated with the preceding character; and determining characters in each row that are not concatenated with the preceding character based on the binary classification operation. The graph neural network can be trained to utilize the semantic and spatial information of characters to determine whether characters in the same row or adjacent rows belong to the same word group. Based on this approach, the graph neural network can accurately determine whether a character is concatenated with the preceding character, thereby precisely identifying characters that are not concatenated with the preceding character and improving the accuracy of non-fixed word group recognition.
[0017] According to a second aspect of this disclosure, an electronic device is provided. The electronic device includes a processing unit and a memory. The processing unit executes instructions in the memory, causing the electronic device to perform a method. The method includes: acquiring character information of an electronic invoice, the character information including multiple characters in the electronic invoice and position information of the multiple characters; identifying at least one fixed phrase in the electronic invoice based on matching the character information with a graph data structure, the graph data structure representing fixed characters included in the fixed phrase in the invoice template and the position information of the fixed characters; and identifying at least one non-fixed phrase in the electronic invoice based on non-fixed characters other than the multiple fixed phrases in the electronic invoice.
[0018] According to a third aspect of this disclosure, an apparatus for identifying phrases in an electronic invoice is provided. The apparatus includes: a character information acquisition unit configured to acquire character information of the electronic invoice, the character information including multiple characters in the electronic invoice and position information of the multiple characters; a fixed phrase identification unit configured to identify at least one fixed phrase in the electronic invoice based on matching the character information with a graph data structure, the graph data structure representing fixed characters included in the fixed phrase in the invoice template and the position information of the fixed characters; and a non-fixed phrase identification unit configured to identify at least one non-fixed phrase in the electronic invoice based on non-fixed characters other than the multiple fixed phrases in the electronic invoice.
[0019] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that stores one or more computer instructions thereon, wherein one or more computer instructions are executed by a processor to cause the processor to perform the method according to a first aspect of this disclosure.
[0020] According to a fifth aspect of this disclosure, a computer program product is provided, including machine-executable instructions that, when executed by a device, cause the device to perform the method according to a first aspect of this disclosure. Attached Figure Description
[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0022] Figure 1 A schematic diagram of a sample electronic invoice is shown;
[0023] Figure 2 A schematic diagram showing the result of electronic invoice recognition using optical character recognition (OCR) is provided.
[0024] Figure 3 A schematic diagram showing the results of electronic invoice recognition using a distance-based general rule is presented.
[0025] Figure 4 A schematic diagram of the structure of an electronic invoice recognition system according to an embodiment of the present disclosure is shown;
[0026] Figure 5 A schematic flowchart illustrating the process of identifying phrases on an electronic invoice according to an embodiment of the present disclosure is shown;
[0027] Figure 6 A detailed flowchart illustrating the process of identifying phrases on an electronic invoice according to an embodiment of the present disclosure is shown.
[0028] Figure 7A schematic block diagram of an apparatus for identifying phrases on an electronic invoice according to an embodiment of the present disclosure is shown; and
[0029] Figure 8 A schematic block diagram of an example device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0030] The technical solutions of this disclosure will now be described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments.
[0031] The technical solutions of the embodiments of this disclosure will now be described with reference to the accompanying drawings. In the description of the embodiments of this disclosure, unless otherwise stated, " / " signifies "and / or," for example, A / B can mean A or B, or A and B. "And / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Furthermore, in the description of the embodiments of this disclosure, "plural" or "multiple" refers to two or more than two.
[0032] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.
[0033] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure. As used in the specification and appended claims of this disclosure, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this disclosure, “at least one” and “one or more” refer to one, two, or more than two. The term “and / or” is used to describe the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.
[0034] References to "one embodiment" or "some embodiments" or the like in the description described in this specification mean that a specific feature, structure, or characteristic described in connection with the embodiments is included in one or more embodiments of the present disclosure. Thus, the appearances of the phrases "in one embodiment," "in some embodiments," "in another embodiment," "in other embodiments," etc. in various places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "comprise," "include," "have," and their variations mean "including but not limited to" unless specifically emphasized otherwise.
[0035] The numbers or numerical values used in this specification are all illustrative, and their purpose is only to facilitate understanding of the technology of the embodiments of the present disclosure, and are in no way intended to limit the scope of the present disclosure.
[0036] To facilitate understanding of the technical ideas and details of the embodiments of the present disclosure, the following terms are provided.
[0037] Character: refers to the basic element that can be directly identified and extracted from an electronic invoice, including the text itself and its attribute information, such as coordinate position, font, font size, color, etc.
[0038] Fixed character: refers to a character that always appears at a specific position with constant content in all instances of a certain type of invoice. Such characters are usually standardized identification information of invoices, such as the characters "发", "票", "代", "码" that make up the "invoice code".
[0039] Non-fixed character: refers to a character whose content may vary in different instances of the same type of invoice, for example, the actual amount, name, and individual characters in the time.
[0040] Fixed phrase: a phrase with semantic unity composed of one or more fixed characters, which is a semantic unit of structured identification in a ticket, such as "invoice code", "purchaser", etc.
[0041] Non-fixed phrase: a phrase composed of one or more non-fixed characters, which carries the actual business data in a specific ticket instance, such as "Beijing", "May 10, 2024", "¥1,000.00", etc.
[0042] Graph: a general-purpose data structure that consists of two parts: vertices (V) and edges (E). Vertices are used to represent entities or elements, and edges are used to represent relationships between elements. In the present disclosure, a graph is used to represent characters and their spatial information and / or phrases and their spatial information in an electronic invoice.
[0043] Word Graph (WG): Used to represent a fixed word group and the spatial structure between its internal characters. Its vertices are composed of characters, and its edges describe the relative spatial relationships between these characters, such as the distance, angle, and relative position between characters, reflecting the visual arrangement pattern of the word group.
[0044] Bill Graph (BG): Used to represent the overall structure of a certain type of electronic invoice. Its vertices are composed of the text content of the word graph (WG), where each WG represents a word in the invoice. The edges describe the spatial relationships between different word graphs, such as the relative distance, angle, and slope between word graphs, thus reflecting the layout characteristics of this type of invoice.
[0045] Overview
[0046] Due to the significant advantages of automated document recognition technology, which can not only improve work efficiency and accuracy but also reduce labor costs and avoid human error, more and more enterprises and institutions are beginning to adopt electronic and automated methods to process documents in order to improve work efficiency and accuracy.
[0047] Digital invoices can be categorized into two types: scanned invoices and electronic invoices. Scanned invoices are typically stored on a computer as photos (pixels). Electronic invoices contain characters and their coordinate information, making them more compatible with digital office systems. Based on statistics of existing expense reimbursement invoices, electronic invoices have become the mainstream format for all digital invoice recognition. Therefore, high-precision parsing of electronic invoices will directly improve the experience and efficiency of automated office work.
[0048] The technical implementation of electronic invoices mainly includes elements such as format specifications, character text, and character position information. From a format specification perspective, electronic invoices may adopt different standard formats, such as Open Fixed Layout Document (OFD), Portable Document Format (PDF), and Extensible Markup Language (XML). These formats differ in data encapsulation, digital signatures, and anti-counterfeiting mechanisms. Character text is the main content of an electronic invoice, including key data such as invoice code, transaction information, product details, and amount. This information is usually stored in a file in the form of a text stream or structured tags. Position information defines the specific layout of characters within the invoice format, such as XY coordinate information. In some implementations, electronic invoices may also include character style information, such as font, font size, and color attributes.
[0049] Figure 1 A schematic diagram of a sample electronic invoice is shown. (For example...) Figure 1As shown, the electronic invoice may include an invoice header, purchaser information, seller information, invoice content, and an invoice footer. The invoice header may include information such as the invoice number and invoice issuance date. The purchaser information may include information such as the purchaser name and unified social credit code / taxpayer identification number. The seller information may include information such as the seller name and unified social credit code / taxpayer identification number. The invoice content may include information such as item name, specifications and model, and unit. The invoice footer may include information such as remarks and the invoicer. Among them, Figure 1 the phrases "invoice number", "invoice issuance date", "item name" and the like shown in are fixed phrases, that is, their content and position are basically consistent under the same invoice type (for example, a value-added tax special invoice), and Figure 1 the "*" shown in is a non-fixed phrase, and its content is also different even under the same invoice type.
[0050] Automated processing of electronic invoices is a process of implementing intelligent collection and arrangement of invoice information through a computer system. The system first automatically recognizes characters on the invoice, including various numbers, letters, and Chinese characters; then intelligently combines these recognized individual characters into meaningful words and numbers, such as combining the four characters "发", "票", "号", and "码" into the complete information "invoice number"; and finally classifies and arranges these information according to a standard format, automatically fills in corresponding data fields, and forms standardized electronic data. In this process, how to obtain correct phrases from discrete characters is a key step in electronic invoice parsing.
[0051] Some existing electronic invoice recognition solutions, taking Optical Character Recognition (OCR) as an example, convert text features in an electronic invoice image into character codes that can be understood by a computer by analyzing the text features. Such solutions usually first convert the electronic invoice into an image format, and pre-process the invoice image, including operations such as grayscale processing, denoising, binarization, and skew correction, to improve image quality. Then, target detection and text recognition are respectively performed based on a deep learning neural network, to output a position and content of a text. The OCR technology can accurately recognize most characters, and has good versatility. However, since the electronic invoice recognition must be implemented by means of image conversion, original characters and position information of the electronic invoice are lost. Therefore, when encountering some characters with similar forms (for example, the number "0" and the letter "O"), recognition errors are likely to occur, and texts that are close to each other are likely to be merged. In addition, since the OCR technology often needs to use a deep learning neural network for text recognition, a large amount of labeling and computing power costs also need to be consumed, and the OCR technology has low interpretability.
[0052] Figure 2 is a schematic diagram showing a result of electronic invoice recognition using OCR. As Figure 2As shown, the electronic invoice contains a record with the item name "*Electronic Components*ABCDEFGHIJKLMN", the specification "ABCDEFGHIJKLMN", and the unit "unit". OCR technology can correctly recognize most phrases in the electronic invoice, including "item name" and "specification". However, because the content under the item name and the content under the specification are too close together, the OCR technology will identify them as the same target phrase "*Electronic Components*ABCDEFGABCDEFG", leading to an error.
[0053] There are also some electronic invoice recognition solutions that perform phrase recognition based on general rules (such as the distance between characters, character color, font, etc.). Figure 3 A schematic diagram illustrating the results of electronic invoice recognition using a distance-based general rule is shown. For example... Figure 3 As shown, distance-based general rule schemes cannot combine vertical word groups, for example... Figure 3 The "buyer information" shown in the image. Furthermore, because word group recognition is strictly based on distance, it cannot distinguish between fixed word groups and variable word groups, for example... Figure 3 The "units" shown in the text.
[0054] Given that existing methods for recognizing phrases in electronic invoices suffer from low accuracy, high cost, and low interpretability, embodiments of this disclosure provide an efficient and accurate phrase recognition scheme for electronic invoices. This scheme matches the character position information stored in the electronic invoice with the graph data structure representing the invoice layout to identify fixed and non-fixed phrases in the electronic invoice. Compared with existing technologies, this scheme has advantages such as low cost and high interpretability.
[0055] Electronic Invoice Recognition System
[0056] Figure 4 A schematic diagram of the structure of an electronic invoice recognition system 400 according to an embodiment of the present disclosure is shown. It should be understood that... Figure 4 The system 400 shown is merely exemplary and should not be construed as limiting the functionality and scope of the implementation described in this disclosure. In some implementations, system 400 may include more modules or functions, and some modules may be omitted.
[0057] In some implementations, System 400 can be implemented as various user terminals or service terminals with computing capabilities. Service terminals can be servers, large computing devices, or clusters provided by various service providers. User terminals can be any type of mobile terminal, fixed terminal, or portable terminal, including mobile phones, sites, units, devices, multimedia computers, multimedia tablets, internet nodes, communicators, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices, or any combination thereof.
[0058] like Figure 4 As shown, system 400 includes an invoice template 402 pre-stored or obtained from other devices, a graph construction module 404 for constructing a graph data structure 406 from the invoice template 402, the graph data structure 406, an electronic invoice to be recognized 408, a character extraction module 410 for extracting embedded character information from the electronic invoice to be recognized 408, a fixed phrase recognition module 412 for recognizing and outputting fixed phrases 413 in the electronic invoice 408, and a non-fixed phrase recognition module 414 for recognizing and outputting non-fixed phrases 416 in the electronic invoice 408. The following details each module or data content in system 400.
[0059] Invoice template 402 can be an invoice instance under a specific invoice category, containing all fixed phrases within that category. Therefore, multiple invoice templates 402 under different invoice categories can be used to identify the specific fixed phrases for each category. For example, invoice template 402 under the VAT special invoice category might include fixed phrases such as "buyer information," "seller information," and "project name," while invoice template 402 under the VAT electronic general invoice category might include fixed phrases such as "buyer," "seller," and "password area." In some implementations, the fixed phrases can be checked and confirmed by the user to ensure their accuracy. In some implementations, invoice template 402 can be stored in a local storage module (not shown in the figure) or provided to system 400 by other devices.
[0060] Graph construction module 404 receives invoice template 402 and generates graph data structure 406 based on the fixed phrases therein. Graph data structure 406 can be further used to identify fixed phrases in electronic invoice 408 that belong to the same type of electronic invoice as invoice template 402. In some embodiments, graph data structure 406 may include one or more phrase graphs, each phrase graph representing the positional relationship between fixed characters that make up the corresponding fixed phrase. The vertices of the phrase graph can represent the character text information of the fixed phrase in invoice template 402, and the edges of the phrase graph can represent the character position information of the fixed phrase in invoice template 402. In some embodiments, graph construction module 404 can construct a graph phrase graph based on the characters identified as fixed phrases in invoice template 402 and their position information (e.g., through character extraction module 410). In the phrase graph, the position information can be, for example, the spatial coordinates of characters, the distance between characters, angles, or slopes.
[0061] In some embodiments, the graph data structure 406 can further construct an invoice graph based on the generated phrase graph. The invoice graph represents the positional relationships between multiple fixed phrases in the invoice template. In some implementations, each vertex of the invoice graph can represent the textual information of a fixed phrase in the invoice template 402, and the edges of the invoice graph can represent the positional information of the fixed phrases at their two vertices in the invoice template 402. In the invoice graph, positional information can be, for example, the spatial coordinates of the fixed phrases (e.g., represented by the coordinates of the leftmost, rightmost, topmost, and bottommost characters in the fixed phrases, or the average coordinates of all characters), the distance between fixed phrases, angles, or slopes, etc.
[0062] In some implementations, the phrase graph and / or invoice graph may be generated by other devices and shared with the system 400 without relying on the graph construction module 404. This disclosure does not restrict the source of the graph data structure 406. That is, the invoice template 402 and the graph construction module 404 can be omitted from the system 400.
[0063] The character extraction module 410 receives the electronic invoice 408 to be recognized and extracts all character information from it. In some implementations, taking an electronic invoice in PDF format as an example, the character extraction module 410 can use a PDF processing library to extract the characters and their position information from the electronic invoice 408 in PDF format. Because it does not undergo secondary recognition through image conversion or other steps, but directly extracts the original character information, it avoids problems such as character recognition errors (e.g., recognizing the letter "O" as the number "0"). After obtaining all character information from the electronic invoice 408 to be recognized, the character extraction module 410 provides it to the fixed phrase recognition module 412.
[0064] The fixed phrase recognition module 412 receives all character information in the electronic invoice 408 to be recognized, and determines and outputs the fixed phrases 413 therein in combination with the graph data structure 406. Specifically, for each phrase graph in the plurality of phrase graphs in the graph data structure 406, the fixed phrase recognition module 412 may determine a fixed phrase matching the phrase graph based on the plurality of characters and their position information in the electronic invoice 408 to be recognized, wherein the position information of the characters in the matched fixed phrase conforms to the position information of the plurality of fixed characters in the fixed phrase represented by the phrase graph.
[0065] For example, vertices of a phrase graph may be "购", "买", and "方", and edges may be positional relationships among the three characters "购", "买", and "方". When matching a fixed phrase using the phrase graph, all the characters "购", "买", and "方" in the electronic invoice 408 to be recognized may first be searched for. If there are multiple repeated characters "购", "买", or "方" in the electronic invoice 408 to be recognized, it may be determined according to a positional relationship of these characters whether it is similar to an edge of the phrase graph. Then, a group of most similar characters "购", "买", and "方" may be determined as the fixed phrase.
[0066] In some cases, multiple fixed phrases matching a certain phrase graph may be recognized from the electronic invoice 408, and only one of them is a correct fixed phrase matching an invoice template. For example, two "购买方" are recognized, but one of them does not belong to a fixed phrase. In this case, the invoice graph may be used to check these recognized fixed phrases (also referred to as "candidate fixed phrases"), and a fixed phrase whose position information matches the invoice graph is determined as the correct fixed phrase.
[0067] After the fixed phrase recognition module 412 recognizes all the fixed phrases 413 in the electronic invoice 408 to be recognized, the system 400 may filter out and remove all the fixed phrases 413 from all the characters of the electronic invoice 408 to be recognized, and determine remaining characters as non-fixed characters. Preferably, the operation of determining a non-fixed character may be implemented by a non-fixed phrase recognition module 414. Alternatively, the above operation may also be implemented by the fixed phrase recognition module 412, or implemented by an independent function module.
[0068] The non-fixed phrase recognition module 414 obtains a non-fixed character in the electronic invoice 408 to be recognized according to a previous operation, and combines it into multiple non-fixed phrases. In some implementations, the non-fixed phrase recognition module 414 may first perform line separation on the non-fixed characters in the electronic invoice 408 to be recognized, and then perform non-fixed phrase segmentation for each line.
[0069] In some implementations, the non-fixed phrase recognition module 414 can input each line of characters into a graph neural network, performing a binary classification operation on each character in each line to determine whether it is concatenated with the preceding character. The graph neural network can be trained to use the semantic and spatial information of the characters to determine whether characters in the same or adjacent lines belong to the same phrase. Then, each line of non-fixed characters can be segmented based on these characters to obtain the non-fixed phrases in the electronic invoice 408 to be recognized.
[0070] Based on the above operations, the fixed phrases 413 and non-fixed phrases 416 in the electronic invoice 408 to be identified can be finally identified. In some implementations, the fixed phrases 413 and non-fixed phrases 416 can be classified and organized according to a standard format to form standardized electronic data.
[0071] In the above process, the computing device can utilize the original characters and their positional information in the electronic invoice to be identified, as well as the graph data structure obtained based on the invoice template, to achieve the identification of fixed phrases and non-fixed phrases. Compared with traditional solutions involving secondary image recognition, black-box recognition, or the inability to distinguish fixed phrases, the embodiments of this disclosure can achieve the effects of accuracy, efficiency, low cost, and strong interpretability.
[0072] Electronic invoice recognition process
[0073] The following is for reference Figures 5 to 8 Embodiments of this disclosure are further described below. In general, embodiments of this disclosure provide a method for identifying fixed and non-fixed word groups based on graph data structure matching.
[0074] Figure 5 A schematic flowchart of a process 500 for identifying phrases on an electronic invoice according to an embodiment of the present disclosure is shown. It should be understood that method 500 may also include additional actions not shown and / or actions shown may be omitted, and the scope of the present disclosure is not limited in this respect. Method 500 may be... Figure 4 The system shown is implemented using system 400. For ease of explanation, please refer to [reference needed]. Figure 4 The process 500 for recognizing phrases on an electronic invoice according to an embodiment of the present disclosure is described. Specifically, the action of box 510 can be implemented by the character extraction module 410, the action of box 520 can be implemented by the fixed phrase recognition module 412, and the action of box 530 can be implemented by the non-fixed phrase recognition module 414.
[0075] like Figure 5As shown in box 510, system 400 obtains character information from an electronic invoice. This character information includes multiple characters and their position information within the electronic invoice. The position information may include the x and y coordinates of each character. Taking a PDF format electronic invoice as an example, in some implementations, system 400 can utilize PDF processing libraries (e.g., PyPDF2, PDFMiner.six, etc.) to extract characters and their position information from the electronic invoice. This disclosure does not limit the method of obtaining character information from electronic invoices.
[0076] In box 520, system 400 identifies at least one fixed phrase in an electronic invoice based on the matching of character information with a graph data structure. The graph data structure represents the fixed characters included in the fixed phrase in the invoice template and their positional information. A graph data structure is a data structure consisting of vertices (also called nodes) and edges connecting the vertices. By using a graph data structure, fixed characters and their positional relationships can be recorded.
[0077] In some implementations, the graph data structure can be constructed based on invoice templates of the same category as the e-invoice to be identified. Specifically, system 400 can first obtain a predefined set of fixed phrases from the invoice template. This set of fixed phrases can be multiple manually collected fixed phrases commonly used in e-invoices, such as "buyer information" or "taxpayer identification number." Then, system 400 can perform matching based on the predefined set of fixed phrases to obtain the fixed characters and their positional information included in the invoice template, thereby constructing the graph data structure. For each invoice category, system 400 can construct a corresponding graph data structure to match various types of e-invoices to be identified.
[0078] In some implementations, the graph data structure can include multiple phrase graphs, each of which can represent the positional information of multiple fixed characters in a fixed phrase within a corresponding invoice template. Specifically, each vertex of a phrase graph can represent the text information of the fixed characters included in a fixed phrase within the corresponding invoice template, and the edges of the phrase graph can represent the positional information of the fixed characters at the two vertices connected by the edge. The positional information can be the horizontal and vertical coordinates of the fixed characters, or information such as the distance, angle, and slope of the line connecting the fixed characters.
[0079] By matching multiple characters and their positional information of the electronic invoice to be identified with multiple word group diagrams, the system 400 can determine one or more matching fixed word groups. Specifically, for each word group diagram in the multiple word group diagrams, the system 400 can determine a fixed word group that matches the word group diagram based on multiple characters and their positional information in the electronic invoice. The positional information of the characters in the matched fixed word group conforms to the positional information of multiple fixed characters in the fixed word group represented by the word group diagram.
[0080] Since each fixed phrase based on phrase graph matching also has positional information, in some implementations, the graph data structure can also include an invoice graph, which can represent the positional information of multiple fixed phrases in the corresponding invoice template. Specifically, the vertices of the invoice graph can represent the text information of the fixed phrases in the corresponding invoice template, and the edges of the invoice graph can represent the positional information of the fixed phrases at the two vertices connected by the edge. The positional information can be the horizontal and vertical coordinates of the fixed phrases, or information such as the distance, angle, and slope of the lines connecting the fixed phrases.
[0081] By matching one or more matching fixed phrases with an invoice image, system 400 can identify at least one fixed phrase in the electronic invoice to be identified. Specifically, system 400 can determine a combination of fixed phrases from one or more matching fixed phrases based on the invoice image, where the positional information of the fixed phrases in the combination matches the positional information of multiple fixed phrases represented in the invoice image. In this way, when multiple identical phrases (such as "buyer information," "taxpayer identification number," etc.) appear in the electronic invoice to be identified, the system can correctly identify the fixed phrases.
[0082] In box 530, system 400 identifies at least one non-fixed phrase in an electronic invoice based on non-fixed characters other than multiple fixed phrases. All non-fixed characters are obtained by removing the fixed characters obtained through graph data structure matching from the multiple characters on the electronic invoice to be identified. In some implementations, system 400 may first divide the non-fixed characters into lines based on their position information, and then identify at least one non-fixed phrase line by line based on the divided non-fixed characters.
[0083] In some implementations, system 400 can first determine the characters in each line that are not concatenated with the preceding character, and then divide the non-fixed characters in each line into multiple non-fixed word groups based on these characters. Alternatively, each line of characters can be input into a graph neural network, and a binary classification operation can be performed on each character in each line to indicate whether the character is concatenated with the preceding character.
[0084] Figure 6 A schematic diagram illustrating a specific process for identifying phrases on an electronic invoice according to an embodiment of this disclosure is shown. For example... Figure 6As shown, in step 602, system 400 can collect fixed phrases (such as "invoice number," "buyer information," etc.) to construct a graph data structure. In step 604, system 400 can read sample character text and its position information from the invoice template. Then, in step 606, system 400 can construct a phrase graph based on the collected fixed phrases and sample characters. Since multiple identical fixed phrases may exist in the invoice template, in step 608, system 400 can filter phrase graphs with correct positions to filter out duplicate and incorrectly positioned fixed phrases. An example phrase graph is shown below:
[0085]
[0086] Besides using character coordinates to represent the edges of a phrase graph, some implementations can also calculate the distance and slope between characters based on their coordinates, and use this calculated information to represent the edges of the phrase graph. In step 610, the system 400 can construct invoice graphs for different invoice categories from multiple phrase graphs. An example invoice graph is shown below:
[0087]
[0088] Similarly, besides using the coordinate information of fixed phrases to represent the edges of the invoice graph, some implementations can also calculate the distance, slope, etc., between fixed phrases based on their coordinate information, and use the calculated information to represent the edges of the invoice graph. Optionally, the coordinate information of the fixed phrases can be the center coordinates of the fixed phrases, or the coordinates of the first character in the fixed phrases, etc., and this disclosure does not impose any restrictions on this.
[0089] After completing the preparation work for constructing the graph data structure, in step 612, the electronic invoice to be parsed can be input into the system 400. The electronic invoice to be parsed can be of any type. Then, in step 614, the system 400 can read the invoice character text and its position information. In step 616, the system 400 can first match the character and phrase graphs to determine all fixed characters in the electronic invoice to be identified. Optionally, the identification of fixed characters can be completed based on pruned matching. Pruned matching can reduce unnecessary search paths and computational load during pattern matching or search through specific strategies, thereby improving matching efficiency. Then, in step 618, the system 400 can match the phrase graph with the invoice graph to identify the correct fixed phrases in the electronic invoice to be identified. After obtaining all fixed phrases, in step 620, the system 400 can filter out these matched fixed phrases to obtain all non-fixed characters.
[0090] For non-fixed characters in the electronic invoice to be identified, in step 622, the system 400 can first perform line splitting based on their position information, and then divide each line of non-fixed characters into phrases. In step 624, the system 400 can perform binary classification on each non-fixed character in each line to determine whether it is concatenated with the previous character. Then, in step 626, the system 400 can divide each line of non-fixed characters into multiple non-fixed phrases based on these characters that are not concatenated with the previous character. In step 628, the system 400 can output these non-fixed phrases with position information. In this way, all fixed and non-fixed phrases in the electronic invoice to be identified can be identified for subsequent phrase category determination.
[0091] Exemplary apparatus and implementation
[0092] Figure 7 A schematic block diagram of an apparatus 700 for identifying phrases on an electronic invoice according to an embodiment of the present disclosure is shown. The apparatus 700 may be implemented in example system 400. The apparatus 700 includes a character information acquisition unit 710 configured to acquire character information of an electronic invoice, the character information including multiple characters and position information of the multiple characters in the electronic invoice; a fixed phrase identification unit 720 configured to identify at least one fixed phrase in the electronic invoice based on matching the character information with a graph data structure, the graph data structure representing fixed characters included in the fixed phrase in the invoice template and the position information of the fixed characters; and a non-fixed phrase identification unit 730 configured to identify at least one non-fixed phrase in the electronic invoice based on non-fixed characters other than the multiple fixed phrases in the electronic invoice.
[0093] In some embodiments, the graph data structure may include multiple word group graphs, each word group graph may represent the position information of multiple fixed characters of a fixed word group in the invoice template, and the fixed word group identification unit 720 may also be configured to: determine one or more matching fixed word groups by matching multiple characters of the electronic invoice and the position information of the multiple characters with the multiple word group graphs.
[0094] In some embodiments, each vertex of the phrase graph can represent the text information of fixed characters included in a fixed phrase in an invoice template, and the edges of the fixed phrase graph can represent the position information of fixed characters at the two vertices connected by the edges.
[0095] In some embodiments, the fixed phrase recognition unit 720 may also be configured to: for each of the multiple phrase graphs, determine a fixed phrase that matches the phrase graph based on multiple characters in the electronic invoice and the position information of the multiple characters, wherein the position information of the characters in the matched fixed phrase conforms to the position information of multiple fixed characters of the fixed phrase represented by the phrase graph.
[0096] In some embodiments, each matched fixed phrase may have location information, the graph data structure may also include an invoice graph, the invoice graph may represent the location information of multiple fixed phrases in the invoice template, and the fixed phrase identification unit 720 may also be configured to: identify at least one fixed phrase in the electronic invoice by matching one or more matched fixed phrases with the invoice graph.
[0097] In some embodiments, the vertices of the invoice graph can represent the text information of fixed phrases in the invoice template, and the edges of the invoice graph can represent the position information of fixed phrases at the two vertices connected by the edges.
[0098] In some embodiments, the fixed phrase identification unit 720 may also be configured to: determine a combination of fixed phrases from one or more matching fixed phrases based on the invoice image, wherein the position information of the fixed phrases in the combination conforms to the position information of multiple fixed phrases represented by the invoice image.
[0099] In some embodiments, the invoice template and the electronic invoice may belong to the same category of invoice.
[0100] In some embodiments, the apparatus 700 may further include a graph data structure generation unit configured to: obtain a predefined set of fixed phrases of an invoice template; obtain fixed characters and position information of the fixed characters included in the invoice template based on the predefined set of fixed phrases; and generate a graph data structure based on the obtained fixed characters and position information of the fixed characters.
[0101] In some embodiments, the non-fixed phrase recognition unit 730 may also be configured to: remove characters from at least one identified fixed phrase from multiple characters on an electronic invoice to obtain non-fixed characters; split the non-fixed characters into lines based on their position information; and recognize at least one non-fixed phrase based on the split non-fixed characters.
[0102] In some embodiments, the non-fixed phrase recognition unit 730 may also be configured to: determine characters in each line that are not concatenated with the preceding character; and divide the non-fixed characters in each line into multiple non-fixed phrases based on the characters that are not concatenated with the preceding character.
[0103] In some embodiments, the non-fixed phrase recognition unit 730 may also be configured to: input each line of characters into a graph neural network, perform a binary classification operation on each character in each line of characters, the binary classification indicating whether the character is concatenated with the preceding character; and, based on the binary classification operation, determine the characters in each line that are not concatenated with the preceding character.
[0104] Figure 8 A schematic block diagram of an example device 800 that can be used to implement embodiments of the present disclosure is shown. Figure 8As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 802 or loaded into random access memory (RAM) 803 from storage unit 806. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0105] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as a touchscreen, keyboard, mouse, etc.; output unit 807, such as various types of displays (e.g., interactive displays, such as touchscreens), speakers, etc.; storage unit 808, such as a disk, optical disk, etc.; and communication unit 809, such as a network interface card (NIC), modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0106] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as method 500. For example, in some embodiments, method 500 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of method 500 described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform method 500 by any other suitable means (e.g., by means of firmware).
[0107] This disclosure can be a method, apparatus, system, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.
[0108] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0109] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0110] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0111] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0112] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0113] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0115] Various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for identifying phrases on electronic invoices, comprising: Obtain character information from an electronic invoice, the character information including multiple characters in the electronic invoice and the position information of the multiple characters; Based on the matching of the character information and the graph data structure, at least one fixed phrase in the electronic invoice is identified, wherein the graph data structure represents the fixed characters included in the fixed phrase in the invoice template and the position information of the fixed characters; and Based on non-fixed characters other than the multiple fixed phrases in the electronic invoice, at least one non-fixed phrase in the electronic invoice is identified.
2. The method according to claim 1, wherein, The graph data structure includes multiple word group graphs, each word group graph representing the positional information of multiple fixed characters in a fixed word group in the invoice template, and identifying at least one fixed word group in the electronic invoice includes: By matching the multiple characters and their location information in the electronic invoice with the multiple word group diagrams, one or more matching fixed word groups are determined.
3. The method according to claim 2, wherein, Each vertex of the phrase graph represents the text information of fixed characters included in a fixed phrase in the invoice template, and the edges of the phrase graph represent the position information of the fixed characters at the two vertices connected by the edges.
4. The method according to claim 2, wherein, By matching the multiple characters and location information of the electronic invoice with the multiple word group diagrams, one or more matching fixed word groups are determined, including: For each of the multiple word group diagrams, based on multiple characters in the electronic invoice and the position information of the multiple characters, a fixed word group that matches the word group diagram is determined, wherein the position information of the characters in the matched fixed word group conforms to the position information of the multiple fixed characters of the fixed word group represented by the word group diagram.
5. The method according to claim 2, wherein, Each matched fixed phrase has location information. The graph data structure also includes an invoice graph, which represents the location information of multiple fixed phrases in the invoice template. Identifying at least one fixed phrase in the electronic invoice further includes: The at least one fixed phrase in the electronic invoice is identified by matching the one or more matching fixed phrases with the invoice image.
6. The method according to claim 5, wherein, The vertices of the invoice diagram represent the text information of fixed phrases in the invoice template, and the edges of the invoice diagram represent the position information of fixed phrases at the two vertices connected by the edges.
7. The method according to claim 5, wherein, Identifying at least one fixed phrase in the electronic invoice by matching the one or more matching fixed phrases with the invoice image includes: Based on the invoice image, a combination of fixed phrases from the one or more matching fixed phrases is determined, wherein the position information of the fixed phrases in the combination conforms to the position information of the multiple fixed phrases represented by the invoice image.
8. The method according to claim 1, wherein, The invoice template and the electronic invoice belong to the same category of invoices.
9. The method according to claim 8, further comprising: Obtain the predefined set of fixed phrases from the invoice template; Based on the predefined set of fixed phrases, obtain the fixed characters included in the invoice template and the position information of the fixed characters; as well as The graph data structure is generated based on the acquired fixed characters and their position information.
10. The method according to claim 1, wherein, Identifying at least one non-fixed phrase in the electronic invoice based on non-fixed characters other than the multiple fixed phrases in the electronic invoice includes: Remove characters from the identified at least one fixed phrase from the plurality of characters on the electronic invoice to obtain the non-fixed characters; Based on the position information of the non-fixed characters, the non-fixed characters are split into lines; and Based on the non-fixed characters after line breaks, the at least one non-fixed word group is identified.
11. The method according to claim 10, wherein, Identifying the at least one non-fixed phrase based on the non-fixed characters after line breaks includes: Determine the characters in each line that are not concatenated with the preceding character; and Based on the characters that are not concatenated with the preceding character, the non-fixed characters in each line are divided into multiple non-fixed word groups.
12. The method of claim 11, wherein determining the characters in each line that are not concatenated with the preceding character includes: Each row of characters is input into a graph neural network, and a binary classification operation is performed on each character in each row. The binary classification indicates whether the character is concatenated with the preceding character. as well as Based on the binary classification operation, characters in each row that are not concatenated with the preceding character are determined.
13. An apparatus for identifying phrases on an electronic invoice, comprising: The character information acquisition unit is configured to acquire character information of an electronic invoice, wherein the character information includes multiple characters in the electronic invoice and the position information of the multiple characters; The fixed phrase recognition unit is configured to recognize at least one fixed phrase in the electronic invoice based on the matching of the character information and the graph data structure, wherein the graph data structure represents the fixed characters included in the fixed phrase in the invoice template and the position information of the fixed characters; as well as The non-fixed phrase recognition unit is configured to recognize at least one non-fixed phrase in the electronic invoice based on non-fixed characters other than the plurality of fixed phrases in the electronic invoice.
14. An electronic device, comprising: processor; as well as A memory storing one or more computer instructions, which, when executed by the processor, cause the electronic device to perform the method according to any one of claims 1 to 12.
15. A computer-readable storage medium having stored thereon one or more computer instructions, wherein the one or more computer instructions are executed by a processor to cause the processor to perform the method according to any one of claims 1 to 12.
16. A computer program product comprising machine-executable instructions that, when executed by a device, cause the device to perform the method according to any one of claims 1 to 12.
