Information extraction, item recognition, and information extraction model training method

By determining the information extraction matrix in the information extraction task to represent the correspondence between the text to be extracted and the prompt information, the problem of long information extraction time in the prior art is solved, and efficient information extraction effect is achieved.

CN116644743BActive Publication Date: 2026-07-24ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2023-04-19
Publication Date
2026-07-24

Smart Images

  • Figure CN116644743B_ABST
    Figure CN116644743B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides an information extraction, an article identification and an information extraction model training method, wherein the information extraction method comprises: receiving an information extraction task, wherein the information extraction task comprises to-be-extracted text and at least two prompt information; inputting the to-be-extracted text and the at least two prompt information into an information extraction model, determining an information extraction matrix corresponding to the information extraction task, wherein the information extraction matrix represents the corresponding relationship between the to-be-extracted text and each prompt information; and determining a target extraction result corresponding to the information extraction task according to the information extraction matrix, the to-be-extracted text and the at least two prompt information. On the basis of parallel input of multiple prompt information, the corresponding relationship between the to-be-extracted text and each prompt information is expressed through the information extraction matrix, so that the information extraction speed is not affected by the complexity of the information extraction outline, and the efficiency of information extraction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of computer technology, text processing increasingly relies on the internet. Text processing is the process of analyzing, understanding, and extracting information from text, and it has been widely applied in various aspects of people's daily lives. Taking information extraction as an example, information extraction refers to text processing techniques that extract specific types of entity, relation, event, and other factual information from natural language text and output structured data.

[0003] Currently, information extraction can usually be performed using Machine Reading Comprehension (MRC). However, for complex and diverse information extraction tasks, different machine learning models are required to achieve information extraction, resulting in high resource consumption during model training and long information extraction time. Therefore, there is an urgent need for an efficient information extraction solution. Summary of the Invention

[0004] In view of this, embodiments of this specification provide an information extraction method. One or more embodiments of this specification also relate to an item recognition method, an information extraction model training method, an information extraction device, an item recognition device, an information extraction model training device, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, an information extraction method is provided, comprising:

[0006] Receive information extraction task, wherein the information extraction task includes the text to be extracted and at least two prompt messages;

[0007] Input the text to be extracted and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the information extraction task. The information extraction matrix represents the correspondence between the text to be extracted and each prompt.

[0008] Based on the information extraction matrix, the text to be extracted, and at least two prompts, determine the target extraction result corresponding to the information extraction task.

[0009] According to a second aspect of the embodiments of this specification, an article identification method is provided, comprising:

[0010] Receive an object recognition task, wherein the object recognition task includes the text to be recognized and at least two prompts;

[0011] Input the text to be identified and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the item identification task. The information extraction matrix represents the correspondence between the text to be identified and each prompt.

[0012] Based on the information extraction matrix, the text to be identified, and at least two prompts, determine the target recognition result corresponding to the object recognition task.

[0013] According to a third aspect of the embodiments of this specification, an information extraction model training method is provided, applied to a cloud-side device, comprising:

[0014] Obtain a sample set, which includes multiple sample texts, each carrying information such as extraction labels and at least two sample prompts;

[0015] Extract the first sample text from multiple sample texts, where the first sample text is any one of the multiple sample texts;

[0016] Input the first sample text and the first sample prompt information carried by the first sample into the initial information extraction model to obtain the first prediction information extraction matrix corresponding to the first sample text;

[0017] Based on the first prediction information extraction matrix, the first sample text, and the first sample prompt information, determine the first prediction extraction result corresponding to the first sample text;

[0018] Compare the first predicted extraction result with the first information extraction label carried by the first sample text, and calculate the loss value;

[0019] Adjust the model parameters of the initial information extraction model based on the loss value, and return to the step of extracting the first sample text from multiple sample texts until the preset stopping condition is reached, and obtain the model parameters of the information extraction model.

[0020] Send information to the end-side device to extract model parameters.

[0021] According to a fourth aspect of the embodiments of this specification, an information extraction apparatus is provided, comprising:

[0022] The first receiving module is configured to receive an information extraction task, wherein the information extraction task includes the text to be extracted and at least two prompt messages.

[0023] The first input module is configured to input the text to be extracted and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the information extraction task, wherein the information extraction matrix represents the correspondence between the text to be extracted and each prompt.

[0024] The first determining module is configured to determine the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and at least two prompts.

[0025] According to a fifth aspect of the embodiments of this specification, an article identification device is provided, comprising:

[0026] The second receiving module is configured to receive an item recognition task, wherein the item recognition task includes the text to be recognized and at least two prompt messages;

[0027] The second input module is configured to input the text to be recognized and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the item recognition task, wherein the information extraction matrix represents the correspondence between the text to be recognized and each prompt.

[0028] The second determination module is configured to determine the target recognition result corresponding to the item recognition task based on the information extraction matrix, the text to be recognized, and at least two prompts.

[0029] According to a sixth aspect of the embodiments of this specification, an information extraction model training apparatus is provided, applied to a cloud-side device, comprising:

[0030] The acquisition module is configured to acquire a sample set, wherein the sample set includes multiple sample texts, each carrying an information extraction label and at least two sample prompts;

[0031] The extraction module is configured to extract a first sample text from multiple sample texts, wherein the first sample text is any one of the multiple sample texts;

[0032] The third input module is configured to input the first sample text and the first sample prompt information carried by the first sample into the initial information extraction model to obtain the information extraction matrix corresponding to the first sample text.

[0033] The third determining module is configured to determine the first prediction extraction result corresponding to the first sample text based on the first prediction information extraction matrix, the first sample text and the first sample prompt information.

[0034] The calculation module is configured to compare the first predicted extraction result with the first information extraction label carried by the first sample text and calculate the loss value.

[0035] The adjustment module is configured to adjust the model parameters of the initial information extraction model based on the loss value, and return to the step of extracting the first sample text from multiple sample texts until a preset stopping condition is reached, thereby obtaining the model parameters of the information extraction model.

[0036] The sending module is configured to send information to the end-side device to extract model parameters of the model.

[0037] According to a seventh aspect of the embodiments of this specification, a computing device is provided, comprising:

[0038] Memory and processor;

[0039] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method provided in the first, second, or third aspect described above.

[0040] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0041] According to a ninth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the method provided in the first, second, or third aspect described above.

[0042] An embodiment of this specification provides an information extraction method that receives an information extraction task, wherein the information extraction task includes a text to be extracted and at least two prompts; inputs the text to be extracted and the at least two prompts into an information extraction model to determine an information extraction matrix corresponding to the information extraction task, wherein the information extraction matrix represents the correspondence between the text to be extracted and each prompt; and determines the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and the at least two prompts. By using an information extraction matrix to express the correspondence between the text to be extracted and each prompt based on the parallel input of multiple prompts, the information extraction speed is not affected by the complexity of the information extraction schema, thus improving the efficiency of information extraction. Attached Figure Description

[0043] Figure 1 This is an architecture diagram of an information extraction system provided in one embodiment of this specification;

[0044] Figure 2 This is a flowchart of an information extraction method provided in one embodiment of this specification;

[0045] Figure 3 This is a flowchart of an article identification method provided in one embodiment of this specification;

[0046] Figure 4 This is a flowchart illustrating an information extraction model training method provided in one embodiment of this specification;

[0047] Figure 5 This is a flowchart of another information extraction method provided in one embodiment of this specification;

[0048] Figure 6 This is a flowchart illustrating the processing steps of an information extraction method provided in one embodiment of this specification.

[0049] Figure 7 This is a flowchart illustrating the processing procedure of another information extraction method provided in one embodiment of this specification.

[0050] Figure 8 This is a schematic diagram of the attention mask matrix in an information extraction method provided in one embodiment of this specification;

[0051] Figure 9 This is a schematic diagram of an information extraction interface provided in one embodiment of this specification;

[0052] Figure 10 This is a schematic diagram of the structure of an information extraction device provided in one embodiment of this specification;

[0053] Figure 11 This is a schematic diagram of the structure of an item identification device provided in one embodiment of this specification;

[0054] Figure 12 This is a schematic diagram of the structure of an information extraction model training device provided in one embodiment of this specification;

[0055] Figure 13 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0056] Many specific details are set forth in the following description to provide 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 extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0057] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as 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.

[0058] 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, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

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

[0060] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0061] Prompt learning: A method that leverages the capabilities of pre-trained models to achieve better results in low-resource scenarios.

[0062] Universal Information Extraction (UIE): This involves extracting information structures (entities, relationships, events, etc.) from a given set of free text according to a specific extraction framework. Different extraction frameworks can extract different information structures from the same input text.

[0063] BERT Model: The BERT (Bidirectional Encoder Representation from Transformers) model is a pre-trained language representation model that acts as an encoder to extract features from input text. It emphasizes a departure from traditional unidirectional language models or shallow concatenation of two unidirectional language models for pre-training. Instead, it employs a novel masked language model to generate deep bidirectional language representations.

