Information extraction method and information extraction model training method

By masking and model training the sample images, the problem of low accuracy of the optical character recognition engine in visual information extraction is solved, and high-precision information extraction model training and visual information extraction are achieved.

CN118429658BActive Publication Date: 2024-10-08ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410833769.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-08
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

In the existing technology, the recognition results of optical character recognition engines in visual information extraction are not completely accurate due to picture layout and font style, resulting in low accuracy of visual information extraction.

Method used

By masking the text content in the sample image, extracting image features, and inputting the encoding unit and decoding unit for training, the model parameters of the initial extraction model are adjusted to achieve high-precision training of the information extraction model, so that the model can understand the image features. and text contextual content.

Benefits of technology

It improves the accuracy of the information extraction model, realizes high-precision information extraction task processing, and improves the efficiency of information extraction and the accuracy of text extraction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429658B_ABST
    Figure CN118429658B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide an information extraction method and an information extraction model training method, wherein the information extraction method comprises: obtaining a task image of an information extraction task; performing image feature extraction on the task image to obtain task image features; inputting the task image features into an encoding unit in an information extraction model to obtain task encoding features, and inputting the task encoding features into a decoding unit in an information extraction model to obtain a text extraction result of the task image, wherein the information extraction model is obtained based on sample image feature training, the sample image features are obtained based on feature extraction of a sample mask image, and the sample mask image is obtained based on masking the text content in the sample image. By training the model after masking the text content in the sample image, the model can understand the image features and text context content, thereby achieving high-precision information extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and in particular to an information extraction method and an information extraction model training method. Background Art

[0002] With the development of computer technology, visual information extraction technology has been widely used in tasks such as document images, card images, street view photos, etc. Through visual information extraction, information can be extracted from scattered, redundant and unstructured images to obtain focused and concise structured information.

[0003] At present, optical character recognition engines are usually used to extract visual information. However, optical character recognition engines may not give completely accurate recognition results due to image layout, font style, etc., which further leads to low visual information extraction accuracy. Therefore, a visual information extraction solution with higher accuracy is urgently needed. Summary of the invention

[0004] In view of this, an embodiment of this specification provides an information extraction method. One or more embodiments of this specification also relate to an information extraction model training method, an information processing method based on an information extraction model, a model training platform, an information extraction model training device, an information extraction device, an information processing device based on an information extraction model, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of the present specification, there is provided an information extraction method, comprising: obtaining a task image of an information extraction task; performing image feature extraction on the task image to obtain task image features; inputting the task image features into an encoding unit in an information extraction model to obtain task encoding features, and inputting the task encoding features into a decoding unit in the information extraction model to obtain a text extraction result of the task image, wherein the information extraction model is obtained based on sample image feature training, the sample image features are obtained based on feature extraction of a sample mask image, and the sample mask image is obtained based on masking of text content in the sample image.

[0006] An information extraction method provided in an embodiment of the present specification improves the accuracy of the information extraction model by performing model training after masking the text content in the sample image, so that the model can understand the image features and text context content of the task image, thereby achieving high-precision information extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 is an architecture diagram of an information extraction model training system provided by an embodiment of this specification;

[0008] Figure 2 is an architecture diagram of an information extraction system provided by an embodiment of this specification;

[0009] Figure 3 is a flow chart of an information extraction model training method provided by an embodiment of this specification;

[0010] Figure 4 is a processing flow chart of an information extraction model training method provided by an embodiment of this specification;

[0011] Figure 5 is a processing flow chart of another information extraction model training method provided by an embodiment of this specification;

[0012] Figure 6 is a flow chart of an information extraction method provided by an embodiment of this specification;

[0013] Figure 7 is a flow chart of an information processing method based on an information extraction model provided by an embodiment of this specification;

[0014] Figure 8 is a schematic diagram of a model training platform provided by an embodiment of this specification;

[0015] Fig. 9 It is a structural diagram of an information extraction model training device provided by an embodiment of this specification;

[0016] Fig.10 It is a structural schematic diagram of an information extraction device provided by an embodiment of this specification;

[0017] Fig.11 is a structural diagram of an information processing device based on an information extraction model provided by an embodiment of this specification;

[0018] Fig.12 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0019] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0020] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0021] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0022] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0023] First, the terms involved in one or more embodiments of this specification are explained.

[0024] Information Extraction (IE): It is an important task in the field of Natural Language Processing (NLP). It aims to automatically identify and extract useful information from unstructured or semi-structured texts and convert it into a structured form for further analysis and utilization.

[0025] Visual Information Extraction (VIE): Extract information from scattered, redundant and unstructured images to obtain focused and concise structured information.

[0026] Masked Image Modeling (MIM): is a self-supervised learning method in the field of computer vision. In MIM, parts of the input image are randomly "masked" or covered up, and the model's task is to reconstruct the complete content of the original image based on the unmasked parts or predict the pixels of the masked areas. In this process, the model can learn to capture and understand the visual structure, texture, color and other visual features in the image, thereby improving its overall image representation capabilities.

[0027] Masked Language Modeling (MLM): is a pre-training task in the field of NLP. In this task, the model receives a partially processed sentence as input, in which some words are randomly "masked" or covered with a special symbol (such as [MASK]), and the goal of the model is to predict the original words in these masked positions. In this process, the model can learn to understand the context of the sentence and infer the missing words based on the contextual information, thereby enhancing its language understanding and generation capabilities.

[0028] Optical Character Recognition (OCR): involves the use of optical technology and computer algorithms to identify and convert text materials, extracting printed or handwritten text from physical media (such as paper documents, pictures) and converting it into an editable and searchable electronic text format. This process usually includes steps such as scanning, image preprocessing, character recognition and post-processing, which can greatly improve the efficiency and accuracy of document processing and is widely used in document digitization, data entry, form processing, archive management and other fields.

[0029] Convolutional Neural Network (CNN) model: is a deep learning algorithm suitable for processing computer vision tasks such as image recognition, image classification, and object detection. Its core feature is to use convolutional layers to extract features of input data (such as images), which are usually followed by pooling layers to reduce the data dimension, and finally classification or regression prediction through fully connected layers. CNN can achieve extremely high accuracy in a variety of visual recognition tasks by learning local features of images and their spatial relationships.

[0030] Deep Self-Attention (Transformer) Model: It is a deep learning architecture based on the attention mechanism, mainly used to process sequence data. The Transformer model consists of a series of encoders and decoders that can be repeatedly stacked. This design allows the Transformer to efficiently learn long-term dependencies and is suitable for a variety of natural language processing tasks including machine translation, text summarization, and question-answering systems.

[0031] Visual Deep Self-Attention (VIT, Vision Transformer) model: is a deep learning model. The VIT model divides the input image into multiple fixed-size image patches, then uses linear embedding to convert these patches into feature vectors, and then feeds these feature vectors into the Transformer architecture together with a special classification token.

[0032] Visual information extraction involves image text detection, text recognition, and extraction capabilities. Through visual information extraction, information can be extracted from scattered, redundant, unstructured images to obtain focused, streamlined, structured information. Applicable tasks for visual information extraction include, but are not limited to, bill information extraction tasks, certificate information extraction tasks, table information extraction tasks, and document information extraction tasks. Therefore, improving visual information extraction capabilities is crucial for optical character recognition.

[0033] At present, commonly used information extraction methods are mainly divided into three categories: the first category is to unify text detection, recognition, and extraction into the same framework to achieve information extraction; the second category is to extract OCR information through an open source OCR engine, including text location and content, and input it into a language model for extraction; the third category is to only input pictures, and the model directly extracts content without text detection and recognition. However, the first type of method lacks a corresponding framework training program, resulting in low accuracy. The second type of method will produce error transmission due to its reliance on the OCR engine. The third type of method is a black box algorithm, lacks interpretability, and decoding is time-consuming.

[0034] In order to solve the above problems, the present embodiment proposes a pre-training scheme for an end-to-end visual information extraction framework, that is, a method for training an information extraction model, including: obtaining an initial extraction model and a sample image, wherein the initial extraction model includes an encoding unit and a decoding unit, the initial extraction model is pre-configured with model parameters, and the encoding unit is connected to the decoding unit; performing mask processing on the text content in the sample image to obtain a sample mask image, and performing image feature extraction on the sample mask image to obtain sample image features; inputting the sample image features into the encoding unit to obtain sample encoding features, and inputting the sample encoding features into the decoding unit to obtain sample prediction results; based on the sample prediction results, adjusting the model parameters of the initial extraction model to obtain a trained information extraction model. By adding a pre-training task, the text content in the sample image is masked and then the model is trained, so that the model can understand the image features and text context content of the sample image, thereby improving the accuracy of the information extraction model and realizing high-precision information extraction task processing.

[0035] In this specification, a method for training an information extraction model is provided. This specification also involves an information extraction method, an information processing method based on an information extraction model, a model training platform, an information extraction model training device, an information extraction device, an information processing device based on an information extraction model, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.

[0036] See also Figure 1 , Figure 1 An architecture diagram of an information extraction model training system provided by an embodiment of the present specification is shown. The information extraction model training system may include a client 100 and a server 200;

[0037] The client 100 is used to send an initial extraction model and a sample image to the server 200, wherein the initial extraction model includes a coding unit and a decoding unit, the initial extraction model is pre-configured with model parameters, and the coding unit is connected to the decoding unit;

[0038] The server 200 is used to perform mask processing on the text content in the sample image to obtain a sample mask image, and perform image feature extraction on the sample mask image to obtain sample image features; input the sample image features into the encoding unit to obtain sample encoding features, and input the sample encoding features into the decoding unit to obtain sample prediction results; based on the sample prediction results, adjust the model parameters of the initial extraction model to obtain a trained information extraction model, wherein the information extraction model is used to process the task image features of the task image in the information extraction method to obtain the text extraction results of the task image; send the model parameters of the trained information extraction model to the client 100;

[0039] The client 100 is also used to receive the model parameters of the trained information extraction model sent by the server 200.

[0040] By applying the solution of the embodiments of this specification, the text content in the sample image is masked and then the model is trained, so that the model can understand the image features and text context content of the sample image, thereby improving the accuracy of the information extraction model and achieving high-precision information extraction task processing.

[0041] See also Figure 2 , Figure 2 An architecture diagram of an information extraction system provided by an embodiment of the present specification is shown. The information extraction system may include a client 100 and a server 200;

