Information extraction template generation method and device, medium and equipment

CN116362219BActive Publication Date: 2026-10-09INSPUR SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310227278.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2026-10-09
Estimated Expiration
2043-03-06

AI Technical Summary

Technical Problem

[0004]然而,依次来看各种技术方案,很难实现广泛的适用性

Benefits of technology

[0019](1) First, a pre-set calibration sample is obtained. Then, the calibration sample is parsed to obtain calibration parameters. Next, a text information extraction template is generated based on the text information class parameters and/or the region information class parameters. The text information extraction template is an information extraction rule for the material to be extracted, corresponding to the type of the calibration sample. Finally, the text information extraction template is saved. It is evident that the method provided in this embodiment of the invention can automatically generate a text recognition template for a specific text information extraction scenario using only a small number of calibration samples. It does not rely on a large number of samples and does not require sample cleaning, annotation, training, testing, or deployment. This reduces development effort and places low demands on staff. Moreover, because the method provided in this embodiment of the invention has low requirements, it has wide applicability to various scenarios and is easy to implement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116362219B_ABST
    Figure CN116362219B_ABST
Patent Text Reader

Abstract

The application provides an information extraction template generation method and device, a medium and equipment. The method comprises the following steps: obtaining a pre-set calibration sample; analyzing the calibration sample to obtain calibration parameters; wherein the calibration parameters comprise text information type parameters and region information type parameters; generating a text information extraction template according to the text information type parameters and / or the region information type parameters; wherein the text information extraction template is an information extraction rule for a to-be-extracted material of a type to which the calibration sample belongs; and saving the text information extraction template. The application does not need to depend on a large number of samples and does not need to go through the steps of sample cleaning, sample labeling, training, testing and deployment, so that the development effort is reduced and the requirement for the staff is not high. Moreover, the method provided by the application has wide applicability to various scenes and is easy to implement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of custom template technology, and in particular to a method, apparatus, medium, and equipment for generating information extraction templates. Background Technology

[0002] In applications involving text information, text extraction is key to the value creation of technology. For example, in the construction of digital government, common documents such as ID cards and business licenses require the extraction of field information, such as "Name: Zhang San" and "Unified Social Credit Code: 123NX456".

[0003] Depending on the application scenario, the technical solutions and levels of difficulty for extracting text information vary greatly. For simple applications, such as those with only one data entry consisting of "field: information," the information can be directly extracted using symbols or regular expressions. For slightly more complex scenarios, such as those with multiple data entries consisting of "field: information; ...; field: information," regular expressions can be combined to extract information from multiple fields. For even more complex scenarios, such as those where "field: information" is not obvious, spans multiple lines, or involves tables, some researchers often use custom templates to extract field information. Furthermore, for scenarios with large amounts of text information, such as contracts or planning documents, some researchers often use semantic analysis based on natural language processing techniques to extract specific information.

[0004] However, examining the various technical solutions reveals a lack of widespread applicability. While natural language processing (NLP) technology boasts considerable applicability, it relies heavily on large datasets for complex scenarios and involves stages such as sample cleaning, annotation, training, testing, and deployment. Each stage demands significant development effort and requires a high level of expertise from researchers. Consequently, without a mature development process, it becomes difficult to sustain business operations, ultimately hindering the practical application of the technology. Summary of the Invention

[0005] To address at least one of the above-mentioned technical problems, embodiments of the present invention provide a method, apparatus, medium, and device for generating information extraction templates.

[0006] According to the first aspect, the information extraction template generation method provided in the embodiments of the present invention includes:

[0007] Obtain the pre-set calibration sample;

[0008] The calibration sample is parsed to obtain calibration parameters; wherein, the calibration parameters include text information parameters and region information parameters;

[0009] A text information extraction template is generated based on the text information class parameters and / or the region information class parameters; wherein, the text information extraction template is an information extraction rule for the material to be extracted, which is of the type to which the calibration sample belongs;

[0010] Save the text information extraction template.

[0011] According to a second aspect, the information extraction template generation apparatus provided in the embodiments of the present invention includes:

[0012] The sample acquisition module is used to acquire pre-set calibration samples;

[0013] The sample parsing module is used to parse the calibration sample to obtain calibration parameters; wherein, the calibration parameters include text information parameters and region information parameters;

[0014] The template generation module is used to generate a text information extraction template based on the text information class parameters and / or the region information class parameters; wherein, the text information extraction template is an information extraction rule for the material to be extracted, which is of the type to which the calibration sample belongs;

[0015] The template saving module is used to save the text information extraction template.

[0016] According to a third aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method provided in the first aspect.

[0017] According to a fourth aspect, the computing device provided in the embodiments of the present invention includes a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method provided in the first aspect.

[0018] The information extraction template generation method, apparatus, medium, and device provided in the embodiments of the present invention have the following beneficial effects, whether individually or in combination:

[0019] (1) First, a pre-set calibration sample is obtained. Then, the calibration sample is parsed to obtain calibration parameters. Next, a text information extraction template is generated based on the text information class parameters and / or the region information class parameters. The text information extraction template is an information extraction rule for the material to be extracted, corresponding to the type of the calibration sample. Finally, the text information extraction template is saved. It is evident that the method provided in this embodiment of the invention can automatically generate a text recognition template for a specific text information extraction scenario using only a small number of calibration samples. It does not rely on a large number of samples and does not require sample cleaning, annotation, training, testing, or deployment. This reduces development effort and places low demands on staff. Moreover, because the method provided in this embodiment of the invention has low requirements, it has wide applicability to various scenarios and is easy to implement.

[0020] (2) In one embodiment, when extracting information using a text recognition template, custom return fields can be implemented, as well as functions such as rare character correction, regional offset correction, deletion of some information, and non-extraction of unnecessary information. It is evident that it has the requirements of easy deployment, strong applicability, rapid adaptation, easy management, and no-code development, which greatly improves the accuracy and utilization efficiency of text information extraction. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating an information extraction template generation method according to an embodiment of the present invention;

[0022] Figure 2 This is a flowchart illustrating steps S120 to S140 in one embodiment of the present invention;

[0023] Figure 3 This is a schematic diagram of the calibration area in one embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram of the system architecture deployed when applying information extraction templates in one embodiment of the present invention. Detailed Implementation

[0025] In a first aspect, embodiments of the present invention provide a method for generating an information extraction template, see [link to relevant documentation]. Figure 1 The method includes the following steps S110 to S140:

[0026] S110. Obtain the pre-set calibration sample;

[0027] In practical scenarios, before executing S110, it is necessary to select standard sample materials. Using a front-end interface or other auxiliary tools, information areas are marked on the sample materials according to certain rules, and the relevant parameters for these areas are filled in. For example, see [link to relevant documentation]. Figure 3The calibrated information can be divided into two categories: textual information parameters and regional information parameters. Regional information parameters include the calibration of the information region, while textual information parameters include the calibration of relevant fields within the region. The calibrated samples are then stored in the medium as calibration samples for use by the algorithm. When an information extraction template needs to be generated, the calibration samples are retrieved from the medium.

[0028] S120. The calibration sample is parsed to obtain calibration parameters; wherein, the calibration parameters include text information parameters and region information parameters;

[0029] In other words, the calibration parameters in the calibration sample are parsed according to certain rules.

[0030] Among them, the text information parameters in the calibration parameters can include text type, explicit field pairs, implicit field pairs, deleted fields, unnecessary fields, and replacement fields, while the region information parameters can include information regions, such as boundary identification regions and specific recognition regions.

[0031] In one embodiment, the text information class parameter may include explicit field pairs and implicit field pairs; wherein:

[0032] The display field pair is a pair of fields extracted from information that conforms to the "key-value" structure. The display field pair is formed by a first field and a second field. The second field has the same name as the field corresponding to the value in the calibration sample. The first field is the English form of the second field.

[0033] The implicit field pair is a pair of fields extracted from information that conforms to the structure "first string-value-second string". The implicit field pair is formed by a third field and a fourth field. The fourth field is the same as the name of the first string in the calibration sample. The third field is the English form of the fourth field.

