Document information extraction method and device, equipment and storage medium

By obtaining the set of qualifiers in the document file and improving the selection probability of the qualifiers in the information extraction model, the problem of low efficiency and insufficient accuracy in document information extraction is solved, and more efficient and accurate document information extraction is achieved.

CN118747205APending Publication Date: 2024-10-08PICC INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410758429.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing document information extraction efficiency is low, unable to meet large-volume processing needs, and there is a risk of outputting illusive information.

Method used

By obtaining a set of qualifiers from the target document file, the selection probability of qualifiers in the information extraction model is improved, and the probability of outputting illusive information is reduced, thereby improving the accuracy and efficiency of document information extraction.

Benefits of technology

It improves the accuracy of document information extraction, reduces human intervention, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747205A_ABST
    Figure CN118747205A_ABST
Patent Text Reader

Abstract

The invention provides a document information extraction method and device, equipment and a storage medium. The method comprises the following steps: receiving an information extraction request, wherein the information extraction request is used for requesting to extract target information in a target document file; according to the target document file, a determiner set corresponding to the content in the target document file is obtained, and the determiner set is used for limiting the extraction range of the target information in the target document file; inputting the information extraction demand, the determiner set and the target document file into an information extraction model, wherein the information extraction model is a large language model capable of improving the selection probability of the determiners in the determiner set in a model processing process; and obtaining the target information extracted from the target document file by the information extraction model. According to the method, the document information extraction efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to communication technology, and in particular to a document information extraction method, device, equipment and storage medium. Background Art

[0002] With the development of society, a large number of document processing requirements are involved in the daily operation of various industries, including contracts, invoices, bills of lading, packing lists, etc. These documents contain a wealth of key data such as transaction information, product information, logistics information, etc. These key data are of vital importance to the operation, supply chain optimization, settlement and other aspects of the enterprise. In the current document processing process, document information extraction mainly relies on manual operation or manual operation combined with regular expressions for semi-automatic processing. However, whether it is through pure manual operation or manual operation combined with regular expressions to extract document information, there is a problem of low efficiency in document information extraction, which cannot meet the needs of large-scale document processing.

[0003] Therefore, how to improve the efficiency of document information extraction is an urgent problem to be solved. Summary of the invention

[0004] The present application provides a document information extraction method, device, equipment and storage medium to solve the problem of low efficiency in document information extraction.

[0005] In a first aspect, the present application provides a document information extraction method, comprising:

[0006] receiving an information extraction request, wherein the information extraction request is used to request to extract target information from a target document file;

[0007] According to the target document, a set of qualifiers corresponding to the content in the target document is acquired, wherein the set of qualifiers is used to limit the extraction scope of the target information in the target document;

[0008] Inputting the information extraction requirement, the qualifier set, and the target document into an information extraction model, wherein the information extraction model is a large language model that can improve the probability of selecting a qualifier in the qualifier set during model processing;

[0009] The target information extracted by the information extraction model from the target document file is obtained.

[0010] Optionally, the information extraction model improves the probability of a qualifier in the qualifier set being selected during model processing, including:

[0011] The information extraction model obtains at least two candidate information to be output and the original score of each candidate information according to the information extraction requirement and the target document;

[0012] If the first candidate information includes a qualifier in the qualifier set and the raw score of the first candidate information is lower than the raw score of any other candidate information, the information extraction model increases the raw score of the first candidate information to be higher than the raw scores of the other candidate information.

[0013] Optionally, the information extraction model improves the original score of the first candidate information to be higher than the original scores of other candidate information, including:

[0014] The information extraction model adjusts the original score of the first candidate information to a preset score, and the preset score is higher than the original score of any of the candidate information.

[0015] Optionally, the information extraction model adjusts the original score of the first candidate information to a preset score, including:

[0016] Obtaining the original scores of the other candidate information;

[0017] Determine second candidate information according to the original scores of the other candidate information, the original score of the second candidate information is higher than the original score of the third candidate information, and the third candidate information is the candidate information among the other candidate information except the second candidate information;

[0018] The original score of the first candidate information is adjusted according to the original score of the second candidate information and a preset adjustment value.

[0019] Optionally, before adjusting the original score of the first candidate information according to the original score of the second candidate information and the preset adjustment value, the method further includes:

[0020] The preset adjustment value corresponding to the original score of the second candidate information is determined according to the original score of the second candidate information and the mapping relationship between the original score and the preset adjustment value.