[0042] The client 100 is used to send a task image of the information extraction task to the server 200;

[0043] The server 200 is used to extract image features from the task image to obtain task image features; input the task image features into the encoding unit in the information extraction model to obtain task encoding features, and input the task encoding features into the decoding unit in the information extraction model to obtain text extraction results of the task image, wherein the information extraction model is obtained based on sample image feature training, the sample image features are obtained based on feature extraction of the sample mask image, and the sample mask image is obtained based on masking of the text content in the sample image; and the text extraction results are sent to the client 100;

[0044] The client 100 is also used to receive the text extraction result sent by the server 200.

[0045] By applying the solution of the embodiments of this specification, high-precision, end-to-end information extraction task processing is achieved using the information extraction model, further improving the information extraction efficiency and the accuracy of the text extraction results.

[0046] In actual applications, the client 100 and the server 200 are connected via a network. The network provides a medium for the communication link between the client 100 and the server 200. The network may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The data transmitted by the client 100 may need to be encoded, transcoded, compressed, etc. before being released to the server 200.

[0047] The client 100 can be any one of a browser, an APP (Application), a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language Version 5) application, a light application (also known as a mini-program, a lightweight application), and a cloud application. The client 100 can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the server 200, such as based on the real-time communication (RTC, Real Time Communication) SDK development and acquisition. The client 100 can be deployed in an electronic device and needs to rely on the device to run or some APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0048] The server 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that support models used on clients, and servers that process data sent by clients. It should be noted that the server 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0049] See also Figure 3 , Figure 3 A flowchart of an information extraction model training method provided by an embodiment of this specification is shown, which specifically includes the following steps:

[0050] Step 302: Acquire an initial extraction model and a sample image, wherein the initial extraction model includes a coding unit and a decoding unit, the initial extraction model is pre-configured with model parameters, and the coding unit is connected to the decoding unit.

[0051] Specifically, the initial extraction model refers to a model with information extraction capability. The initial extraction model may be an untrained Transformer model or a pre-trained Transformer model. The model is selected according to the actual situation, and the embodiments of this specification do not impose any restrictions on this. The sample image is used to adjust the parameters of the initial extraction model. The sample image may be an image of different scenes, such as an image of a financial scene, an image of a traffic scene, an image of a transaction scene, and the like. The sample image includes but is not limited to a bill image, a certificate image, and a table image. The encoding unit may be referred to as an encoder, which is used to convert the input sequence into a series of high-order feature representations, that is, sample encoding features. The decoding unit may be referred to as a decoder, which is used to generate an output sequence using the high-order feature representation output by the encoding unit and its own input (in the case of step-by-step decoding, it is a previously generated sequence part) to generate an output sequence, that is, a sample prediction result. The model parameters refer to the starting weights and bias values ​​given to the initial extraction model in order to start the training process when constructing the initial extraction model. The model parameters are selected based on a series of theoretical and practical experiences (such as avoiding saturation and gradient vanishing strategies, uniform and normal distribution initialization strategies) to promote the model to converge to a better solution quickly and effectively.

[0052] It should be noted that the sample image carries the sample label, which is used to determine whether the training of the initial extraction model is complete. Generally, there are a large number of sample images for training the initial extraction model. The sample labels can be generated using the OCR engine. Since the OCR engine has certain errors, the sample labels carried by the sample image can be regarded as pseudo labels. The sample labels include sample content labels and regional location labels.

[0053] In practical applications, there are many ways to obtain the initial extraction model and sample images, which are selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the initial extraction model and sample images can be read from other data acquisition devices or databases. In another possible implementation of this specification, training data of the target task sent by the client can be received.

[0054] Step 304: mask the text content in the sample image to obtain a sample mask image, and extract image features from the sample mask image to obtain sample image features.

[0055] Specifically, the process of masking the text content in the sample image can be regarded as a MIM process. The sample mask image refers to the sample image after the text content is masked. Image feature extraction refers to extracting key information from the sample image that helps describe the image content, structure or semantics. This information is usually converted into numerical values, vectors or other forms that are convenient for the initial extraction model to process. Image feature extraction allows the initial extraction model to understand and distinguish different image contents in a more efficient and abstract way. Sample image features refer to a set of representations or descriptions obtained from the sample image through the image feature extraction process. Sample image features can characterize the key information in the sample image to facilitate subsequent visual information extraction.

[0056] It should be noted that there are many ways to mask the text content in the sample image and obtain a sample mask image, which can be selected according to the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, a certain proportion of the text content (such as 15%) in the sample image can be randomly "masked" or covered with a special symbol to obtain a sample mask image. In another possible implementation of this specification, the text content in the sample image can be divided into two types, namely words and characters. For words and chars, different mask ratios can be used to mask the text content to obtain a sample mask image. For example, the word of the text content is randomly masked and replaced with a learnable word mask token; the char of the text content is randomly masked and replaced with a learnable char masktoken. Among them, word mask15%, char mask30%.

[0057] In practical applications, there are many ways to extract image features from sample mask images and obtain sample image features. The specific selection is based on the actual situation, and the embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, a CNN model can be used to extract image features from a sample mask image to obtain sample image features. In another possible implementation of this specification, a VIT model can be used to extract image features from a sample mask image to obtain sample image features.

[0058] Step 306: Input the sample image features into the encoding unit to obtain sample encoding features, and input the sample encoding features into the decoding unit to obtain sample prediction results.

[0059] It should be noted that in the encoding unit, the sample image features will first be converted into a higher-dimensional representation through an embedding layer (EmbeddingLayer) to make the sample image features compatible with the internal representation of the model. Then, the sample image features will undergo a multi-head self-attention mechanism, which allows the model to learn complex relationships between features, and help gradient propagation and accelerate convergence through feedforward neural networks and residual connections and layer normalization, and finally output sample encoding features.

[0060] In the decoding unit, the sample encoding features will pass through the multi-head self-attention mechanism to ensure that when generating the output of the current position, the model can only see the past position information to avoid the leakage of future information. Then it will enter the encoding unit-decoding unit attention, so that the decoding unit can focus on different parts of the input sequence. Finally, the feedforward neural network, residual connection and layer normalization are used to enhance the nonlinear expression ability of the model and stabilize the training process to obtain sample prediction results.

[0061] Step 308: Based on the sample prediction results, adjust the model parameters of the initial extraction model to obtain a trained information extraction model, wherein the information extraction model is used to process the task image features of the task image in the information extraction method to obtain the text extraction result of the task image.

[0062] It should be noted that the implementation of the information extraction method can refer to Figure 6 The processing flow of the information extraction method shown in the figure will not be described in detail in the embodiments of this specification. In practical applications, when adjusting the model parameters of the initial extraction model based on the sample prediction results, the content prediction loss can be calculated according to the sample prediction results and the sample content label, and the model parameters of the initial extraction model can be adjusted according to the content prediction loss until the preset stop condition is reached to obtain a trained information extraction model. The sample content label includes a text content label and a position label of the text content in the sample image.

[0063] There are many functions for calculating content prediction loss based on sample prediction results and sample content labels, such as cross entropy loss function, L1 norm loss function, L2 norm loss function, KL divergence (Kullback-Leibler divergence), etc., which are selected according to actual conditions, and the embodiments of this specification do not impose any restrictions on this. The preset stop conditions include but are not limited to the content prediction loss being less than or equal to a preset threshold and the number of iterations reaching a preset number of iterations, wherein the preset threshold and the preset number of iterations are selected according to actual conditions, and the embodiments of this specification do not impose any restrictions on this.

[0064] In a possible implementation of the present specification, after calculating the content prediction loss, the content prediction loss can be compared with a preset threshold. Specifically, if the content prediction loss is greater than the preset threshold, it means that the difference between the sample prediction result and the sample content label is large, and the generation ability of the initial extraction model is poor. At this time, the model parameters of the initial extraction model can be adjusted, and the initial extraction model is continuously trained until the content prediction loss is less than or equal to the preset threshold, indicating that the difference between the sample prediction result and the sample content label is small, and the preset stop condition is reached, and the trained information extraction model is obtained.

[0065] In another possible implementation of the present specification, in addition to comparing the relationship between the content prediction loss and the preset threshold, the number of iterations can also be combined to determine whether the current initial extraction model has been trained. Specifically, if the content prediction loss is greater than the preset threshold, the model parameters of the initial extraction model are adjusted, and the initial extraction model is continuously trained until the preset number of iterations is reached, and the iteration is stopped to obtain a trained information extraction model.

[0066] By applying the solution of the embodiments of this specification, the model parameters of the initial extraction model are adjusted according to the sample prediction results and the sample content labels until the preset stopping conditions are met, and a trained information extraction model is obtained. By continuously adjusting the model parameters of the initial extraction model when the preset stopping conditions are not met, the final information extraction model can have accurate text detection and recognition capabilities.

[0067] In the embodiments of this specification, visual information extraction includes three stages: text detection, text recognition, and information extraction. Text detection and text recognition can be combined into a text detection and recognition (spotting) stage, and the information extraction stage can be divided into a text grouping (grouping) stage for combining text into entities and an entity labeling (labeling) stage for classifying entities. Therefore, the entire visual information extraction process can include three stages: text spotting, text grouping, and entity labeling. By adjusting the model parameters of the initial extraction model based on the sample prediction results, the trained information extraction model has good text spotting and can handle text extraction tasks. Furthermore, in order to enable the information extraction model to have text grouping and entity labeling capabilities, and to handle entity extraction and entity category recognition tasks, the trained information extraction model can be further parameter updated to obtain an updated information extraction model.

[0068] In an optional embodiment of the present specification, in view of the text grouping capability of the model, an entity region prediction unit for predicting entity regions in an image can be constructed after the encoding unit of the trained information extraction model. Then, the information extraction model is trained using a spotting task so that it can recognize text content and text positions in an image, and the information extraction model is trained using an entity detection (ETD) task so that it can determine entity regions in an image and text content (entities) in the region. That is, the information extraction model includes an encoding unit, a decoding unit, and an entity region prediction unit, and the entity region prediction unit is connected to the encoding unit. After the above-mentioned adjustment of the model parameters of the initial extraction model based on the sample prediction results and the acquisition of the trained information extraction model, the following steps may also be included:

[0069] Obtain training images for the information extraction task;

[0070] Masking the text content in the training image to obtain a training mask image, and extracting image features from the training mask image to obtain training image features;