[0064] seq2seq: seq2seq is an encoder-decoder network where the input is a sequence and the output is also a sequence. The encoder transforms a variable-length signal sequence into a fixed-length vector representation, and the decoder transforms this fixed-length vector into a variable-length target signal sequence.

[0065] With the development of computer technology, text processing increasingly relies on the internet. Text processing is the process of analyzing, understanding, and extracting information from text, and it has been widely applied in various aspects of people's daily lives. Taking information extraction as an example, information extraction refers to text processing techniques that extract specific types of entity, relation, event, and other factual information from natural language text and output structured data.

[0066] Currently, common information extraction schemes include the following two types: First, information extraction is based on Machine Reading Comprehension (MRC). However, this method has a long inference time due to the central processing unit (CPU). Second, information extraction is based on seq2seq. However, seq2seq-based information extraction suffers from poor efficiency. Therefore, a more efficient information extraction scheme is urgently needed.

[0067] To address the aforementioned issues, this specification provides an information extraction method. The method receives an information extraction task, which includes a text to be extracted and at least two prompts. The text to be extracted and the at least two prompts are input into an information extraction model to determine an information extraction matrix corresponding to the task. This information extraction matrix represents the correspondence between the text to be extracted and each prompt. Based on the information extraction matrix, the text to be extracted, and the at least two prompts, the target extraction result corresponding to the task is determined. By using an information extraction matrix to express the correspondence between the text to be extracted and each prompt, and by allowing multiple prompts to be input in parallel, the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0068] This specification provides an information extraction method, and also relates to an item recognition method, an information extraction model training method, an information extraction device, an item recognition device, an information extraction model training device, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0069] See Figure 1 , Figure 1 This specification illustrates an architecture diagram of an information extraction system according to one embodiment. The information extraction system may include a client 100 and a server 200.

[0070] Client 100 is used to send an information extraction task to server 200, wherein the information extraction task includes the text to be extracted and at least two prompt messages;

[0071] Server 200 is used to input the text to be extracted and at least two prompts into the information extraction model, determine the information extraction matrix corresponding to the information extraction task, wherein the information extraction matrix represents the correspondence between the text to be extracted and each prompt; determine the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted and at least two prompts; and send the target extraction result corresponding to the information extraction task to client 100.

[0072] Client 100 is also used to receive the target extraction results corresponding to the information extraction task sent by server 200.

[0073] The scheme described in this specification involves receiving an information extraction task, wherein the information extraction task includes a text to be extracted and at least two prompts; inputting the text to be extracted and the at least two prompts into an information extraction model to determine an information extraction matrix corresponding to the information extraction task, wherein the information extraction matrix represents the correspondence between the text to be extracted and each prompt; and determining the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and the at least two prompts. By using an information extraction matrix to express the correspondence between the text to be extracted and each prompt based on the parallel input of multiple prompts, the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0074] In practical applications, an information extraction system may include multiple clients 100 and a server 200. Multiple clients 100 can establish communication connections 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 can act as senders or receivers respectively, and communicate through the server 200.

[0075] Users can interact with server 200 through client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the information extraction scenario, users can publish data streams to server 200 through client 100, server 200 can generate information extraction results based on the data stream, and push the information extraction results to other clients that have established communication.

[0076] In this system, client 100 and server 200 establish a connection via a network. The network provides the medium for communication between client 100 and server 200. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. Data transmitted by client 100 may need to undergo encoding, transcoding, compression, or other processing before being published to server 200.

[0077] Client 100 can be a browser, an app (application), a web application such as an H5 (HyperText Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. Client 100 can be developed based on the software development kit (SDK) of the corresponding service provided by server 200, such as a real-time communication (RTC) SDK. Client 100 can be deployed on electronic devices and depends on the device or certain apps on the device to run. Electronic devices may have displays and support information browsing, such as personal mobile terminals like mobile phones, tablets, and personal computers. Various other types of applications can also be configured on electronic devices, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.

[0078] Server 200 may include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server 200 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be a cloud server (cloud-side device) providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0079] It is worth noting that the information extraction method provided in the embodiments of this specification is generally executed by the server. However, 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 executed jointly by the client and the server.

[0080] See Figure 2 , Figure 2 This specification shows a flowchart of an information extraction method according to an embodiment, which specifically includes the following steps:

[0081] Step 202: Receive information extraction task, wherein the information extraction task includes the text to be extracted and at least two prompt messages.

[0082] In one or more embodiments of this specification, the information extraction task can be processed based on the text to be extracted and at least two prompts in the information extraction task, thereby realizing information extraction.

[0083] Specifically, information extraction tasks refer to the task of extracting continuous text segments from a text to be extracted. There are various types of information extraction tasks, including but not limited to named entity recognition, relation extraction, event extraction, and attribute sentiment extraction. Information extraction tasks can be performed in different scenarios, including but not limited to financial scenarios, conference scenarios, and e-commerce scenarios. The text to be extracted is the object of information extraction. The prompting information is used to guide the information extraction process; it can be understood as a schema, a general and abstract description of things, reflecting the level of understanding and determining the machine's ability to extract events.

[0084] It should be noted that the named entity recognition task is a binary task including entity type and entity span. The relation extraction task is a triple task including subject span, relation type, and object span. The event extraction task is a quadruple task including event type, trigger word span, argument type, and argument span. The attribute sentiment extraction task is a triple task including topic, sentiment span, and sentiment polarity.

[0085] Step 204: Input the text to be extracted and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the information extraction task. The information extraction matrix represents the correspondence between the text to be extracted and each prompt.

[0086] In one or more embodiments of this specification, after receiving an information extraction task, the text to be extracted and at least two prompts can be input into the information extraction model to determine the information extraction matrix corresponding to the information extraction task.

[0087] Specifically, the information extraction model is trained based on multiple sample texts, information extraction labels carried by each sample text, and at least two sample prompts. The sample prompts are derived by transforming the outlines corresponding to the sample texts. The information extraction model is a machine learning model, which can be understood as a trained program that can discover patterns and make predictions in new data. These models are represented as a mathematical function that accepts requests in the form of input data, makes predictions on the input data, and then provides an output as a response.

[0088] In practical applications, the information extraction model includes a feature extraction layer and an attention layer. The text to be extracted and at least two prompts can be input into the information extraction model. The feature extraction layer extracts features from the text and the prompts, and the attention layer processes the prompt and text features output by the feature extraction layer to obtain the information extraction matrix. In other words, the process of inputting the text and at least two prompts into the information extraction model and determining the information extraction matrix corresponding to the information extraction task can include the following steps:

[0089] Input the text to be extracted and at least two prompts into the feature extraction layer to obtain the text features of the text to be extracted and the prompt features corresponding to each prompt.

[0090] The text features of the text to be extracted and the prompt features corresponding to each prompt are input into the attention layer to obtain the information extraction matrix corresponding to the information extraction task.

[0091] Specifically, the information extraction model includes an input layer, a feature extraction layer, an attention layer, and an output layer. The input layer feeds the text to be extracted and at least two prompts into the feature extraction layer; the feature extraction layer outputs encoded features to the attention layer; the attention layer transforms the encoded features into a two-dimensional fractional matrix, i.e., the information extraction matrix; the output layer calculates the extracted information based on the positions of 0s and 1s in the information extraction matrix. The feature extraction layer, also known as the encoder layer, generates a high-dimensional spatial representation of the input information, i.e., the text features of the text to be extracted and the prompt features corresponding to each prompt. Text features can also be called text vectors, and prompt features can also be called prompt vectors. The feature extraction layer includes, but is not limited to, recurrent neural networks (RNNs), convolutional neural networks (CNNs), etc., selected according to the specific situation; this specification does not limit this selection in any way.

[0092] It should be noted that in the attention layer, the attention distribution of the input information can be calculated through the attention mechanism, and then the weighted average of the input information can be calculated based on the attention distribution to obtain the information extraction matrix corresponding to the information extraction task.

[0093] By applying the scheme of the embodiments of this specification, the text to be extracted and at least two prompts are input into the feature extraction layer to obtain the text features of the text to be extracted and the prompt features corresponding to each prompt; the text features of the text to be extracted and the prompt features corresponding to each prompt are input into the attention layer to obtain the information extraction matrix corresponding to the information extraction task. The correspondence between the text to be extracted and each prompt is expressed through the information extraction matrix, so that the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0094] In one optional embodiment of this specification, the above-mentioned inputting the text features of the text to be extracted and the prompt features corresponding to each prompt message into the attention layer to obtain the information extraction matrix corresponding to the information extraction task may include the following steps:

[0095] In the attention layer, a feature matrix is ​​constructed based on the text features of the text to be extracted and the prompt features corresponding to each prompt.

[0096] Based on the attention mechanism and feature matrix, determine the information extraction matrix corresponding to the information extraction task.