[0021] Optionally, acquiring, according to the target document, a set of qualifiers corresponding to the content in the target document, includes:

[0022] Performing text recognition on the target document to obtain text content of the target document;

[0023] According to the text content, obtaining a word list after the text content is segmented and deduplicated;

[0024] The word list is converted into the set of qualifying words corresponding to the content in the target document.

[0025] Optionally, converting the vocabulary into the set of qualifiers corresponding to the content in the target document file includes:

[0026] Inputting the vocabulary into the information extraction model;

[0027] The word list is converted into the set of qualifiers corresponding to the content in the target document file through the word segmenter of the information extraction model, and the set of qualifiers is a tag sequence that can be processed by the information extraction model.

[0028] In a second aspect, the present application provides a document information extraction device, comprising:

[0029] A receiving module, used for receiving an information extraction request, wherein the information extraction request is used for requesting to extract target information from a target document;

[0030] A processing module, configured to obtain, according to the target document, a set of qualifiers corresponding to the content in the target document, wherein the set of qualifiers is used to limit the extraction scope of the target information in the target document;

[0031] A control module, configured to input the information extraction requirement, the qualifier set, and the target document into an information extraction model, wherein the information extraction model is a large language model capable of increasing the probability of a qualifier in the qualifier set being selected during model processing;

[0032] An acquisition module is used to acquire the target information extracted from the target document by the information extraction model.

[0033] In a third aspect, the present application provides an electronic device, comprising: a processor, a communication interface and a memory, wherein the processor is communicatively connected to the communication interface and the memory respectively;

[0034] The memory stores computer-executable instructions;

[0035] The communication interface communicates and interacts with external devices;

[0036] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.

[0038] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements any method in the first aspect when executed by a processor.

[0039] The document information extraction method, device, equipment and storage medium provided by the present application obtain a qualifier set that limits the extraction range of the target information in the target document file from the target document file, and improve the probability of the qualifiers in the qualifier set being selected in the process of extracting document information by the information extraction model, so as to reduce the probability of outputting hallucination information, and facilitate the use of the information extraction model to extract the target information belonging to the original information in the target document file from the target document file, thereby improving the accuracy of document information extraction. In addition, the method reduces the need for human intervention in the document information extraction process and improves the efficiency of document information extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] Figure 1 A schematic diagram of a scenario of a document information extraction method provided in an embodiment of the present application;

[0042] Figure 2 A flowchart of a document information extraction method provided in an embodiment of the present application;

[0043] Figure 3 A flowchart of another document information extraction method provided in an embodiment of the present application;

[0044] Figure 4 A flowchart of another document information extraction method provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of the structure of a document information extraction device provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0047] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0049] First, the terms involved in this application are explained:

[0050] Large Language Model (LLM): A deep learning model trained on massive text data. Large language models can include decoder-only LLMs, which are widely used in fields such as natural language processing (NLP). Unlike the traditional encoder-decoder structure, the decoder-only model only contains one decoder and generates text by stacking multiple layers of neural networks.

[0051] Prompt: refers to the input instructions or key words provided when interacting with artificial intelligence. It serves as a bridge for communication between users and artificial intelligence, allowing artificial intelligence to understand and respond or generate creative content accordingly.

[0052] In the current document processing process, information extraction mainly relies on manual operation or manual operation combined with regular expressions for semi-automatic processing. Although the method of directly extracting information through manual operation guarantees the accuracy of extracted information to a certain extent, its efficiency is extremely low and cannot meet the needs of large-scale document processing. The introduction of regular expressions has improved the extraction efficiency to a certain extent, but it still requires manual intervention and verification, and regular expressions have limited processing capabilities for documents with long texts and complex formats, and often cannot accurately extract all relevant information. Therefore, whether it is pure manual operation extraction or combined with regular expressions, it is difficult to deal with information extraction of long text fields in documents. These fields often contain a lot of key information, but due to the complexity and diversity of their expression, traditional extraction methods are difficult to deal with. This not only affects the efficiency of document processing, but may also bring potential problems due to incomplete or incorrect information extraction.

[0053] Therefore, whether it is extracted through manual operation or combined with regular expressions, there are problems of low efficiency and low accuracy in document information extraction.