[0071] Input the training image features into the encoding unit to obtain the training encoding features, and input the training encoding features into the decoding unit to obtain the training prediction results;

[0072] Inputting the training encoding features into the entity region prediction unit to obtain the training entity region prediction result;

[0073] Based on the training prediction results and the training entity region prediction results, the model parameters of the information extraction model are adjusted to obtain an updated information extraction model.

[0074] Specifically, the training prediction result refers to the result obtained by the information extraction model for extracting and predicting the information in the training image. The training entity area prediction result refers to the result obtained by the entity area prediction unit for predicting the regional position of the entity in the text content of the training image in the training image. In order to enable the information extraction model trained using the training image to be directly used for information extraction tasks, the training labels carried by the training image can be accurate real labels obtained by manual annotation, and the training labels include training content labels and training area location labels. The architecture of the entity area prediction unit includes but is not limited to CNN models and Transformer models, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any restrictions on this.

[0075] It should be noted that when adjusting the model parameters of the information extraction model based on the training prediction results and the training entity area prediction results, the training content prediction loss can be calculated according to the training prediction results and the training content labels; the training area prediction loss can be calculated according to the training entity area prediction results and the training area location labels; the model parameters of the information extraction model can be adjusted according to the training content prediction loss and the training area prediction loss to obtain an updated information extraction model. Among them, the adjustment process of the training content prediction loss, the training area prediction loss, and the model parameters of the information extraction model can refer to the calculation process of the above-mentioned content prediction loss and the training process of the initial extraction model, and the embodiments of this specification will not be repeated.

[0076] By applying the solution of the embodiments of this specification, it is possible to train the information extraction model using spotting tasks and ETD tasks, so that the model can acquire entity area detection capabilities on the basis of text detection and recognition capabilities, thereby expanding the processing capabilities of the information extraction model and improving the scope of application of the model.

[0077] In an optional embodiment of the present specification, in view of the entity labeling capability of the model, an entity region prediction unit for predicting the entity region in the image can be constructed after the encoding unit of the trained information extraction model, and a category prediction unit for predicting the entity category can be constructed after the entity region prediction unit. Then, the information extraction model is trained using a tagging task so that it can identify the category of the entity, that is, the information extraction model also includes a category prediction unit, and the category prediction unit is connected to the entity region prediction unit; after the training encoding feature is input into the entity region prediction unit and the training entity region prediction result is obtained, the following steps can also be included:

[0078] Inputting the training entity region prediction result into the category prediction unit to perform entity category prediction, and obtaining the entity category prediction result;

[0079] Adjusting the model parameters of the information extraction model based on the training prediction results and the training entity region prediction results to obtain an updated information extraction model may include the following steps:

[0080] Based on the training prediction results, the training entity region prediction results and the entity category prediction results, the model parameters of the information extraction model are adjusted to obtain an updated information extraction model.

[0081] Specifically, in addition to the training content label and the training area location label, the training image can also carry an entity category label. The architecture of the category prediction unit includes but is not limited to a CNN model and a Transformer model, which are selected according to actual conditions, and the embodiments of this specification do not impose any limitation on this.

[0082] It should be noted that when adjusting the model parameters of the information extraction model based on the training prediction results, the training entity region prediction results and the entity category prediction results, the training content prediction loss can be calculated according to the training prediction results and the training content labels; the training area prediction loss can be calculated according to the training entity region prediction results and the training area location labels; the category prediction loss can be calculated according to the entity category prediction results and the entity category labels; the model parameters of the information extraction model can be adjusted according to the training content prediction loss, the training area prediction loss and the category prediction loss to obtain an updated information extraction model. Among them, the adjustment process of the training content prediction loss, the training area prediction loss, the category prediction loss and the model parameters of the information extraction model can refer to the calculation process of the above-mentioned content prediction loss and the training process of the initial extraction model, and the embodiments of this specification will not be repeated.

[0083] By applying the scheme of the embodiments of this specification, the training entity area prediction results are input into the category prediction unit to perform entity category prediction, and the entity category prediction results are obtained. This realizes the use of Tag tasks to directly classify and predict entities and obtain entity categories, so that the information extraction model has text detection and recognition capabilities, entity area detection capabilities, and entity category recognition capabilities, thereby expanding the processing capabilities of the information extraction model and improving the scope of application of the model.

[0084] In an optional embodiment of the present specification, the initial extraction model further includes a mask prediction unit, and the mask prediction unit is connected to the encoding unit; after inputting the sample image features into the encoding unit and obtaining the sample encoding features, the following steps may also be included:

[0085] Inputting the sample encoding feature into the mask prediction unit to perform mask content prediction and obtain a mask prediction result;

[0086] Based on the sample prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model, which may include the following steps:

[0087] Based on the sample prediction results and the mask prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

[0088] It should be noted that the mask prediction result refers to the result obtained by the mask prediction unit predicting the mask content in the sample image. The architecture of the mask prediction unit includes but is not limited to the CNN model and the Transformer model, which are selected according to the actual situation, and the embodiments of this specification do not impose any restrictions on this. The mask prediction unit is used to predict the mask content in the sample mask image. When the sample encoding features are input into the mask prediction unit for mask content prediction, when the word in the sample image is randomly masked and replaced with a learnable word mask token, and the char of the text content is randomly masked and replaced with a learnable char mask token to obtain a sample mask image, the target of the mask content prediction is the word and char in the text content. Therefore, the mask content prediction can be understood as doing MIM at the char level and the word level, that is, predicting and reconstructing the masked char and word. Since the text content before the mask is known, the sample image carries a mask content label.

[0089] In practical applications, when adjusting the model parameters of the initial extraction model based on the sample prediction results and the mask prediction results, the content prediction loss can be calculated according to the sample prediction results and the sample content labels; the mask prediction loss can be calculated according to the mask prediction results and the mask content labels; the model parameters of the initial extraction model can be adjusted according to the content prediction loss and the mask prediction loss to obtain a trained information extraction model. Among them, the method of calculating the mask prediction loss is the same as the method of calculating the content prediction loss mentioned above, and the method of adjusting the model parameters of the initial extraction model according to the content prediction loss and the mask prediction loss is the same as the method of adjusting the model parameters of the initial extraction model according to the content prediction loss mentioned above, and the embodiments of this specification will not be repeated.

[0090] By applying the solution of the embodiment of this specification, during the model parameter adjustment process, if the initial extraction model can reconstruct the char, it means that the initial extraction model knows which chars a specific word is composed of and clearly understands the shape of the char, and the initial extraction model can understand the contextual semantics of the text content and learn basic language knowledge, such as grammar, etc., so it can reconstruct the masked word. The spotting ability and information extraction ability of the initial extraction model can be improved during this stage of training.

[0091] In an optional embodiment of the present specification, the initial extraction model further includes an entity prediction unit, and the entity prediction unit is connected to the encoding unit; after the sample image features are input into the encoding unit to obtain the sample encoding features, the following steps may also be included:

[0092] Inputting the sample encoding features into the entity prediction unit to perform entity prediction and obtain entity prediction results;

[0093] Based on the sample prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model, which may include the following steps:

[0094] Based on the sample prediction results and the entity prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

[0095] It should be noted that the entity prediction results include entity area prediction results, entity content prediction results, and entity block prediction results. The entity prediction results refer to the results obtained by the entity prediction unit predicting the entities in the sample image. The architecture of the entity prediction unit includes but is not limited to the CNN model and the Transformer model, which are selected according to the actual situation, and the embodiments of this specification do not impose any restrictions on this. The entity prediction unit is used to predict the entity area, entity content, and entity block in the text content. The entity area refers to the regional position of the entity in the sample image. The entity area includes at least one entity block, and the text content in the entity block is the entity.

[0096] By applying the solution of the embodiments of this specification, entity recognition of text content in sample images is achieved through the entity prediction unit, so that the information extraction model has entity recognition capability.

[0097] In an optional embodiment of the present specification, the entity prediction unit includes an entity region prediction unit, an entity content prediction unit and an entity block prediction unit, the entity region includes an entity block, the entity block includes an entity content, and the entity region prediction unit, the entity content prediction unit and the entity block prediction unit are respectively connected to the encoding unit; the above-mentioned inputting the sample encoding feature into the entity prediction unit to perform entity prediction and obtain the entity prediction result may include the following steps:

[0098] Inputting the sample coding features into the entity region prediction unit to obtain the entity region prediction result;

[0099] Inputting the sample encoding features into the entity content prediction unit to obtain the entity content prediction result;

[0100] The sample coding feature is input into the entity block prediction unit to obtain the entity block prediction result.

[0101] Specifically, the entity region prediction unit is used to predict the regional position of the entity in the text content of the sample image in the sample image, and the entity region prediction result refers to the result obtained by the entity region prediction unit on the regional position of the entity in the text content of the sample image in the sample image. The entity content prediction unit is used to predict the entity content in the text content of the sample image, and the entity content prediction result refers to the result obtained by the entity content prediction unit on the entity content in the text content of the sample image. The entity block prediction unit is used to predict the regional block (entity block) of the entity in the entity region, and the entity block prediction result refers to the result obtained by the entity block prediction unit on the regional block of the entity in the entity region.

[0102] It should be noted that inputting sample encoding features into the entity region prediction unit can be regarded as a top-down ETD task. The ETD task first starts from the high-level structure of the entire text content, identifies large regions or sections (such as titles, paragraphs, tables, etc.), and then further refines the search for entities in these regions. This method focuses on understanding the overall layout and logical structure of the text content, thereby inferring the location of the entity and ultimately detecting the entity region.

[0103] Furthermore, entity words can be detected through the entity content prediction unit, and entity blocks can be predicted through the entity block prediction unit. Therefore, the process of determining the entity mapping prediction relationship based on the entity content prediction results and the entity block prediction results can be regarded as a bottom-up entity mapping process (WTB, Word-To-Block). In contrast to ETD, WTB starts with the recognition of a single word and gradually combines to form larger structures, such as words, phrases, and even complete entities or information blocks. This method pays more attention to the microstructure and proximity of the text, and infers the overall structure through the aggregation of local features.

[0104] By applying the solution of the embodiment of this specification, ETD is first used to directly detect the entity area, and then WTB is used to realize the mapping from word to entity block, so as to form a closed loop and realize entity grouping, so that the information extraction model has text grouping capability.