[0097] Specifically, the feature matrix includes multiple feature vectors, and the information extraction matrix can be a "01" matrix. Based on the valid value "1" in the information extraction matrix, the extraction result corresponding to the information extraction task can be determined.

[0098] It should be noted that there are multiple ways to construct the feature matrix based on the text features of the text to be extracted and the prompt features corresponding to each prompt. The specific method should be selected according to the actual situation, and the embodiments in this specification do not impose any limitations on this. In one possible implementation of this specification, the text to be extracted and the prompt features corresponding to each prompt can be concatenated to obtain concatenated features. Further, the concatenated features are used as rows and columns of a matrix to construct a feature matrix. In another possible implementation of this specification, the text features can be used as rows and columns of a matrix to construct a first matrix, and the prompt features corresponding to each prompt can be used as rows and columns of a matrix to construct a second matrix. Thus, a feature matrix is ​​constructed based on the first matrix and the second matrix.

[0099] Furthermore, after constructing and obtaining the feature matrix, the attention mechanism in the self-attention layer can be used to perform attention calculation on the feature matrix, thereby obtaining the information extraction matrix corresponding to the information extraction task.

[0100] By applying the scheme of the embodiments of this specification, in the attention layer, a feature matrix is ​​constructed based on the text features of the text to be extracted and the prompt features corresponding to each prompt. Based on the attention mechanism and the feature matrix, the information extraction matrix corresponding to the information extraction task is determined. A two-dimensional information extraction matrix is ​​obtained by calculating the vector product. The information extraction matrix is ​​used to express the correspondence between the text to be extracted and each prompt, so that the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0101] In another optional embodiment of this specification, the positional information of each character and the masking method can be introduced into the feature extraction layer processing to improve the accuracy of the information processing model. That is, the feature extraction layer includes an embedding layer and at least one encoding layer. The above-mentioned inputting the text to be extracted and at least two prompts into the feature extraction layer to obtain the text features of the text to be extracted and the prompt features corresponding to each prompt can include the following steps:

[0102] The text to be extracted and each prompt message are input into the embedding layer. In the embedding layer, the position information of each character in the text to be extracted and the position information of each character in each prompt message are used to determine the text feature sequence of the text to be extracted and the prompt feature sequence of each prompt message.

[0103] The text feature sequence of the text to be extracted and the prompt feature sequence of each prompt are input into at least one encoding layer. In at least one encoding layer, the text features of the text to be extracted and the prompt features corresponding to each prompt are determined by using an attention mask matrix.

[0104] Specifically, the feature extraction layer can use a pre-trained language model, consisting of an embedding layer and at least one encoding layer, where the encoding layer is a transformer structure. The embedding layer transforms the discrete characters in the text to be extracted and each prompt into an embedded feature sequence, i.e., a text feature sequence and a prompt feature sequence. When calculating the embedded feature sequence, the positional information (positionid) of the characters can be incorporated to accurately extract information. The at least one encoding layer can calculate a high-dimensional vector representation of the embedded feature sequence, i.e., the text features and the prompt features corresponding to each prompt. When calculating the high-dimensional vector representation using the at least one encoding layer, an attention mask matrix can be used.

[0105] The schemes implemented in this specification incorporate positional information into the processing of the embedding layer and an attention mask matrix into the processing of at least one coding layer, thereby improving the accuracy of the information processing model.

[0106] Furthermore, the attention layer includes a first feedforward neural network layer and a second feedforward neural network layer; the above-mentioned inputting the text features of the text to be extracted and the prompt features corresponding to each prompt information into the attention layer to obtain the information extraction matrix corresponding to the information extraction task may include the following steps:

[0107] The text features and the prompt features corresponding to each prompt message are input into the first feedforward neural network layer to obtain the first network features;

[0108] The text features and the prompt features corresponding to each prompt message are input into the second feedforward neural network layer to obtain the second network features;

[0109] Calculate the relative position features based on the text features and the feature position information of the prompt features corresponding to each prompt message;

[0110] Based on the first network features, the second network features, and the relative position features, the information extraction matrix corresponding to the information extraction task is determined.

[0111] Specifically, the attention layer can be a rotated attention layer, which transforms the high-dimensional feature representation into a two-dimensional information extraction matrix. This information extraction matrix represents the score between every two characters. The rotated attention layer includes two feedforward neural networks: a first feedforward neural network and a second feedforward neural network. These two feedforward neural networks convert the high-dimensional features into two network features, respectively. The information extraction matrix can then be calculated using the vector product of the outputs of the two feedforward neural networks and the relative position features.

[0112] In practical applications, the information extraction matrix can be determined in the attention layer using the following formula (1):

[0113]

[0114] Where T represents the matrix transpose operation. The product is the Kronecker product, and Z represents the output two-dimensional information extraction matrix. It is the value in the j-th row and k-th column, and h is the output of the feature extraction layer, i.e., the input of the attention layer. This represents the high-dimensional feature of the j-th word in the i-th row; Represents the high-dimensional features of the k-th word in the i-th row, FFNN q This represents the first feedforward neural network, FFNN. k This represents the second feedforward neural network, where the first and second feedforward neural networks transform h into two different network features, respectively. This represents the position code of the k-th position in the i-th row. This represents the position code of the i-th row and j-th position. It is based on and The relative position features calculated from the distance between them can also be called relative position encoding vectors, and M is the attention matrix.

[0115] The scheme implemented in this specification involves inputting text features and prompt features corresponding to each prompt message into a first feedforward neural network layer to obtain first network features; inputting text features and prompt features corresponding to each prompt message into a second feedforward neural network layer to obtain second network features; calculating relative position features based on the feature position information of the text features and prompt features corresponding to each prompt message; and determining the information extraction matrix corresponding to the information extraction task based on the first network features, the second network features, and the relative position features. By introducing relative position features into the rotating attention layer, the accuracy of the information processing model is improved.

[0116] Step 206: Based on the information extraction matrix, the text to be extracted, and at least two prompts, determine the target extraction result corresponding to the information extraction task.

[0117] In one or more embodiments of this specification, an information extraction task is received, the text to be extracted and at least two prompts are input into the information extraction model, and after determining the information extraction matrix corresponding to the information extraction task, the target extraction result corresponding to the information extraction task can be further determined based on the information extraction matrix, the text to be extracted and at least two prompts.

[0118] By applying the scheme of the embodiments in this specification, based on the parallel input of multiple prompts, the correspondence between the text to be extracted and each prompt is expressed by an information extraction matrix, so that the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0119] In practical applications, there are multiple ways to determine the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and at least two prompts. The specific method should be selected according to the actual situation, and the embodiments in this specification do not limit this in any way.

[0120] In one possible implementation of this specification, the text to be extracted and at least two prompt messages can be merged to obtain merge identification information. The merge identification information is then used to identify the rows and columns of the information extraction matrix. The merge identification information corresponding to the valid values ​​in the information extraction matrix is ​​then searched to obtain the target extraction result corresponding to the information extraction task.

[0121] For example, assuming the text to be extracted is "Zhang San's hometown is in XY City", and at least two prompts are "person" and "city", then by merging the text to be extracted and the at least two prompts, the merged identifier information is "". <hint>City <hint>figure <sep>Zhang San's hometown is XY City. <sep>Assuming the information extraction matrix is ​​a 16*16 "01" matrix, by using merge identifiers to label the rows and columns of the information extraction matrix, and searching for the merge identifiers corresponding to the valid value "1" in the information extraction matrix, the target extraction result for the information extraction task can be obtained. It should be noted that... <hint>and <sep>This is an identifier used to separate the text to be extracted from the prompt message.

[0122] In another possible implementation of this specification, a text matrix can be constructed based on the text to be extracted and at least two prompts. Then, based on the valid values ​​in the information extraction matrix, the target extraction result can be extracted from the text matrix. That is, determining the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and at least two prompts can include the following steps:

[0123] Construct a text matrix based on the text to be extracted and at least two prompts;

[0124] Based on the information extraction matrix, extract the target extraction results corresponding to the information extraction task from the text matrix.

[0125] It should be noted that when constructing a text matrix based on the text to be extracted and at least two prompts, the text to be extracted and at least two prompts can be concatenated, and the concatenated text information can be used as the rows and columns of the matrix to construct the text matrix.

[0126] For example, assuming the text to be extracted is "Zhang San's hometown is in XY City", and at least two prompts are "person" and "city", then the text to be extracted and the at least two prompts are combined to obtain " <hint>City <hint>figure <sep>Zhang San's hometown is XY City. <sep>”, respectively <hint>City <hint>figure <sep>Zhang San's hometown is XY City. <sep>"Using these as rows and columns of the text matrix yields a 16x16 text matrix. Based on the information extraction matrix, the target extraction results corresponding to the information extraction task are extracted from the text matrix."

[0127] In one optional embodiment of this specification, before extracting the target extraction result corresponding to the information extraction task from the text matrix according to the information extraction matrix, the text matrix and the information extraction matrix can be aligned so as to accurately extract the target extraction result corresponding to the information extraction task from the text matrix according to the information extraction matrix.