[0054] In order to improve the efficiency of document information extraction, there is currently a solution to achieve document information extraction through a large language model. With its powerful natural language understanding ability, the large language model can effectively extract key information from unstructured document texts. This ability makes the information extraction process faster and more accurate. Compared with manual extraction or semi-automatic processing combined with regular expressions, it can improve the efficiency of document information extraction.

[0055] However, when extracting information from documents through a large language model, if the input document data is wrong, missing, or in a confusing format, or if the large language model has weak model generalization capabilities, the large language model may output inaccurate information, that is, the output information may be hallucination information. The "hallucination information" here refers to information output by the large language model that does not match or does not exist in the original document content.

[0056] Therefore, how to improve the efficiency and accuracy of document information extraction is an urgent problem to be solved.

[0057] In view of this, the present application provides a document information extraction method, which obtains a qualifier set that limits the extraction range of target information in the target document file from the target document file, and improves the probability of qualifiers in the qualifier set being selected in the process of extracting document information by the information extraction model, so as to reduce the probability of outputting hallucination information, and facilitates the use of the information extraction model to extract target information belonging to the original information in the target document file from the target document file, thereby improving the accuracy of document information extraction. In addition, the method reduces the need for human intervention in the document information extraction process and improves the efficiency of document information extraction.

[0058] Figure 1 A schematic diagram of a scenario of a document information extraction method provided in an embodiment of the present application. Figure 1 As shown, the scenario may include: a user end and a server end.

[0059] The user end is used to send an information extraction request to the server end according to user needs, so that the server end can extract document information and extract the target information requested by the information extraction request from the target document file.

[0060] The user end may be, for example, an electronic device of the user, such as a mobile phone, a computer, a tablet computer, etc. The user end may also be, for example, an application installed on the user's electronic device, the application being used to send an information extraction request to the server end, and to receive target information returned by the server end.

[0061] The server is used to perform document information extraction processing to extract target information from the target document file according to the information extraction request sent by the user. The server can be a document information extraction device with computing capabilities, such as a computing device such as a mobile phone, a computer, a server, or a cloud platform or server that is connected to the document information extraction device.

[0062] The execution subject of the present application may be a document information extraction device, or a processing chip for document information extraction. If the execution subject is the document information extraction device, the document information extraction device may execute the method of the present application based on its own processing; if the execution subject is the processing chip of the document information extraction device, the processing chip may execute the method of the present application by executing a program or code that implements the method. The document information extraction device may be, for example, a computing device such as a mobile phone, a computer, or a server. Optionally, the execution subject of the present application may also be a cloud platform or server that is communicatively connected to the document information extraction device. The document information extraction device uploads the document to the cloud platform or server through interaction with the cloud platform or server. After the cloud platform or server completes the document information extraction, the extracted information is returned to the document information extraction device.

[0063] The following takes the document information extraction device as an example, and describes in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems in combination with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in combination with the accompanying drawings.

[0064] Figure 2 The following is a flow chart of a document information extraction method provided in an embodiment of the present application. Figure 2 As shown, the method may include:

[0065] S201. Receive an information extraction request.

[0066] The information extraction requirement is used to request the extraction of target information in the target document. The target document may be, for example, a contract document, a report document, a product document, a research report, etc., which is not limited in this application. The target information may include, for example, entity information (such as names of people, places, etc.), quantity information (such as amounts, quantities, ratios, etc.), date information, descriptive information (such as product descriptions, service descriptions, etc.) in the target document.

[0067] The information extraction request may include, for example, a text description, and the content of the text description may indicate the content to be extracted. Alternatively, the information extraction request may also include only an indication (e.g., an identifier) ​​to instruct the document information extraction device to extract document information according to the indication. Optionally, the information extraction request may include the target document file, and may also instruct the document information extraction device how to obtain and / or where to obtain the target document file.

[0068] The information extraction request may be manually input by the user into the document information extraction device, or received from other devices (for example, received from the user's personal electronic device, or from devices such as the server where the enterprise's internal system is located), or the information extraction request may be obtained by receiving a message sent by a third-party application, etc.

[0069] S202. According to the target document file, obtain a set of qualifiers corresponding to the content in the target document file.

[0070] Among them, the qualifier set is used to limit the extraction scope of the target information in the target document. The qualifiers included in the qualifier set are determined based on the original content in the target document, that is, the qualifiers are all words composed of the original text included in the original content. By limiting the extraction scope of the target information by the qualifier set, it is possible to prevent the information extraction model from extracting other content outside the qualifier set when extracting the internal content of the target document, thereby reducing the probability of the information extraction model outputting hallucination information and improving the accuracy of extracting target information.