[0105] In an optional embodiment of the present specification, the sample image carries a sample content label, a region location label, and an entity relationship label; the above-mentioned adjusting the model parameters of the initial extraction model based on the sample prediction results and the entity prediction results to obtain the trained information extraction model may include the following steps:

[0106] Calculate the content prediction loss based on the sample prediction results and sample content labels;

[0107] Calculate the region prediction loss based on the entity region prediction results and region location labels;

[0108] Determine an entity mapping prediction relationship according to the entity content prediction result and the entity block prediction result;

[0109] Predict relations and entity relation labels based on entity mappings and calculate contrastive learning loss;

[0110] According to the content prediction loss, region prediction loss and contrastive learning loss, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

[0111] Specifically, the entity relationship label is used to describe the association relationship between an entity and the entity block where the entity is located. Since the sample image carries the sample content label and the regional location label, and the sample content includes entities, the sample content label and the regional location label can be parsed through rules to determine the paragraph information in the text content, and further determine the entity block where the entity is located, that is, the entity relationship label. The content prediction loss is used to describe the degree of difference between the sample prediction result and the sample content label; the regional prediction loss is used to describe the degree of difference between the entity region prediction result and the regional location label; the entity mapping prediction relationship refers to the corresponding relationship between the entity content and the entity block; the contrastive learning loss is used to describe the degree of difference between the entity mapping prediction relationship and the entity relationship label.

[0112] It should be noted that the sample encoding features are input into the entity content prediction unit to obtain the entity content prediction result, and the sample encoding features are input into the entity block prediction unit to obtain the entity block prediction result. This realizes the learning of word embedding and entity block embedding through two branches, and supervises by contrasting learning loss to bring the word embedding closer.<entity,words> distance between the two parties and push the rest of the relationships away.

[0113] In actual applications, the method of adjusting the model parameters of the initial extraction model according to the content prediction loss, the region prediction loss and the contrastive learning loss is the same as the above-mentioned method of adjusting the model parameters of the initial extraction model according to the content prediction loss, and will not be repeated in the embodiments of this specification.

[0114] By applying the solution of the embodiment of this specification, the model parameters of the initial extraction model are adjusted according to the content prediction loss, the region prediction loss and the contrastive learning loss to obtain a trained information extraction model. The entity grouping is realized through the top-down ETD and the bottom-up WTB, so that the information extraction model has the text grouping capability.

[0115] In an optional embodiment of the present specification, the initial extraction model further includes a context prediction unit, and the context prediction unit is connected to the encoding unit; after inputting the sample image features into the encoding unit and obtaining the sample encoding features, the following steps may also be included:

[0116] Input the sample encoding features into the context prediction unit for prediction to obtain the context prediction result;

[0117] Based on the sample prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model, which may include the following steps:

[0118] Based on the sample prediction results and the context prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

[0119] It should be noted that the context prediction result refers to the result obtained by the context prediction unit predicting the context semantic relationship and context position relationship of the text content of the sample image. The architecture of the context prediction unit includes but is not limited to the CNN model and the Transformer model, which are selected according to the actual situation, and the embodiments of this specification do not impose any restrictions on this. Since the context semantics and the text space position relationship are extremely important for information extraction, the context prediction unit can be used to predict the context semantic relationship and context position relationship of the text content. The context position relationship is used to describe the reading order of the text content.

[0120] By applying the solution of the embodiments of this specification, semantic and text spatial position relationship prediction is achieved through context prediction results, and the accuracy of entity labeling is improved, so that the information extraction model has better labeling capabilities.

[0121] In an optional embodiment of the present specification, the context prediction unit includes a fusion coding unit, a semantic prediction unit and a position prediction unit, the fusion coding unit is connected to the coding unit, and the semantic prediction unit and the position prediction unit are respectively connected to the fusion coding unit; the above-mentioned inputting the sample coding feature into the context prediction unit for prediction to obtain the context prediction result may include the following steps:

[0122] The sample coding feature, the text coding feature and the position coding feature are fused through a fusion coding unit to obtain a sample fusion feature, wherein the text coding feature is extracted from the sample image based on the position of the text content in the sample image;

[0123] Inputting the sample fusion features into the semantic prediction unit to perform context semantic relationship prediction to obtain a first context prediction result;

[0124] The sample fusion features are input into the position prediction unit to perform context position relationship prediction to obtain a second context prediction result.

[0125] It should be noted that when extracting text encoding features from a sample image based on the position of the text content in the sample image, the center position of the text content in the sample image can be determined, and features of the image content at the center position can be extracted to obtain the text encoding features. The fusion encoding unit can be a multimodal Transformer model.

[0126] In practical applications, in the fusion coding unit, the sample coding features, text coding features, and position coding features are input into the multimodal Transformer for encoding to obtain the representation of each token, that is, the sample fusion features. Next, the MLM task is performed in the semantic prediction unit, that is, the corresponding token is inferred from the masked token to obtain the first context prediction result. Finally, the reading order reasoning (ROR) task is performed in the position prediction unit, that is, the relationship with the remaining lines is identified at the beginning token of each line. If it is the next line, it is 1, otherwise it is 0, so as to identify the reading order and obtain the second context prediction result.

[0127] By applying the solution of the embodiments of this specification, the semantics of text content and spatial position layout information are learned through MLM tasks and ROR tasks, which improves the accuracy of entity labeling, thereby enabling the information extraction model to have better labeling capabilities.

[0128] See also Figure 4 , Figure 4 FIG. 1 shows a processing flow chart of an information extraction model training method provided by an embodiment of the present specification. Figure 5 , Figure 5 FIG. 2 shows a processing flow chart of another information extraction model training method provided by an embodiment of the present specification. Figure 4 and Figure 5 As shown in the figure, the visual information extraction task is divided into three tasks: text detection and recognition, text combination, and entity labeling. Corresponding pre-training tasks are proposed for each task, including:

[0129] Text detection and recognition: obtain an initial extraction model and a sample image; perform mask processing on the text content in the sample image to obtain a sample mask image, and perform image feature extraction on the sample mask image to obtain sample image features; input the sample image features into the encoding unit in the initial extraction model to obtain sample encoding features, and input the sample encoding features into the decoding unit in the initial extraction model to obtain sample prediction results; input the sample encoding features into the mask prediction unit in the initial extraction model to perform mask content prediction to obtain mask prediction results, wherein, when predicting the mask content, predictions can be made for characters and words respectively, therefore, the mask prediction unit can include a word mask prediction unit and a character mask prediction unit, and the text detection and recognition task can include a character mask pixel reconstruction task and a word mask pixel reconstruction task;

[0130] Text combination: input the sample coding features into the entity prediction unit in the initial extraction model to perform entity prediction and obtain entity prediction results; specifically, input the sample coding features into the entity region prediction unit in the entity prediction unit to obtain entity region prediction results; input the sample coding features into the entity content prediction unit in the entity prediction unit to obtain entity content prediction results; input the sample coding features into the entity block prediction unit in the entity prediction unit to obtain entity block prediction results; determine the entity mapping prediction relationship based on the entity content prediction results and the entity block prediction results, so the text combination task can include an entity region detection task and an entity content-entity block mapping task;

[0131] Entity labeling: Input the sample coding features into the context prediction unit in the initial extraction model for prediction to obtain a context prediction result; specifically, the sample coding features, text coding features and position coding features are fused through the fusion coding unit in the context prediction unit to obtain a sample fusion feature; the sample fusion feature is input into the semantic prediction unit in the context prediction unit for context semantic relationship prediction to obtain a first context prediction result; the sample fusion feature is input into the position prediction unit in the context prediction unit for context position relationship prediction to obtain a second context prediction result. Therefore, the entity labeling task may include a context semantic relationship prediction task and a context position relationship prediction task;

[0132] Pre-training: pre-training the initial extraction model according to the sample prediction results, the mask prediction results, the entity region prediction results, the entity content prediction results, the entity block prediction results, the first context prediction results and the second context prediction results to obtain a trained information extraction model;

[0133] Fine-tuning: After pre-training is completed, fine-tune the parameters of the pre-trained information extraction model to obtain an information extraction model that can be directly used for information extraction tasks. In the fine-tuning stage, the encoding unit, decoding unit, entity region prediction unit and category prediction unit are mainly trained. In the category prediction unit, the model is trained using the labeling task to obtain an information extraction model with entity category recognition capabilities.

[0134] By applying the scheme of the embodiments of this specification, the information extraction model can obtain the content and location of the text through the text detection and recognition task; through the entity detection task, the information extraction model can obtain the area of ​​the entity; through the labeling task, the information extraction model can directly classify the entity to obtain the entity category, thereby realizing information extraction. Through the training scheme of the information extraction model, the model is helped to understand the underlying image features, entity features, and semantic features, thereby improving the model accuracy.

[0135] See also Figure 6 , Figure 6 A flowchart of an information extraction method provided by an embodiment of this specification is shown, which specifically includes the following steps:

[0136] Step 602: Obtain a task image of the information extraction task.

[0137] Specifically, the task image can be an image containing text content in different scenes, such as images in financial scenes, images in traffic scenes, images in transaction scenes, etc. Sample images include but are not limited to bill images, certificate images, and table images. Information extraction tasks include but are not limited to text extraction tasks, entity recognition tasks, and entity category recognition tasks. The specific selection is based on the actual situation, and the embodiments of this specification do not make any restrictions on this.

[0138] In practical applications, there are many ways to obtain the task image of the information extraction task, which can be selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the task image of the information extraction task sent by the terminal device can be received. In another possible implementation of this specification, the task image of the information extraction task can be read from other data acquisition devices or databases.

[0139] Step 604: extract image features from the task image to obtain task image features.

[0140] It should be noted that the implementation method of "extracting image features from the task image to obtain task image features" is the same as the implementation method of "extracting image features from the sample mask image to obtain sample image features" mentioned above, and will not be repeated in this specification embodiment.

[0141] Step 606: Input the task image features into the encoding unit in the information extraction model to obtain the task encoding features, and input the task encoding features into the decoding unit in the information extraction model to obtain the text extraction result of the task image, wherein the information extraction model is trained based on the sample image features, the sample image features are obtained based on feature extraction of the sample mask image, and the sample mask image is obtained based on masking the text content in the sample image.