[0128] The scheme implemented in this specification constructs a text matrix based on the text to be extracted and at least two prompts; based on the information extraction matrix, the target extraction result corresponding to the information extraction task is extracted from the text matrix, so that the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0129] In one optional embodiment of this specification, since information extraction tasks are usually quite complex, in order to improve the extraction efficiency of information extraction tasks, in this embodiment of the specification, when the information extraction task includes information extraction subtasks, at least two information extraction subtasks and the initial prompt information corresponding to each information extraction subtask can be determined, and the information extraction subtasks can be processed by recursive reasoning. That is, after receiving the information extraction task, the following steps may also be included:

[0130] Analyze the information extraction task to determine at least two information extraction subtasks and the initial prompt information corresponding to each information extraction subtask;

[0131] Based on the initial prompt and the extraction results of the completed information extraction subtasks, determine the current prompt corresponding to the current information extraction subtask.

[0132] Specifically, a completed information extraction subtask refers to a subtask for which the extraction result has been obtained. A current information extraction subtask refers to the subtask in the current information extraction process that is about to extract information but has not yet obtained the extraction result. The initial prompt information corresponding to each information extraction subtask may include one prompt message or multiple prompt messages, depending on the actual situation. This specification does not impose any limitations on this aspect in the embodiments.

[0133] For example, suppose the information extraction task includes prompts for "person, city, hometown". Classifying these three prompts, we determine that "person" and "city" are entities, and "hometown" is a relational entity. Therefore, the information extraction task can be divided into two sub-tasks: Sub-task 1 is "extracting entities of the 'person' and 'city' types", with initial prompts for "person, city"; Sub-task 2 is "extracting the hometown entity corresponding to the person", with initial prompts for "person, hometown".

[0134] In the embodiments of this specification, when processing at least two information extraction subtasks recursively, for the current information extraction subtask, since the current information extraction subtask processing can use the extraction results of the completed information extraction subtasks, such as in the example above, when executing information extraction subtask 2, it is necessary to know the entity corresponding to the person in order to determine the person's hometown entity. Therefore, the current prompt information corresponding to the current information extraction subtask can be determined based on the initial prompt information and the extraction results of the completed information extraction subtasks.

[0135] Referring to the example above, assuming the current information extraction subtask is information extraction subtask 2, the current prompt information corresponding to the current information extraction subtask is "Person: Zhang San; Hometown".

[0136] By applying the scheme of the embodiments in this specification, the information extraction task is parsed to determine at least two information extraction sub-tasks and the initial prompt information corresponding to each information extraction sub-task; based on the initial prompt information and the extraction results of the completed information extraction sub-tasks, the current prompt information corresponding to the current information extraction sub-task is determined. By parsing the information extraction task, the complex information extraction task is transformed into at least two simple information extraction sub-tasks, enabling this scheme to support information extraction tasks with arbitrary combinations of information extraction sub-tasks, thus improving the universality of information extraction.

[0137] In practical applications, there are multiple ways to parse an information extraction task, determine at least two information extraction sub-tasks and the initial prompt information corresponding to each information extraction sub-task, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on this method in its embodiments. One possible implementation in this specification is to classify the information extraction task according to at least one task type corresponding to the information extraction task, and then determine at least two information extraction sub-tasks corresponding to the information extraction task and the initial prompt information corresponding to each information extraction sub-task.

[0138] In another possible implementation of this specification, the information extraction task can be split according to at least two prompts included in the information extraction task to obtain at least two information extraction sub-tasks and the initial prompts corresponding to each information extraction sub-task. That is, the above-mentioned parsing of the information extraction task and determination of at least two information extraction sub-tasks and the initial prompts corresponding to each information extraction sub-task may include the following steps:

[0139] Classify at least two prompts in the information extraction task and determine the prompt type corresponding to each prompt.

[0140] Based on the prompt type corresponding to each prompt, determine at least two information extraction subtasks corresponding to the information extraction task and the initial prompt information corresponding to each information extraction subtask.

[0141] In practical applications, there are multiple ways to classify at least two prompts in an information extraction task and determine the prompt type corresponding to each prompt. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. One possible implementation of this specification is to look up the prompt type corresponding to each prompt from a preset prompt-type relationship table. Another possible implementation of this specification is to input each prompt into a pre-trained information classification model to obtain the prompt type corresponding to each prompt.

[0142] Furthermore, after determining the prompt type corresponding to each prompt, the information extraction task can be divided according to the number of prompt types, at least two information extraction sub-tasks can be determined, and prompts of the same prompt type can be used as the initial prompts for the information extraction sub-tasks corresponding to that prompt type.

[0143] By applying the scheme of the embodiments of this specification, at least two prompts in the information extraction task are classified to determine the prompt type corresponding to each prompt; based on the prompt type corresponding to each prompt, at least two information extraction sub-tasks corresponding to the information extraction task and the initial prompts corresponding to each information extraction sub-task are determined, thus ensuring the accuracy of the initial prompts.

[0144] In one optional embodiment of this specification, when the information extraction task is divided into at least two information extraction sub-tasks, the above-mentioned inputting the text to be extracted and at least two prompt messages into the information extraction model to determine the information extraction matrix corresponding to the information extraction task may include the following steps:

[0145] Input the text to be extracted and the current prompt information into the information extraction model to determine the information extraction matrix corresponding to the current information extraction subtask;

[0146] The above-mentioned determination of the target extraction result for the information extraction task based on the information extraction matrix, the text to be extracted, and at least two prompts may include the following steps:

[0147] Based on the information extraction matrix corresponding to the current information extraction subtask, determine the extraction result corresponding to the current information extraction subtask;

[0148] Based on the extraction results of each information extraction subtask, determine the target extraction result corresponding to the information extraction task.

[0149] It should be noted that the implementation method of "inputting the text to be extracted and the current prompt information into the information extraction model to determine the information extraction matrix corresponding to the current information extraction subtask" is the same as the implementation method of "inputting the text to be extracted and at least two prompt information into the information extraction model to determine the information extraction matrix corresponding to the information extraction task" described above, and will not be repeated in the embodiments of this specification.

[0150] Furthermore, after determining the information extraction matrix corresponding to the current information extraction subtask, the extraction result corresponding to the current information extraction subtask can be determined based on the current information extraction subtask, the text to be extracted, and the current prompt information. The implementation method of "determining the extraction result corresponding to the current information extraction subtask based on the information extraction matrix corresponding to the current information extraction subtask" is the same as the implementation method of "determining the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and at least two prompt information" described above, and will not be repeated in the embodiments of this specification.

[0151] In the embodiments of this specification, after determining the extraction results corresponding to each information extraction subtask, the extraction results corresponding to each information extraction subtask can be integrated, and the integrated extraction results can be used as the target extraction result.

[0152] For example, suppose the information extraction task includes information extraction subtask A and information extraction subtask B. The initial prompt information for information extraction subtask A is 'a', and the initial prompt information for information extraction subtask B is 'b'. When the current information extraction subtask is information extraction subtask A, the current prompt information is 'a'. The text to be extracted and the current prompt information 'a' are input into the information extraction model to determine the information extraction matrix A corresponding to information extraction subtask A. Based on the information extraction matrix A, the text to be extracted, and the current prompt information 'a', the extraction result corresponding to information extraction subtask A is determined to be 'A'. When the current information extraction subtask is information extraction subtask B, based on the initial prompt information 'b' of information extraction subtask B and the extraction result A of the completed information extraction subtask A, the current prompt information for the current information extraction subtask B is determined to be 'A+b'. Input the text to be extracted and the current prompt information A+b into the information extraction model to determine the information extraction matrix B corresponding to the information extraction subtask B. Based on the information extraction matrix B, the text to be extracted, and the current prompt information A+b, determine the extraction result B corresponding to the information extraction subtask B.

[0153] The scheme implemented in this specification involves inputting the text to be extracted and the current prompt information into the information extraction model to determine the information extraction matrix corresponding to the current information extraction subtask. Based on the information extraction matrix, the extraction result corresponding to the current information extraction subtask is determined. Based on the extraction results of each information extraction subtask, the target extraction result corresponding to the information extraction task is determined. By parsing the information extraction task, complex information extraction tasks are transformed into at least two simple information extraction subtasks. This allows the scheme to support information extraction tasks with arbitrary combinations of information extraction subtasks, improving the universality of information extraction. Furthermore, by expressing the correspondence between the text to be extracted and the current prompt information through the information extraction matrix, the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0154] In one optional embodiment of this specification, before determining the current prompt information corresponding to the current information extraction sub-task based on the initial prompt information and the extraction results of the completed information extraction sub-tasks, it can be determined whether there are currently completed information extraction sub-tasks, and the current prompt information corresponding to the current information extraction sub-task can be determined based on the determination result. That is, before determining the current prompt information corresponding to the current information extraction sub-task based on the initial prompt information and the extraction results of the completed information extraction sub-tasks, the following steps may also be included:

[0155] Find the extraction results corresponding to each information extraction subtask and obtain the search results;

[0156] Based on the search results, determine whether there is a completed information extraction subtask.

[0157] For example, suppose the information extraction task includes information extraction subtasks A, B, and C, where information extraction subtask A corresponds to extraction result A. If the current information extraction subtask is information extraction subtask B, then by searching through information extraction subtasks A, B, and C, and determining that information extraction subtask A corresponds to an extraction result, it is determined that there exists a completed information extraction subtask, and that the completed information extraction subtask is information extraction subtask A with an extraction result.

[0158] By applying the scheme of the embodiments in this specification, the extraction results corresponding to each information extraction subtask are searched to obtain the search results; based on the search results, it is determined whether there is a completed information extraction subtask, and each information extraction subtask is fully and completely traversed, thereby ensuring the accuracy of the completed information extraction subtask and further improving the accuracy of the current prompt information.

[0159] In practical applications, determining whether a completed information extraction subtask exists can yield two results: yes or no. Further, based on these results, the current prompt information for the current information extraction subtask can be determined. That is, determining the current prompt information for the current information extraction subtask based on the initial prompt information and the extraction results of completed subtasks can include the following steps:

[0160] If there is no completed information extraction subtask, the initial prompt information will be used as the current prompt information for the current information extraction subtask.

[0161] If there is a completed information extraction subtask, determine the current prompt information corresponding to the current information extraction subtask based on the initial prompt information and the extraction results of the completed information extraction subtask.

[0162] It should be noted that if no completed information extraction subtask exists, it means that the current information extraction subtask is the first subtask to begin information extraction. In this case, the initial prompt information corresponding to that subtask is directly used as the current prompt information for the current information extraction subtask. If completed information extraction subtasks exist, it means that the current information extraction subtask is not the first subtask to begin information extraction. The current prompt information for the current information extraction subtask is affected by the extraction results of the completed subtasks. Therefore, the current prompt information for the current information extraction subtask can be determined based on the initial prompt information and the extraction results of the completed subtasks.

[0163] Furthermore, when determining the current prompt information corresponding to the current information extraction subtask based on the initial prompt information and the extraction results of the completed information extraction subtasks, the initial prompt information and the extraction results of the completed information extraction subtasks can be merged to obtain the current prompt information.

[0164] The solution implemented in this specification ensures the accuracy of the current prompt information by determining the current prompt information based on whether there is a completed information extraction subtask, using recursive reasoning.

[0165] In one optional embodiment of this specification, the training method of the above-described information extraction model may include the following steps:

[0166] Obtain a sample set, which includes multiple sample texts, each carrying information such as extraction labels and at least two sample prompts;

[0167] Extract the first sample text from multiple sample texts, where the first sample text is any one of the multiple sample texts;

[0168] Input the first sample text and the first sample prompt information carried by the first sample into the initial information extraction model to obtain the first prediction information extraction matrix corresponding to the first sample text;

[0169] Based on the first prediction information extraction matrix, the first sample text, and the first sample prompt information, determine the first prediction extraction result corresponding to the first sample text;

[0170] Compare the first predicted extraction result with the first information extraction label carried by the first sample text, and calculate the loss value;

[0171] Adjust the model parameters of the initial information extraction model based on the loss value, and return to the step of extracting the first sample text from multiple sample texts until the preset stopping condition is reached to obtain the information extraction model.

[0172] Specifically, the model parameters of the initial information extraction model are initialized using a pre-trained model (such as the BERT model). The training method for the information extraction model is supervised training based on cue learning, meaning that each sample text in the sample set carries a real information extraction label. The information extraction label is the extraction target of the information extraction model and is used to guide the training process of the information extraction model. The sample set can be obtained by reading a large number of sample texts carrying information extraction labels and at least two sample cue messages from other data acquisition devices or databases. Alternatively, it can be obtained by receiving a large number of sample texts carrying information extraction labels and at least two sample cue messages from user input. The specific method of obtaining the text training set is selected according to the actual situation, and this specification does not limit it in any way.

[0173] It is worth noting that the implementation method of "inputting the first sample text and the first sample prompt information carried by the first sample into the initial information extraction model to obtain the first predicted information extraction matrix corresponding to the first sample text" is the same as the implementation method of "inputting the text to be extracted and at least two prompt information into the information extraction model to determine the information extraction matrix corresponding to the information extraction task"; the implementation method of "determining the first predicted extraction result corresponding to the first sample text based on the first predicted information extraction matrix, the first sample text and the first sample prompt information" is the same as the implementation method of "determining the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted and at least two prompt information", and will not be described again in the embodiments of this specification.

[0174] In one possible implementation of this specification, the preset stopping condition includes a loss value less than or equal to a preset threshold. After calculating the loss value based on the first predicted extraction result and the first information extraction label carried by the first sample text, the loss value is compared with the preset threshold.

[0175] Specifically, if the loss value is greater than the preset threshold, it indicates that there is a large difference between the first predicted extraction result and the first information extraction label carried by the first sample text, and the initial information extraction model has poor prediction ability for the first sample text. At this time, the model parameters of the initial information extraction model can be adjusted, and the step of extracting the first sample text from multiple sample texts can be returned to continue training the initial information extraction model until the loss value is less than or equal to the preset threshold, indicating that the difference between the first predicted extraction result and the first information extraction label carried by the first sample text is small, the preset stopping condition is reached, and the information extraction model that has been trained is obtained.

[0176] In another possible implementation of this specification, in addition to comparing the magnitude of the loss value and the preset threshold, the number of iterations can also be used to determine whether the current initial information extraction model has been trained.

[0177] Specifically, if the loss value is greater than a preset threshold, the model parameters of the initial information extraction model are adjusted, and the step of extracting the first sample text from multiple sample texts is returned to continue training the initial information extraction model until the preset number of iterations is reached, at which point the iteration stops and the trained information extraction model is obtained. The preset threshold and the preset number of iterations are selected according to the actual situation, and this specification does not limit them in any way.

[0178] In practical applications, there are many functions for calculating loss values, such as cross-entropy loss function, L1 norm loss function, maximum loss function, mean squared error loss function, log loss function, etc. The specific function to be selected depends on the actual situation, and the embodiments in this specification do not impose any limitations on this.

[0179] The scheme implemented in this specification involves calculating a loss value based on the first predicted extraction result and the first information extraction label carried by the first sample text. This loss value is then compared with a preset stopping condition. If the preset stopping condition is not met, the initial information extraction model continues to be trained until it is reached, thus completing the training and obtaining the information extraction model. By continuously adjusting the model parameters of the initial information extraction model, the final information extraction model can be made more accurate.

[0180] See Figure 3 , Figure 3 This specification shows a flowchart of an article identification method according to an embodiment, which specifically includes the following steps:

[0181] Step 302: Receive an object recognition task, wherein the object recognition task includes the text to be recognized and at least two prompts.

[0182] Step 304: Input the text to be recognized and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the item recognition task. The information extraction matrix represents the correspondence between the text to be recognized and each prompt.

[0183] Step 306: Based on the information extraction matrix, the text to be identified, and at least two prompts, determine the target recognition result corresponding to the item recognition task.

[0184] It should be noted that the implementation methods of steps 302-306 are the same as those of steps 202-206 above, and will not be described again in the embodiments of this specification.

[0185] In practical applications, taking e-commerce scenarios as an example, consumers can input text to be recognized through the client, which includes the items they want to buy. The client can generate an item recognition request based on the input text and send it to the server. The server can then use the item recognition method described above to determine the target recognition result for the item recognition task and send it to the client, allowing the client to display the result to the consumer. Furthermore, the client can also query corresponding items based on the target recognition result and recommend items that meet the consumer's needs.

[0186] By applying the scheme of the embodiments in this specification, based on the parallel input of multiple prompts, the correspondence between the text to be extracted and each prompt is expressed by an information extraction matrix, so that the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0187] See Figure 4 , Figure 4 This document illustrates a flowchart of an information extraction model training method according to an embodiment of this specification. The information extraction model training method is applied to cloud-side devices and specifically includes the following steps:

[0188] Step 402: Obtain a sample set, which includes multiple sample texts, each carrying an information extraction label and at least two sample prompts.

[0189] Step 404: Extract the first sample text from the multiple sample texts, where the first sample text is any one of the multiple sample texts.

[0190] Step 406: Input the first sample text and the first sample prompt information carried by the first sample into the initial information extraction model to obtain the first prediction information extraction matrix corresponding to the first sample text.

[0191] Step 408: Based on the first prediction information extraction matrix, the first sample text, and the first sample prompt information, determine the first prediction extraction result corresponding to the first sample text.

[0192] Step 410: Compare the first predicted extraction result with the first information extraction label carried by the first sample text, and calculate the loss value.