[0071] One possible implementation method is to identify the text content included in the target document file from the target document file by means of text recognition, and generate a corresponding qualifier set according to the processing of the text content. For example, the text content included in the target document file can be extracted from the target document file by means of optical character recognition (OCR).

[0072] Another possible implementation is to determine the qualifier set corresponding to the target document document according to the target document document and the mapping relationship between the qualifier set and the target document document. In this implementation, the mapping relationship between the qualifier set and the target document document can be pre-built. The mapping relationship can be stored in the document information extraction device, or can be obtained by the document information extraction device from a database, a server, etc.

[0073] S203: Input the information extraction requirements, the qualifier set, and the target document file into the information extraction model.

[0074] The information extraction model is a large language model that can improve the probability of a qualifier in a qualifier set being selected during the model processing.

[0075] For example, the information extraction model may be a large language model that increases the probability of selecting a qualifier for output by increasing the output weight or priority of the qualifier during the model processing. Specifically, the architecture and / or parameters of the information extraction model may be adjusted to increase the attention paid to the qualifier. For example, a specific attention mechanism may be designed to make the information extraction model pay more attention to the qualifier when processing the text.

[0076] The information extraction requirement may be a dialogue text, and according to the dialogue text and the intention understanding prompt template, an intention understanding prompt for input into the information extraction model is generated. The intention understanding prompt includes input instructions or key words (i.e., prompt words) provided when interacting with artificial intelligence. The intention understanding prompt template may be pre-configured for a variety of information extraction requirements for target documents.

[0077] In one possible implementation method, the information extraction requirements, the qualifier set, and the target document file can be integrated into one input information and input into the information extraction model, so that the information extraction model can extract the target information corresponding to the information extraction requirements from the target document file based on the information including the information extraction requirements and the qualifier set.

[0078] In another possible implementation, the qualifier set and / or the target document can be first input into the information extraction model. After the information extraction model receives the information extraction requirement, it obtains the intention understanding prompt according to the dialogue text corresponding to the information extraction requirement. And according to the intention understanding prompt, the target information corresponding to the intention understanding prompt is extracted from the extraction range defined by the qualifier set in the target document.

[0079] S204: Obtain target information extracted from the target document file by the information extraction model.

[0080] After the information extraction model extracts the target information from the target document file, the target information is output. When the information extraction model is preset in the document information extraction device, the target information can be directly output according to the model output. When the information extraction model is configured on other devices or in the cloud, the document information extraction device can receive the target information output by the information extraction model to obtain the target information.

[0081] The method provided in the embodiment of the present application obtains a qualifier set that limits the extraction scope of the target information in the target document file from the target document file, and improves the probability of the qualifiers in the qualifier set being selected in the process of extracting document information by the information extraction model, so as to reduce the probability of outputting hallucination information, and facilitates the use of the information extraction model to extract the target information belonging to the original information in the target document file from the target document file, thereby improving the accuracy of document information extraction. In addition, the method reduces the need for human intervention in the document information extraction process and improves the efficiency of document information extraction.

[0082] Next, a detailed description is given of how the information extraction model in the aforementioned step S203 improves the probability of a qualifier in the qualifier set being selected during the model processing process. Figure 3 A flowchart of another document information extraction method provided in an embodiment of the present application. Figure 3 As shown, the method specifically includes:

[0083] S301. The information extraction model obtains at least two candidate information to be output and the original score of each candidate information according to the information extraction requirements and the target document file.

[0084] The candidate information is information extracted from the target document file after the information extraction model understands the intention of the information extraction requirement and according to the intention of the information extraction requirement. The candidate information extracted by the information extraction model may include information that is the same as the original content in the target document file, or may include inferred information related to the original content.

[0085] In the process of information extraction by the large language model, when a piece of text (i.e., information extraction requirements) is input to the large language model and the model is expected to extract certain specific information from it, the model will first understand the intention of extraction and analyze the text according to this intention. In the last layer of the model (such as the fully connected layer), the model generates a score for each possible output category (or label), which can be called the original logits. The original logits represent the output tendency of the model for each output category before any normalization or probabilistic processing.

