Information extraction method and device
By processing text detection and recognition tasks in parallel, using the information extraction model to determine word information and position, and generating structured information, the shortcomings of visual information extraction methods in the existing technology are solved, and the information extraction framework is simplified and the processing process is shortened. Enhanced model flexibility and convenience.
Patent Information
- Application Number
- CN202410781843.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Existing visual information extraction methods have problems such as insufficient ability to rely on third-party OCR engines, inability to determine text content and location, long processing procedures, and difficulty in model training.
By processing text detection and text recognition tasks in parallel, the information extraction model is used to determine word information and word position information, and structured information is generated based on this information, simplifying the information extraction framework and avoiding calling a third-party OCR engine.
It achieves the simplification of the information extraction framework and the shortening of the processing process, reduces the difficulty of model training, and enhances the flexibility and convenience of the model.
Smart Images

Figure CN118349700B
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to an information extraction method. Background Art
[0002] Visual information extraction is one of the important capabilities in image processing, involving text detection, text recognition, information extraction, etc. Through visual information extraction algorithms, information can be extracted from scattered, redundant, unstructured images to obtain focused, streamlined structured information.
[0003] There are three types of visual information extraction methods at present: OCR-based, OCR-dependent, and OCR-free. OCR-based unifies text detection, recognition, and extraction into the same framework to achieve information extraction; OCR-dependent extracts OCR information through a third-party OCR engine, and then inputs the information into the language model for information extraction; OCR-free inputs images into the model, and the model directly extracts information without text detection and recognition. These three methods rely on the capabilities of third-party OCR engines, or cannot determine the content and location of the text, or have long processing procedures and are difficult to train models. Therefore, technical personnel are urgently needed to adjust the information extraction plan to enhance the flexibility and convenience of the model. 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 device, 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 this specification, there is provided an information extraction method, comprising:
[0006] Receiving an image to be processed, wherein the image to be processed includes unstructured information;
[0007] The image to be processed is input into an information extraction model to obtain structured information output by the information extraction model, wherein the information extraction model determines word information and word position information in the image to be processed, determines entity information based on the word information and word position information, and generates structured information based on the entity information.
[0008] According to a second aspect of an embodiment of this specification, there is provided an information extraction method, which is applied to a cloud-side device, and includes:
[0009] An image to be processed sent by a receiving end-side device, wherein the image to be processed includes unstructured information;
[0010] Inputting the image to be processed into an information extraction model to obtain structured information output by the information extraction model, wherein the information extraction model determines word information and word position information in the image to be processed, determines entity information according to the word information and word position information, and generates structured information according to the entity information;
[0011] The structured information is sent to the terminal device.
[0012] According to a third aspect of the embodiments of this specification, there is provided an information extraction device, including:
[0013] A receiving module is configured to receive an image to be processed, wherein the image to be processed includes unstructured information;
[0014] The extraction module is configured to input the image to be processed into an information extraction model to obtain structured information output by the information extraction model, wherein the information extraction model determines word information and word position information in the image to be processed, determines entity information based on the word information and word position information, and generates structured information based on the entity information.
[0015] According to a fourth aspect of an embodiment of this specification, a computing device is provided, including:
[0016] Memory and processor;
[0017] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned information extraction method are implemented.
[0018] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the above-mentioned information extraction method are implemented.
[0019] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above-mentioned information extraction method when executed by a processor.
[0020] Through the method provided in this specification, the text detection and text recognition of the image to be processed are combined, and the word information and word position information are obtained by processing at the same time. At the same time, the process of determining the entity information based on the word information and the word position information, and generating structured information based on the entity information, and the process of determining the word information and the word position information from the image to be processed are two branches processed in parallel, and the two branches share the same feature extraction module, so that the entire link is relatively short. The information extraction framework is further streamlined. The processing flow of the information extraction framework is shorter. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of an information extraction method provided by an embodiment of this specification;
[0022] Figure 2 is a schematic diagram of a model structure of an information extraction model provided by an embodiment of this specification;
[0023] Figure 3 is a processing flow chart of an information extraction method provided by an embodiment of this specification;
[0024] Figure 4 It is a structural schematic diagram of an information extraction device provided by an embodiment of this specification;
[0025] Figure 5 is an architecture diagram of an information extraction system provided by an embodiment of this specification;
[0026] Figure 6 It is a flow chart of an information extraction method applied to a cloud-side device provided by an embodiment of this specification;
[0027] Figure 7 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0028] 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.
[0029] 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.
[0030] 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".
[0031] 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 this manual 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 regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0032] First, the terms involved in one or more embodiments of this specification are explained.
[0033] OCR: Optical Character Recognition, refers to the process in which an electronic device examines the characters printed on an image, determines their shape by detecting dark and light patterns, and then uses character recognition methods to translate the shape into computer text.
[0034] OCR-based: Unify text detection, recognition, and extraction into the same framework to achieve information extraction.
[0035] OCR-dependent: OCR information is extracted through a third-party OCR engine, including text location and content, and input into the language model for extraction.
[0036] OCR-free: Only images are input, and the model directly extracts content without text detection and recognition.
[0037] Visual information extraction is one of the important capabilities in image processing, which involves text detection, text recognition, information extraction and other capabilities. Through visual information extraction algorithms, information can be extracted from scattered, redundant and unstructured images to obtain focused and concise structured information.
[0038] The current visual information extraction algorithms include the above-mentioned OCR-based, OCR-dependent, and OCR-free. Among them, the OCR-dependent solution only considers the final field classification link, which greatly simplifies the information extraction, is not conducive to information extraction, and will be affected by the effect of the third-party OCR engine; for visual information extraction in industrial scenarios, it is necessary to output text content and location, so the OCR-free solution is not suitable for industrial scenarios; there are fewer OCR-based solutions, most of which train machine learning models for text detection, recognition, and extraction separately, and then connect the modules in series, resulting in a longer process and greater training difficulty.
[0039] Based on this, in this specification, an information extraction method is provided. This specification also involves an information extraction device, 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.
[0040] See also Figure 1 , Figure 1 A flow chart of an information extraction method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0041] Step 102: receiving an image to be processed, wherein the image to be processed includes unstructured information.
[0042] The image to be processed can be understood as an image from which information extraction is required, and the image to be processed includes unstructured information, and the unstructured information can be understood as the information contained in the image to be processed is unstructured. The unstructured information can be understood as the information included in the image to be processed is not in a preset structural format. The method provided in this specification requires extracting the information from the image to be processed and storing it in a structured manner, and structured storage refers to storing the information in a preset format.
[0043] In practical applications, the image to be processed may be various types of bill images, photos, etc. The image to be processed includes text information, and the text information in the image to be processed is extracted by OCR recognition and stored in a structured manner.
[0044] Step 104: Input the image to be processed into the information extraction model to obtain structured information output by the information extraction model, wherein the information extraction model determines word information and word position information in the image to be processed, determines entity information based on the word information and word position information, and generates structured information based on the entity information.
[0045] In the method provided in this specification, the information extraction model specifically refers to a machine learning model used to process images, identify and extract information in images. The information extraction model is used to perform visual information extraction tasks for images. In the method provided in the embodiment of this specification, the information extraction model divides the visual information extraction task into three subtasks, namely, word localization task, entity grouping task and entity classification task.
[0046] Specifically, the information extraction model first processes the image to be processed to determine the word information and word position information in the image to be processed. Then, the entity information is grouped according to the word information and word position information to determine the entity information. The entity information can be understood as the acquired entity content information. After the entity information is identified and classified, the category of the entity information is obtained, and finally, the structured information is output according to the entity information and the entity information category. The structured information can be understood as the extracted entity information and entity information category being stored in a preset format.
[0047] In a specific implementation provided in this specification, the information extraction model includes a word location unit, an entity grouping unit, and an entity classification unit;
[0048] Inputting the image to be processed into an information extraction model to obtain structured information output by the information extraction model includes:
[0049] S1042: Input the image to be processed into the word positioning unit to obtain at least one word information and word position information corresponding to each word information.
[0050] Based on the above three subtasks, the information extraction model includes three units, namely, word location unit, entity grouping unit and entity classification unit. Among them, the word location unit is used to perform word location task (word spotting). The word location unit can identify, detect and locate the text in the image at word granularity, and obtain the word information of the word granularity of the text in the image to be processed and the word position information corresponding to each word information.
[0051] Word granularity refers to term granularity. A word is a language unit in natural language. For example, for a sentence "The weather is very good today", it can be divided into "today", "weather", "very", and "good" according to word granularity.
[0052] The word information set is information obtained after being divided according to the word granularity. The word position information specifically refers to the position information of each word information. In the method provided in the embodiment of this specification, the word position information can be understood as the position information of each word information in the image to be processed.
[0053] The word localization task is performed in the word localization unit, specifically, the text in the image to be processed is detected and recognized. In the current task, only the text content at the word granularity can be recognized, but the meaning of the word cannot be known.
[0054] In a specific implementation provided in this specification, the word location unit includes a feature extraction module and a location module;
[0055] Inputting the image to be processed into the word positioning unit to obtain at least one word information and word position information corresponding to each word information includes:
[0056] Inputting the image to be processed into the feature extraction module to obtain multi-scale feature information corresponding to the image to be processed;
[0057] The multi-scale feature information is input into the positioning module to obtain at least one word information output by the positioning module and word position information corresponding to each word information.
[0058] In this embodiment, the word positioning unit includes a feature extraction module and a positioning module, wherein the feature extraction module is used to extract image features of the image to be processed, and the positioning module is used to recognize and locate the text in the image to be processed according to the image features.
[0059] Specifically, the image to be processed is input into the feature extraction module, and the feature extraction module processes the image to be processed to obtain multi-scale feature information corresponding to the image to be processed. The feature extraction module can be understood as at least one convolution layer, and each convolution layer performs convolution processing on the image to be processed to obtain multi-scale feature information corresponding to the image to be processed.
[0060] The multi-scale feature information is input into the positioning module, and decoding processing is performed in the positioning module according to the multi-scale feature information to identify word information in the image to be processed and word position information corresponding to each word information.
[0061] In the method provided in this specification, the two tasks of text detection and text recognition in the image to be processed are completed in the word positioning unit, that is, it can detect whether there is text in the image to be processed, and can recognize the detected text, realizing the unification of text detection and text recognition. In the word positioning unit, the same feature extraction module can be used to process the two tasks of text detection and text recognition, avoiding the need to train the text detection module and the text recognition module separately, shortening the model size of the information extraction model, and shortening the processing link of the model.
[0062] S1044. Input the image to be processed, at least one word information and word position information corresponding to each word information into an entity grouping unit to obtain at least one entity detection box and entity information corresponding to each entity detection box.
[0063] After obtaining at least one word information and the word position information corresponding to each word information, the entity grouping task (wordgrouping) can be further performed based on the at least one word information and the word position information corresponding to each word information and the image to be processed. The entity grouping task is used to group the detected word information into entities. It should be noted that in this embodiment, the focus is on grouping the entities of each word information according to the visual information of the image to be processed. Grouping according to visual information can be understood as visually grouping the content of the same row, the content of adjacent columns, etc.
[0064] The entity grouping unit performs the entity grouping task to obtain at least one entity detection frame and entity information corresponding to each entity detection frame. The entity detection frame can be understood as a detection frame that marks the entity.
[0065] In a specific implementation provided in this specification, the entity grouping unit includes a character encoding module, a visual feature fusion module and an entity grouping module;
[0066] Inputting the image to be processed, at least one word information and word position information corresponding to each word information into an entity grouping unit, and obtaining at least one entity detection frame and entity information corresponding to each entity detection frame, including:
[0067] Generate a grid positioning image to be processed according to the image to be processed, at least one word information and word position information corresponding to each word information;
[0068] Inputting the grid positioning image to be processed into the character encoding module to obtain character encoding features;
[0069] Inputting the character encoding feature and the multi-scale feature information into the visual feature fusion module to obtain image fusion feature information;
[0070] The image fusion feature information is input into an entity grouping module to obtain at least one entity detection frame output by the entity grouping module and entity information corresponding to each entity detection frame.
[0071] Among them, the entity grouping unit specifically includes a character encoding module, a visual feature fusion module and an entity grouping module. Among them, the character encoding module is used to encode the word information at character granularity (char granularity), and the visual feature fusion module extracts the image fusion feature information according to the position of the word information. Finally, the entity detection box and the entity information corresponding to each entity detection box are obtained according to the image fusion feature information.
[0072] Specifically, in the process of performing the entity grouping task, the method provided in the embodiment of this specification is implemented using a target detection algorithm. In practical applications, if you want to identify the entity boundary, in addition to the layout information in the picture, you also need to know the text semantics in order to more accurately obtain the entity boundary. Therefore, in the method provided in this specification, a grid positioning image to be processed (Chargrid) is introduced. The grid positioning image to be processed can be understood as an image marked with each character identification information corresponding to the word information.
[0073] Specifically, a grid positioning map to be processed is generated according to the image to be processed, at least one word information and the word position information corresponding to each word information, and the grid positioning map to be processed is presented in character granularity (char). The grid positioning map to be processed is generated according to the image to be processed, at least one word information and the word position information corresponding to each word information, including:
[0074] Generate an empty image to be processed according to the image to be processed;
[0075] Determine character identification information corresponding to each word information according to at least one word information;
[0076] According to the word position information corresponding to each word information, the character identification information corresponding to each word information is added to the to-be-processed empty image to generate a to-be-processed grid positioning image.
[0077] In practical applications, an empty image to be processed is created according to the size of the image to be processed. The empty image to be processed is an image with blank information, and the image size of the empty image to be processed is the same as the image size of the image to be processed. The character identification information corresponding to each word information is determined according to each word information. The character identification information is specifically the ID information corresponding to each word. For example, "The weather is good today" includes three words "today", "weather", and "good", among which "today" includes two characters "today" and "day", and the two characters correspond to two character identification information respectively; "weather" includes two characters "day" and "air", and the two characters correspond to two character identification information respectively. It should be noted that the day of "today" and the day of "weather" correspond to the same character identification information.
[0078] In a specific embodiment provided in this specification,
[0079] Determining character identification information corresponding to each word information according to at least one word information includes:
[0080] Determine at least one character information corresponding to the target word information, wherein the target word information is any one of the at least one word information;
[0081] Determine the character identifier corresponding to each character information according to the preset character comparison table;
[0082] Each character identifier is mapped to three-channel feature information to generate character identifier information corresponding to each character identifier.
[0083] In actual applications, a character and character ID comparison table is maintained, and the corresponding character ID can be uniquely determined according to each character in the word information. In the process of determining the character identification information corresponding to each word information, a target word information can be determined first, and at least one character information corresponding to the target word information can be determined at the same time. The target word information is any one of the word information.
[0084] According to the preset character comparison table, the character identifier corresponding to each character information can be queried and determined. In the method provided in this specification, in order to facilitate subsequent visual grouping, each character identifier is mapped to three-channel feature information, and the three-channel feature information corresponding to each character identifier is the character identifier information.
[0085] Each character identifier is mapped to three-channel feature information. The purpose is to convert the input integer sequence into a dense vector representation. For example, this can be achieved through the nn.embedding() function. Specifically, the character identifier information corresponding to id1 can be represented by nn.embedding(id1, 3), where di1 is the character ID and 3 represents the dimension of embedding.
[0086] After determining the character identification information corresponding to each word information, the character identification information corresponding to each word information is added to the above-mentioned empty image to be processed according to the word position information corresponding to each word information, so as to generate a grid positioning image to be processed.
[0087] After the grid positioning image to be processed is determined, the grid positioning image to be processed is input into a character encoding module for encoding to obtain a character encoding feature corresponding to the grid positioning image to be processed.
[0088] The character encoding features and multi-scale feature information are input into the visual feature fusion module for feature fusion processing. The layout information in the image can be obtained according to the multi-scale feature information, and the text semantic information can be obtained according to the character encoding features, so as to obtain the entity boundary more accurately, thereby determining at least one entity detection box and the entity information corresponding to each entity detection box.
[0089] In a specific implementation provided in this specification, the visual feature fusion module includes a pyramid pooling layer and a visual feature fusion layer;
[0090] Inputting the character encoding feature and the multi-scale feature information into the visual feature fusion module to obtain image fusion feature information includes:
[0091] Inputting the multi-scale feature information into the pyramid pooling layer to obtain pooling feature information;
[0092] The pooled feature information and the character encoding feature are input into the visual feature fusion layer to obtain image fusion feature information.
[0093] In this embodiment, the visual feature fusion module includes a pyramid pooling layer and a visual feature fusion layer. The multi-scale feature information generated in the previous task is input into the pyramid pooling layer for feature pooling, and feature information of different scales in the multi-scale feature information can be obtained, and pooled feature information of the image to be processed can be obtained according to different size fields of view.
[0094] The pooled feature information and character encoding feature information are input into the visual feature fusion layer for fusion to obtain image fusion feature information.
[0095] After the image fusion feature information is obtained, the image fusion feature information is input into the entity grouping module for processing to obtain at least one entity detection frame output by the entity grouping module and entity information corresponding to the entity detection frame.
[0096] In the entity grouping task provided in this embodiment, the visual feature information in the image is referenced and the text semantic information in the image is integrated to facilitate accurate determination of the boundary of the entity, thereby generating an entity detection frame. After the entity detection frame is determined, the entity information corresponding to the entity detection can be determined based on the entity detection frame.
[0097] S1046: Input each entity detection frame and each entity information into an entity classification unit to obtain entity category information corresponding to each entity information.
[0098] The entity classification unit is used to perform entity classification tasks (entity labeling). The entity classification unit labels each entity information and classifies each entity information, thereby obtaining the entity attributes of each entity. In the method provided in this specification, each entity information can be classified to determine whether each entity information is a key or a value. When the entity information is a value, the specific category of the entity information can be further determined, such as a person's name, a place name, etc.
[0099] In a specific implementation provided in this specification, each entity detection frame and each entity information is input into an entity classification unit to obtain entity category information corresponding to each entity information, including:
[0100] The grid positioning image to be processed, each entity detection frame and each entity information are input into the entity classification unit to obtain the entity category information corresponding to each entity information.
[0101] In the method provided in the embodiment of this specification, in addition to inputting the entity detection frame and entity information into the entity classification unit, the grid positioning image to be processed also needs to be input into the entity classification unit. The visual information of the word granularity in the grid positioning image to be processed assists the encoding.
[0102] Furthermore, the entity classification unit includes a word granularity feature extraction module, a semantic encoding module and a semantic classifier;
[0103] Inputting the grid positioning image to be processed, each entity detection frame and each entity information into the entity classification unit to obtain entity category information corresponding to each entity information, including:
[0104] Inputting the to-be-processed grid positioning image into the word granularity feature extraction module to obtain the word granularity feature information output by the word granularity feature extraction module;
[0105] Inputting the word granularity feature information into the semantic encoding module to obtain word granularity semantic feature information;
[0106] The word granularity semantic feature information, each entity detection box and each entity information are input into the semantic classifier to obtain the entity category information corresponding to each entity information.
[0107] In this embodiment, the entity classification unit includes a word granularity feature extraction module, a semantic encoding module and a semantic classifier, wherein the word granularity feature extraction module is used to perform word granularity feature extraction on the processed grid positioning image, and the semantic encoding module is used to perform semantic encoding on the features extracted by the word granularity feature extraction module to obtain the encoded feature information of the word granularity, and then input the encoded features into the semantic classifier to obtain the entity classification information corresponding to each entity information.
[0108] Specifically, in the word granularity feature extraction module, the feature points of each word information are determined in the grid positioning image to be processed, and the three-dimensional feature values of the word information are converted into two-dimensional feature values of the corresponding feature points. Specifically, the three-dimensional feature values (length, width, channel) of the word information of word granularity can be converted into two-dimensional features of the feature points through the words as point semantic model, that is, the word granularity feature information is obtained.
[0109] For example, the three-dimensional feature of word granularity is H*W*C, where H represents the height of the word granularity, W represents the width of the word granularity, and C represents the number of channels of the word granularity. Through the words as point model, H and W of the word granularity are converted to 1, that is, the feature points corresponding to the word information, and the two-dimensional features of the feature points corresponding to the word information are obtained. When the grid positioning image to be processed includes N words, N 1*C word granularity feature information can be obtained.
[0110] After obtaining the word granularity feature information, the position code of the word information is concatenated and input into the semantic encoding module for processing to obtain the word granularity semantic feature information output by the semantic encoding module.
[0111] The word-granularity semantic feature information, entity detection box and entity information are then input into the semantic classifier. The semantic classifier performs semantic classification based on the entity detection box, the entity information corresponding to the entity detection box and the word-granularity semantic feature information to obtain the entity category information corresponding to the entity information.
[0112] Specifically, the entity category information includes whether the entity information is a key (kye) or a value (value). If the entity information is a value, it can be further determined what category the entity information is. For example, if a certain entity information is a value, its corresponding category is a name; if another entity information is a value, its corresponding category is an address, and so on.
[0113] S1048. Determine structured information according to each piece of entity information and entity category information corresponding to each piece of entity information.
[0114] After each entity information and the entity category information corresponding to each entity information are determined, corresponding structured storage can be performed according to the corresponding relationship between the entity information and the entity category information to generate structured information.
[0115] In a specific implementation provided in this specification, the structured information is determined according to each entity information and the entity category information corresponding to each entity information, including:
[0116] Determine target entity information and target entity category information corresponding to the target entity information;
[0117] The target entity information and the target entity category information are correspondingly added to the structured information.
[0118] In practical applications, the target entity information and the target entity category information corresponding to the target entity information may be determined, the target entity information and the target entity category information may be correspondingly saved, and added to the structured information.
[0119] In another specific implementation manner provided in this specification, the information extraction model is trained and generated by the following steps:
[0120] Acquire a sample image and sample word information, sample word position information, and sample structure information corresponding to the sample image;
[0121] Inputting the sample image into an information extraction model to obtain predicted structural information, predicted word information and predicted word position information output by the information extraction model;
[0122] Calculating a model loss value according to the sample word information, the sample word position information, the sample structure information and the predicted structure information, the predicted word information, and the predicted word position information;
[0123] The model parameters of the information extraction model are adjusted according to the model loss value, and the information extraction model is continued to be trained until the model training stop condition is reached.
[0124] In a specific implementation provided in this specification, the information extraction model is trained by supervised training, which includes sample images and sample word information, sample word position information, and sample structural information corresponding to the sample images. In the training method provided in the embodiment of this specification, the training sample pairs are used, the sample images are sample data, and the sample word information, sample word position information, and sample structural information are sample labels.
[0125] After obtaining the sample image, the sample image is input into the information extraction model. At this time, the information extraction model is an untrained information extraction model. In the information extraction model, corresponding predicted structured information, predicted word information and predicted word position information are generated according to each sample image. The data processing process of the sample image in the untrained information extraction model is the same as the data processing process in the above embodiment. Regarding the data processing process of the sample image in the untrained information extraction model, refer to the data processing process of the above information extraction model, which will not be repeated here.
[0126] After obtaining the predicted structured information, predicted word information and predicted word position information, the model loss value can be calculated based on the predicted results and sample labels. That is, the model loss value is calculated based on the sample word information, sample word position information, sample structured information and predicted structured information, predicted word information, and predicted word position information. In the method provided in this specification, there are many methods for calculating the model loss value, such as the cross entropy loss function, the maximum loss function, the average loss function, etc. In this specification, the specific method of the loss function is not limited, and it shall be subject to the actual application.
[0127] In one or more specific implementations provided in this specification, calculating the model loss value according to the sample word information, the sample word position information, the sample structure information and the predicted structure information, the predicted word information, and the predicted word position information includes:
[0128] Calculate a first loss value according to the sample word information, the sample word position information, the predicted word information, and the predicted word position information;
[0129] Calculating a second loss value according to the sample structured information and the predicted structured information;
[0130] A model loss value is calculated based on the first loss value and the second loss value.
[0131] Specifically, a first loss value is calculated based on sample word information and predicted word information, sample word position information and predicted word position information, a second loss value is calculated based on sample structured information and predicted structured information, and finally a final model loss value is determined based on the first loss value and the second loss value. The first loss value and the second loss value are loss values calculated by comparing different predicted information and sample information during model training, which facilitates targeted parameter adjustment of the model in the subsequent process.
[0132] The information extraction method provided by the embodiments of the present specification includes receiving an image to be processed, wherein the image to be processed includes unstructured information; inputting the image to be processed into an information extraction model to obtain structured information output by the information extraction model, wherein the information extraction model determines word information and word position information in the image to be processed, determines entity information based on the word information and word position information, and generates structured information based on the entity information.
[0133] Through the method provided in this specification, the text detection and text recognition of the image to be processed are combined, and the word information and word position information are obtained by processing at the same time. At the same time, the process of determining the entity information based on the word information and the word position information, and generating structured information based on the entity information, and the process of determining the word information and the word position information from the image to be processed are two branches processed in parallel, and the two branches share the same feature extraction module, so that the entire link is relatively short. The information extraction framework is further streamlined. The processing flow of the information extraction framework is shorter.
[0134] In addition, through the multi-level representation of character granularity, word granularity, and entity granularity, tasks of different granularities are unified into the same information extraction framework, making the information extraction framework simpler and lighter.
[0135] See also Figure 2 , Figure 2 A schematic diagram of the model structure of an information extraction model provided in an embodiment of this specification is shown. Figure 2 As shown, the information extraction model includes a word location unit, an entity grouping unit and an entity classification unit.
[0136] Among them, the word location unit is used to perform word location tasks, the entity grouping unit is used to perform entity grouping tasks, and the entity classification unit is used to perform entity classification tasks. In the information extraction model, the word location unit is the first branch, the entity grouping unit and the entity classification unit are the second branch, and the first branch and the second branch are two parallel branches. In the model training stage, the two branches can be trained separately using labels, which shortens the model training link and reduces the difficulty of model training.
[0137] The word localization unit includes a feature extraction module and a localization module. The feature extraction module is used to extract multi-scale feature information of the image to be processed. The multi-scale feature information is input into the localization module to determine the word information in the image to be processed and the word position information corresponding to the word information. In the word localization unit, text detection and text recognition are combined into a word localization task. The multi-scale feature information in the word localization unit is also input into the entity grouping unit for feature fusion, so that the feature information in the first branch can be used in the second branch, reducing the steps of extracting feature information in the second branch and shortening the model volume of the information extraction model.
[0138] The entity grouping unit includes a character encoding module, a visual feature fusion module and an entity grouping module. The grid positioning image to be processed is generated by the image to be processed, the word information and the word position information, and the grid positioning image to be processed is input into the character encoding module for processing to obtain the character encoding feature. The character encoding feature and the multi-scale feature are input into the visual feature fusion module for feature fusion to obtain the image fusion feature information. The image fusion feature information is input into the entity grouping module for entity grouping to obtain the entity detection box and the entity information corresponding to the entity detection box.
[0139] The entity classification unit includes a word granularity feature extraction module, a semantic encoding module and a semantic classification module. The word granularity feature extraction module is used to extract word granularity feature information in the grid positioning image to be processed. After the word granularity feature information is spliced with the position code, it is input into the semantic encoding module to obtain word granularity semantic feature information. The word granularity semantic feature information is input into the semantic classifier for classification to obtain the entity category information corresponding to each entity information.
[0140] Finally, according to the entity information and entity category information, the structured information corresponding to the image to be processed is further generated.
[0141] Through the method provided in this specification, the text detection and text recognition of the image to be processed are combined, and the word information and word position information are obtained by processing at the same time. At the same time, the process of determining the entity information based on the word information and the word position information, and generating structured information based on the entity information, and the process of determining the word information and the word position information from the image to be processed are two branches processed in parallel, and the two branches share the same feature extraction module, so that the entire link is relatively short. The information extraction framework is further streamlined. The processing flow of the information extraction framework is shorter.
[0142] In addition, the information extraction model used in the method provided in the embodiments of this specification does not need to call a third-party OCR engine.
[0143] Through multi-level representation of character granularity, word granularity, and entity granularity, tasks of different granularities are unified into the same information extraction framework, making the information extraction framework simpler and lighter.
[0144] The following combination Figure 3 , taking the application of the information extraction method provided in this specification to bill images as an example, the information extraction method is further explained. Figure 3 A processing flow chart of an information extraction method provided by an embodiment of the present specification is shown, which specifically includes the following steps.
[0145] Step 302: Acquire a bill image to be processed, wherein the bill image to be processed includes unstructured information.
[0146] Step 304: Input the bill image to be processed into the information extraction model to obtain the bill structured information output by the information extraction model, wherein the information extraction model determines the word information and word position information in the bill image to be processed, determines the entity information based on the word information and word position information, and generates the bill structured information based on the entity information.
[0147] Optionally, the information extraction model includes a word location unit, an entity grouping unit and an entity classification unit;
[0148] Inputting the to-be-processed bill image into the information extraction model to obtain the bill structured information output by the information extraction model, including:
[0149] Inputting the to-be-processed bill image into the word positioning unit to obtain at least one word information and word position information corresponding to each word information;
[0150] Inputting the to-be-processed bill image, at least one word information and word position information corresponding to each word information into an entity grouping unit, and obtaining at least one entity detection frame and entity information corresponding to each entity detection frame;
[0151] Input each entity detection frame and each entity information into the entity classification unit to obtain the entity category information corresponding to each entity information;
[0152] The bill structured information is determined according to each entity information and the entity category information corresponding to each entity information.
[0153] Optionally, the word positioning unit includes a feature extraction module and a positioning module;
[0154] Inputting the to-be-processed bill image into the word positioning unit to obtain at least one word information and word position information corresponding to each word information includes:
[0155] Inputting the to-be-processed bill image into the feature extraction module to obtain multi-scale feature information corresponding to the to-be-processed bill image;
[0156] The multi-scale feature information is input into the positioning module to obtain at least one word information output by the positioning module and word position information corresponding to each word information.
[0157] Optionally, the entity grouping unit includes a character encoding module, a visual feature fusion module and an entity grouping module;
[0158] Inputting the to-be-processed bill image, at least one word information and word position information corresponding to each word information into an entity grouping unit, and obtaining at least one entity detection frame and entity information corresponding to each entity detection frame, including:
[0159] Generate a grid positioning image to be processed according to the bill image to be processed, at least one word information and word position information corresponding to each word information;
[0160] Inputting the grid positioning image to be processed into the character encoding module to obtain character encoding features;
[0161] Inputting the character encoding feature and the multi-scale feature information into the visual feature fusion module to obtain image fusion feature information;
[0162] The image fusion feature information is input into an entity grouping module to obtain at least one entity detection frame output by the entity grouping module and entity information corresponding to each entity detection frame.
[0163] Optionally, generating a grid positioning image to be processed according to the bill image to be processed, at least one word information and word position information corresponding to each word information includes:
[0164] Generate a blank image to be processed according to the bill image to be processed;
[0165] Determine character identification information corresponding to each word information according to at least one word information;
[0166] According to the word position information corresponding to each word information, the character identification information corresponding to each word information is added to the to-be-processed empty image to generate a to-be-processed grid positioning image.
[0167] Optionally, determining character identification information corresponding to each word information according to at least one word information includes:
[0168] Determine at least one character information corresponding to the target word information, wherein the target word information is any one of the at least one word information;
[0169] Determine the character identifier corresponding to each character information according to the preset character comparison table;
[0170] Each character identifier is mapped to three-channel feature information to generate character identifier information corresponding to each character identifier.
[0171] Optionally, the visual feature fusion module includes a pyramid pooling layer and a visual feature fusion layer;
[0172] Inputting the character encoding feature and the multi-scale feature information into the visual feature fusion module to obtain image fusion feature information includes:
[0173] Inputting the multi-scale feature information into the pyramid pooling layer to obtain pooling feature information;
[0174] The pooled feature information and the character encoding feature are input into the visual feature fusion layer to obtain image fusion feature information.
[0175] Optionally, each entity detection box and each entity information is input into an entity classification unit to obtain entity category information corresponding to each entity information, including:
[0176] The grid positioning image to be processed, each entity detection frame and each entity information are input into the entity classification unit to obtain the entity category information corresponding to each entity information.
[0177] Optionally, the entity classification unit includes a word granularity feature extraction module, a semantic encoding module and a semantic classifier;
[0178] Inputting the grid positioning image to be processed, each entity detection frame and each entity information into the entity classification unit to obtain entity category information corresponding to each entity information, including:
[0179] Inputting the to-be-processed grid positioning image into the word granularity feature extraction module to obtain the word granularity feature information output by the word granularity feature extraction module;
[0180] Inputting the word granularity feature information into the semantic encoding module to obtain word granularity semantic feature information;
[0181] The word granularity semantic feature information, each entity detection box and each entity information are input into the semantic classifier to obtain the entity category information corresponding to each entity information.
[0182] Optionally, the bill structured information is determined according to each entity information and entity category information corresponding to each entity information, including:
[0183] Determine target entity information and target entity category information corresponding to the target entity information;
[0184] The target entity information and the target entity category information are correspondingly added to the bill structured information.
[0185] Through the method provided in this specification, the text detection and text recognition of the bill image to be processed are combined, and the word information and word position information are processed at the same time. At the same time, the process of determining entity information based on the word information and word position information, and generating structured information based on the entity information, and the process of determining the word information and word position information from the image to be processed are two branches processed in parallel. The two branches share the same feature extraction module, making the entire link relatively short. The information extraction framework is further streamlined. The processing flow of the information extraction framework is shorter.
[0186] Corresponding to the above method embodiment, this specification also provides an information extraction device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of an information extraction device provided by an embodiment of the present specification. Figure 4 As shown, the device comprises:
[0187] The receiving module 402 is configured to receive an image to be processed, wherein the image to be processed includes unstructured information;
[0188] The extraction module 404 is configured to input the image to be processed into an information extraction model to obtain structured information output by the information extraction model, wherein the information extraction model determines word information and word position information in the image to be processed, determines entity information based on the word information and word position information, and generates structured information based on the entity information.
[0189] 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.
[0190] See also Figure 5 , Figure 5 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;
[0191] The client 100 is used to send an image to be processed to the server 200, wherein the image to be processed includes unstructured information;
[0192] The server 200 is used to input the image to be processed into the information extraction model, obtain the structured information output by the information extraction model, wherein the information extraction model determines the word information and word position information in the image to be processed, determines the entity information according to the word information and word position information, and generates the structured information according to the entity information; and sends the structured information to the client 100;
[0193] The client 100 is also used to receive structured information sent by the server 200.
[0194] The information extraction system may include multiple clients 100 and a server 200, wherein the client 100 may be referred to as a terminal device and the server 200 may be referred to as a cloud device. A communication connection may be established between multiple clients 100 through the server 200. In the information extraction scenario, the server 200 is used to provide information extraction services between multiple clients 100. Multiple clients 100 may serve as a sender or a receiver, respectively, and realize communication through the server 200.
[0195] The user can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the information extraction scenario, the user can publish a data stream to the server 200 through the client 100, and the server 200 generates structured information according to the data stream and pushes the structured information to other clients that have established communication.
[0196] The client 100 and the server 200 are connected via a network. The network provides a medium for a 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.
[0197] The client 100 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. 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.
[0198] 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.
[0199] It is worth noting that the information extraction method provided in the embodiments of this specification is generally executed by the server, but in other embodiments of this specification, the client may also have similar functions to the server, thereby executing the information extraction method provided in the embodiments of this specification. In other embodiments, the information extraction method provided in the embodiments of this specification may also be jointly executed by the client and the server.
[0200] Figure 6 A flowchart of an information extraction method applied to a cloud-side device according to an embodiment of this specification is shown. The method is applied to a cloud-side device and includes:
[0201] Step 602: receiving an image to be processed sent by a terminal-side device, wherein the image to be processed includes unstructured information.
[0202] Step 604: Input the image to be processed into the information extraction model to obtain structured information output by the information extraction model, wherein the information extraction model determines word information and word position information in the image to be processed, determines entity information based on the word information and word position information, and generates structured information based on the entity information.
[0203] Step 606: Send the structured information to the terminal device.
[0204] Figure 7 The block diagram of a computing device 700 according to an embodiment of the present specification is shown. The components of the computing device 700 include but are not limited to a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.
[0205] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. 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 740 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-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0206] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 7The 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.
[0207] The computing device 700 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 700 may also be a mobile or stationary server.
[0208] The processor 720 is used to execute the following computer program / instructions, which implement the steps of the above-mentioned information extraction method when executed by the processor.
[0209] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the information extraction method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the information extraction method embodiment.
[0210] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned information extraction method when executed by a processor.
[0211] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the information extraction method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the information extraction method embodiment.
[0212] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned information extraction method when executed by a processor.
[0213] 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 above information extraction method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above information extraction method.
[0214] 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.
[0215] 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.
[0216] It should be noted that the above is a description of a specific embodiment of the present 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 accompanying 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. 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 the present specification.
[0217] 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.
[0218] 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 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 understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. An information extraction method, comprising: Receiving an image to be processed, wherein the image to be processed includes unstructured information; The image to be processed is input into a word positioning unit in an information extraction model to obtain multi-scale feature information, at least one word information and word position information corresponding to each word information corresponding to the image to be processed; the image to be processed, the multi-scale feature information, at least one word information and word position information corresponding to each word information are input into an entity grouping unit in the information extraction model to obtain at least one entity detection box and entity information corresponding to each entity detection box; each entity detection box and each entity information are input into an entity classification unit in the information extraction model to obtain entity category information corresponding to each entity information; structured information is determined according to each entity information and entity category information corresponding to each entity information, wherein the entity grouping unit generates a grid positioning image to be processed according to the image to be processed, at least one word information and word position information corresponding to each word information, obtains character coding features according to the grid positioning image to be processed, obtains image fusion feature information based on the character coding features and the multi-scale feature information, and obtains at least one entity detection box output by the entity grouping module and entity information corresponding to each entity detection box according to the image fusion feature information.
2. The method according to claim 1, wherein the word location unit comprises a feature extraction module and a location module; Inputting the image to be processed into a word location unit in the information extraction model to obtain multi-scale feature information corresponding to the image to be processed, at least one word information and word location information corresponding to each word information, including: Inputting the image to be processed into the feature extraction module to obtain multi-scale feature information corresponding to the image to be processed; The multi-scale feature information is input into the positioning module to obtain at least one word information output by the positioning module and word position information corresponding to each word information.
3. The method according to claim 2, wherein the entity grouping unit comprises a character encoding module, a visual feature fusion module and an entity grouping module; Inputting the image to be processed, the multi-scale feature information, at least one word information and the word position information corresponding to each word information into the entity grouping unit in the information extraction model, and obtaining at least one entity detection box and the entity information corresponding to each entity detection box, including: Generate a grid positioning image to be processed according to the image to be processed, at least one word information and word position information corresponding to each word information; Inputting the grid positioning image to be processed into the character encoding module to obtain character encoding features; Inputting the character encoding feature and the multi-scale feature information into the visual feature fusion module to obtain image fusion feature information; The image fusion feature information is input into an entity grouping module to obtain at least one entity detection frame output by the entity grouping module and entity information corresponding to each entity detection frame.
4. The method according to claim 3, generating a grid positioning image to be processed according to the image to be processed, at least one word information and word position information corresponding to each word information, comprising: Generate an empty image to be processed according to the image to be processed; Determine character identification information corresponding to each word information according to at least one word information; According to the word position information corresponding to each word information, the character identification information corresponding to each word information is added to the to-be-processed empty image to generate a to-be-processed grid positioning image.
5. The method according to claim 4, determining the character identification information corresponding to each word information according to at least one word information, comprising: Determine at least one character information corresponding to the target word information, wherein the target word information is any one of the at least one word information; Determine the character identifier corresponding to each character information according to the preset character comparison table; Each character identifier is mapped to three-channel feature information to generate character identifier information corresponding to each character identifier.
6. The method according to claim 5, wherein the visual feature fusion module comprises a pyramid pooling layer and a visual feature fusion layer; Inputting the character encoding feature and the multi-scale feature information into the visual feature fusion module to obtain image fusion feature information includes: Inputting the multi-scale feature information into the pyramid pooling layer to obtain pooling feature information; The pooled feature information and the character encoding feature are input into the visual feature fusion layer to obtain image fusion feature information.
7. The method according to claim 3, inputting each entity detection frame and each entity information into an entity classification unit to obtain entity category information corresponding to each entity information, comprising: The grid positioning image to be processed, each entity detection frame and each entity information are input into the entity classification unit to obtain the entity category information corresponding to each entity information.
8. The method according to claim 7, wherein the entity classification unit comprises a word granularity feature extraction module, a semantic encoding module and a semantic classifier; Inputting the grid positioning image to be processed, each entity detection frame and each entity information into the entity classification unit to obtain entity category information corresponding to each entity information, including: Inputting the to-be-processed grid positioning image into the word granularity feature extraction module to obtain the word granularity feature information output by the word granularity feature extraction module; Inputting the word granularity feature information into the semantic encoding module to obtain word granularity semantic feature information; The word granularity semantic feature information, each entity detection box and each entity information are input into the semantic classifier to obtain the entity category information corresponding to each entity information.
9. The method according to claim 1, determining structured information according to each entity information and entity category information corresponding to each entity information, comprising: Determine target entity information and target entity category information corresponding to the target entity information; The target entity information and the target entity category information are correspondingly added to the structured information.
10. The method according to claim 1, wherein the information extraction model is generated by training through the following steps: Acquire a sample image and sample word information, sample word position information, and sample structure information corresponding to the sample image; Inputting the sample image into an information extraction model to obtain predicted structural information, predicted word information and predicted word position information output by the information extraction model; Calculating a model loss value according to the sample word information, the sample word position information, the sample structure information, the predicted structure information, the predicted word information, and the predicted word position information; The model parameters of the information extraction model are adjusted according to the model loss value, and the information extraction model is continued to be trained until the model training stop condition is reached.
11. The method according to claim 10, wherein the model loss value is calculated according to the sample word information, the sample word position information, the sample structure information and the predicted structure information, the predicted word information, and the predicted word position information, comprising: Calculate a first loss value according to the sample word information, the sample word position information, the predicted word information, and the predicted word position information; Calculating a second loss value according to the sample structured information and the predicted structured information; A model loss value is calculated based on the first loss value and the second loss value.
12. An information extraction method, applied to a cloud-side device, comprising: An image to be processed sent by a receiving end-side device, wherein the image to be processed includes unstructured information; Input the image to be processed into the word positioning unit in the information extraction model to obtain multi-scale feature information, at least one word information and word position information corresponding to each word information corresponding to the image to be processed; input the image to be processed, the multi-scale feature information, at least one word information and word position information corresponding to each word information into the entity grouping unit in the information extraction model to obtain at least one entity detection box and entity information corresponding to each entity detection box; input each entity detection box and each entity information into the entity classification unit in the information extraction model to obtain entity category information corresponding to each entity information; determine structured information according to each entity information and entity category information corresponding to each entity information, wherein the entity grouping unit generates a grid positioning image to be processed according to the image to be processed, at least one word information and word position information corresponding to each word information, obtains character coding features according to the grid positioning image to be processed, obtains image fusion feature information based on the character coding features and the multi-scale feature information, and obtains at least one entity detection box output by the entity grouping module and entity information corresponding to each entity detection box according to the image fusion feature information; The structured information is sent to the terminal device.
13. An information extraction device, comprising: A receiving module is configured to receive an image to be processed, wherein the image to be processed includes unstructured information; The extraction module is configured to input the image to be processed into a word positioning unit in an information extraction model to obtain multi-scale feature information, at least one word information and word position information corresponding to each word information corresponding to the image to be processed; input the image to be processed, the multi-scale feature information, at least one word information and the word position information corresponding to each word information into an entity grouping unit in the information extraction model to obtain at least one entity detection box and entity information corresponding to each entity detection box; input each entity detection box and each entity information into an entity classification unit in the information extraction model to obtain entity category information corresponding to each entity information; determine structured information according to each entity information and the entity category information corresponding to each entity information, wherein the entity grouping unit generates a grid positioning image to be processed according to the image to be processed, at least one word information and the word position information corresponding to each word information, obtains character coding features according to the grid positioning image to be processed, obtains image fusion feature information based on the character coding features and the multi-scale feature information, and obtains at least one entity detection box output by the entity grouping module and entity information corresponding to each entity detection box according to the image fusion feature information.
14. 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 programs / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.
16. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.
