Multimodal named entity recognition method, device and computer equipment
By constructing a task combination of entity perception, visual area perception and triplet perception, we enhance the interactivity of the multi-modal named entity model, solve the problem of insufficient performance of the large language model in multi-modal named entity recognition, and achieve More accurate and efficient named entity recognition.
Patent Information
- Application Number
- CN202410710644.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-04
AI Technical Summary
Large language models have the problems of input conflict illusion and insufficient text description in multi-modal named entity recognition tasks, resulting in poor performance in multi-modal information extraction and named entity recognition.
By constructing a specific multi-modal named entity recognition task combination including entity perception, visual area perception and triplet perception, as the training data of the multi-modal named entity model, the model is gradually guided to enhance the model through task instructions with different task characteristics. Stateful information interaction improves naming recognition performance.
It significantly improves the naming recognition accuracy and efficiency of multi-modal named entity models, and solves the limitations of large language models in multi-modal information extraction.
Smart Images

Figure CN118297068B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a multimodal named entity recognition method, device, computer equipment and storage medium. Background Art
[0002] In the field of natural language processing, large language models have demonstrated excellent understanding and generation capabilities through training on a large corpus. In particular, through the contextual learning paradigm, large language models integrated with visual components can extract named entities from texts, classify entity types, and detect corresponding visual areas from images based on the requirements of multimodal named entity recognition tasks, thereby processing multimodal information and playing a greater role in visual language tasks.
[0003] However, in the specific task of multimodal named entity recognition, the general large language model still has certain limitations when using context learning in multimodal information extraction. First, there is an input conflict hallucination in the output of the large language model, and the generated content deviates from the provided prompts. Second, the text description and demonstration examples in the prompts are not enough for the large language model to effectively understand the input label mapping by analogy. Therefore, in order to improve the performance of large language models in multimodal information extraction tasks, effectively performing multimodal named entity recognition is an issue that needs to be studied urgently. Summary of the invention
[0004] Based on this, the purpose of the present invention is to provide a multimodal named entity recognition method, apparatus, computer equipment and storage medium, by constructing task combination pairs of specific multimodal named entity recognition tasks including entity perception, visual area perception and triple perception as training data of the multimodal named entity model, gradually guiding the multimodal named entity model to enhance the interaction between different modal information through task instructions with different task characteristics, thereby improving the performance of naming recognition of the multimodal named entity model, thereby performing multimodal named entity recognition more accurately and effectively.
[0005] In a first aspect, an embodiment of the present application provides a multimodal named entity recognition method, comprising the following steps:
[0006] Obtaining a plurality of training document data and naming recognition real label data of the training document data, wherein the training document data includes training perception text and training images, and the training perception text includes entity perception text, visual area perception text and triple perception text;
[0007] Encoding the training-perceptual texts and training images of the plurality of training document data to obtain the training-perceptual text representations and training image representations of the plurality of training document data, wherein the training-perceptual text representations include entity-perceptual text representations, visual-area-perceptual text representations, and triple-perceptual text representations;
[0008] Combining the entity-aware text representation, the visual-region-aware text representation, and the triple-aware text representation of the same training document data with the training image representation, respectively, to construct a plurality of training task combination pairs of the training document data;
[0009] Inputting a plurality of training task combinations of the training document data into an initial multimodal named entity model for name recognition, obtaining a plurality of name recognition prediction label data of the training document data, training the initial multimodal named entity model according to the name recognition prediction label data and the name recognition real label data of the training document data, and obtaining a target multimodal named entity model;
[0010] Obtain a coded representation of the document data to be tested, the coded representation including a text representation to be tested and an image representation to be tested, input the coded representation of the document data to be tested into the target multimodal named entity model for name recognition, and obtain a name recognition result of the document data to be tested.
[0011] In a second aspect, an embodiment of the present application provides a multimodal named entity recognition device, comprising:
[0012] A data acquisition module, used to obtain a plurality of training document data and real label data of naming recognition of the training document data, wherein the training document data includes training perception text and training images, and the training perception text includes entity perception text, visual area perception text and triple perception text;
[0013] A data encoding module, used for encoding the training-perceptual texts and training images of the training document data to obtain the training-perceptual text representations and training image representations of the training document data, wherein the training-perceptual text representations include entity-perceptual text representations, visual-area-perceptual text representations, and triple-perceptual text representations;
[0014] A data processing module, used for combining the entity-aware text representation, the visual-area-aware text representation and the triple-aware text representation of the same training document data with the training image representation, respectively, to construct a plurality of training task combination pairs of the training document data;
[0015] A model training module, used for inputting a plurality of training task combination pairs of the training document data into an initial multimodal named entity model for name recognition, obtaining a plurality of name recognition prediction label data of the training document data, and training the initial multimodal named entity model according to the name recognition prediction label data and the name recognition real label data of the training document data to obtain a target multimodal named entity model;
[0016] A naming recognition module is used to obtain a coded representation of the document data to be tested, wherein the coded representation includes a text representation to be tested and an image representation to be tested, and input the coded representation of the document data to be tested into the target multimodal named entity model for naming recognition to obtain a naming recognition result of the document data to be tested.
[0017] In a third aspect, an embodiment of the present application provides a computer device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor; when the computer program is executed by the processor, the steps of the multimodal named entity recognition method described in the first aspect are implemented.
[0018] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the multimodal named entity recognition method as described in the first aspect are implemented.
[0019] In an embodiment of the present application, a multimodal named entity recognition method, apparatus, computer device and storage medium are provided. By constructing a task combination pair of specific multimodal named entity recognition tasks including entity perception, visual area perception and triple perception as training data for a multimodal named entity model, the multimodal named entity model is gradually guided to enhance the interaction between different modal information through task instructions of different task characteristics, thereby improving the naming recognition performance of the multimodal named entity model, thereby performing multimodal named entity recognition more accurately and effectively.
[0020] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a multimodal named entity recognition method provided by an embodiment of the present application;
[0022] Figure 2 A schematic diagram of the process of S2 in a multimodal named entity recognition method provided in one embodiment of the present application;
[0023] Figure 3 A schematic diagram of the process of S4 in a multimodal named entity recognition method provided in one embodiment of the present application;
[0024] Figure 4 A schematic diagram of the process of S4 in a multimodal named entity recognition method provided in one embodiment of the present application;
[0025] Figure 5 A schematic diagram of the structure of a multimodal named entity recognition device provided by one embodiment of the present application;
[0026] Figure 6 A schematic diagram of the structure of a computer device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0028] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application 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 herein refers to and includes any or all possible combinations of one or more associated listed items.
[0029] It should be understood that, although the terms first, second, third, etc. may be used in the present application to describe various information, these 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 the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" / "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determination".
[0030] The data sending end may be a computer device or a mobile terminal device, which is used to establish a network connection with the data receiving end, and can encode data information sent to the data receiving end, and parse data information sent from the data receiving end.
[0031] The data receiving end may be a computer device or a mobile terminal device, which is used to establish a network connection with the data sending end, and can encode the data information sent to the data sending end, and parse the data information sent from the data sending end.
[0032] See also Figure 1 , Figure 1 A flowchart of a multimodal named entity recognition method provided by an embodiment of the present application, the method comprises the following steps:
[0033] S1: Obtain a number of training document data and real label data for naming and identifying the training document data.
[0034] The execution subject of the multimodal named entity recognition method of the present application is a recognition device of the multimodal named entity recognition method (hereinafter referred to as the recognition device). In an optional embodiment, the recognition device can be a computer device, a server, or a server cluster composed of multiple computer devices.
[0035] In this embodiment, the recognition device can obtain a number of training document data and named recognition real label data of the training document data input by the user, and can also obtain a number of training document data and named recognition real label data of the training document data from a preset database, wherein the training document data include training perceived text and training images, and the training perceived text includes entity perceived text, visual area perceived text and triple perceived text.
[0036] Specifically, the entity-aware text is constructed by concatenating training text with preset entity-aware question and answer text. The training text is a text description corresponding to the training image. The entity-aware question and answer text is a natural language text sequence specific to entity-aware question and answer, and provides supplementary information including three basic elements: title, definition and emphasis, for example: "Please identify the named entities corresponding to the entity types mentioned in the text and the bounding box coordinates of the visual area."
[0037] The visual area awareness text is constructed by splicing the training text with the preset visual area awareness question and answer text. The visual area awareness question and answer text is a region selection problem that provides four candidate options, for example: "Please find the option corresponding to (named entity, entity type). Only the option of outputting the image area bounding box is required. There are 4 predefined options: A. Bounding box 1, B. Bounding box 2, C. Bounding box 3, D. None".
[0038] Among them, there is an option of a ground truth bounding box among the options of the image area bounding box in the visual area perception question and answer text, which is the correct answer that the large language model must recognize. The other two bounding box options are interference options. In an optional embodiment, we use the target detection model VinVL to extract all potential visual areas in the training image, select the first several objects from several potential visual areas according to probability as relevant visual areas, obtain the bounding boxes of the relevant visual areas, and randomly select two objects whose intersection over union (IoU) scores between the bounding boxes of several relevant visual areas and the ground truth bounding boxes are less than 0.25 as interference visual areas, obtain the named entities corresponding to the interference visual areas, and create two interference options.
[0039] The triple-aware text is constructed by splicing the training text and the preset triple-aware question and answer text. The triple-aware question and answer text is a natural language text sequence specific to triple-aware question and answer. The triples include named entities, entity types, and visual area position coordinates, for example: "Please find the triples that exist in the training text."
[0040] S2: Encoding the training perceptual texts and training images of the training document data to obtain the training perceptual text representations and training image representations of the training document data.
[0041] In this embodiment, the recognition device encodes the training-perceived texts and training images of several training document data to obtain training-perceived text representations and training image representations of several training document data, wherein the training-perceived text representations include entity-perceived text representations, visual-area-perceived text representations, and triple-perceived text representations.
[0042] See also Figure 2 , Figure 2 The flowchart of S2 in the multimodal named entity recognition method provided in one embodiment of the present application includes steps S21 to S22, which are specifically as follows:
[0043] S21: Inputting the training perception texts of the plurality of training document data into a preset word embedding model for encoding processing to obtain the training perception text representations of the plurality of training document data.
[0044] In this embodiment, the recognition device inputs the training perception texts of several training document data into a preset word embedding model for encoding processing to obtain the training perception text representations of several training document data, wherein the word embedding module adopts the BERT (Bidirectional Encoder Representation from Transformers) word embedding model to convert the vectors of several words in the training perception text into corresponding state vectors.
[0045] Specifically, the recognition device inputs the training perceived text into the BERT word embedding model, maps each word of the training perceived text to a low-dimensional vector space, obtains the hidden layer vectors of several words of the training perceived text output by the BERT word embedding model by querying the pre-trained BERT matrix, as the word embedding vector, and performs encoding processing to obtain several training perceived text representations of the training document data.
[0046] S22: Inputting a plurality of training images of the training document data into a preset target detection model for target detection, and obtaining a plurality of training image representations of the training document data.
[0047] In this embodiment, the recognition device inputs several training images of the training document data into a preset target detection model for target detection, and obtains several training image representations of the training document data, wherein the target detection module adopts the image encoder Vision Transformer module of the pre-training model CLIP (Contrastive Language-Image Pre-training) for multi-target detection, which can determine predefined objects related to entities in the training images.
[0048] Specifically, the recognition device divides the training image into several image sub-regions, inputs the several image sub-regions into the image encoder Vision Transformer module for target detection, obtains the visual coding representation as the training image representation, and obtains several training image representations of the training document data, wherein the visual coding representation includes detection vectors of several image sub-regions.
[0049] S3: Combining the entity-aware text representation, visual-area-aware text representation and triple-aware text representation of the same training document data with the training image representation respectively, to construct a plurality of training task combination pairs of the training document data.
[0050] The multimodal named entity recognition task consists of two subtasks: entity extraction and image entity object box detection. The entity extraction subtask aims to identify entity type pairs, representing cross-modal interactions from image to text. In contrast, the image entity object box detection subtask focuses on extracting entity-region pairs, representing cross-modal interactions from language to vision.
[0051] In this embodiment, the recognition device combines the entity-aware text representation, visual-region-aware text representation, and triple-aware text representation of the same training document data with the training image representation, respectively, to construct a plurality of training task combination pairs of the training document data, wherein the training task combination pairs include entity-aware task combination pairs, visual-region-aware task combination pairs, and triple-aware task combination pairs. The training task combination pairs of the training document data are used as training data for the multimodal named entity model, so as to gradually guide the multimodal named entity model to enhance the interaction between different modal information through task instructions of a plurality of different task characteristics, thereby improving the accuracy and efficiency of naming recognition of the multimodal named entity model.
[0052] S4: Inputting a plurality of training task combinations of the training document data into an initial multimodal named entity model for name recognition, obtaining a plurality of named recognition prediction label data of the training document data, training the initial multimodal named entity model according to the named recognition prediction label data of the plurality of training document data and the named recognition true label data, and obtaining a target multimodal named entity model.
[0053] The initial multimodal named entity model adopts the LLAMA multimodal large language model. In this embodiment, the recognition device inputs a training task combination pair of the training document data into the initial multimodal named entity model for naming recognition, and obtains naming recognition prediction label data of the training document data.
[0054] The recognition device trains the initial multimodal named entity model according to the named recognition predicted label data and the named recognition real label data of the training document data to obtain a target multimodal named entity model.
[0055] See also Figure 3 , Figure 3 The flowchart of S4 in the multimodal named entity recognition method provided in one embodiment of the present application includes step S41, which is as follows:
[0056] S41: Obtaining a plurality of named recognition prediction label data of the training document data according to a plurality of training task combination pairs of the training document data and a preset named recognition algorithm.
[0057] The naming recognition algorithm is:
[0058]
[0059] In the formula, Predict probability distribution data for named entities corresponding to entity perception tasks, To name the identification function, is the training image representation, for entity-aware text representation, Predict the probability distribution data of the visual area position coordinates corresponding to the visual area perception task, for visual region-aware text representation, Predict probability distribution data for named entities corresponding to triple perception tasks, Predict probability distribution data for entity categories corresponding to triple perception tasks, Predict the probability distribution data of the visual area position coordinates corresponding to the triple perception task, For triple-aware text representation.
[0060] In this embodiment, the recognition device obtains the named recognition prediction label data of the training document data according to the training task combination pairs of the training document data and the preset named recognition algorithm, wherein the named recognition prediction label data includes the named entity prediction probability distribution data corresponding to the entity perception task and the triple perception task, the entity category prediction probability distribution data corresponding to the triple perception task, and the visual area position coordinate prediction probability distribution data corresponding to the visual area perception task and the triple perception task.
[0061] Specifically, for the named entity prediction probability distribution data corresponding to the entity perception task, the recognition device inputs the entity perception task combination pair in the training task combination pair of the training document data into the initial multimodal named entity model for processing, and obtains the named entity prediction probability distribution data corresponding to the entity perception task, so as to guide the initial multimodal named entity model to establish the interaction between visual cues and named entities.
[0062] For the visual area position coordinate prediction probability distribution data corresponding to the visual area perception task, the recognition device inputs the visual area perception task combination pair in the training task combination pair of the training document data into the initial multimodal named entity model for processing, and obtains the visual area position coordinate prediction probability distribution data corresponding to the visual area perception task, so as to deepen the initial multimodal named entity model's understanding of the relationship between the named entity and the corresponding visual area.
[0063] For the named entity prediction probability distribution data, entity category prediction probability distribution data, and visual area position coordinate prediction probability distribution data corresponding to the triple perception task, the recognition device inputs the triple perception task combination pairs in the training task combination pairs of the training document data into the initial multimodal named entity model for processing, and obtains the named entity prediction probability distribution data, entity category prediction probability distribution data, and visual area position coordinate prediction probability distribution data corresponding to the triple perception task, so as to guide the initial multimodal named entity model's understanding of the relationship between the triple elements.
[0064] The named entity prediction probability distribution data includes prediction probability distribution vectors of several named entities, the entity category prediction probability distribution data includes prediction probability distribution vectors of several named entity categories, and the visual area position coordinate prediction probability distribution data includes prediction probability distribution vectors of several visual area position coordinates. The named recognition real label data includes real probability distribution data of named entities corresponding to the entity perception task and the triple perception task, real probability distribution data of entity categories corresponding to the triple perception task, and real probability distribution data of visual area position coordinates corresponding to the visual area perception task and the triple perception task; the named entity real probability distribution data includes real probability distribution vectors of several named entities, the entity category real probability distribution data includes real probability distribution vectors of several named entity categories, and the visual area position coordinate real probability distribution data includes real probability distribution vectors of several visual area position coordinates.
[0065] See also Figure 4 , Figure 4 The flowchart of S4 in the multimodal named entity recognition method provided in one embodiment of the present application includes steps S42 to S43, which are specifically as follows:
[0066] S42: Based on the naming recognition predicted label data and the naming recognition true label data of the same training document data, construct several types of training probability distribution data combinations of the training document data, wherein the training probability distribution data combinations include the same type of predicted probability distribution data and true probability distribution data.
[0067] In this embodiment, the recognition device constructs several types of training probability distribution data combinations of the training document data based on the named recognition predicted label data and the named recognition real label data of the same training document data, wherein the training probability distribution data combinations include the same type of predicted probability distribution data and real probability distribution data.
[0068] Specifically, the recognition device respectively combines the named entity prediction probability distribution data and the named entity true probability distribution data in the named recognition predicted label data and the named entity true label data of the same training document data, combines the corresponding entity category prediction probability distribution data and the entity category true probability distribution data, and combines the corresponding visual area position coordinate prediction probability distribution data and the visual area position coordinate true probability distribution data, to obtain several types of training probability distribution data combinations of several training document data.
[0069] S43: According to several training probability distribution data combinations of the same training document data and a preset cross-entropy loss calculation algorithm, loss values of several training probability distribution data combinations of the training document data are obtained, and the loss values of several training probability distribution data combinations of the same training document data are accumulated to obtain a total loss value of the several training document data, and according to the total loss value, the initial multimodal named entity model is trained to obtain a target multimodal named entity model.
[0070] The cross entropy loss calculation algorithm is:
[0071]
[0072] In the formula, is the loss value, The first prediction probability distribution data of the training probability distribution data combination j A predicted probability distribution vector, The first j The true probability distribution vector.
[0073] In this embodiment, the recognition device obtains loss values of several training probability distribution data combinations of several training document data based on several training probability distribution data combinations of the same training document data and a preset cross-entropy loss calculation algorithm, wherein the loss values of the several training probability distribution data combinations include the loss value of the named entity corresponding to the entity perception task, the loss value of the visual area position coordinates corresponding to the visual area perception task, the loss value of the named entity corresponding to the triple perception task, the loss value of the entity category corresponding to the triple perception task, and the loss value of the visual area position coordinates corresponding to the triple perception task.
[0074] The recognition device accumulates the loss values of several combinations of training probability distribution data of the same training document data to obtain the total loss values of the several training document data, and trains the initial multimodal named entity model according to the total loss value to obtain the target multimodal named entity model. Specifically, the recognition device freezes a part of the weight parameters of the initial multimodal named entity model, retains a part of the external parameters as learnable parameters, and adds these learnable parameters to the weights of the self-attention layer and the feedforward layer of the initial multimodal named entity model. According to the low-rank adaptive fine-tuning method, the learnable parameters are decomposed into a low-rank matrix, and according to the total loss value, the learnable parameters are iteratively adjusted to give the multimodal named entity model knowledge specific to the multimodal named entity recognition task, so as to avoid the expensive training cost of full parameter fine-tuning and the risk of catastrophic forgetting, and improve the accuracy and efficiency of naming recognition of the multimodal named entity model.
[0075] S5: Obtaining a coded representation of the document data to be tested, the coded representation including a text representation to be tested and an image representation to be tested, inputting the coded representation of the document data to be tested into the target multimodal named entity model for name recognition, and obtaining a name recognition result of the document data to be tested.
[0076] In this embodiment, the recognition device obtains the coded representation of the document data to be tested, wherein the coded representation includes the text representation to be tested and the image representation to be tested.
[0077] The recognition device inputs the encoded representation of the document data to be tested into the target multimodal named entity model for naming recognition, and obtains the naming recognition result of the document data to be tested, wherein the naming recognition result includes a named entity recognition result, an entity category recognition result, and a visual area position coordinate recognition result.
[0078] Specifically, the recognition device inputs the encoded representation of the document data to be tested into the target multimodal named entity model for naming recognition, and obtains triple prediction probability distribution data of the document data to be tested, wherein the triple prediction probability distribution data includes named entity prediction probability distribution data, entity category prediction probability distribution data, and visual area position coordinate prediction probability distribution data;
[0079] The recognition device obtains the predicted probability distribution vector of the target named entity with the largest dimension in the named entity predicted probability distribution data, the predicted probability distribution vector of the target entity category with the largest dimension in the entity category predicted probability distribution data, and the predicted probability distribution vector of the target visual area position coordinate with the largest dimension in the visual area position coordinate predicted probability distribution data; takes the named entity corresponding to the target entity category predicted probability distribution data as the named entity recognition result, takes the entity category corresponding to the target entity category predicted probability distribution vector as the entity category recognition result, and takes the visual area position coordinates corresponding to the predicted probability distribution vector of the target visual area position coordinates as the visual area position coordinate recognition result, to obtain the naming recognition result of the document data to be tested.
[0080] By constructing task combination pairs of specific multimodal named entity recognition tasks including entity perception, visual area perception and triple perception as training data for the multimodal named entity model, the multimodal named entity model is gradually guided to enhance the interaction between different modal information through task instructions with different task characteristics, thereby improving the naming recognition performance of the multimodal named entity model, thereby performing multimodal named entity recognition more accurately and effectively.
[0081] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of a multimodal named entity recognition device provided by an embodiment of the present application. The device can implement all or part of the multimodal named entity recognition device through software, hardware, or a combination of both. The device 5 includes:
[0082] A data acquisition module 51 is used to obtain a plurality of training document data and real label data of naming recognition of the training document data, wherein the training document data includes training perception text and training images, and the training perception text includes entity perception text, visual area perception text and triple perception text;
[0083] A data encoding module 52 is used to encode the training perceived texts and training images of the training document data to obtain the training perceived text representations and training image representations of the training document data, wherein the training perceived text representations include entity perceived text representations, visual area perceived text representations, and triple perceived text representations;
[0084] A data processing module 53 is used to combine the entity-aware text representation, the visual-area-aware text representation and the triple-aware text representation of the same training document data with the training image representation, respectively, to construct a plurality of training task combination pairs of the training document data;
[0085] A model training module 54 is used to input the training task combination pairs of the training document data into the initial multimodal named entity model for name recognition, obtain the name recognition prediction label data of the training document data, and train the initial multimodal named entity model according to the name recognition prediction label data and the name recognition real label data of the training document data to obtain a target multimodal named entity model;
[0086] The naming recognition module 55 is used to obtain the coded representation of the document data to be tested, which includes the text representation to be tested and the image representation to be tested, and input the coded representation of the document data to be tested into the target multimodal named entity model for naming recognition to obtain the naming recognition result of the document data to be tested.
[0087] In this embodiment, a plurality of training document data and naming recognition real label data of the training document data are obtained through a data acquisition module, wherein the training document data include training perception text and training images, and the training perception text includes entity perception text, visual area perception text and triple perception text; a plurality of training perception text and training images of the training document data are encoded through a data encoding module to obtain a plurality of training perception text representations and training image representations of the training document data, wherein the training perception text representation includes entity perception text representation, visual area perception text representation and triple perception text representation; a plurality of training perception text representations, visual area perception text representations and triple perception text representations of the same training document data are encoded through a data processing module, and the entity perception text representation, visual area perception text representation and triple perception text representation of the same training document data are respectively combined with the entity perception text representation, visual area perception text representation and triple perception text representation of the same training document data. The training image representations are combined to construct a number of training task combination pairs of the training document data; through a model training module, the training task combination pairs of the training document data are input into an initial multimodal named entity model for naming recognition, and a number of naming recognition prediction label data of the training document data are obtained; according to the naming recognition prediction label data of the training document data and the naming recognition real label data, the initial multimodal named entity model is trained to obtain a target multimodal named entity model; through a naming recognition module, an encoded representation of the document data to be tested is obtained, the encoded representation includes a text representation to be tested and an image representation to be tested, the encoded representation of the document data to be tested is input into the target multimodal named entity model for naming recognition, and a naming recognition result of the document data to be tested is obtained. By constructing task combination pairs of specific multimodal named entity recognition tasks including entity perception, visual area perception and triple perception as training data for the multimodal named entity model, the multimodal named entity model is gradually guided to enhance the interaction between different modal information through task instructions with different task characteristics, thereby improving the naming recognition performance of the multimodal named entity model, thereby performing multimodal named entity recognition more accurately and effectively.
[0088] Please refer to Figure 6 , Figure 6 The schematic diagram of the structure of a computer device provided in one embodiment of the present application, the computer device 6 comprises: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61; the computer device may store a plurality of instructions, which are suitable for being loaded and executed by the processor 61 Figures 1 to 4 For the specific implementation process, please refer to Figures 1 to 4 The specific description is not repeated here.
[0089] Among them, the processor 61 may include one or more processing cores. The processor 61 uses various interfaces and lines to connect various parts in the server, and executes various functions and processes data of the multimodal named entity recognition device 5 by running or executing instructions, programs, code sets or instruction sets stored in the memory 62, and calling the data in the memory 62. Optionally, the processor 61 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programble Logic Array, PLA). The processor 61 can integrate one or a combination of a central processing unit 61 (Central Processing Unit, CPU), an image processor 61 (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the touch display screen; and the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 61, but implemented separately through a chip.
[0090] The memory 62 may include a random access memory 62 (RAM) or a read-only memory 62 (Read-Only Memory). Optionally, the memory 62 includes a non-transitory computer-readable storage medium. The memory 62 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 62 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch instructions, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 62 may also be optionally at least one storage device located away from the aforementioned processor 61.
[0091] The present application also provides a storage medium that can store multiple instructions, which are suitable for the processor to load and execute the above-mentioned Figures 1 to 4 For the specific implementation process, please refer to Figures 1 to 4 The specific description is not repeated here.
[0092] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0093] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0094] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraint algorithm of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0095] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0097] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0098] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.
[0099] The present invention is not limited to the above-mentioned embodiments. If various changes or modifications to the present invention do not depart from the spirit and scope of the present invention, and if these changes and modifications fall within the scope of the claims and equivalent technologies of the present invention, the present invention is also intended to include these changes and modifications.
Claims
1. A multimodal named entity recognition method, characterized in that: The following steps are involved: Obtaining a plurality of training document data and naming recognition real label data of the training document data, wherein the training document data includes training perception text and training images, and the training perception text includes entity perception text, visual area perception text and triple perception text; Encoding the training-perceptual texts and training images of the plurality of training document data to obtain the training-perceptual text representations and training image representations of the plurality of training document data, wherein the training-perceptual text representations include entity-perceptual text representations, visual-area-perceptual text representations, and triple-perceptual text representations; Combining the entity-aware text representation, visual-region-aware text representation, and triple-aware text representation of the same training document data with the training image representation, respectively, to construct a plurality of training task combination pairs of the training document data, wherein the training task combination pairs include entity-aware task combination pairs, visual-region-aware task combination pairs, and triple-aware task combination pairs; Input the training task combination pairs of the training document data into the initial multimodal named entity model for name recognition, and obtain the name recognition prediction label data of the training document data according to the training task combination pairs of the training document data and the preset name recognition algorithm, wherein the name recognition prediction label data includes the named entity prediction probability distribution data corresponding to the entity perception task and the triple perception task, the entity category prediction probability distribution data corresponding to the triple perception task, and the visual area perception task and the visual area position coordinate prediction probability distribution data corresponding to the triple perception task, and the name recognition algorithm is: In the formula, Predict probability distribution data for named entities corresponding to entity perception tasks, To name the identification function, is the training image representation, for entity-aware text representation, Predict the probability distribution data of the visual area position coordinates corresponding to the visual area perception task, for visual region-aware text representation, Predict probability distribution data for named entities corresponding to triple perception tasks, Predict probability distribution data for entity categories corresponding to triple perception tasks, Predict the probability distribution data of the visual area position coordinates corresponding to the triple perception task, triple-aware text representation; Training the initial multimodal named entity model according to the named recognition predicted label data and the named recognition real label data of the plurality of training document data to obtain a target multimodal named entity model; Obtain a coded representation of the document data to be tested, the coded representation including a text representation to be tested and an image representation to be tested, input the coded representation of the document data to be tested into the target multimodal named entity model for name recognition, and obtain a name recognition result of the document data to be tested.
2. The multimodal named entity recognition method according to claim 1, characterized in that: The encoding process of the training perception texts and training images of the plurality of training document data to obtain the training perception text representations and training image representations of the plurality of training document data comprises the following steps: Inputting the training perception texts of the plurality of training document data into a preset word embedding model for encoding processing to obtain the training perception text representations of the plurality of training document data; The training images of the training document data are input into a preset target detection model to perform target detection, so as to obtain the training image representations of the training document data.
3. The multimodal named entity recognition method according to claim 1, characterized in that: The named entity prediction probability distribution data includes a plurality of prediction probability distribution vectors of named entities, the entity category prediction probability distribution data includes a plurality of prediction probability distribution vectors of named entity categories, and the visual area position coordinate prediction probability distribution data includes a plurality of prediction probability distribution vectors of visual area position coordinates; The real label data for named recognition includes the real probability distribution data of named entities corresponding to the entity perception task and the triple perception task, the real probability distribution data of entity categories corresponding to the triple perception task, and the real probability distribution data of visual area position coordinates corresponding to the visual area perception task and the triple perception task; the real probability distribution data of named entities includes the real probability distribution vectors of several named entities, the real probability distribution data of entity categories includes the real probability distribution vectors of several named entity categories, and the real probability distribution data of visual area position coordinates includes the real probability distribution vectors of several visual area position coordinates.
4. The multimodal named entity recognition method according to claim 3, characterized in that: The initial multimodal named entity model is trained according to the named recognition predicted label data and the named recognition real label data of the plurality of training document data to obtain the target multimodal named entity model, comprising the steps of: According to the naming recognition predicted label data and the naming recognition real label data of the same training document data, constructing several types of training probability distribution data combinations of several training document data, wherein the training probability distribution data combinations include the same type of predicted probability distribution data and real probability distribution data; According to several training probability distribution data combinations of the same training document data and a preset cross entropy loss calculation algorithm, loss values of several training probability distribution data combinations of the training document data are obtained, and the loss values of several training probability distribution data combinations of the same training document data are accumulated to obtain a total loss value of several training document data. According to the total loss value, the initial multimodal named entity model is trained to obtain a target multimodal named entity model, wherein the cross entropy loss calculation algorithm is: In the formula, is the loss value, The first prediction probability distribution data of the training probability distribution data combination j A predicted probability distribution vector, The first j The true probability distribution vector.
5. A multimodal named entity recognition device, characterized in that: include: A data acquisition module, used to obtain a plurality of training document data and real label data of naming recognition of the training document data, wherein the training document data includes training perception text and training images, and the training perception text includes entity perception text, visual area perception text and triple perception text; A data encoding module, used for encoding the training-perceptual texts and training images of the training document data to obtain the training-perceptual text representations and training image representations of the training document data, wherein the training-perceptual text representations include entity-perceptual text representations, visual-area-perceptual text representations, and triple-perceptual text representations; A data processing module, used for combining the entity-aware text representation, the visual-area-aware text representation and the triple-aware text representation of the same training document data with the training image representation, respectively, to construct a plurality of training task combination pairs of the training document data, wherein the training task combination pairs include entity-aware task combination pairs, visual-area-aware task combination pairs and triple-aware task combination pairs; The model training module is used to input the training task combination pairs of the training document data into the initial multimodal named entity model for name recognition, and obtain the name recognition prediction label data of the training document data according to the training task combination pairs of the training document data and the preset name recognition algorithm, wherein the name recognition prediction label data includes the named entity prediction probability distribution data corresponding to the entity perception task and the triple perception task, the entity category prediction probability distribution data corresponding to the triple perception task, and the visual area perception task and the visual area position coordinate prediction probability distribution data corresponding to the triple perception task, and the name recognition algorithm is: In the formula, Predict probability distribution data for named entities corresponding to entity perception tasks, To name the identification function, is the training image representation, for entity-aware text representation, Predict the probability distribution data of the visual area position coordinates corresponding to the visual area perception task, for visual region-aware text representation, Predict probability distribution data for named entities corresponding to triple perception tasks, Predict probability distribution data for entity categories corresponding to triple perception tasks, Predict the probability distribution data of the visual area position coordinates corresponding to the triple perception task, triple-aware text representation; Training the initial multimodal named entity model according to the named recognition predicted label data and the named recognition real label data of the plurality of training document data to obtain a target multimodal named entity model; A naming recognition module is used to obtain a coded representation of the document data to be tested, wherein the coded representation includes a text representation to be tested and an image representation to be tested, and input the coded representation of the document data to be tested into the target multimodal named entity model for naming recognition to obtain a naming recognition result of the document data to be tested.
6. A computer device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the multimodal named entity recognition method according to any one of claims 1 to 4 are implemented.
7. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the multimodal named entity recognition method according to any one of claims 1 to 4 are implemented.