[0142] It should be noted that for the text extraction task, the task image features can be input into the encoding unit in the information extraction model to obtain the task encoding features, and the task encoding features can be input into the decoding unit in the information extraction model to obtain the text extraction result of the task image. The implementation method of "inputting the task image features into the encoding unit in the information extraction model to obtain the task encoding features, and inputting the task encoding features into the decoding unit in the information extraction model to obtain the text extraction result of the task image" is the same as the implementation method of "inputting the sample image features into the encoding unit to obtain the sample encoding features, and inputting the sample encoding features into the decoding unit to obtain the sample prediction results", and the embodiments of this specification will not be repeated.

[0143] In applying the scheme of the embodiments of this specification, since the information extraction model is obtained by adjusting the model parameters of the initial extraction model based on the sample prediction results, the sample prediction results are obtained by decoding the sample coding features by the decoding unit in the initial extraction model, the sample coding features are obtained by encoding the sample image features by the encoding unit in the initial extraction model, the sample image features are obtained by extracting image features from the sample mask image, and the sample mask image is obtained by masking the text content in the sample image, therefore, the information extraction model is a high-precision model, and the information extraction model is used to implement high-precision, end-to-end information extraction task processing, further improving the information extraction efficiency and the accuracy of the text extraction results.

[0144] In an optional embodiment of the present specification, an entity region prediction unit may be connected after the encoding unit to process the entity recognition task, that is, the information extraction model also includes an entity region prediction unit; after the encoding unit that inputs the task image features into the information extraction model and obtains the task coding features, the following steps may also be included:

[0145] The task encoding features are input into the entity region prediction unit to obtain the entity region of the task image and the entity extraction result of the task image.

[0146] It should be noted that in the entity region prediction unit, after obtaining the entity region of the task image based on the task encoding features, the regional position of the entity in the task image can be determined, and further the text content in the regional position can be identified, and the text content is the entity in the sample image.

[0147] By applying the solution of the embodiments of this specification, based on the specific information extraction task (entity recognition task), on the basis of the basic information extraction model including the encoding unit and the decoding unit, an entity region prediction unit can be additionally added, and the entity region prediction unit can be used to perform region prediction to obtain the entity extraction result of the task image, thereby achieving end-to-end high-precision entity recognition.

[0148] In an optional embodiment of the present specification, a category prediction unit may be connected after the entity region prediction unit to process the entity category recognition task, that is, the information extraction model also includes a category prediction unit; after inputting the task coding feature into the entity region prediction unit to obtain the entity region of the task image and the entity extraction result of the task image, the following steps may also be included:

[0149] The entity extraction result is input into the category prediction unit for category prediction to obtain the entity category of the entity extraction result.

[0150] Specifically, the entity category can be understood as the type of the entity, such as the category of the entity "Zhang San" is a name, and the category of the entity "City A" is a place name.

[0151] By applying the scheme of the embodiments of this specification, based on the specific information extraction task (entity category recognition task), on the basis of the basic information extraction model including the encoding unit and the decoding unit, an entity region prediction unit and a category prediction unit can be additionally added, and the entity region prediction unit can be used to perform region prediction to obtain the entity extraction result of the task image, and then the category prediction unit can be used to perform category prediction on the entity extraction result to achieve end-to-end high-precision entity category recognition.

[0152] In an optional embodiment of the present specification, after inputting the task encoding feature into the decoding unit in the information extraction model to obtain the text extraction result of the task image, the following steps may also be included:

[0153] Send the text extraction results to the client;

[0154] Receiving result feedback information sent by the client, wherein the result feedback information is information providing feedback on the text extraction result based on the task information of the information extraction task;

[0155] Based on the feedback information from the results, build a model to optimize the data;

[0156] Use the model to optimize data and adjust the parameters of the information extraction model.

[0157] Specifically, the result feedback information can be information that provides feedback on the content, quality, and completeness of the text extraction results, reflecting the user's true feelings and expectations about the text extraction results. The result feedback information includes but is not limited to result quality evaluation information, corrected accurate text extraction results, and model optimization areas. Model optimization data refers to accurate optimized sample data used to optimize the information extraction model.

[0158] In practical applications, there are many ways to construct model optimization data based on the result feedback information, which are selected according to the actual situation. The embodiments of this specification do not limit this. In one possible implementation of this specification, the model optimization data can be automatically constructed directly based on the result feedback information. In another possible implementation of this specification, optimization prompt information can be generated based on the result feedback information, and the model optimization data sent by the client based on the optimization prompt information can be received.

[0159] It should be noted that, taking the construction of model optimization data directly based on the result feedback information as an example, if the result feedback information is the corrected accurate text extraction result, the model optimization data can be constructed based on the task image of the information extraction task and the corrected accurate text extraction result. If the result feedback information is the optimization field of the model, such as the XXX field, the sample image of the XXX field can be obtained, and the sample image of the XXX field can be determined as the model optimization data. Among them, the process of adjusting the parameters of the information extraction model using the model optimization data is the same as the training process of the information extraction model, and the embodiments of this specification will not be repeated.

[0160] By applying the solution of the embodiments of this specification, the performance of the information extraction model is continuously optimized by collecting and utilizing result feedback information to more accurately meet the actual needs of users and improve the quality and accuracy of the final text extraction results.

[0161] In an optional embodiment of the present specification, the above-mentioned construction of model optimization data according to the result feedback information may include the following steps:

[0162] Generate optimization prompt information according to the result feedback information, wherein the optimization prompt information is used to guide the client to send model optimization data for optimizing the information extraction model;

[0163] The optimization prompt information is sent to the client, and the model optimization data sent by the client based on the optimization prompt information is received.

[0164] It should be noted that there are multiple ways to generate optimization prompt information based on the result feedback information, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any limitation on this.

[0165] In a possible implementation of this specification, the preset prompt information can be directly obtained, and the result feedback information can be added to the preset prompt information to obtain the optimized prompt information, such as the preset prompt information is "I am very sorry for giving you inaccurate information. Please point out where the information is not accurate or provide the correct extraction results of the relevant images. I will correct and optimize my answer as soon as possible to better serve you." If the result feedback information is "the result is inaccurate", the optimized prompt information is "Regarding the inaccurate result you reported, I am very sorry for giving you inaccurate information. Please point out where the information is not accurate or provide the correct extraction results of the relevant images. I will correct and optimize my answer as soon as possible to better serve you."

[0166] In another possible implementation of the present specification, the result feedback information may be type identified to determine the information type of the result feedback information, further match the information type with the prompt type of each prompt information in the prompt information library, and determine the prompt information with the same prompt type as the information type as the optimized prompt information.

[0167] By applying the solution of the embodiments of this specification, model optimization data is obtained through an interactive guidance method, which improves the interactivity with users and further improves user satisfaction.

[0168] In an optional embodiment of the present specification, after inputting the task encoding feature into the decoding unit in the information extraction model to obtain the text extraction result of the task image, the following steps may also be included:

[0169] Annotate the key information in the text extraction results to obtain updated text extraction results;

[0170] Send the updated text extraction results to the client.

[0171] Specifically, key information refers to the content in the text extraction results that helps users understand the main idea of ​​the results, capture the core ideas, and identify important facts or details that are of decisive significance. This information is usually the core component of the text extraction results. The key information in the text extraction results includes but is not limited to keywords, topics, and entities, which are selected according to actual conditions, and the embodiments of this specification do not make any restrictions on this.

[0172] In practical applications, the key information in the text extraction results is annotated, and before obtaining the updated text extraction results, the text extraction results can be identified for key information to determine the key information in the text extraction results. There are many ways to identify key information in the text extraction results, which are selected according to the actual situation, and the embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the text extraction results can be matched with preset key information, and the information that appears in the text extraction results and is the same as the preset key information can be determined as key information. In another possible implementation of this specification, the text extraction results can be input into a key information identification model to obtain key information, wherein the key information identification model is trained based on multiple sample data and key information labels for each sample data.

[0173] It should be noted that when marking the key information in the text extraction results, the key information can be bolded, highlighted, italicized, bordered, etc. The marking method of the key information is selected according to the actual situation, and the embodiments of this specification do not impose any restrictions on this.

[0174] By applying the solution of the embodiment of this specification, key information in the text extraction result is marked to obtain an updated text extraction result; the updated text extraction result is sent to the client so that the user can view the result, thereby improving the user experience.

[0175] In an optional embodiment of the present specification, after inputting the task encoding feature into the decoding unit in the information extraction model to obtain the text extraction result of the task image, the following steps may also be included:

[0176] Send the text extraction results to the client;

[0177] Receiving adjustment information sent by the client, wherein the adjustment information is used to adjust the text extraction result;

[0178] According to the adjustment information, the text extraction result is adjusted to obtain the adjusted text extraction result.

[0179] Specifically, the adjustment information is used to describe the user's adjustment requirements for the text extraction results. The adjustment requirements include but are not limited to the requirements for adding annotations, deleting content, and replacing content. Furthermore, the adjustment requirements can also be the adjustment requirements for key information in the text extraction results.

[0180] It should be noted that there are multiple ways to adjust the text extraction results according to the adjustment information, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, an adjustment template (such as a content replacement template, a content deletion template) corresponding to the adjustment information can be obtained, and the text extraction results can be adjusted based on the adjustment template. In another possible implementation of this specification, a deep learning model (such as a translation model, a classification model) corresponding to the adjustment information can be determined, and the text extraction results can be adjusted using the deep learning model corresponding to the adjustment information.

[0181] By applying the solution of the embodiments of this specification, the text extraction result is adjusted according to the adjustment information sent by the user, which increases the human-computer interactivity and improves the adaptability and flexibility of information extraction.

[0182] See also Figure 7 , Figure 7 A flowchart of an information processing method based on an information extraction model provided by an embodiment of this specification is shown, which specifically includes the following steps:

[0183] Step 702: Receive a task generation request, wherein the task generation request includes request information.

[0184] Specifically, the information processing method based on the information extraction model can be applied to the terminal device or to the model training platform. The task generation request is used to request the task information for generating the information extraction task. The task generation request usually includes the task type, the expected output format, and the request information. For example, when the user selects the "entity recognition" function on the front-end interface of the model training platform and uploads the task image, a task generation request can be constructed, which includes the task image, the task type (i.e., entity recognition), the size of the task image, the storage address, and other information. The request information refers to the parameters or description information related to the information extraction task carried in the task generation request. The request information includes, but is not limited to, the task scenario identifier of the information extraction task, the task model identifier, or the training image of the information extraction task.