[0086] Although the original logits reflect the model's inclination towards each output category, they do not meet the requirements of probability distribution (i.e. the sum of the probabilities of all categories is 1). In order to convert these original logits into a valid probability distribution, the model usually uses a softmax function to convert the original logits into a non-negative probability distribution. The final output information is determined based on this probability distribution.

[0087] Correspondingly, the information extraction model of the present application is based on the above logic. When obtaining at least two candidate information to be output, each candidate information will be scored or weighted (i.e., the original logits of each candidate information are generated) to characterize the tendency of outputting the candidate information. Usually, the candidate information with a higher original score will be selected as the final output information by the information extraction model. At least two candidate information to be output and the original score corresponding to each candidate information are obtained in the model processing stage.

[0088] If the first candidate information among the at least two candidate information to be output includes a qualifier in the qualifier set, and the original score of the first candidate information is lower than the original score of any other candidate information, it indicates that the information extraction model has a low tendency to output the first candidate information, and may output other candidate information that does not match the original content of the target document. It is necessary to adjust the original score of the first candidate information to reduce the probability that the model outputs candidate information that does not match the original content of the target document, and execute step S302.

[0089] If the first candidate information among at least two candidate information to be output includes a qualifier in the qualifier set, and the original score of the first candidate information is higher than the original score of any other candidate information, then it is characterized that the information extraction model has a high tendency to output the first candidate information, and has a low tendency to output other candidate information that does not conform to the original content of the target document, and there is no need to adjust the original score of the first candidate information.

[0090] If the first candidate information including the qualifier in the qualifier set does not exist in the at least two candidate information to be output, the representation model may fail to understand the information extraction requirement and cannot output the target information. At this time, an abnormal prompt message can be output to prompt the user to re-describe the information extraction requirement.

[0091] S302: The information extraction model increases the original score of the first candidate information to be higher than the original scores of other candidate information.

[0092] Specifically, the original score of the first candidate information can be improved to be higher than the original scores of other candidate information by modifying the Constrain_logits_processor object in the generation module of the information extraction model. The Constrain_logits_processor object is located after the information extraction model outputs the original logits and before the softmax function is input. Its main function is to constrain and process the original logits generated by the model during the model generation process. For example, the Constrain_logits_processor object can modify the original logits after the model generates the original logits vector and before the original logits vector is converted into a probability distribution through the softmax function, thereby affecting the final probability distribution.

[0093] In a possible implementation, the raw score of the first candidate information can be adjusted to a preset score that is higher than the raw score of any of the candidate information. For example, the raw score of the first candidate information can be adjusted to the highest raw score that the information extraction model can generate (for example, if the highest raw score is 100 points, then the raw score of the first candidate information is adjusted to 100 points); or, the raw score of the first candidate information can be adjusted to a preset score that the information extraction model cannot usually reach when generating raw scores (for example, the highest raw score is 100 points, but when the information extraction model generates raw scores, since there is often not only one candidate information, it is usually unable to generate a score higher than a certain threshold, assuming it is 90 points, then the raw score of the first candidate information can be adjusted to 90 points, or a score higher than 90 points).

[0094] Another possible implementation manner may be to determine how to adjust the raw score of the first candidate information based on the raw scores of other candidate information except the first candidate information among the at least two candidate information. For example, the raw score of the first candidate information may be adjusted to be higher than the highest score among the raw scores of the other candidate information. In this implementation manner, specifically, the raw score of the first candidate information may be adjusted to a preset score through the following steps:

[0095] S3021. Obtain original scores of other candidate information.

[0096] The other candidate information is candidate information other than the first candidate information among the at least two candidate information output by the information extraction model.

[0097] S3022. Determine second candidate information according to the original scores of other candidate information.

[0098] Among them, the raw score of the second candidate information is higher than the raw score of the third candidate information, and the third candidate information is the candidate information other than the second candidate information among the other candidate information. Among the other candidate information, it can be divided into the second candidate information and the third candidate information, the second candidate information is the candidate information with the highest raw score among the other candidate information, and the third candidate information is the candidate information other than the second candidate information among the other candidate information.

[0099] For example, the other candidate information may be sorted according to their original scores, and the second candidate information with the highest original score may be determined according to the sorting result. Alternatively, the second candidate information with the highest original score may be determined by traversing the other candidate information and their original scores.

[0100] S3023. Adjust the original score of the first candidate information according to the original score of the second candidate information and a preset adjustment value.