[0193] Step 412: Adjust the model parameters of the initial information extraction model according to the loss value, and return to the step of extracting the first sample text from multiple sample texts until the preset stopping condition is reached, and obtain the model parameters of the information extraction model.

[0194] Step 414: Send information to the end-side device to extract the model parameters of the model.

[0195] It should be noted that steps 402-412 are the same as those described above. Figure 2 The training method for the information extraction model in the provided information extraction method is the same, so the embodiments in this specification will not be described again.

[0196] In practical applications, after the cloud-side device sends the model parameters of the information extraction model to the end-side device, the end-side device can build the information extraction model locally based on the model parameters and then use the information extraction model to extract information.

[0197] The scheme implemented in this specification involves calculating a loss value based on the first predicted extraction result and the first information extraction label carried by the first sample text. This loss value is then compared with a preset stopping condition. If the preset stopping condition is not met, the initial information extraction model continues to be trained until it is reached, thus completing the training and obtaining the information extraction model. By continuously adjusting the model parameters of the initial information extraction model, the final information extraction model can be made more accurate.

[0198] See Figure 5 , Figure 5 This specification illustrates a flowchart of another information extraction method provided in one embodiment, which specifically includes the following steps:

[0199] Step 502: Receive information extraction task, wherein the information extraction task includes the text to be extracted and at least two prompt messages.

[0200] Step 504: Analyze the information extraction task and determine at least two information extraction subtasks and the initial prompt information corresponding to each information extraction subtask.

[0201] Step 506: If there is no completed information extraction subtask, use the initial prompt information as the current prompt information corresponding to the current information extraction subtask.

[0202] Step 508: If there is a completed information extraction subtask, determine the current prompt information corresponding to the current information extraction subtask based on the initial prompt information and the extraction results of the completed information extraction subtask.

[0203] Step 510: Input the text to be extracted and the current prompt information into the feature extraction layer to obtain the text features of the text to be extracted and the current prompt features corresponding to the current prompt information.

[0204] Step 512: In the attention layer, construct a feature matrix based on text features and current prompt features.

[0205] Step 514: Determine the information extraction matrix corresponding to the current information extraction subtask based on the attention mechanism and feature matrix.

[0206] Step 516: Construct a text matrix based on the text to be extracted and the current prompt information.

[0207] Step 518: Based on the information extraction matrix corresponding to the current information extraction subtask, extract the extraction results corresponding to the current information extraction subtask from the text matrix.

[0208] Step 520: Determine the target extraction result corresponding to the information extraction task based on the extraction results corresponding to each information extraction subtask.

[0209] It should be noted that the specific implementation methods of steps 502-520 are the same as those described above. Figure 2 The information extraction methods provided are implemented in the same way, so the embodiments in this specification will not be described again.

[0210] The solution implemented in this specification, by parsing the information extraction task, transforms a complex information extraction task into at least two simple information extraction sub-tasks. This allows the solution to support information extraction tasks with arbitrary combinations of information extraction sub-tasks, improving the universality of information extraction. Furthermore, based on the parallel input of multiple prompts, the correspondence between the text to be extracted and each prompt is expressed through an information extraction matrix. This ensures that the information extraction speed is not affected by the complexity of the information extraction outline, thereby improving the efficiency of information extraction.

[0211] See Figure 6 , Figure 6 A flowchart illustrating the processing steps of an information extraction method according to one embodiment of this specification is shown. See also... Figure 7 , Figure 7 A flowchart illustrating the processing steps of another information extraction method provided in one embodiment of this specification is shown. See also... Figure 8 , Figure 8 A schematic diagram of an attention mask matrix in an information extraction method provided in one embodiment of this specification is shown.

[0212] Assuming the information extraction task includes the prompts "person, city, hometown", the information extraction task is parsed and divided into two sub-tasks. Sub-task 1 is to "extract entities of the type 'person' and 'city'", with the initial prompts "person, city"; sub-task 2 is to "extract the hometown entity corresponding to the person", with the initial prompts "person, hometown".

[0213] For information extraction subtask 1: such as Figure 6 As shown, when information extraction subtask 1 is the current information extraction subtask, there are no completed information extraction subtasks. Therefore, the current prompt information corresponding to information extraction subtask 1 is "person, city". The text to be extracted, "Zhang San's hometown is in XY City", and the current prompt information "person, city" are input into the information extraction model to obtain the information extraction matrix. The information extraction matrix is ​​then updated based on the text to be extracted and the current prompt information to obtain the result shown below. Figure 6 The information extraction matrix shown is based on... Figure 6 The information extraction matrix shown determines that the extraction result corresponding to information extraction subtask 1 is "Person: Zhang San; City: XY / XY City".

[0214] It should be noted that, <hint>and <sep>`H`, `T`, `THWS`, and `NHW` are identifiers used to separate the text to be extracted from the prompt message. In the information extraction matrix, `H`, `T`, `THWS`, and `NHW` are valid values ​​and can also be converted to `1`. The `H` part of the information extraction matrix represents the correspondence between the starting position of the extraction result (span) and the prompt message; the `T` part represents the correspondence between the ending position of the extraction result and the prompt message; `THWS` indicates that there is an entity from column j to row i; and `NNW` indicates a continuous relationship between the entity features (token) from row i to column j.

[0215] For information extraction subtask 2: such as Figure 7 As shown, when information extraction subtask 2 is the current information extraction subtask, information extraction subtask 1 is the completed information extraction subtask. Therefore, based on the initial prompt information of information extraction subtask 2 and the extraction result of information extraction subtask 1, the current prompt information is determined to be "Person: Zhang San; Hometown". The text to be extracted, "Zhang San's hometown is in XY City," and the current prompt information, "Person: Zhang San; Hometown," are input into the information extraction model to obtain the information extraction matrix. The information extraction matrix is ​​then updated based on the text to be extracted and the current prompt information to obtain the result shown below. Figure 7 The information extraction matrix shown is based on... Figure 7 The information extraction matrix shown determines the extraction result corresponding to information extraction subtask 2 as "Person: Zhang San; Hometown: XY City".

[0216] In one optional embodiment of this specification, such as Figure 8 As shown, assuming the text to be extracted is "Zhang San's hometown is in XY City", using the above information extraction method, we can determine as follows: Figure 8 The attention mask matrix shown is as follows: dark squares represent 0, indicating that the attention between characters in the corresponding row and column is masked, while light squares represent 1. The attention mask matrix includes [CLS], Person, :, Zhang San, [T], Residence, (Location), Location, Work, (Organization), [P], X, Y, [Text], Zhang San's hometown is in XY City, and [SEP]. [CLS] is placed first, indicating classification, which can be understood as being used for downstream classification tasks. [P] represents location information, [Text] represents the text content to be extracted, and [SEP] is used to separate the two input sentences.

[0217] Furthermore, the same method can be used to determine the extraction results corresponding to prompts such as location, quantity, and population.

[0218] The solution implemented in this specification eliminates the need to enumerate all input prompts during information extraction. Instead, it concatenates multiple prompts into an input information extraction model and uses a matrix structure to represent the correspondence between the text to be extracted and each prompt. Since the text length is often much greater than the length of the concatenated prompts, the information extraction speed is unaffected by the complexity of the information extraction outline, resulting in a 70% improvement in reasoning efficiency. Furthermore, this solution employs a recursive reasoning approach for information extraction, supporting the extraction of any tuple set, thus achieving universal information extraction from tuples.

[0219] See Figure 9 , Figure 9 This diagram illustrates an information extraction interface according to an embodiment of this specification. The information extraction interface is divided into an information extraction task input interface and an information extraction result display interface. The information extraction task input interface includes an information extraction task input box, an "OK" control, and a "Cancel" control. The information extraction result display interface includes an information extraction result display box.

[0220] The user inputs an information extraction task through the input box displayed on the client and clicks the "OK" button. The server receives the information extraction task sent by the client. The task includes the text to be extracted and at least two prompts. The server inputs the text and the two prompts into the information extraction model to determine the information extraction matrix corresponding to the task. This matrix represents the correspondence between the text to be extracted and each prompt. Based on the extraction matrix, the text, and the two prompts, the server determines the target extraction result for the task and sends it to the client. The client displays the target extraction result in the information extraction result display box.

[0221] In practical applications, users can interact with controls in various ways, including clicking, double-clicking, touching, hovering, swiping, long-pressing, voice control, or shaking. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this.

[0222] Corresponding to the above method embodiments, this specification also provides embodiments of information extraction devices. Figure 10 A schematic diagram of an information extraction device according to one embodiment of this specification is shown. Figure 10 As shown, the device includes:

[0223] The first receiving module 1002 is configured to receive an information extraction task, wherein the information extraction task includes the text to be extracted and at least two prompt messages.

[0224] The first input module 1004 is configured to input the text to be extracted and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the information extraction task, wherein the information extraction matrix represents the correspondence between the text to be extracted and each prompt.

