A method for intelligently extracting and filling invoices
Through model training and feature preprocessing technology, training strategies are dynamically adjusted to improve the accuracy of invoice information extraction, solving the problem that the existing technology is difficult to extract and fill non-template invoice information, and achieving efficient invoice intelligent extraction and filling, improving user experience and reducing costs.
Patent Information
- Application Number
- CN202410433786.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-11
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-04-11
AI Technical Summary
Existing invoice intelligent identification technology is difficult to effectively extract and fill in colloquial or textual invoice information other than templates, resulting in poor user experience and high time costs.
Through model training, including feature preprocessing and learning training processes, training strategies are dynamically adjusted to improve model accuracy, and regular expressions and entity marking techniques are used to intelligently extract and fill in invoice information.
It realizes intelligent extraction and filling of invoice information, simplifies the workflow during online invoice issuance, improves user experience, reduces time costs, and improves extraction accuracy.
Smart Images

Figure CN118468824B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of invoice content extraction, and in particular to a method for intelligently extracting and filling invoices. Background Art
[0002] With the rapid development of information technology, invoices, as important vouchers in financial management, have become an important task for identification and information extraction. Traditional invoice identification methods mainly rely on manual operations, which are inefficient and prone to errors. In recent years, with the continuous development of deep learning technology, it has achieved remarkable results in the field of image recognition, providing a new solution for intelligent invoice recognition.
[0003] The existing intelligent invoice recognition technology mainly recognizes the invoice information on paper or pictures as structured fields. It realizes the extraction process of invoice content based on OCR recognition combined with preset rules.
[0004] However, the existing invoice extraction method is more effective for templated invoice extraction, but lacks the implementation of structured intelligent filling of spoken or textual invoice information. An invoice involves at least 19 parameters, and manual filling will undoubtedly increase time costs and the user experience is also very poor. Summary of the invention
[0005] The purpose of the present invention is to provide a method for intelligently extracting and filling invoices to solve the following technical problems:
[0006] How to intelligently extract and fill in invoice information.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] A method for intelligently extracting and filling invoices, the method comprising:
[0009] S1. Perform model training, wherein the model training process includes feature preprocessing and learning training process;
[0010] During the learning and training process, the accuracy of the model training results is monitored in real time, and the learning and training process is dynamically adjusted according to the accuracy change curve of the model training results;
[0011] S2. Use the model trained in step S1 to perform intelligent extraction and filling of invoices.
[0012] Furthermore, the feature preprocessing process includes:
[0013] S11, extracting standardized long digital string information;
[0014] S12. Write a regular expression based on the found features;
[0015] S13, using regular expressions to extract corresponding long digital string information from the sample;
[0016] S14, clearing the information extracted in step S13 to obtain remaining information;
[0017] S15, physically marking the remaining information;
[0018] S16, sorting out the marking results in step S15.
[0019] Furthermore, the process of step S15 includes:
[0020] For each entity, start with "B-nerName" and use the continuous "I-nerName" as the middle part until the fixed character O is encountered as the end of the entity;
[0021] Where nerName is the name of the corresponding entity.
[0022] Furthermore, the process of dynamically adjusting the learning and training process includes:
[0023] The training process is divided according to the preset time segmentation strategy to obtain the accuracy change curve of each entity in each divided period;
[0024] Perform a state analysis on the accuracy change curve of each entity, and adjust the sample size distribution ratio of each entity in the next division period according to the state analysis results.
[0025] Furthermore, the process of the status analysis includes:
[0026] By formula:
[0027]
[0028]
[0029] Calculate the sample size proportion p of the i-th entity in the next divided period i ;
[0030] Among them, e i is the state value of the i-th entity in the current partition period, n is the number of recognized entities, i∈[1,n]; ΔA i is the accuracy improvement of the i-th entity in the current partition period, μ is the preset proportional coefficient, A i (t) is the accuracy change curve of the i-th entity in the current partition period, t1 i , t2 i are respectively the starting time point and the ending time point of the i-th entity in the current divided time period.
[0031] Furthermore, the process of obtaining the preset time division strategy includes:
[0032] The improvement in the recognition accuracy of all entities in the current divided time period is obtained, and the duration of the next divided time period is dynamically adjusted according to the discreteness of the improvement in the recognition accuracy of all entities in the current divided time period.
[0033] Furthermore, the process of dynamically adjusting the duration of the next divided time period includes:
[0034] By formula:
[0035]
[0036] Calculate the discreteness s of the improvement in accuracy of all entity recognition, and dynamically adjust the duration of the next divided period according to the discreteness s;
[0037] in, For all ΔA i The average value of .
[0038] Furthermore, the process of determining the duration of the next divided time period includes:
[0039] By formula:
[0040]
[0041] Calculate the duration t of the next divided time period;
[0042] Among them, t0 is the preset fixed time length, s0 is the discreteness threshold, and σ is the adjustment ratio coefficient.
[0043] Beneficial effects of the present invention:
[0044] (1) Through the model training process, the present invention simplifies the workflow of invoice information input during online invoicing and improves the user experience. On the other hand, only a small number of personnel are required to quickly check the intelligent filling results, reducing time costs. At the same time, by real-time monitoring of the accuracy of the model training results, the learning and training process is dynamically adjusted according to the accuracy change curve of the model training results. The training strategy can be adjusted dynamically and adaptively, thereby improving the training rate and training effect, thereby improving the accuracy of intelligent extraction of invoice content. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The present invention will be further described below in conjunction with the accompanying drawings.
[0046] Figure 1 It is a flowchart of the method steps of intelligent invoice extraction and filling of the present invention;
[0047] Figure 2It is a process flow chart of feature preprocessing of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] See also Figure 1 As shown, in one embodiment, a method for intelligent extraction and filling of invoices is provided, the method comprising: S1, performing model training, the model training process comprising feature preprocessing and learning training process;
[0050] Among them, see Figure 2 As shown in Figure 2, the feature preprocessing process includes:
[0051] S11. Extract standardized long digital string information; the characteristics of such planned character strings can be sorted out in combination with national, industry, enterprise and other standards, mainly involving characteristic restrictions such as total length of the character string, structural division, content components, and constituent elements;
[0052] S12. Write a regular expression based on the found features;
[0053] S13, using regular expressions to extract corresponding long digital string information from the sample;
[0054] S14, clearing the information extracted in step S13 to obtain remaining information;
[0055] S15. Entity tagging is performed on the remaining information; the tagging involves 4 types of entities and 9 labels in total. Each entity starts with "B-nerName" and ends with a continuous "I-nerName" until a fixed character O is encountered as the end of the entity, where nerName is the name of the corresponding entity. Take entity = "commodity name commodity" as an example, assuming that the sample content = "......Toys*Up and Down Ramp: 3 units, unit price 400, total price 1200......", then the tagging effect of the commodity "Toys*Up and Down Ramp" is "Toy B-commodity I-commodity*I-commodity Up I-commodity Down I-commodity Slope I-commodity Road I-commodity", and the subsequent semicolon tagging effect is ":O". Similarly, all other non-entity characters are marked as O.
[0056] S16. Arrange the labeling results in step S15 and output them into a standardized .json file, where each sample is saved in json format.
[0057] During the learning and training process, except for the output layer whose activation function is softmax, Tanh is used as the activation function for other layers. In terms of hyperparameters, Adam optimizer and self-attenuating learning rate are used. The accuracy of the model training results is monitored in real time, and the learning and training process is dynamically adjusted according to the accuracy change curve of the model training results. Through this process, the training strategy can be adjusted dynamically and adaptively, thereby improving the training rate and training effect. After that, through S2, the model obtained by training in step S1 is used to perform the intelligent extraction and filling process of invoices, thereby improving the accuracy of intelligent extraction of invoice content.
[0058] At the same time, the recognition method in this embodiment, on the one hand, simplifies the workflow of invoice information input during online invoicing and improves the user experience; on the other hand, only a small number of people are needed to quickly check the intelligent filling results, reducing time costs.
[0059] As a real-time method of the present invention, the process of dynamically adjusting the learning and training process includes: dividing the training process according to a preset time division strategy, and obtaining the accuracy change curve of each entity in each divided time period;
[0060] Perform state analysis on the accuracy change curve of each entity, and adjust the sample size distribution ratio of each entity in the next division period according to the state analysis results. The state analysis process includes:
[0061]
[0062]
[0063] Calculate the sample size proportion p of the i-th entity in the next divided period i ; Among them, e i is the state value of the i-th entity in the current partition period, n is the number of recognized entities, i∈[1,n]; ΔA i is the accuracy improvement of the i-th entity in the current partition period, μ is the preset proportional coefficient, which is set according to empirical data, A i (t) is the accuracy change curve of the i-th entity in the current partition period, t1 i , t2 i are the starting time point and the ending time point of the i-th entity in the current partition period, so the state value e i The calculation process can determine the change of accuracy in the current divided time period, where ΔA ireflects the improvement in accuracy of different entities, and through relatively The ratio of ΔA can determine the changing trend of the accuracy. When the changing speed tends to be stable, i On a fixed basis, it is possible to judge will be greater than At this time, the sample size ratio should be reduced. will be less than pass The accuracy rate change trend can be adjusted to the sample size ratio, and the comprehensive ΔA i and And adjust the weight ratio by preset proportional coefficient μ, so as to obtain Simplify to obtain Therefore, through Calculate and then obtain a more accurate sample size ratio p of different identified entities in the next divided time period i , which can improve efficiency and training effects in subsequent training processes.
[0064] As a real-time method of the present invention, the process of obtaining the preset time segmentation strategy includes: obtaining the improvement of all entity recognition accuracy rates in the current segmented time period, dynamically adjusting the duration of the next segmented time period according to the discreteness of all current improvement of entity recognition accuracy rates, and the process of dynamically adjusting the duration of the next segmented time period includes:
[0065] By formula:
[0066]
[0067] Calculate the discreteness s of the improvement in accuracy of all entity recognition, where: For all ΔA i The average value of , dynamically adjusts the duration of the next divided period according to the discreteness s, including: through the formula:
[0068]
[0069] Calculate and obtain the duration t of the next divided time period; among them, t0 is the preset fixed duration, s0 is the discreteness threshold, σ is the adjustment ratio coefficient, t0, s0, σ are all set according to the empirical data fitting, so when the accuracy change difference in the current time period is large, it means that the sample allocation strategy needs to be further dynamically adjusted, so at this time, the duration of the next divided time period is reduced; conversely, when the accuracy change difference in the current time period is small, it means that the demand for dynamic adjustment of the sample allocation strategy is low, so at this time, the duration of the next divided time period is increased, and then the efficiency and effect of training can be improved through dynamic division of time periods.
[0070] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A method for intelligently extracting and filling invoices, characterized in that: The method comprises: S1. Perform model training, wherein the model training process includes feature preprocessing and learning training process; During the learning and training process, the accuracy of the model training results is monitored in real time, and the learning and training process is dynamically adjusted according to the accuracy change curve of the model training results; S2, using the model trained in step S1 to perform intelligent extraction and filling of invoices; The feature preprocessing process includes: S11, extracting standardized long digital string information; S12. Write a regular expression based on the found features; S13, using regular expressions to extract corresponding long digital string information from the sample; S14, clearing the information extracted in step S13 to obtain remaining information; S15, physically marking the remaining information; S16, arranging the marking results in step S15; The process of step S15 includes: Each entity starts with "B-nerName" and uses "I-nerName" as the middle part until the fixed character O is encountered as the end of the entity; Where nerName is the name of the corresponding entity; The process of dynamically adjusting the learning and training process includes: The training process is divided according to the preset time segmentation strategy to obtain the accuracy change curve of each entity in each divided period; Perform status analysis on the accuracy change curve of each entity, and adjust the sample size distribution ratio of each entity in the next division period according to the status analysis results; The process of the status analysis includes: By formula: Calculate the sample size proportion p of the i-th entity in the next divided period i ; Among them, e i is the state value of the i-th entity in the current partition period, n is the number of recognized entities, i∈[1,n]; ΔA i is the accuracy improvement of the i-th entity in the current partition period, μ is the preset proportional coefficient, A i (t) is the accuracy change curve of the i-th entity in the current partition period, t1 i , t2 i are the starting time point and the ending time point of the i-th entity in the current divided time period respectively; The process of obtaining the preset time division strategy includes: Obtain the improvement in accuracy of all entity recognition in the current divided time period, and dynamically adjust the duration of the next divided time period according to the discreteness of the improvement in accuracy of all entity recognition in the current divided time period; The process of dynamically adjusting the duration of the next divided time period includes: By formula: Calculate the discreteness s of the improvement in the accuracy of all entity recognition, and dynamically adjust the duration of the next divided period according to the discreteness s; in, For all ΔA i The average value of .
2. The method for intelligently extracting and filling invoices according to claim 1 is characterized in that: The process of determining the duration of the next divided period includes: By formula: Calculate the duration of the next divided period t +1 ; Among them, t0 is the preset fixed time length, s0 is the discreteness threshold, and σ is the adjustment ratio coefficient.
Citation Information
Patent Citations
Multi-stage data generation self-circulation financial invoice text intelligent identification system and method
CN111079562A