[0185] Step 704: Based on the request information, an information extraction model is obtained, wherein the information extraction model is trained based on sample image features, the sample image features are obtained based on feature extraction of a sample mask image, and the sample mask image is obtained based on masking text content in the sample image.

[0186] In actual applications, there are many ways to obtain the information extraction model based on the request information, and the specific selection is made according to the actual situation. The embodiments of this specification do not impose any limitation on this.

[0187] In an optional embodiment of the present specification, the obtaining of the information extraction model based on the request information may include the following steps:

[0188] Based on the task scenario identifier, determine a target scenario template from a plurality of preset scenario templates, and based on the target scenario template, search for an information extraction model from a model library, wherein the model library stores a plurality of deep learning models, and the request information includes a task scenario identifier of the information extraction task; or,

[0189] Based on the task model identifier, the information extraction model is searched from the model library, wherein the request information includes the task model identifier of the information extraction task.

[0190] Specifically, the task scene identifier refers to a unique or specific label used to distinguish different task application scenarios. In the embodiment of this specification, the task scene identifier is part of the request information. Through the task scene identifier, a target scene template matching the request information can be selected from a series of preset scene templates to generate task information. For example, if the task scene identifier is "entity recognition", it means that the user wants to perform entity recognition on the uploaded task image, then the entity recognition scene template can be selected from multiple preset scene templates according to the task scene identifier. The preset scene template is a standard configuration scene template predefined for different visual information extraction task application scenarios, and each template contains information such as model information matching the task application scenario and task processing flow. Through a series of preset scene templates, task generation requests for different scenarios can be quickly responded to. Different preset scene templates correspond to different task types, model information and processing flows. For example, there may be an entity recognition scene template specifically for entity recognition tasks in the preset scene template, which contains model information and processing flow of a trained entity recognition model. The target scene template refers to a scene template that matches the task scene identifier. When parsing the task generation request, the corresponding target scenario template can be located based on the task scenario identifier, and the corresponding information extraction model and other related configuration information can be selected from the model library according to the model information included in the target scenario template. For example, when the task scenario identifier is "entity recognition", the target scenario template is a template containing the model information and related configuration parameters of the entity recognition model. The model library is a resource library that centrally stores deep learning models, which are trained and optimized to solve different information extraction tasks. The deep learning models stored in the model library include but are not limited to information extraction models, intelligent question and answer models, counterfactual processing models, and counterfactual question and answer models. In addition, the deep learning models in the model library can be divided into different versions according to different applicable tasks. For example, there may be multiple versions of information extraction models in the model library, such as entity recognition models, text extraction models, and entity category recognition models. The task model identifier refers to a unique or specific label used to distinguish models applicable to different tasks. For example, the task model identifier can be "entity recognition". Based on the task model identifier, an entity recognition model applicable to the entity recognition task can be found from the model library.

[0191] By applying the solution of the embodiments of this specification, through pre-defined task scenario templates, task model identifiers and model library resources, the process of obtaining the information extraction model is made more flexible, efficient and standardized.

[0192] In another optional embodiment of the present specification, in addition to selecting a pre-trained information extraction model from a model library, the pre-trained information extraction model may be fine-tuned according to the training image in the request information, that is, the request information includes the training image of the information extraction task; the above-mentioned acquisition of the information extraction model based on the request information may include the following steps:

[0193] Based on the training images, the information extraction model corresponding to the information extraction task is trained to obtain an updated information extraction model.

[0194] It should be noted that the implementation method of “training the information extraction model corresponding to the information extraction task based on the training image to obtain an updated information extraction model” is the same as the training method of the above-mentioned “updated information extraction model”, and will not be repeated in this specification embodiment.

[0195] By applying the solution of the embodiments of this specification, the information extraction model corresponding to the information extraction task is trained based on the training images to obtain an updated information extraction model, thereby ensuring the accuracy of the information extraction model and making the model more in line with the task requirements.

[0196] Step 706: Generate task information based on the information extraction model, where the task information is used to perform the information extraction task.

[0197] Specifically, the task information includes the model configuration and processing flow required to perform the information extraction task. The terminal device or other server-side components can correctly use the information extraction model to process the information extraction task based on the task information.

[0198] It should be noted that when generating task information based on the information extraction model, the model parameters of the information extraction model can be directly packaged to obtain the task information. Other model information of the information extraction model can also be obtained to construct task information based on the other model information, where the other model information includes the processing method of the model input data, the specifications of the expected output results, and the intermediate steps and other auxiliary information that may be involved.

[0199] Exemplarily, in an entity recognition task, the task information may include the address information of the selected entity recognition model, the storage location of the input task image, the target path of the output entity extraction result, and other parameters such as the environment configuration required for the operation of the information extraction model. This information enables the entity recognition model to be correctly loaded on the local or remote server and the entity recognition task to be performed.

[0200] By applying the solution of the embodiments of this specification, by generating task information for information extraction tasks, it is possible to reduce system deployment and operation and maintenance costs while ensuring the processing quality and efficiency of information extraction tasks, thereby providing users with convenient and efficient information extraction task processing services.

[0201] See also Figure 8 , Figure 8 A schematic diagram of a model training platform provided by an embodiment of the present specification is shown, the model training platform comprising a request interface unit 802 and a model unit 804;

[0202] The request interface unit 802 is used to receive a model training request, wherein the model training request includes request information;

[0203] The model unit 804 is used to obtain an initial extraction model and a sample image based on the request information, wherein the initial extraction model includes an encoding unit and a decoding unit, the initial extraction model is pre-configured with model parameters, and the encoding unit is connected to the decoding unit; masking is performed on the text content in the sample image to obtain a sample mask image, and image feature extraction is performed on the sample mask image to obtain sample image features; the sample image features are input into the encoding unit to obtain sample encoding features, and the sample encoding features are input into the decoding unit to obtain sample prediction results; based on the sample prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

[0204] Specifically, the model training platform can be deployed on a terminal device or on a cloud device, and the specific settings are based on the actual situation. The embodiments of this specification do not impose any restrictions on this. The model training platform provides large-scale data processing and high-performance computing resources for training, optimizing and deploying various machine learning models, especially deep learning models. On the model training platform, users can upload data, select or customize algorithm models, and efficiently train and verify models through distributed computing capabilities. The model training platform can receive a task generation request from a terminal device, obtain a corresponding information extraction model based on the request information included in the task generation request, and generate task information based on the information extraction model. The model training platform can also quickly respond to the needs of different tasks, call appropriate information extraction models for model training, and ultimately generate an accurate information extraction model.

[0205] It should be noted that the processing method of the model unit is the same as the training method of the above-mentioned information extraction model, and will not be repeated in the embodiments of this specification.

[0206] In an optional embodiment of this specification, the model training platform further includes a model library;

[0207] The model unit is also used to store the trained information extraction model in the model library.

[0208] It should be noted that the model unit obtains the initial extraction model and the sample image based on the request information, and after using the sample image to train the initial extraction model to obtain the trained information extraction model, the trained information extraction model can be stored in the model library, so that the trained information extraction model can be directly obtained from the model library for task processing later, without repeating the model training. Among them, the method of obtaining the trained information extraction model from the model library can refer to the above-mentioned implementation method of "determining the target scene template from multiple preset scene templates based on the task scene identification, and searching the information extraction model from the model library based on the target scene template; or, searching the information extraction model from the model library based on the task model identification", and the embodiments of this specification will not be repeated.

[0209] Corresponding to the above-mentioned information extraction model training method embodiment, this specification also provides an information extraction model training device embodiment, Fig. 9 FIG. 1 is a schematic diagram showing the structure of an information extraction model training device provided by an embodiment of the present specification. Fig. 9 As shown, the device comprises:

[0210] A first acquisition module 902 is configured to acquire an initial extraction model and a sample image, wherein the initial extraction model includes a coding unit and a decoding unit, the initial extraction model is pre-configured with model parameters, and the coding unit is connected to the decoding unit;

[0211] The processing module 904 is configured to perform mask processing on the text content in the sample image to obtain a sample mask image, and perform image feature extraction on the sample mask image to obtain sample image features;

[0212] The first input module 906 is configured to input the sample image feature into the encoding unit to obtain the sample encoding feature, and input the sample encoding feature into the decoding unit to obtain the sample prediction result;

[0213] The adjustment module 908 is configured to adjust the model parameters of the initial extraction model based on the sample prediction results to obtain a trained information extraction model, wherein the information extraction model is used to process the task image features of the task image in the information extraction method to obtain the text extraction results of the task image.

[0214] Optionally, the initial extraction model also includes a mask prediction unit, which is connected to the encoding unit; the device also includes: a third input module, configured to input the sample encoding features into the mask prediction unit for mask content prediction to obtain a mask prediction result; an adjustment module 908, further configured to adjust the model parameters of the initial extraction model based on the sample prediction results and the mask prediction results to obtain a trained information extraction model.

[0215] Optionally, the initial extraction model also includes an entity prediction unit, which is connected to the encoding unit; the device also includes: a fourth input module, configured to input sample encoding features into the entity prediction unit for entity prediction to obtain an entity prediction result; an adjustment module 908, further configured to adjust the model parameters of the initial extraction model based on the sample prediction results and the entity prediction results to obtain a trained information extraction model.

[0216] Optionally, the entity prediction unit includes an entity region prediction unit, an entity content prediction unit and an entity block prediction unit, the entity region includes an entity block, the entity block includes entity content, and the entity region prediction unit, the entity content prediction unit and the entity block prediction unit are respectively connected to the encoding unit; the fourth input module is further configured to input the sample coding feature into the entity region prediction unit to obtain the entity region prediction result; input the sample coding feature into the entity content prediction unit to obtain the entity content prediction result; input the sample coding feature into the entity block prediction unit to obtain the entity block prediction result.

[0217] Optionally, the sample image carries a sample content label, a region location label and an entity relationship label; the adjustment module 908 is further configured to calculate the content prediction loss based on the sample prediction results and the sample content label; calculate the region prediction loss based on the entity region prediction results and the region location label; determine the entity mapping prediction relationship based on the entity content prediction results and the entity block prediction results; calculate the contrastive learning loss based on the entity mapping prediction relationship and the entity relationship label; adjust the model parameters of the initial extraction model based on the content prediction loss, the region prediction loss and the contrastive learning loss to obtain a trained information extraction model.