[0101] In a possible implementation, the preset adjustment value may be a preset fixed adjustment value. Assuming that the original score is in percentage, the preset adjustment value may be 1, 5, 10, etc., and the present application does not limit this. The preset adjustment value is added to the original score of the second candidate information to generate a target original score. The target original score is used as the adjustment target of the original score of the first candidate information, and the original score of the first candidate information is adjusted to the target original score.

[0102] Exemplarily, assuming that the original score of the second candidate information is 70, the preset adjustment value is 5, and the original score of the first candidate information is 55, the original score of the first candidate information can be adjusted to 75.

[0103] In another possible implementation, the preset adjustment value may be a floating adjustment value. For example, the corresponding preset adjustment value may be determined based on the original score of the second candidate information, or the interval in which the original score of the second candidate information is located. Specifically, a mapping relationship between the original score and the preset adjustment value may be pre-constructed. Based on the original score of the second candidate information, and the mapping relationship between the original score and the preset adjustment value, the preset adjustment value corresponding to the original score of the second candidate information is determined. Then, the original score of the first candidate information is adjusted based on the original score of the second candidate information and the preset adjustment value.

[0104] Exemplarily, assuming that the original score of the second candidate information is 75, which is in the original score range of 70-80, according to the mapping relationship, it can be determined that the preset adjustment value corresponding to the range is 10, and the original score of the first candidate information can be adjusted to 85. When assuming that the original score of the second candidate information is 92, which is in the original score range of 90-100, if the corresponding preset adjustment value is still 10, it will exceed the upper limit of the original score. Therefore, the preset adjustment value corresponding to the original score range of 90-100 can be determined as 3 in the mapping relationship. According to the mapping relationship and the original score of the second candidate information of 92, the preset adjustment value 3 is determined, and the original score of the first candidate information is adjusted to 95.

[0105] In the method provided by the embodiment of the present application, the information extraction model obtains at least two candidate information to be output and the original score of each candidate information according to the information extraction requirements and the target document. If the first candidate information among the at least two candidate information to be output includes a qualifier in the qualifier set, and the original score of the first candidate information is lower than the original score of any other candidate information, the information extraction model increases the original score of the first candidate information to be higher than the original score of the other candidate information, thereby increasing the probability of outputting the first candidate information that is faithful to the original content of the target document, and reducing the probability of outputting hallucination information, thereby improving the accuracy of the document information extraction process.

[0106] Next, taking obtaining a set of qualifiers through text recognition as an example, how to obtain a set of qualifiers corresponding to the content in the target document file according to the target document file in the aforementioned step S102 is described in detail. Figure 4 The following is a flow chart of another document information extraction method provided in the embodiment of the present application. Figure 4 As shown, the aforementioned step S202 may include:

[0107] S401: Perform text recognition on the target document to obtain the text content of the target document.

[0108] The target document file may be an image file (such as an image file in a format such as PNG, JPG, etc.), a PDF file, etc.

[0109] If the target document is an image file, OCR technology can be used to scan the character shapes in the image and convert them into computer-editable text. In this process, the OCR engine can identify the text data in the image by analyzing the character outlines, lines, breakpoints and other information.

[0110] If the target document file is a PDF file, you can use OCR technology to scan the character shapes in the PDF, or you can use the PDF parsing library to directly extract the text content and convert it into actionable text data.

[0111] After obtaining the text data, the text data can be spliced ​​according to the structures such as sentences and paragraphs in the target document file and the coordinate information corresponding to these structures to obtain the text content.

[0112] S402: According to the text content, a word list after the text content is segmented and duplicated is removed is obtained.

[0113] The text content obtained in step S401 is segmented to divide the continuous text content into independent vocabulary units. The segmentation process can be completed using existing segmentation tools or libraries (such as jieba segmentation, etc.), which will not be described in detail here.

[0114] According to the obtained vocabulary units, a corresponding vocabulary list is generated. The deduplication operation of the text content is completed by removing duplicate words in the vocabulary list, and the deduplication vocabulary list is used as the vocabulary list corresponding to the text content. The deduplication operation can be implemented by using a set data structure or manually traversing a list, which will not be described here.

[0115] S403: Convert the vocabulary into a set of qualifiers corresponding to the contents in the target document file.

[0116] The qualifier set is a tag sequence that can be processed by the information extraction model. The qualifiers in the qualifier set are elements in the tag sequence.