[0034] Here, a "key-value" structure refers to a key-value pair, such as "Name: Zhang San" or "Gender: Male". The field name extracted from "Name: Zhang San" is "Name", meaning the value in this structure is "Zhang San". The corresponding field name for "Zhang San" is "Name", therefore "Name" is used as the second field. The first field is the English form of "Name", for example, "name". Thus, a display field pair is "name: Name". The first field uses English for ease of program development; the specific English form can be customized. The second field, however, must be consistent with the field in the calibration sample and cannot be customized.

[0035] Wherein, "first string-value-second string" refers to "str-value-str", for example, "Real Estate Right No. 000001", the first string is "Real Estate Right No.", therefore the fourth field is "Real Estate Right No.", and the third field is the English form of "Real Estate Right No.", for example, "real_estate_num", thus an implicit field pair is "real_estate_num: Real Estate Right No.". The reason that English is adopted for the third field herein is to facilitate program development, and the specific English form can be defined. The fourth field needs to be consistent with the field or character in the calibrated sample, and cannot be customized.

[0036] In one embodiment, the text information type fields may further comprise a deletion field, a non-essential field and a replacement field; wherein:

[0037] the deletion field is a field or character that needs to be deleted in the calibrated sample;

[0038] the non-essential field is a field or character that does not need to be extracted in the calibrated sample;

[0039] the replacement field is a field or character having text similarity variants in the calibrated sample.

[0040] Wherein, the deletion field is a field or character that needs to be deleted in the calibrated sample, for example, the sentence "The interpretation right of this contract belongs to the company" is not valid information for information extraction, and may affect the accurate extraction of information.

[0041] Wherein, the non-essential field is a field or character that does not need to be extracted in the calibrated sample, for example, "Remarks: xxxx", the remark information may affect the accurate extraction of information.

[0042] Wherein, the replacement field refers to a field or character that is easily confused in the calibrated sample. For example, for "Qiandao Lake" and "Gandao Lake", a replacement rule can be specified through the replacement field, for example, "{"original_text":"Gandao Lake","changed_text":"Qiandao Lake"}", so as to solve the problem of recognition error caused by visual similarity of very few rare characters.

[0043] Wherein, the text information type fields may further comprise a text type, and the text type is the type of the calibrated sample, for example, ID card, business license, etc.

[0044] S130, generating a text information extraction template according to the text information type parameters and / or the region information type parameters; wherein the text information extraction template is an information extraction rule for a to-be-extracted material belonging to the type of the calibrated sample;

[0045] In one embodiment, see Figure 2 When the text information class parameters include explicit field pairs, implicit field pairs, deleted fields, unnecessary fields, and replacement fields, S130 may specifically include:

[0046] S131. Parse the display field pair to obtain a first return field and a first text field; wherein, the first return field is the information return field corresponding to the first field, and the first text field is the second field;

[0047] S132. Parse the implicit field pair to obtain a second return field and a second text field; wherein, the second return field is the information return field corresponding to the third field, and the second text field is the fourth field;

[0048] S133. Perform regularization processing on the first text field, the second text field, the deleted field, the unnecessary field and the replaced field to obtain the regularization processing result;

[0049] S134. Based on the first returned field, the second returned field, and the regularization result, the text information extraction template is formed.

[0050] The first returned field is the field name used when returning information. For example, for "Name: Zhang San" in an ID card, the corresponding display field pair is "name: Name". The first returned field obtained after parsing can be "name", "xingming", "name_01", or "Name". It can be seen that the first returned field can be customized, and it is generally in English. The first text field is "Name" and cannot be customized to other forms. It must be consistent with the field name in the calibration sample.

[0051] The second returned field is similar to the first returned field, and is generally in English. The second returned field can be customized based on the third field. The second text field is the same as the fourth field and cannot be customized.

[0052] The returned fields and text fields have a one-to-one correspondence. After parsing the returned fields and text fields, a correspondence can be established between them to maintain the correspondence.