[0225] The first determining module 1006 is configured to determine the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and at least two prompts.

[0226] Optionally, the information extraction model includes a feature extraction layer and an attention layer; the first input module 1004 is further configured to input the text to be extracted and at least two prompts into the feature extraction layer to obtain the text features of the text to be extracted and the prompt features corresponding to each prompt; and input the text features of the text to be extracted and the prompt features corresponding to each prompt into the attention layer to obtain the information extraction matrix corresponding to the information extraction task.

[0227] Optionally, the first input module 1004 is further configured to construct a feature matrix in the attention layer based on the text features of the text to be extracted and the prompt features corresponding to each prompt information; and to determine the information extraction matrix corresponding to the information extraction task based on the attention mechanism and the feature matrix.

[0228] Optionally, the feature extraction layer includes an embedding layer and at least one encoding layer; the first input module 1004 is further configured to input the text to be extracted and each prompt information into the embedding layer, and in the embedding layer, use the position information of each character in the text to be extracted and the position information of each character in each prompt information to determine the text feature sequence of the text to be extracted and the prompt feature sequence of each prompt information; input the text feature sequence of the text to be extracted and the prompt feature sequence of each prompt information into at least one encoding layer, and in the at least one encoding layer, use an attention mask matrix to determine the text features of the text to be extracted and the prompt features corresponding to each prompt information.

[0229] Optionally, the attention layer includes a first feedforward neural network layer and a second feedforward neural network layer; the first input module 1004 is further configured to input text features and prompt features corresponding to each prompt information into the first feedforward neural network layer to obtain first network features; input text features and prompt features corresponding to each prompt information into the second feedforward neural network layer to obtain second network features; calculate relative position features based on the feature position information of text features and prompt features corresponding to each prompt information; and determine the information extraction matrix corresponding to the information extraction task based on the first network features, the second network features, and the relative position features.

[0230] Optionally, the first determining module 1006 is further configured to construct a text matrix based on the text to be extracted and at least two prompts; and to extract the target extraction result corresponding to the information extraction task from the text matrix based on the information extraction matrix.

[0231] Optionally, the device further includes: a parsing module configured to parse information extraction tasks, determine at least two information extraction subtasks and initial prompt information corresponding to each information extraction subtask; and determine the current prompt information corresponding to the current information extraction subtask based on the initial prompt information and the extraction results of the completed information extraction subtasks.

[0232] Optionally, the first input module 1004 is further configured to input the text to be extracted and the current prompt information into the information extraction model to determine the information extraction matrix corresponding to the current information extraction sub-task; the first determining module 1006 is further configured to determine the extraction result corresponding to the current information extraction sub-task based on the information extraction matrix corresponding to the current information extraction sub-task; and determine the target extraction result corresponding to the information extraction task based on the extraction results corresponding to each information extraction sub-task.

[0233] Optionally, the parsing module is further configured to classify at least two prompts in the information extraction task, determine the prompt type corresponding to each prompt, and determine at least two information extraction subtasks corresponding to the information extraction task and the initial prompts corresponding to each information extraction subtask based on the prompt type corresponding to each prompt.

[0234] Optionally, the device further includes: a search module configured to search for the extraction results corresponding to each information extraction subtask, and obtain the search results; and based on the search results, determine whether there are currently any completed information extraction subtasks.

[0235] Optionally, the parsing module is further configured to, in the absence of a completed information extraction subtask, use the initial prompt information as the current prompt information corresponding to the current information extraction subtask; and in the presence of a completed information extraction subtask, determine the current prompt information corresponding to the current information extraction subtask based on the initial prompt information and the extraction results of the completed information extraction subtask.

[0236] Optionally, the device further includes: an information extraction model training module configured to acquire a sample set, wherein the sample set includes multiple sample texts, each sample text carrying an information extraction label and at least two sample prompts; extract a first sample text from the multiple sample texts, wherein the first sample text is any one of the multiple sample texts; input the first sample text and the first sample prompts carried by the first sample text into an initial information extraction model to obtain a first predicted information extraction matrix corresponding to the first sample text; determine a first predicted extraction result corresponding to the first sample text based on the first predicted information extraction matrix, the first sample text, and the first sample prompts; compare the first predicted extraction result with the first information extraction label carried by the first sample text to calculate a loss value; adjust the model parameters of the initial information extraction model based on the loss value, and return to execute the step of extracting the first sample text from the multiple sample texts until a preset stopping condition is reached to obtain an information extraction model.

[0237] By applying the scheme of the embodiments in this specification, based on the parallel input of multiple prompts, the correspondence between the text to be extracted and each prompt is expressed by an information extraction matrix, so that the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0238] The above is a schematic scheme of an information extraction device according to this embodiment. It should be noted that the technical solution of this information extraction device and the technical solution of the information extraction method described above belong to the same concept. For details not described in detail in the technical solution of the information extraction device, please refer to the description of the technical solution of the information extraction method described above.

[0239] Corresponding to the above method embodiments, this specification also provides embodiments of an item recognition device. Figure 11 A schematic diagram of an article recognition device according to one embodiment of this specification is shown. Figure 11 As shown, the device includes:

[0240] The second receiving module 1102 is configured to receive an item recognition task, wherein the item recognition task includes text to be recognized and at least two prompt messages;

[0241] The second input module 1104 is configured to input the text to be recognized and at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the item recognition task, wherein the information extraction matrix represents the correspondence between the text to be recognized and each prompt.

[0242] The second determining module 1106 is configured to determine the target recognition result corresponding to the item recognition task based on the information extraction matrix, the text to be recognized, and at least two prompts.

[0243] By applying the scheme of the embodiments in this specification, based on the parallel input of multiple prompts, the correspondence between the text to be extracted and each prompt is expressed by an information extraction matrix, so that the information extraction speed is not affected by the complexity of the information extraction outline, thus improving the efficiency of information extraction.

[0244] The above is a schematic scheme of an item identification device according to this embodiment. It should be noted that the technical solution of this item identification device and the technical solution of the item identification method described above belong to the same concept. For details not described in detail in the technical solution of the item identification device, please refer to the description of the technical solution of the item identification method described above.

[0245] Corresponding to the above method embodiments, this specification also provides embodiments of an information extraction model training device. Figure 12 A schematic diagram of an information extraction model training device according to one embodiment of this specification is shown. Figure 12 As shown, this device is applied to cloud-side equipment and includes:

[0246] The acquisition module 1202 is configured to acquire a sample set, wherein the sample set includes multiple sample texts, and the sample texts carry information extraction labels and at least two sample prompt messages;

[0247] Extraction module 1204 is configured to extract a first sample text from multiple sample texts, wherein the first sample text is any one of the multiple sample texts;

[0248] The third input module 1206 is configured to input the first sample text and the first sample prompt information carried by the first sample into the initial information extraction model to obtain the first prediction information extraction matrix corresponding to the first sample text.

[0249] The third determining module 1208 is configured to determine the first prediction extraction result corresponding to the first sample text based on the first prediction information extraction matrix, the first sample text and the first sample prompt information.

[0250] The calculation module 1210 is configured to compare the first predicted extraction result with the first information extraction label carried by the first sample text and calculate the loss value.

[0251] The adjustment module 1212 is configured to adjust the model parameters of the initial information extraction model according to the loss value, and return to the step of extracting the first sample text from multiple sample texts until the preset stopping condition is reached, thereby obtaining the model parameters of the information extraction model.

[0252] The sending module 1214 is configured to send information to the end-side device to extract model parameters of the model.

[0253] The scheme implemented in this specification involves calculating a loss value based on the first predicted extraction result and the first information extraction label carried by the first sample text. This loss value is then compared with a preset stopping condition. If the preset stopping condition is not met, the initial information extraction model continues to be trained until it is reached, thus completing the training and obtaining the information extraction model. By continuously adjusting the model parameters of the initial information extraction model, the final information extraction model can be made more accurate.

[0254] The above is a schematic scheme of an information extraction model training device according to this embodiment. It should be noted that the technical solution of this information extraction model training device and the technical solution of the information extraction model training method described above belong to the same concept. For details not described in detail in the technical solution of the information extraction model training device, please refer to the description of the technical solution of the information extraction model training method described above.

[0255] Figure 13 A structural block diagram of a computing device according to one embodiment of this specification is shown. The components of the computing device 1300 include, but are not limited to, a memory 1310 and a processor 1320. The processor 1320 is connected to the memory 1310 via a bus 1330, and a database 1350 is used to store data.

[0256] The computing device 1300 also includes an access device 1340, which enables the computing device 1300 to communicate via one or more networks 1360. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 1340 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0257] In one embodiment of this specification, the above-described components of the computing device 1300 and Figure 13 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 13 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0258] The computing device 1300 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 1300 can also be a mobile or stationary server.

[0259] The processor 1320 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the aforementioned information extraction method, item recognition method, or information extraction model training method.