[0117] One possible implementation method is to convert the words in the vocabulary into tags that can be processed by the information extraction model based on the words in the vocabulary and the mapping relationship between the words in the vocabulary and the tag sequence of the information extraction model. According to the tags corresponding to each word in the vocabulary, a set of qualifiers (i.e., a tag sequence) corresponding to the content in the target document is generated.

[0118] Another possible implementation is to convert the vocabulary into a token sequence through a pre-trained language model or an embedding model. For example, the vocabulary can be converted into a set of qualifiers through the tokenizer of the above information extraction model. This implementation can be achieved through the following steps:

[0119] S4031. Input the vocabulary into the information extraction model.

[0120] The information extraction model has the function of processing a vocabulary and converting the words therein into tags that can be processed by the information extraction model.

[0121] Optionally, before inputting the vocabulary into the information extraction model, the vocabulary may be appropriately formatted or encoded to ensure that the vocabulary matches the expected format of the model input layer. For example, the words in the vocabulary may be converted into vectors by vocabulary vectorization. The vector set corresponding to the vocabulary is input into the information extraction model to convert the vocabulary.

[0122] S4032. Convert the vocabulary into a set of qualifiers corresponding to the contents in the target document file through the word segmenter of the information extraction model.

[0123] The tokenizer component in the information extraction model is responsible for converting the input vocabulary into a token sequence that the model can understand and process. The tokens in the token sequence are a representation used within the model, such as a specific encoding, vector, or other form of symbol.

[0124] Optionally, the tokenizer can convert each word into one or more specific tags by traversing the input vocabulary. These tags may represent the semantics, part of speech, or other linguistic features of the word. Alternatively, the tokenizer converts the words into vectors that capture the semantic relationships between words so that the model can perform mathematical operations and comparisons more easily.

[0125] The word segmenter converts each word in the vocabulary into a token that can be processed by the information extraction model. According to the tokens corresponding to each word in the vocabulary, a set of qualifiers corresponding to the vocabulary is constructed to improve the accuracy of document information extraction in the future.

[0126] Figure 5 This is a schematic diagram of the structure of a document information extraction device provided in an embodiment of the present application. Figure 5 As shown, the device may include: a receiving module 11, a processing module 12, a control module 13, and an acquisition module 14.

[0127] The receiving module 11 is used to receive an information extraction request, where the information extraction request is used to request to extract target information from a target document.

[0128] The processing module 12 is used to obtain a set of qualifiers corresponding to the content in the target document file according to the target document file, and the set of qualifiers is used to limit the extraction scope of the target information in the target document file.

[0129] The control module 13 is used to input the information extraction requirement, the qualifier set, and the target document file into the information extraction model. The information extraction model is a large language model that can improve the probability of selecting the qualifiers in the qualifier set during the model processing.

[0130] The acquisition module 14 is used to acquire the target information extracted from the target document by the information extraction model.

[0131] Optionally, the processing module 12 is specifically used to perform text recognition on the target document file to obtain the text content of the target document file. According to the text content, a word list after the text content is segmented and deduplicated is obtained. The word list is converted into the set of qualifiers corresponding to the content in the target document file.

[0132] Optionally, the processing module 12 is specifically used to input the vocabulary into the information extraction model, and convert the vocabulary into the qualifier set corresponding to the content in the target document file through the word segmenter of the information extraction model, and the qualifier set is a tag sequence that can be processed by the information extraction model.

[0133] The document information extraction device provided in the embodiment of the present application can execute the document information extraction method in the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0134] The present application also provides an information extraction model processing device, which is used to perform the action of increasing the probability of the qualifier in the qualifier set being selected during the model processing process in the above method embodiment. The implementation principle is similar and will not be described in detail.

[0135] Figure 6 The structure diagram of an electronic device provided in an embodiment of the present application. The electronic device is used to execute the document information extraction method mentioned above, for example, it can be the document information extraction device mentioned above. Figure 6 As shown, the electronic device 600 may include: at least one processor 601 , a memory 602 , and a communication interface 603 .

[0136] The memory 602 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.

[0137] The memory 602 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0138] The processor 601 is used to execute the computer-executable instructions stored in the memory 602 to implement the method described in the above method embodiment. The processor 601 may be a CPU, or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0139] The processor 601 can communicate and interact with external devices through the communication interface 603. The external device can be, for example, the user electronic device or server mentioned above. In a specific implementation, if the communication interface 603, the memory 602 and the processor 601 are implemented independently, the communication interface 603, the memory 602 and the processor 601 can be interconnected through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0140] Optionally, in a specific implementation, if the communication interface 603, the memory 602 and the processor 601 are integrated on a chip, the communication interface 603, the memory 602 and the processor 601 can communicate through an internal interface.