[0218] Optionally, the initial extraction model also includes a context prediction unit, which is connected to the encoding unit; the device also includes: a fifth input module, configured to input the sample encoding features into the context prediction unit for prediction to obtain a context prediction result; an adjustment module 908, further configured to adjust the model parameters of the initial extraction model based on the sample prediction results and the context prediction results to obtain a trained information extraction model.

[0219] Optionally, the context prediction unit includes a fusion coding unit, a semantic prediction unit and a position prediction unit, the fusion coding unit is connected to the coding unit, and the semantic prediction unit and the position prediction unit are respectively connected to the fusion coding unit; the fifth input module is further configured to fuse the sample coding features, the text coding features and the position coding features through the fusion coding unit to obtain the sample fusion features, wherein the text coding features are extracted from the sample image based on the position of the text content in the sample image; the sample fusion features are input into the semantic prediction unit for context semantic relationship prediction to obtain a first context prediction result; the sample fusion features are input into the position prediction unit for context position relationship prediction to obtain a second context prediction result.

[0220] Optionally, the information extraction model includes an encoding unit, a decoding unit and an entity region prediction unit, and the entity region prediction unit is connected to the encoding unit; the device also includes: a fourth acquisition module, configured to acquire a training image for the information extraction task; masking the text content in the training image to obtain a training mask image, and performing image feature extraction on the training mask image to obtain training image features; inputting the training image features into the encoding unit to obtain training coding features, and inputting the training coding features into the decoding unit to obtain training prediction results; inputting the training coding features into the entity region prediction unit to obtain training entity region prediction results; based on the training prediction results and the training entity region prediction results, adjusting the model parameters of the information extraction model to obtain an updated information extraction model.

[0221] Optionally, the information extraction model also includes a category prediction unit, which is connected to the entity area prediction unit; the device also includes: a sixth input module, configured to input the training entity area prediction result into the category prediction unit for entity category prediction to obtain an entity category prediction result; an adjustment module 908, further configured to adjust the model parameters of the information extraction model based on the training prediction result, the training entity area prediction result and the entity category prediction result to obtain an updated information extraction model.

[0222] By applying the solution of the embodiments of this specification, the text content in the sample image is masked and then the model is trained, so that the model can understand the image features and text context content of the sample image, thereby improving the accuracy of the information extraction model and achieving high-precision information extraction task processing.

[0223] The above is a schematic scheme of an information extraction model training device of this embodiment. It should be noted that the technical scheme of the information extraction model training device and the technical scheme of the above-mentioned information extraction model training method belong to the same concept, and the details not described in detail in the technical scheme of the information extraction model training device can be found in the description of the technical scheme of the above-mentioned information extraction model training method.

[0224] Corresponding to the above-mentioned information extraction method embodiment, this specification also provides an information extraction device embodiment, Fig.10 FIG. 1 shows a schematic diagram of the structure of an information extraction device provided by an embodiment of the present specification. Fig.10 As shown, the device comprises:

[0225] The second acquisition module 1002 is configured to acquire a task image of the information extraction task;

[0226] The extraction module 1004 is configured to extract image features from the task image to obtain task image features;

[0227] The second input module 1006 is configured to input the task image features into the encoding unit in the information extraction model to obtain the task encoding features, and input the task encoding features into the decoding unit in the information extraction model to obtain the text extraction result of the task image, wherein the information extraction model is trained based on the sample image features, the sample image features are obtained based on feature extraction of the sample mask image, and the sample mask image is obtained based on masking the text content in the sample image.

[0228] Optionally, the information extraction model also includes an entity region prediction unit; the device also includes: a sixth input module, configured to input the task coding feature into the entity region prediction unit to obtain the entity region of the task image and the entity extraction result of the task image.

[0229] Optionally, the information extraction model also includes a category prediction unit; the device also includes: a seventh input module, configured to input the entity extraction result into the category prediction unit for category prediction, and obtain the entity category of the entity extraction result.

[0230] Optionally, the device also includes: a first sending module, configured to send the text extraction result to the client; receiving result feedback information sent by the client, wherein the result feedback information is information that provides feedback on the text extraction result based on task information of the information extraction task; constructing model optimization data based on the result feedback information; and using the model optimization data to adjust parameters of the information extraction model.

[0231] Optionally, the first sending module is further configured to generate optimization prompt information based on the result feedback information, wherein the optimization prompt information is used to guide the client to send model optimization data for optimizing the information extraction model; send the optimization prompt information to the client, and receive the model optimization data sent by the client based on the optimization prompt information.

[0232] Optionally, the device further includes: a marking module configured to mark key information in the text extraction result to obtain an updated text extraction result; and send the updated text extraction result to the client.

[0233] Optionally, the device also includes: a second sending module, configured to send the text extraction result to the client; receive adjustment information sent by the client, wherein the adjustment information is used to adjust the text extraction result; adjust the text extraction result according to the adjustment information to obtain an adjusted text extraction result.

[0234] By applying the solution of the embodiments of this specification, since the information extraction model is a high-precision model, high-precision, end-to-end information extraction task processing can be achieved using the information extraction model, further improving the information extraction efficiency and the accuracy of the text extraction results.

[0235] The above is a schematic scheme of an information extraction device of this embodiment. It should be noted that the technical scheme of the information extraction device and the technical scheme of the above information extraction method belong to the same concept, and the details of the technical scheme of the information extraction device that are not described in detail can be found in the description of the technical scheme of the above information extraction method.

[0236] Corresponding to the above-mentioned information processing method embodiment based on the information extraction model, this specification also provides an information processing device embodiment based on the information extraction model. Fig.11 FIG. 1 shows a schematic diagram of the structure of an information processing device based on an information extraction model provided by an embodiment of the present specification. Fig.11 As shown, the device comprises:

[0237] The receiving module 1102 is configured to receive a task generation request, wherein the task generation request includes request information;

[0238] The third acquisition module 1104 is configured to acquire an information extraction model based on the request information, wherein the information extraction model is obtained based on sample image feature training, the sample image feature is obtained based on feature extraction of a sample mask image, and the sample mask image is obtained based on masking text content in the sample image;

[0239] The generating module 1106 is configured to generate task information based on the information extraction model, wherein the task information is used to perform the information extraction task.

[0240] Optionally, the third acquisition module 1104 is further configured to determine a target scene template from multiple preset scene templates based on the task scenario identifier, and search for an information extraction model from a model library based on the target scene template, wherein the model library stores multiple deep learning models, and the request information includes the task scenario identifier of the information extraction task; or, search for an information extraction model from the model library based on the task model identifier, wherein the request information includes the task model identifier of the information extraction task.

[0241] Optionally, the request information includes a training image for the information extraction task; the third acquisition module 1104 is further configured to train the information extraction model corresponding to the information extraction task based on the training image to obtain an updated information extraction model.

[0242] By applying the solution of the embodiments of this specification, by generating task information for information extraction tasks, it is possible to reduce system deployment and operation and maintenance costs while ensuring the processing quality and efficiency of information extraction tasks, thereby providing users with convenient and efficient information extraction task processing services.

[0243] The above is a schematic scheme of an information processing device based on an information extraction model of this embodiment. It should be noted that the technical scheme of the information processing device based on the information extraction model and the technical scheme of the information processing method based on the information extraction model belong to the same concept, and the details not described in detail in the technical scheme of the information processing device based on the information extraction model can be found in the description of the technical scheme of the information processing method based on the information extraction model.

[0244] Fig.12 The block diagram of a computing device provided by an embodiment of the present specification is shown. The components of the computing device 1200 include but are not limited to a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230, and the database 1250 is used to store data.

[0245] The computing device 1200 also includes an access device 1240 that enables the computing device 1200 to communicate via one or more networks 1260. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1240 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0246] In one embodiment of the present specification, the above components of the computing device 1200 and Fig.12 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.12 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0247] The computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1200 may also be a mobile or stationary server.

[0248] Among them, the processor 1220 is used to execute computer programs / instructions, which, when executed by the processor, implement the steps of the above-mentioned information extraction model training method or information extraction method or information processing method based on the information extraction model.

[0249] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the information extraction model training method, information extraction method and information processing method based on the information extraction model belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the information extraction model training method or information extraction method or information processing method based on the information extraction model.

[0250] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned information extraction model training method or information extraction method or information processing method based on the information extraction model.

[0251] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the information extraction model training method, the information extraction method and the information processing method based on the information extraction model belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the information extraction model training method or the information extraction method or the information processing method based on the information extraction model.

[0252] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned information extraction model training method or information extraction method or information processing method based on the information extraction model.

[0253] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the information extraction model training method, information extraction method and information processing method based on the information extraction model belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be found in the description of the technical scheme of the information extraction model training method or information extraction method or information processing method based on the information extraction model.

[0254] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0255] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0256] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0257] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0258] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. An information extraction method, comprising: Obtain a task image for the information extraction task; Performing image feature extraction on the task image to obtain task image features; The task image feature is input into the encoding unit in the information extraction model to obtain the task encoding feature, and the task encoding feature is input into the decoding unit in the information extraction model to obtain the text extraction result of the task image, wherein the information extraction model includes the encoding unit, the entity prediction unit and the decoding unit, and the entity prediction unit includes an entity region prediction unit, an entity content prediction unit and an entity block prediction unit; the information extraction model is obtained by adjusting the model parameters of the initial extraction model based on the sample prediction result and the entity prediction result; the sample prediction result is obtained by inputting the sample encoding feature into the decoding unit, the sample encoding feature is obtained by inputting the sample image feature into the encoding unit, the sample image feature is obtained based on feature extraction of the sample mask image, and the sample mask image is obtained based on masking of the text content in the sample image; the entity prediction result includes an entity region prediction result, an entity content prediction result and an entity block prediction result; the entity region prediction result is obtained by inputting the sample encoding feature into the entity region prediction unit, the entity content prediction result is obtained by inputting the sample encoding feature into the entity content prediction unit, and the entity block prediction result is obtained by inputting the sample encoding feature into the entity block prediction unit.

2. The method according to claim 1, wherein after inputting the task image feature into the encoding unit in the information extraction model to obtain the task encoding feature, the method further comprises: The task coding feature is input into the entity region prediction unit to obtain the entity region of the task image and the entity extraction result of the task image.