[0053] When performing regularization on the first text field, the second text field, the deleted field, the unnecessary field, and the replacement field, regular expressions are used to regularize each of these fields, resulting in regularization results for each field. A regular expression is a logical formula for manipulating characters or fields. After regularization, the result for each field includes its corresponding rules, such as rules for extracting text, deletion rules, rules for ignoring unnecessary information, and replacement rules. Once these rules are determined, the rules for extracting text from the sample material are obtained, and the returned fields and these rules form the text information extraction template. Using this template, each returned field and its corresponding text information can be obtained, and the deletion, ignoring, and replacement of some information can be implemented.

[0054] Furthermore, when the text information class parameters include text type, explicit field pairs, implicit field pairs, deleted fields, unnecessary fields, and replacement fields, S134 can specifically include:

[0055] A1. Based on the text type, the first returned field, the second returned field, and the regularization result, the text information extraction template is formed.

[0056] In other words, a text type has been added to the text information extraction template. This means that when using the text information extraction template to extract information from sample materials, the text type of the sample materials will also be returned, such as ID card, business license, etc.

[0057] Furthermore, based on the aforementioned text information parameters, when the region information parameters include an information region, step A1 can specifically include:

[0058] The information area is corrected by gap correction to obtain the corrected information area, so as to adjust the deviation of the area defined in the calibration process;

[0059] The text information extraction template is formed based on the corrected information area, the text type, the first returned field, the second returned field, and the regularization result.

[0060] In other words, since the calibrated information areas may be biased during the manual calibration process, the gaps between each information area are adjusted to correct the calibration bias. Then, based on the corrected information areas, text types, returned fields, and regularization results, a text information extraction template is formed. When using this template to extract information from sample materials, it returns the area, text type, returned fields, and corresponding text information for each piece of text information in the sample materials. It also allows for the deletion, ignoring, and replacement of some information.

[0061] S140. Save the text information extraction template.

[0062] Understandably, since the text information extraction template consists of a set of extraction rules, these rules are a set of parameters. The parameter set is saved, and when needed, the parameter set corresponding to the text type is queried, and then the text information extraction template corresponding to the parameter set is used to extract the text information.

[0063] Specifically, the text information extraction template can be saved to a medium, such as a database, table, parameter file, or memory, for later querying.

[0064] As can be seen, this invention proposes a method for automatically generating text information extraction templates using calibration samples. For a specific text information extraction scenario, one to two common calibration samples are used to customize the scenario template information, enabling the automatic generation of text recognition templates. When extracting information using text recognition templates, customizable return fields (i.e., returned keywords) can be implemented. Furthermore, functions such as rare character correction, region offset correction, deletion of certain information, and exclusion of unnecessary information can be achieved. This method is easy to deploy, highly applicable, quickly adaptable, easy to manage, and requires no code development, greatly improving the accuracy and efficiency of text information extraction.

[0065] The text information extraction template is a set of parameters based on specific rules, which can be easily combined and used according to business needs to achieve rapid deployment.

[0066] Understandably, when using text recognition templates, one can query the corresponding text recognition template based on the business scenario, and combine it with information extraction and processing algorithms, artificial intelligence, etc., to ultimately extract the structured information of the sample material.

[0067] It is understood that the method provided in this embodiment of the invention is one of the core algorithms for custom templates in the field of text recognition, greatly improving the actual recognition effect and stability of custom templates. One of the core aspects of the method provided in this embodiment of the invention is the use of a front-end interface or other auxiliary tools to calibrate samples, and then obtaining a text information extraction template based on the above steps S110 to S140. From the user's perspective, a new text information extraction template for cards, certificates, or other materials can be developed without coding through simple operations.

[0068] Understandably, since the calibration parameters after parsing the calibration samples include information such as text type, explicit field pairs, implicit field pairs, deleted fields, unnecessary fields, replaced fields, and information areas, it can effectively make up for the recognition limitations of existing recognition engines, realize the need to return customized return fields, screen personalized text, and correct rare characters, and meet most business scenarios.