[0260] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solutions of the information extraction method, the item recognition method, and the information extraction model training method described above. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the information extraction method, the item recognition method, or the information extraction model training method described above.

[0261] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described information extraction method, item recognition method, or information extraction model training method.

[0262] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the information extraction method, the item recognition method, and the information extraction model training method described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the information extraction method, the item recognition method, or the information extraction model training method described above.

[0263] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described information extraction method, item recognition method, or information extraction model training method.

[0264] The above is an illustrative scheme of a computer program according to this embodiment. It should be noted that the technical solution of this computer program belongs to the same concept as the technical solutions of the information extraction method, the item recognition method, and the information extraction model training method described above. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solutions of the information extraction method, the item recognition method, or the information extraction model training method described above.

[0265] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0266] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0267] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0268] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0269] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.< / sep> < / hint> < / sep> < / sep> < / hint> < / hint> < / sep> < / sep> < / hint> < / hint> < / sep> < / hint> < / sep> < / sep> < / hint> < / hint>

Claims

1. An information extraction method, comprising: Receive an information extraction task, wherein the information extraction task includes the text to be extracted and at least two prompt messages; The text to be extracted and the at least two prompts are input into the information extraction model to determine the information extraction matrix corresponding to the information extraction task. The information extraction matrix represents the correspondence between the text to be extracted and each prompt. The rows and columns of the information extraction matrix are identified based on merged identification information, which is obtained by merging the text to be extracted and the at least two prompts. Based on the information extraction matrix, the text to be extracted, and the at least two prompts, the target extraction result corresponding to the information extraction task is determined.

2. The method according to claim 1, wherein the information extraction model comprises a feature extraction layer and an attention layer; The step of inputting the text to be extracted and the at least two prompts into the information extraction model to determine the information extraction matrix corresponding to the information extraction task includes: The text to be extracted and the at least two prompts are input into the feature extraction layer to obtain the text features of the text to be extracted and the prompt features corresponding to each prompt. The text features of the text to be extracted and the prompt features corresponding to each prompt are input into the attention layer to obtain the information extraction matrix corresponding to the information extraction task.

3. The method according to claim 2, wherein inputting the text features of the text to be extracted and the prompt features corresponding to each prompt message into the attention layer to obtain the information extraction matrix corresponding to the information extraction task includes: In the attention layer, a feature matrix is ​​constructed based on the text features of the text to be extracted and the prompt features corresponding to each prompt message; Based on the attention mechanism and the feature matrix, the information extraction matrix corresponding to the information extraction task is determined.

4. The method according to claim 2, wherein the feature extraction layer comprises an embedding layer and at least one encoding layer; The step of inputting the text to be extracted and the at least two prompt messages into the feature extraction layer to obtain the text features of the text to be extracted and the prompt features corresponding to each prompt message includes: The text to be extracted and each prompt message are input into the embedding layer. In the embedding layer, the text feature sequence of the text to be extracted and the prompt feature sequence of each prompt message are determined by using the position information of each character in the text to be extracted and the position information of each character in each prompt message. The text feature sequence of the text to be extracted and the prompt feature sequence of each prompt are input into the at least one encoding layer. In the at least one encoding layer, the text features of the text to be extracted and the prompt features corresponding to each prompt are determined by using an attention mask matrix.

5. The method according to claim 4, wherein the attention layer comprises a first feedforward neural network layer and a second feedforward neural network layer; The step of inputting the text features of the text to be extracted and the prompt features corresponding to each prompt message into the attention layer to obtain the information extraction matrix corresponding to the information extraction task includes: The text features and the prompt features corresponding to each prompt information are input into the first feedforward neural network layer to obtain the first network features; The text features and the prompt features corresponding to each prompt message are input into the second feedforward neural network layer to obtain the second network features; Calculate the relative position features based on the text features and the feature position information of the prompt features corresponding to each prompt message; Based on the first network feature, the second network feature, and the relative position feature, the information extraction matrix corresponding to the information extraction task is determined.

6. The method according to claim 1, wherein determining the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and the at least two prompt messages includes: Construct a text matrix based on the text to be extracted and the at least two prompts; Based on the information extraction matrix, the target extraction result corresponding to the information extraction task is extracted from the text matrix.

7. The method according to claim 1, further comprising, after the information extraction task: Analyze the information extraction task to determine at least two information extraction sub-tasks and the initial prompt information corresponding to each information extraction sub-task; Based on the initial prompt information and the extraction results of the completed information extraction sub-tasks, the current prompt information corresponding to the current information extraction sub-task is determined.

8. The method according to claim 7, wherein inputting the text to be extracted and the at least two prompts into an information extraction model to determine the information extraction matrix corresponding to the information extraction task includes: Input the text to be extracted and the current prompt information into the information extraction model to determine the information extraction matrix corresponding to the current information extraction subtask; The step of determining the target extraction result corresponding to the information extraction task based on the information extraction matrix, the text to be extracted, and the at least two prompt messages includes: Based on the information extraction matrix corresponding to the current information extraction subtask, determine the extraction result corresponding to the current information extraction subtask; Based on the extraction results corresponding to each information extraction subtask, the target extraction result corresponding to the information extraction task is determined.

9. The method according to claim 7, wherein parsing the information extraction task and determining at least two information extraction sub-tasks and initial prompt information corresponding to each information extraction sub-task includes: Classify at least two prompts in the information extraction task and determine the prompt type corresponding to each prompt; Based on the prompt type corresponding to each prompt message, determine at least two information extraction sub-tasks corresponding to the information extraction task and the initial prompt message corresponding to each information extraction sub-task.

10. The method according to claim 7, further comprising, before determining the current prompt information corresponding to the current information extraction subtask based on the initial prompt information and the extraction results of the completed information extraction subtasks: Find the extraction results corresponding to each information extraction subtask and obtain the search results; Based on the search results, determine whether there is a completed information extraction subtask.

11. The method according to any one of claims 7-10, wherein determining the current prompt information corresponding to the current information extraction subtask based on the initial prompt information and the extraction results of the completed information extraction subtasks includes: If there is no completed information extraction subtask, the initial prompt information will be used as the current prompt information corresponding to the current information extraction subtask. If there is a completed information extraction subtask, the current prompt information corresponding to the current information extraction subtask is determined based on the initial prompt information and the extraction results of the completed information extraction subtask.

12. The method according to claim 1, wherein the training method of the information extraction model includes: Obtain a sample set, wherein the sample set includes multiple sample texts, and the sample texts carry information extraction tags and at least two sample prompt messages; Extract a first sample text from the plurality of sample texts, wherein the first sample text is any one of the plurality of sample texts; Input the first sample text and the first sample prompt information carried by the first sample into the initial information extraction model to obtain the first prediction information extraction matrix corresponding to the first sample text; Based on the first prediction information extraction matrix, the first sample text, and the first sample prompt information, determine the first prediction extraction result corresponding to the first sample text; Compare the first predicted extraction result with the first information extraction label carried by the first sample text, and calculate the loss value; Adjust the model parameters of the initial information extraction model according to the loss value, and return to the step of extracting the first sample text from the multiple sample texts until the preset stopping condition is reached to obtain the information extraction model.

13. An item recognition method, comprising: Receive an item recognition task, wherein the item recognition task includes text to be recognized and at least two prompt messages; The text to be identified and the at least two prompts are input into an information extraction model to determine the information extraction matrix corresponding to the item identification task. The information extraction matrix represents the correspondence between the text to be identified and each prompt. The rows and columns of the information extraction matrix are identified based on merged identification information, which is obtained by merging the text to be identified and the at least two prompts. Based on the information extraction matrix, the text to be identified, and the at least two prompts, the target recognition result corresponding to the item recognition task is determined.

14. An information extraction model training method, applied to cloud-side devices, comprising: Obtain a sample set, wherein the sample set includes multiple sample texts, and the sample texts carry information extraction tags and at least two sample prompt messages; Extract a first sample text from the plurality of sample texts, wherein the first sample text is any one of the plurality of sample texts; The first sample text and the first sample prompt information carried by the first sample text are input into the initial information extraction model to obtain the first prediction information extraction matrix corresponding to the first sample text. The rows and columns of the first prediction information extraction matrix are identified based on the merged identification information, which is obtained by merging the first sample text and the first sample prompt information carried by the first sample text. Based on the first prediction information extraction matrix, the first sample text, and the first sample prompt information, determine the first prediction extraction result corresponding to the first sample text; Compare the first predicted extraction result with the first information extraction label carried by the first sample text, and calculate the loss value; Adjust the model parameters of the initial information extraction model according to the loss value, and return to the step of extracting the first sample text from the multiple sample texts until the preset stopping condition is reached to obtain the model parameters of the information extraction model. The information is sent to the end-side device to extract the model parameters of the model.

15. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 12, or claim 13 or claim 14.

16. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method of any one of claims 1 to 12, or claim 13, or claim 14.