3. According to the method of claim 2, the information extraction model further comprises a category prediction unit; After inputting the task coding feature into the entity region prediction unit to obtain the entity region of the task image and the entity extraction result of the task image, the method further includes: The entity extraction result is input into the category prediction unit for category prediction to obtain the entity category of the entity extraction result.

4. The method according to claim 1, after inputting the task encoding feature into the decoding unit in the information extraction model to obtain the text extraction result of the task image, further comprises: Sending the text extraction result to the client; Receiving result feedback information sent by the client, wherein the result feedback information is information providing feedback on the text extraction result based on task information of the information extraction task; According to the result feedback information, a model is constructed to optimize the data; The model optimization data is used to adjust parameters of the information extraction model.

5. The method according to claim 4, wherein constructing a model optimization data according to the result feedback information comprises: Generate optimization prompt information according to the result feedback information, wherein the optimization prompt information is used to guide the client to send model optimization data for optimizing the information extraction model; The optimization prompt information is sent to the client, and the model optimization data sent by the client based on the optimization prompt information is received.

6. The method according to claim 1, after inputting the task encoding feature into the decoding unit in the information extraction model to obtain the text extraction result of the task image, further comprises: Annotating key information in the text extraction result to obtain an updated text extraction result; The updated text extraction result is sent to the client.

7. The method according to any one of claims 1 to 6, after inputting the task encoding feature into the decoding unit in the information extraction model to obtain the text extraction result of the task image, further comprising: Sending the text extraction result to the client; Receiving adjustment information sent by the client, wherein the adjustment information is used to adjust the text extraction result; The text extraction result is adjusted according to the adjustment information to obtain an adjusted text extraction result.

8. A method for training an information extraction model, comprising: Acquire an initial extraction model and a sample image, wherein the initial extraction model includes an encoding unit, an entity prediction unit and a decoding unit, the initial extraction model is pre-configured with model parameters, the entity prediction unit includes an entity region prediction unit, an entity content prediction unit and an entity block prediction unit, the encoding unit is connected to the decoding unit, and the entity prediction unit is connected to the encoding unit; Performing mask processing on the text content in the sample image to obtain a sample mask image, and performing image feature extraction on the sample mask image to obtain sample image features; Inputting the sample image feature into the encoding unit to obtain a sample encoding feature; Inputting the sample coding feature into the entity prediction unit to perform entity prediction and obtain an entity prediction result, including: inputting the sample coding feature into the entity region prediction unit to obtain an entity region prediction result; inputting the sample coding feature into the entity content prediction unit to obtain an entity content prediction result; inputting the sample coding feature into the entity block prediction unit to obtain an entity block prediction result; Inputting the sample encoding feature into the decoding unit to obtain a sample prediction result; Based on the sample prediction results and the entity prediction results, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model, wherein the information extraction model is used to process the task image features of the task image in the information extraction method according to any one of claims 1 to 7 to obtain a text extraction result of the task image.

9. According to the method of claim 8, the physical area includes a physical block, the physical block includes physical content, and the physical area prediction unit, the physical content prediction unit, and the physical block prediction unit are respectively connected to the encoding unit.

10. The method according to claim 9, wherein the sample image carries a sample content label, a region location label, and an entity relationship label; The adjusting the model parameters of the initial extraction model based on the sample prediction result and the entity prediction result to obtain a trained information extraction model includes: Calculating content prediction loss according to the sample prediction result and the sample content label; Calculating a region prediction loss according to the entity region prediction result and the region location label; Determining an entity mapping prediction relationship according to the entity content prediction result and the entity block prediction result; Calculating contrastive learning loss based on the entity mapping predicted relationship and the entity relationship label; According to the content prediction loss, the region prediction loss and the contrastive learning loss, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

11. The method according to claim 8, wherein the initial extraction model further comprises a mask prediction unit, and the mask prediction unit is connected to the encoding unit; After inputting the sample image feature into the encoding unit to obtain the sample encoding feature, the method further includes: Inputting the sample coding feature into the mask prediction unit to perform mask content prediction to obtain a mask prediction result; The adjusting the model parameters of the initial extraction model based on the sample prediction result and the entity prediction result to obtain a trained information extraction model includes: Based on the sample prediction result, the entity prediction result and the mask prediction result, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

12. The method according to claim 8, wherein the initial extraction model further comprises a context prediction unit, and the context prediction unit is connected to the encoding unit; After inputting the sample image feature into the encoding unit to obtain the sample encoding feature, the method further includes: Inputting the sample coding feature into the context prediction unit for prediction to obtain a context prediction result; The adjusting the model parameters of the initial extraction model based on the sample prediction result and the entity prediction result to obtain a trained information extraction model includes: Based on the sample prediction result, the entity prediction result and the context prediction result, the model parameters of the initial extraction model are adjusted to obtain a trained information extraction model.

13. The method according to claim 12, wherein the context prediction unit comprises a fusion coding unit, a semantic prediction unit and a position prediction unit, the fusion coding unit is connected to the coding unit, and the semantic prediction unit and the position prediction unit are respectively connected to the fusion coding unit; The step of inputting the sample coding feature into the context prediction unit for prediction to obtain a context prediction result includes: The sample coding feature, the text coding feature and the position coding feature are fused through the fusion coding unit to obtain a sample fusion feature, wherein the text coding feature is extracted from the sample image based on the position of the text content in the sample image; Inputting the sample fusion feature into the semantic prediction unit to perform context semantic relationship prediction to obtain a first context prediction result; The sample fusion feature is input into the position prediction unit to perform context position relationship prediction to obtain a second context prediction result.

14. The method according to any one of claims 8 to 13, wherein after adjusting the model parameters of the initial extraction model based on the sample prediction result and the entity prediction result to obtain the trained information extraction model, the method further comprises: Obtain training images for the information extraction task; Performing mask processing on the text content in the training image to obtain a training mask image, and performing image feature extraction on the training mask image to obtain training image features; Inputting the training image features into the encoding unit to obtain training encoding features, and inputting the training encoding features into the decoding unit to obtain training prediction results; Inputting the training coding features into the entity region prediction unit to obtain a training entity region prediction result; Based on the training prediction results and the training entity region prediction results, the model parameters of the information extraction model are adjusted to obtain an updated information extraction model.

15. The method according to claim 14, wherein the information extraction model further comprises a category prediction unit, and the category prediction unit is connected to the entity region prediction unit; After inputting the training coding features into the entity region prediction unit to obtain the training entity region prediction result, the method further includes: Inputting the training entity region prediction result into the category prediction unit to perform entity category prediction to obtain an entity category prediction result; The adjusting the model parameters of the information extraction model based on the training prediction result and the training entity region prediction result to obtain an updated information extraction model includes: Based on the training prediction results, the training entity region prediction results and the entity category prediction results, the model parameters of the information extraction model are adjusted to obtain an updated information extraction model.

16. An information processing method based on an information extraction model, comprising: receiving a task generation request, wherein the task generation request includes request information; Based on the request information, an information extraction model is obtained, wherein the information extraction model includes an encoding unit, an entity prediction unit and a decoding unit, and the entity prediction unit includes an entity region prediction unit, an entity content prediction unit and an entity block prediction unit; the information extraction model is obtained by adjusting the model parameters of the initial extraction model based on the sample prediction result and the entity prediction result; the sample prediction result is obtained by inputting the sample coding feature into the decoding unit, the sample coding feature is obtained by inputting the sample image feature into the encoding unit, the sample image feature is obtained based on feature extraction of the sample mask image, and the sample mask image is obtained based on masking of the text content in the sample image; the entity prediction result includes an entity region prediction result, an entity content prediction result and an entity block prediction result; the entity region prediction result is obtained by inputting the sample coding feature into the entity region prediction unit, the entity content prediction result is obtained by inputting the sample coding feature into the entity content prediction unit, and the entity block prediction result is obtained by inputting the sample coding feature into the entity block prediction unit; Based on the information extraction model, task information is generated, wherein the task information is used to perform the information extraction task.

17. The method according to claim 16, wherein obtaining the information extraction model based on the request information comprises: Based on the task scenario identifier, determine a target scenario template from a plurality of preset scenario templates, and based on the target scenario template, search for an information extraction model from a model library, wherein the model library stores a plurality of deep learning models, and the request information includes the task scenario identifier of the information extraction task; or Based on the task model identifier, an information extraction model is searched from the model library, wherein the request information includes the task model identifier of the information extraction task.

18. The method according to claim 16 or 17, wherein the request information includes a training image for the information extraction task; The obtaining of the information extraction model based on the request information includes: Based on the training image, the information extraction model corresponding to the information extraction task is trained to obtain an updated information extraction model.

19. A model training platform, comprising a request interface unit and a model unit; The request interface unit is used to receive a model training request, wherein: The model training request includes request information; The model unit is used to obtain an initial extraction model and a sample image based on the request information, wherein the initial extraction model includes an encoding unit, an entity prediction unit and a decoding unit, the initial extraction model is pre-configured with model parameters, the entity prediction unit includes an entity region prediction unit, an entity content prediction unit and an entity block prediction unit, the encoding unit is connected to the decoding unit, and the entity prediction unit is connected to the encoding unit; masking the text content in the sample image to obtain a sample mask image, and extracting image features from the sample mask image to obtain sample image features; inputting the sample image features into the encoding unit element, obtain sample coding features; input the sample coding features into the entity prediction unit to perform entity prediction and obtain entity prediction results, including: inputting the sample coding features into the entity area prediction unit to obtain entity area prediction results; inputting the sample coding features into the entity content prediction unit to obtain entity content prediction results; inputting the sample coding features into the entity block prediction unit to obtain entity block prediction results; and inputting the sample coding features into the decoding unit to obtain sample prediction results; based on the sample prediction results and the entity prediction results, adjusting the model parameters of the initial extraction model to obtain a trained information extraction model.

20. The model training platform according to claim 19, further comprising a model library; The model unit is also used to store the trained information extraction model in the model library.

21. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 7, any one of claims 8 to 15, or any one of claims 16 to 18 are implemented.

22. A computer-readable storage medium storing a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any one of claims 1 to 7, any one of claims 8 to 15, or any one of claims 16 to 18.

23. A computer program product comprising a computer program / instructions, which when executed by a processor implements the steps of the method described in any one of claims 1 to 7 or any one of claims 8 to 15 or any one of claims 16 to 18.