[0141] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores program instructions, and the program instructions are used for the methods in the above embodiments.

[0142] The present application also provides a program product, which includes an execution instruction, which is stored in a readable storage medium. At least one processor of a computing device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the computing device implements the actions of the document information extraction device.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A document information extraction method, It is characterized in that The method comprises: receiving an information extraction request, wherein the information extraction request is used to request to extract target information from a target document file; According to the target document, a set of qualifiers corresponding to the content in the target document is acquired, wherein the set of qualifiers is used to limit the extraction scope of the target information in the target document; Inputting the information extraction requirement, the qualifier set, and the target document into an information extraction model, wherein the information extraction model is a large language model that can improve the probability of selecting a qualifier in the qualifier set during model processing; The target information extracted by the information extraction model from the target document file is obtained.

2. The method according to claim 1, It is characterized in that The information extraction model improves the probability of a qualifier in the qualifier set being selected during the model processing, including: The information extraction model obtains at least two candidate information to be output and the original score of each candidate information according to the information extraction requirement and the target document; If the first candidate information includes a qualifier in the qualifier set and the raw score of the first candidate information is lower than the raw score of any other candidate information, the information extraction model increases the raw score of the first candidate information to be higher than the raw scores of the other candidate information.

3. The method according to claim 2, It is characterized in that The information extraction model improves the original score of the first candidate information to be higher than the original scores of the other candidate information, including: The information extraction model adjusts the original score of the first candidate information to a preset score, and the preset score is higher than the original score of any of the candidate information.

4. The method according to claim 3, It is characterized in that The information extraction model adjusts the original score of the first candidate information to a preset score, including: Obtaining the original scores of the other candidate information; Determine second candidate information according to the original scores of the other candidate information, the original score of the second candidate information is higher than the original score of the third candidate information, and the third candidate information is the candidate information among the other candidate information except the second candidate information; The original score of the first candidate information is adjusted according to the original score of the second candidate information and a preset adjustment value.

5. The method according to claim 4, It is characterized in that Before adjusting the original score of the first candidate information according to the original score of the second candidate information and the preset adjustment value, the method further includes: The preset adjustment value corresponding to the original score of the second candidate information is determined according to the original score of the second candidate information and the mapping relationship between the original score and the preset adjustment value.

6. The method according to any one of claims 1 to 5, It is characterized in that The acquiring, according to the target document, a set of qualifiers corresponding to the content in the target document includes: Performing text recognition on the target document to obtain text content of the target document; According to the text content, obtaining a word list after the text content is segmented and deduplicated; The word list is converted into the set of qualifying words corresponding to the content in the target document.

7. The method according to claim 6, It is characterized in that The converting the vocabulary into the set of qualifiers corresponding to the content in the target document file comprises: Inputting the vocabulary into the information extraction model; The word list is converted into the set of qualifiers corresponding to the content in the target document file through the word segmenter of the information extraction model, and the set of qualifiers is a tag sequence that can be processed by the information extraction model.

8. A document information extraction device, It is characterized in that include: A receiving module, used for receiving an information extraction request, wherein the information extraction request is used for requesting to extract target information from a target document; A processing module, configured to obtain, according to the target document, a set of qualifiers corresponding to the content in the target document, wherein the set of qualifiers is used to limit the extraction scope of the target information in the target document; A control module, configured to input the information extraction requirement, the qualifier set, and the target document into an information extraction model, wherein the information extraction model is a large language model capable of increasing the probability of a qualifier in the qualifier set being selected during model processing; An acquisition module is used to acquire the target information extracted from the target document by the information extraction model.

9. An electronic device, It is characterized in that include: A processor, a communication interface and a memory, wherein the processor is communicatively connected to the communication interface and the memory respectively; The memory stores computer-executable instructions; The communication interface communicates and interacts with external devices; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the document information extraction method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intelligent element extraction method and system based on multiple tasks

    CN113743114A

  • Information extraction method and model training method and device for information extraction

    CN116524523A

  • Form information extraction method and device, equipment and storage medium

    CN117494688A

  • Text information extraction method based on large language model and efficient parameter fine tuning

    CN118132674A