[0069] It is understood that the method provided in the embodiments of the present invention adopts a set of rigorous rule design, which enables the method to have the advantage of "1+N", that is, one method can solve the needs of multiple different types of application scenarios.

[0070] In the application process, the material to be extracted is first obtained, and then the text information extraction template is applied to extract the text information. Specifically, upon receiving a service request, the parameter set of the corresponding text information extraction template is retrieved from the storage medium, and then the text information extraction template is reconstructed using the parameters in the parameter set. The material to be extracted is generally common image data, image URLs, or PDF format data, and includes information such as text location information, confidence level, and text content. Finally, by combining the text information extraction template and the above information, the text information in the material to be extracted can be extracted according to the rules.

[0071] See Figure 3 Taking "xx license" as an example, "------" defines the area, and "xxxx" represents the text information. Figure 3 The standard defines six regions. Region 2 is an "implicit field pair", and regions 3 and 4 are "explicit field pairs".

[0072] See Figure 4The parameter set of the text information extraction template is stored in the template database on the server. The intelligent computing service mainly includes two functional modules: AI (Artificial Intelligence) and information extraction. When the task management module receives a service request, it queries the template database to obtain the parameter set of the text information extraction template. Then, it calls the AI ​​module to identify information such as the location, confidence level, and content of the text in the material to be extracted. Next, it calls the information extraction module, combining the text information extraction template and the aforementioned information, to extract the text information from the material. Finally, the extracted text information is returned to the user as the extraction result.

[0073] Secondly, embodiments of the present invention provide an information extraction template generation apparatus, comprising:

[0074] The sample acquisition module is used to acquire pre-set calibration samples;

[0075] The sample parsing module is used to parse the calibration sample to obtain calibration parameters; wherein, the calibration parameters include text information parameters and region information parameters;

[0076] The template generation module is used to generate a text information extraction template based on the text information class parameters and / or the region information class parameters; wherein, the text information extraction template is an information extraction rule for the material to be extracted, which is of the type to which the calibration sample belongs;

[0077] The template saving module is used to save the text information extraction template.

[0078] In one embodiment, the text information class parameter includes explicit field pairs and implicit field pairs; wherein:

[0079] The display field pair is a pair of fields extracted from information that conforms to the "key-value" structure. The display field pair is formed by a first field and a second field. The second field has the same name as the field corresponding to the value in the calibration sample. The first field is the English form of the second field.

[0080] The implicit field pair is a pair of fields extracted from information that conforms to the structure "first string-value-second string". The implicit field pair is formed by a third field and a fourth field. The fourth field is the same as the name of the first string in the calibration sample. The third field is the English form of the fourth field.

[0081] In one embodiment, the text information field further includes a delete field, a non-essential field, and a replacement field; wherein:

[0082] The deleted field is the field or character in the calibration sample that needs to be deleted;

[0083] The non-essential fields are fields or characters in the calibration sample that do not need to be extracted;

[0084] The replacement field is a field or character in the calibration sample that has a text similarity variant.

[0085] In one embodiment, the template generation module includes:

[0086] The first parsing unit is used to parse the display field pair to obtain a first return field and a first text field; wherein, the first return field is the information return field corresponding to the first field, and the first text field is the second field;

[0087] The second parsing unit is used to parse the implicit field pairs to obtain a second return field and a second text field; wherein, the second return field is the information return field corresponding to the third field, and the second text field is the fourth field;

[0088] The third parsing unit is used to perform regularization processing on the first text field, the second text field, the deleted field, the unnecessary field and the replaced field to obtain the regularization processing result;

[0089] The template forming unit is used to form the text information extraction template based on the first returned field, the second returned field, and the regularization processing result.

[0090] In one embodiment, the text information field further includes a text type, which is the type of the calibration sample.

[0091] In one embodiment, the template forming unit is specifically used to: form the text information extraction template based on the text type, the first returned field, the second returned field, and the regularization processing result.

[0092] Furthermore, the region information class parameter includes an information region; correspondingly, the template forming unit further includes:

[0093] The gap correction subunit is used to correct the gap in the information area to obtain the corrected information area, so as to adjust the deviation of the area defined in the calibration process.

[0094] The template forming subunit is used to form the text information extraction template based on the corrected information area, the text type, the first returned field, the second returned field, and the regularization processing result.

[0095] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the contents of the device provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0096] Thirdly, embodiments of the present invention provide a computer-readable medium storing computer instructions, which, when executed by a processor, cause the processor to perform the method provided in the first aspect.

[0097] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0098] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0099] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0100] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0101] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.

[0102] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the contents in the computer-readable medium provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0103] Fourthly, one embodiment of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method of any embodiment of the specification.

[0104] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the computing device provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0105] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0106] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, widgets, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0107] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for generating an information extraction template, characterized in that, include: Obtain the pre-set calibration sample; The calibration sample is parsed to obtain calibration parameters; wherein, the calibration parameters include text information parameters and region information parameters; A text information extraction template is generated based on the text information class parameters and / or the region information class parameters; wherein, the text information extraction template is an information extraction rule for the material to be extracted, which is of the type to which the calibration sample belongs; Save the text information extraction template; The text information class parameters include explicit field pairs and implicit field pairs; wherein: The display field pair is a pair of fields extracted from information that conforms to the "key-value" structure. The display field pair is formed by a first field and a second field. The second field has the same name as the field corresponding to the value in the calibration sample. The first field is the English form of the second field. The implicit field pair is a pair of fields extracted from information that conforms to the structure "first string-value-second string". The implicit field pair is formed by a third field and a fourth field. The fourth field is the same as the name of the first string in the calibration sample. The third field is the English form of the fourth field. The text information fields also include deletion fields, unnecessary fields, and replacement fields; wherein: The deleted field is the field or character in the calibration sample that needs to be deleted; The non-essential fields are fields or characters in the calibration sample that do not need to be extracted; The replacement field is a field or character in the calibration sample that has a text similarity variant; The step of generating a text information extraction template based on the text information class parameters and / or the region information class parameters includes: The display field pair is parsed to obtain a first return field and a first text field; wherein, the first return field is the information return field corresponding to the first field, and the first text field is the second field; The implicit field pairs are parsed to obtain a second return field and a second text field; wherein, the second return field is the information return field corresponding to the third field, and the second text field is the fourth field; The first text field, the second text field, the deleted field, the unnecessary field, and the replaced field are subjected to regularization processing to obtain the regularization processing result; Based on the first returned field, the second returned field, and the regularization result, the text information extraction template is formed. The text information field also includes a text type, where the text type is the type of the calibration sample. The step of forming the text information extraction template according to preset rules based on the first returned field, the second returned field, and the regularization result includes: Based on the text type, the first returned field, the second returned field, and the regularization result, the text information extraction template is formed. The region information class parameter includes an information region; correspondingly, the step of forming the text information extraction template based on the text type, the first returned field, the second returned field, and the regularization processing result includes: The information area is corrected by gap correction to obtain the corrected information area, so as to adjust the deviation of the area defined in the calibration process; The text information extraction template is formed based on the corrected information area, the text type, the first returned field, the second returned field, and the regularization result.

2. An information extraction template generation apparatus using the method of claim 1, characterized in that, include: The sample acquisition module is used to acquire pre-set calibration samples; The sample parsing module is used to parse the calibration sample to obtain calibration parameters; wherein, the calibration parameters include text information parameters and region information parameters; The template generation module is used to generate a text information extraction template based on the text information class parameters and / or the region information class parameters; wherein, the text information extraction template is an information extraction rule for the material to be extracted, which is of the type to which the calibration sample belongs; The template saving module is used to save the text information extraction template.

3. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed in a computer, causes the computer to perform the method described in claim 1.

4. A computing device, characterized in that, The system includes a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method of claim 1.

Citation Information

Patent Citations

  • Template configuration method, information extraction method, device, electronic equipment and medium

    CN111597205A

  • Information extraction method and device, electronic equipment and storage medium

    CN113723347A