Text structured processing method, device, storage medium and computer equipment

Through the entity extraction and entity attention weight mechanism based on knowledge dictionary, combined with text character features and entity encoding features, the inaccuracy problem caused by independent entity recognition and relationship recognition in the prior art is solved, and more accurate text structure is achieved deal with.

CN114266230BActive Publication Date: 2024-11-05ANHUI IFLYHEALTH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111644937.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-11-05
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In the existing text structured processing methods, the two subtasks of entity recognition and relationship recognition are carried out independently, and the dependency relationship is not considered, resulting in inaccurate results.

Method used

The entity extraction encoding process based on the knowledge dictionary is adopted, combining text character features and entity encoding features, and information interaction is enhanced through entity attention weights, text encoding and decoding is realized, and structured information is obtained.

Benefits of technology

It improves the accuracy of text structured processing, eliminates error propagation, enhances information interaction between entities, and improves the effect of text structured processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114266230B_ABST
    Figure CN114266230B_ABST
Patent Text Reader

Abstract

The present application discloses a text structured processing method, device, storage medium and computer equipment. The method includes: based on the entities and entity types in the knowledge dictionary, entity extraction and encoding processing is performed on the text information to be structured, and the entity encoding features of each entity in the text information are obtained, and the text character features corresponding to the text information are spliced ​​with the entity encoding features to obtain a feature set including text character features and entity encoding features, and the entity attention weight of each feature in the feature set relative to the text information is obtained. According to the entity attention weight, the text information is encoded to obtain the text encoding features corresponding to the text information, and the text encoding features are decoded to obtain the structured information in the text information. The present application can extract the association relationship and entity in the text information at the same time, eliminate error propagation, enhance the information interaction between different entities, and improve the accuracy of text structured processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a text structured processing method, apparatus, computer-readable storage medium and computer equipment. Background Art

[0002] Document structuring is one of the important tasks in natural language processing, which aims to identify entities in documents and the relationships between entities. In many fields, such as education, medical care, finance, and industrial manufacturing, there are many kinds of documents. For example, the medical field involves a large number of electronic medical records, examination reports, medical textbooks, and medical guidelines. These unstructured or semi-structured documents can be converted into structured documents. Through structured documents, the content of the documents can be quickly understood, which can effectively improve the work efficiency of the staff in the corresponding fields and better mine and utilize the important information in the documents.

[0003] Currently, document structuring processing includes a two-stage approach, that is, document structuring processing is divided into two subtasks: entity recognition and relationship recognition. The two subtasks are performed in series, and the results of entity recognition are used for relationship recognition. In this way, errors in entity recognition will affect relationship recognition. Moreover, the two subtasks of entity recognition and relationship recognition are performed independently without considering the dependency between the two subtasks, resulting in inaccurate results of document structuring processing. Summary of the invention

[0004] The embodiments of the present application provide a text structuring processing method, apparatus, computer-readable storage medium and computer equipment, which can improve the accuracy of text data structuring.

[0005] The present application provides a text structure processing method, including:

[0006] Based on the entities and entity types in the knowledge dictionary, entity extraction and encoding processing is performed on the text information to be structured to obtain entity encoding features of each entity in the text information;

[0007] Concatenate the text character features corresponding to the text information with the entity code features to obtain a feature set including the text character features and the entity code features;

[0008] Obtaining an entity attention weight of each feature in the feature set relative to the text information;

[0009] According to the entity attention weight, the text information is encoded to obtain a text encoding feature corresponding to the text information;

[0010] The text encoding feature is decoded to obtain structured information in the text information, where the structured information includes a target entity, a target entity type corresponding to the target entity, and a relationship type between the target entity types.

[0011] The present application also provides a text structure processing device, including:

[0012] An entity encoding module is used to perform entity extraction and encoding processing on the text information to be structured based on the entities and entity types in the knowledge dictionary to obtain entity encoding features of each entity in the text information;

[0013] A feature concatenation module, used for concatenating the text character features corresponding to the text information with the entity code features to obtain a feature set including the text character features and the entity code features;

[0014] A weight acquisition module, used to obtain the entity attention weight of each feature in the feature set relative to the text information;

[0015] A text encoding module, used to encode the text information according to the entity attention weight to obtain a text encoding feature corresponding to the text information;

[0016] A decoding module is used to decode the text encoding feature to obtain structured information in the text information, wherein the structured information includes a target entity, a target entity type corresponding to the target entity, and a relationship type between the target entity types.

[0017] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded by a processor to execute the steps in the text structuring processing method described in any of the above embodiments.

[0018] An embodiment of the present application also provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps in the text structuring processing method described in any of the above embodiments by calling the computer program stored in the memory.

[0019] The text structured processing method, device, computer-readable storage medium and computer equipment provided in the embodiments of the present application perform entity extraction and encoding processing on the text information to be structured based on the entities and entity types in the knowledge dictionary, obtain the entity encoding features of each entity in the text information, concatenate the text character features corresponding to the text information with the entity encoding features to obtain a feature set including text character features and entity encoding features, and obtain the entity attention weight of each feature in the feature set relative to the text information. The embodiments of the present application can determine the entity attention weight based on the feature set composed of the entity encoding features and text character features in the knowledge dictionary. In this way, the knowledge information is integrated into the entity attention weight, and the entity attention weight is determined based on each feature in the feature set, taking into account the text character features and entity encoding features. Code features can more effectively realize the information interaction between text characters and entities, pay more attention to the correlation between text characters and entities in text information, improve the information interaction between text characters and entities, and then encode the text information according to the entity attention weight to obtain the text encoding feature corresponding to the text information, so that the text encoding feature strengthens the entity, the interaction between the entity and the text character, and weakens the redundant information. The text encoding feature is decoded to obtain the structured information in the text information, and the structured information includes the target entity, the target entity type corresponding to the target entity, and the relationship type between the target entity types. In this way, the scheme in the embodiment of the present application can simultaneously extract the association relationship and entity in the text information, eliminate error propagation, enhance the information interaction between different entities, and improve the accuracy of text structuring processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A schematic diagram of structured information of text information provided in an embodiment of the present application.

[0022] Figure 2 A flowchart of a text structuring processing method provided in an embodiment of the present application.

[0023] Figure 3 Another flowchart of the text structuring processing method provided in an embodiment of the present application.

[0024] Figure 4 A schematic diagram of a sub-process of a text structuring processing method provided in an embodiment of the present application.

[0025] Figure 5 A schematic diagram of a processing result of text structuring processing provided in an embodiment of the present application.

[0026] Figure 6 Another flowchart of the text structuring processing method provided in the embodiment of the present application.

[0027] Figure 7 A schematic diagram of the structure of a text structuring processing device provided in an embodiment of the present application.

[0028] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0030] The embodiments of the present application provide a text structured processing method, apparatus, computer-readable storage medium and computer equipment. Specifically, the text structured processing method of the embodiments of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server and other devices. The terminal can be a smart phone, a tablet computer, a laptop computer, a game console, a personal computer (PC), an intelligent vehicle terminal, a robot and other devices. The server can be an independent physical server, or a server cluster composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0031] Before formally introducing the technical solution of the embodiment of the present application, a brief analysis of the current text structuring processing solution is first performed to facilitate understanding of the technical solution of the present application.

[0032] There are two main approaches to text structured processing currently available: a two-stage approach and a joint extraction approach.

[0033] Among them, in the two-stage approach, entity recognition and relationship recognition are divided into two subtasks: entity recognition and relationship recognition. The two subtasks are connected in series, and the results of entity recognition are input into the model corresponding to relationship recognition, so as to obtain the structured information in the text information. Since the two subtasks are connected in series, the error of entity recognition will affect the relationship recognition, and there is a certain dependency between entity recognition and relationship recognition. However, in the two-stage approach, the two subtasks of entity recognition and relationship recognition are performed independently, and the dependency between the two subtasks is not considered, resulting in inaccurate results of text structured processing.

[0034] For joint extraction, it is expected to extract entities and associations in text information through a unified framework. Joint extraction models are generally divided into two categories: parameter sharing and joint decoding. Joint extraction can be achieved by sharing input features or hidden layer states between two subtasks. This solution has no restrictions on submodels, but due to the use of independent decoding algorithms, the interaction between the entity model and the relationship model is not strong, and the effect of text structured processing needs to be improved.

[0035] In order to solve the above method, the embodiments of the present application propose a text structured processing method, device, computer-readable storage medium and computer equipment, which will be described in detail below. It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0036] The structured information in the text information is represented in the form of triples, that is, the relationship between entities is represented in the form of triples, and the form of triples is (head entity, tail entity, relationship). Figure 1 Shown is a schematic diagram of the text information structure of the embodiment of the present application. The input text corresponding to the decoder is "Progressive decrease in vision in the left eye", where the entity type of "left eye" is "part", the entity type of "progressive decrease in vision in the left eye" is "symptom", and the relationship type between the two entities is "attribute", which is recorded in the form of a triple (left eye, progressive decrease in vision in the left eye, part / symptom / attribute). In this triple, "left eye" is the "head entity", "progressive decrease in vision in the left eye" is the tail entity, and the association relationship is "part / symptom / attribute". Similarly, from Figure 1 Another triplet (progressive, progressive decrease in left eye vision, nature / symptom / attribute) can be constructed in the text information of the medical field. The following is an example of text information in the medical field.

[0037] Figure 2 The flowchart of the text structure processing method provided in the embodiment of the present application is shown in FIG. The text structure processing method is applied in a computer device and includes the following steps.

[0038] 101. Based on the entities and entity types in the knowledge dictionary, entity extraction and encoding processing is performed on the text information to be structured, and entity encoding features of each entity in the text information are obtained.

[0039] In each field, the knowledge dictionary includes a large number of terms (entities) and their corresponding types (entity types). For example, in the medical field, entities include "left eye" and "left eye vision loss", and entity types correspond to "part" and "symptoms".

[0040] As shown in Table 1, it is an example of a medical knowledge dictionary. Each row in Table 1 corresponds to each entry, and each entry consists of three parts, namely, medical terms (entities), attributes, and types (entity types).

[0041] Table 1 Example of medical knowledge dictionary

[0042]

[0043]

[0044] As can be seen from Table 1, "left eye" belongs to the location category, "sinus tachycardia" belongs to the disease category, and "progressive" belongs to the property category.

[0045] In one embodiment, the above step 101 includes: based on the entities and entity types in the knowledge dictionary, performing entity extraction on the text information to be structured to obtain each entity and the corresponding entity type in the text information; encoding each entity and the corresponding entity type to obtain the entity encoding features of each entity in the text information.

[0046] Based on the knowledge dictionary, entity extraction is performed on the text information to be structured to obtain the entities in the text information and the corresponding entity types. Specifically, it includes: comparing the text information to be structured with the entities in the knowledge dictionary to extract the entities in the text information; and determining the entity type corresponding to the entity in the text information according to the corresponding relationship between the entities and entity types in the knowledge dictionary.

[0047] Specifically, each word or words in the text information are matched with each entity in the knowledge dictionary, and the successfully matched word or words are used as entities in the text information; then the entity type of the successfully matched entity is determined based on the correspondence between the entities and entity types in the knowledge dictionary.

[0048] The following pseudo code may be used to implement the determination of entities and entity types in text information to be structured.

[0049]

[0050]

[0051] The input of the above pseudo code part is the text information to be structured and the knowledge dictionary, and the output is the position information of the entity matched in the text information and its corresponding entity type.

[0052] For example, if the text information is "progressive decrease in left eye vision", the corresponding output is shown in Table 2. The corresponding entities include: left eye, progressive, progressive decrease in vision, and the corresponding entity types are: part, nature, and symptoms.

[0053] Table 2 Input and output examples of entity matching

[0054]

[0055] After obtaining each entity and the corresponding entity type in the text information to be structured, each entity and the corresponding entity type are encoded to obtain entity encoding features of each entity in the text information. In one embodiment, the above-mentioned step of encoding each entity and the corresponding entity type to obtain entity encoding features of each entity in the text information includes: performing feature encoding processing on each entity to obtain entity text features corresponding to each entity; encoding each entity type to obtain type encoding features corresponding to each entity type; superimposing the entity text features corresponding to each entity and the corresponding type encoding features to determine the entity encoding features of each entity in the text information.

[0056] In one embodiment, each entity can be feature-encoded by a neural network to obtain entity text features corresponding to each entity. For example, a convolutional neural network is used to perform feature coding on each entity in the text information. For example, entities such as "left eye", "progressive", and "progressive visual impairment" are input into a convolutional neural network for feature coding to convert the corresponding entities into low-dimensional dense entity text features. Among them, the convolutional neural network can effectively capture the local features of each entity through sparse interaction and parameter sharing, and the most important information in each entity can be obtained through the pooling layer and the fully connected layer, so that the entity text features include important information in the entity. Specifically, the text corresponding to each entity is feature-encoded using a convolutional neural network. Please refer to the solution in the prior art, which will not be described in detail here. Among them, taking a 512-dimensional feature vector as an example, "left eye", "progressive", and "progressive visual impairment" are feature-encoded, and the dimensions corresponding to the entity text features obtained are 1*512, 1*512, and 1*512, respectively.

[0057] After obtaining the entity text features, each entity type is encoded to obtain type encoding features. Among them, the word embedding vector method can be used to encode each entity type to obtain type encoding features. For example, the texts such as "part", "nature", and "symptoms" are encoded. Among them, the neural network method can be used to encode each entity type to obtain type encoding features, or other methods can be used to encode the text corresponding to each entity type. The dimensions of the type encoding features obtained by encoding the texts such as "part", "nature", and "symptoms" are 1*512, 1*512, and 1*512 respectively.

[0058] After obtaining the entity text features and type coding features, the entity coding features of each entity in the text information are determined according to the entity text features and the type coding features. Specifically, the entity text features corresponding to each entity and the type coding features corresponding to the entity are superimposed to obtain the entity coding features of each entity in the text information.

[0059] For example, the entity text features corresponding to "left eye" and the type coding features corresponding to "part" are superimposed, the entity text features corresponding to "progressive" and the type coding features corresponding to "nature" are superimposed, and the entity text features corresponding to "progressive visual impairment" and the type coding features corresponding to "symptoms" are superimposed. The dimension of the entity coding features obtained after superposition is still 1*512. In this way, three entity coding features with a dimension of 1*512 are obtained.

[0060] This step realizes the entity encoding in the text information to be structured, or it can also be understood as the knowledge encoding in the text information. Correspondingly, the entity (knowledge) in the text information is searched and the entity is vectorized, so as to integrate the prior knowledge into the text structure processing. In this method, the knowledge dictionary with this structure can be used as a knowledge source, so that the generalization performance of the scheme is good.

[0061] 102, concatenating the text character features and entity coding features corresponding to the text information to obtain a feature set including the text character features and the entity coding features.

[0062] The text information is vectorized to obtain the text character features corresponding to the text information, wherein each text character corresponds to one text character feature. If there are multiple text characters in the text information, multiple text character features correspond to it. For example, the text information can be vectorized using a word embedding vector to obtain text character features, or other methods can be used to obtain text character features corresponding to the text information. For example, in the text information "Progressive decrease in vision in the left eye", each text character therein is vectorized to obtain 9 text character features, and one text / one character corresponds to one text character feature. The dimension corresponding to each text character feature can be 1*512, and the text character feature corresponding to the text information is 9*512.

[0063] After obtaining the text character features and entity coding features, the text character features and entity coding features are concatenated to obtain a feature set including text character features and entity coding features. For example, the dimension of the text character features is 9*512, and the dimension of the entity coding features is 3*512, that is, 1*512 entity coding features corresponding to 3 entities. The text character features and entity coding features are concatenated to obtain a 12*512 feature set. There are 12 1*512 features in the concatenated feature set. See Figure 3 shown.

[0064] In this step, the text character features and the entity coding features are concatenated so that the feature set includes both the text character features in the text information and the entity coding features in the text information.

[0065] 103, obtaining the entity attention weight of each feature in the feature set relative to the text information.

[0066] In order to better distinguish the difference between entities in text information and original text, and strengthen the connection and interaction between entities and original text, entity information is integrated into text structuring processing. In the process of feature encoding of text information, an embodiment of the present application proposes an entity attention mechanism. The entity attention mechanism can explicitly distinguish entity information from original text information by controlling corresponding parameters.

[0067] The entity attention mechanism is used to determine the entity attention weight of each feature in the feature set relative to the text information, and the text character features are encoded according to the entity attention weight.

[0068] In one embodiment, the step 103 includes: determining the correlation between the features in the feature set, and determining the determined correlation as the entity attention weight of each feature in the feature set relative to the text information. Determining the correlation between the features in the feature set can also be understood as the contribution of each feature relative to other features in the feature set.

[0069] In one embodiment, the step of determining the correlation between each feature in a feature set includes: determining the correlation between each text character feature and each text character feature in the feature set, determining the correlation between each text character feature and each entity coding feature, determining the correlation between each entity coding feature and each text character feature, and determining the correlation between each entity coding feature and each entity coding feature.

[0070] Since the feature set includes text character features corresponding to each text character (such as 9) and entity coding features corresponding to each entity (such as 3), in order to determine the contribution / correlation of each feature to other features in the feature set, it is necessary to calculate the correlation between each text character feature and each text character feature in the feature set, determine the correlation between each text character feature and each entity coding feature, determine the correlation between each entity coding feature and each text character feature, and determine the correlation between each entity coding feature and each entity coding feature.

[0071] It is assumed that each feature in the feature set is represented by X = {x 1 ,x 2 ,x 3 ,....,x n}, the correlation between the features in the feature set can be calculated according to the following formula (1).

[0072]

[0073] Among them, K and Q are parameter matrices, L is the dimension of the corresponding eigenvector, divided by Indicates normalization processing, x i and x j represents the i-th feature and the j-th feature in the feature set, α ij Represents the correlation between the i-th feature and the j-th feature. The text parameter matrix includes K, Q c2c , the text entity parameter matrix includes K, Q c2e , the entity text parameter matrix includes K, Q e2c , the entity parameter matrix includes K, Q e2e . Among them, the text parameter matrix, text entity parameter matrix, entity text parameter matrix and entity parameter matrix are all obtained during the training process. In the first formula of the above formula (1), x i and x j are all text character features in the text information; x in the second formula in the above formula (1) i is the text character feature in the text information, x j is the entity encoding feature; x in the third formula in the above formula (1)i is the entity encoding feature, x j is the text character feature in the text information; x in the fourth formula in the above formula (1) i and x j Both are entity encoding features.

[0074] The step of determining the correlation between each text character feature and each text character feature comprises: using the text parameter matrix, performing a dot product process on any text character feature in the feature set and the transposition of any text character feature in the feature set to obtain a dot product process result of each text character feature and the transposition of each text character feature; and normalizing the dot product process result to obtain the correlation between each text character feature and each text character feature. Specifically, refer to the first formula in the above formula (1).

[0075] For example, assuming that the first 9 features in the feature set are text character features, determining the correlation between each text character feature and each text character feature means that the 9 text character features are correlated with the transposition of the 9 text character features in the feature set. For example, the text character feature corresponding to the text character "left" is dot-producted with the transposition of any of the text character features of the text characters "left", "eye", "vision", "force", "advance", "travel", "sexuality", "down", and "down", and normalized to obtain the correlation between the text character "left" and the text characters "left", "eye", "vision", "force", "advance", "travel", "sexuality", "down", and "down", and the corresponding i=1, j range is [1,9]. Similarly, the correlation between other text characters and the text characters "left", "eye", "vision", "force", "advance", "travel", "sexuality", "down", and "down" can be calculated.

[0076] It should be noted that when calculating the correlation, one of the two features needs to be transposed before calculation. In the following text, when calculating the correlation without transposition, you need to understand it in this way and will not explain it again.

[0077] The step of determining the correlation between each text character feature and each entity coding feature includes: using the text entity parameter matrix, performing dot product processing on any text character feature in the feature set and any entity coding feature in the feature set to obtain the dot product processing result between each text character feature and each entity coding feature; and normalizing the dot product processing result to obtain the correlation between each text character feature and each entity coding feature. For details, please refer to the second formula in the above formula (1).

[0078] For example, assuming that the first 9 features in the feature set are text character features and the last 3 features are entity coding features, the second formula in formula (1) is used to calculate the correlation between the first 9 features and the last 3 features. For example, when calculating the correlation between any of the text character features of the text characters "left", "eye", "vision", "power", "progress", "travel", "nature", "down", and "drop" and any of the entity coding features corresponding to "left eye" + "location", "progressive" + "nature", "progressive decrease in vision" + "symptoms", the second formula in the above formula (1) is used, and the corresponding range of i is [1,9] and the range of j is [10,12].

[0079] The step of determining the correlation between each entity coding feature and each text character feature includes: using the entity text parameter matrix, performing dot product processing on any entity coding feature in the feature set and any text character feature in the feature set to obtain the dot product processing result between each entity coding feature and each text character feature; and normalizing the dot product processing result to obtain the correlation between each entity coding feature and each text character feature. For details, please refer to the third formula in the above formula (1).

[0080] For example, assuming that the first 9 features in the feature set are text character features and the last 3 features are entity coding features, the third formula in formula (1) is used when calculating the correlation between the last 3 features and the first 9 features. For example, when any entity coding feature corresponding to "left eye" + "location", "progressive" + "nature", "progressive visual acuity decline" + "symptoms" is correlated with any text character feature in the text characters "left", "eye", "vision", "power", "progress", "walk", "nature", "down", "down", the third formula in the above formula (1) is used, and the corresponding range of i is [10,12], and the range of j is [1,9].

[0081] The step of determining the correlation between each entity coding feature and each entity coding feature includes: using the entity parameter matrix, performing dot product processing on any entity coding feature in the feature set and the transpose of any entity coding feature in the feature set to obtain the dot product processing result between each entity coding feature and each entity coding feature; normalizing the dot product processing result to obtain the correlation between each entity coding feature and each entity coding feature. For details, please refer to the fourth formula in the above formula (1).

[0082] For example, assuming that the last three features in the feature set are entity coding features, the fourth formula in formula (1) is used when calculating the correlation between the last three features and the devices of the last three features. For example, when the correlation processing is performed on the transposition of any entity coding feature corresponding to "left eye" + "location", "progressive" + "nature", "progressive visual impairment" + "symptoms" and any entity coding feature corresponding to "left eye" + "location", "progressive" + "nature", "progressive visual impairment" + "symptoms", the fourth formula in the above formula (1) is used, and the corresponding range of i is [10,12], and the range of j is [10,12].

[0083] When the range of i is [1,12] and the range of j is [1,12], the final α ij is a matrix with a dimension of 12*12, where each value in the matrix represents the correlation between the corresponding two features. It can be understood that the correlation between any two features is a scalar.

[0084] Through the calculation method of the entity attention weight, knowledge information is integrated into the entity attention weight, and the entity attention weight is determined according to each feature in the feature set. In this way, the text character features and entity encoding features are taken into account, and the text characters and entity information in the text information can be explicitly distinguished. The information interaction between text characters and entities can be more effectively realized, and more attention can be paid to the correlation between text characters and entities in the text information.

[0085] 104, encoding the text information according to the entity attention weight to obtain the text encoding feature corresponding to the text information.

[0086] Because the entity attention weight takes into account the text character features and entity encoding features, it can more effectively realize the information interaction between text characters and entities, and pay more attention to the correlation between text characters and entities in the text information. Therefore, according to the entity attention weight, the text information is encoded to obtain the text encoding features corresponding to the text information, so that the text encoding features strengthen the entities, the interaction between entities and text characters, and weaken the redundant information.

[0087] Since the text information includes entity information and text character information, the text feature code corresponding to the text information in step 104 includes: a text feature code corresponding to each text character information and a text feature code corresponding to each entity information.

[0088] In one embodiment, the above step 104 includes: for each feature in the feature set, performing dot product processing on the entity attention weight corresponding to the feature and each feature in the feature set; and summing up the features obtained by the dot product processing to obtain the text encoding feature corresponding to each feature.

[0089] For example, when the number of features in the feature set is 12, the entity attention weight corresponding to the i-th feature is α i1 To α i12 , α i1 To α i12 Perform dot product processing with each feature in the feature set. i1 Perform dot product processing with the first feature in the feature set, α i2 Perform dot product processing with the second feature in the feature set, and so on, α i12 Perform dot product processing with the 12th feature in the feature set, so that 12 features are obtained respectively. The features obtained by the dot product processing are summed up, that is, the 12 features obtained by the dot product processing are summed up to obtain the text encoding feature corresponding to the i-th feature.

[0090] The text encoding feature corresponding to the text information can be determined according to formula (2).

[0091]

[0092] Where n is the total number of features in the feature set, h i Represents the text encoding feature corresponding to the i-th feature in the feature set. According to formula (2), the text encoding feature corresponding to each feature in the feature set can be obtained, which can also be understood as obtaining the text encoding feature corresponding to the text information. Among them, the feature set can be understood as the feature information corresponding to the text information.

[0093] For example, if the number of features in the feature set is 12 and the dimension of each feature in the feature set is 1*512, then the number of text encoding features obtained is also 12, such as Figure 3 As shown in the figure, the dimension of each text encoding feature is 1*512.

[0094] The above steps 101 to 104 are the implementation process of an encoder, and the output of the encoder is the text feature code. In actual implementation, there can be multiple encoders, and the output of the first encoder will be used as the input of the second encoder, until the output of the last encoder. The output of the last encoder is used as the text feature vector obtained at the end of the encoding stage. Among them, the processing process in each encoder is the same, only the input is different.

[0095] It should be noted that the text encoding feature includes the encoding features corresponding to the text character features, and also includes the encoding features obtained after the entity encoding features are encoded again, so that the output of the encoder includes both the entity content and the original text content, which strengthens the interaction between the original text and the entity and improves the accuracy of structured processing.

[0096] 105 , decoding the text encoding features to obtain structured information in the text information, where the structured information includes target entities and association relationships between target entities.

[0097] The association relationship between target entities includes the target entity type of the target entity and the relationship type between the target entity types.

[0098] The decoding process is similar to the encoding process, and the masked attention mechanism is used in the decoding process. It should be noted that, in general, if there are several encoders, there are also several decoders. Figure 3 The encoder and decoder shown are both one, but there can be multiple encoders and decoders. For example, if there are two encoders, there are also two decoders, and the output of the last encoder is input to the Cross Attention module in each decoder, also known as the encoder-decoderAttention module. The Cross Attention module is used to interactively process the text encoding features and the input features obtained by the first two modules in the decoder (masked self-attention module and normalized summation module).

[0099] In one embodiment, if Figure 4 As shown, step 105 includes the following steps 201 to 204.

[0100] 201, based on the masked attention mechanism, mask processing is performed on the current features input at the current moment and the input features input before the current moment in the decoder to obtain masked features.

[0101] 202, normalize and sum the masked features.

[0102] Among them, the decoder decodes one by one in sequence, so the input features of the decoder at the current moment include the current features input at the current moment and the input features input before the current moment. The input features of the decoder at the current moment are masked to obtain the masked attention weight.

[0103] For example, if the current moment is the 0th moment, and the decoder input is the text character feature corresponding to "left", the text character feature corresponding to "left" is dot-producted with itself (the text character feature corresponding to "left") to obtain the masked attention weight; the masked attention weight is dot-producted with the text character feature corresponding to "left" to obtain the masked feature. If the current masked feature is one, normalization and summation are performed to obtain the corresponding masked feature.

[0104] For example, the current moment is the first moment, and the input of the decoder includes the text character feature corresponding to the "eye" input at the current moment and the text character feature corresponding to the "left" input before the current moment / the latent vector corresponding before the current moment. The text character feature corresponding to "left" and itself, the text character feature corresponding to "left" and the text character feature corresponding to "eye", the text character feature corresponding to "eye" and the text character feature corresponding to "left", and the text character feature corresponding to "eye" and the text character feature corresponding to "eye" are all dot-product processed to obtain four masked attention weights respectively, and the four masked attention weights and the four text character features composed of the text character features corresponding to "left" and the text character features corresponding to "eye" are dot-product processed to obtain masked features. The masked features are normalized and summed to obtain the summed features, and the dimension of the summed features is 1*512.

[0105] By analogy, at the last moment, the decoder input includes the entity encoding features corresponding to the "progressive visual impairment" + "symptoms" input at the current moment, and the 11 features input before the current moment. The input features at the current moment in the decoder are masked to obtain masked features, and the masked features are normalized and summed to obtain the summed features.

[0106] The above-mentioned mask features are obtained through the mask self-attention module, and the normalization and summation processing are realized through the normalized summation module.

[0107] 203, interactively process the summed features and the text encoding features to obtain the output features of the decoder at the current moment.

[0108] Among them, step 203 includes: performing dot product processing on the summed features and each text encoding feature to obtain a cross-attention weight; and decoding each text encoding feature according to the cross-attention weight to obtain the output feature of the decoder at the current moment.

[0109] Assume that the text encoding feature is represented as H = {h 1 ,h 2 ,...,h j ,...,h n}, the feature after summation at the decoder at time t is represented as y t , then the corresponding cross attention weight can be calculated according to formula (3).

[0110] β tj =Wy t Q j (3)

[0111] Among them, β tj is the corresponding cross attention weight, is a scalar, and W and Q are learnable parameters. After calculating the cross attention weight, the output features of the decoder can be obtained according to formula (4).

[0112]

[0113] Among them, yt' is the output feature of the decoder at the tth moment, and the dimension of the output feature is 1*512.

[0114] It should be noted that in the embodiment of the present application, the text encoding features obtained by the encoder are input into the decoder for interactive processing to strengthen the connection between encoding and decoding and improve the accuracy of entity recognition and relationship extraction.

[0115] 204 , mapping the output features to the dictionary space to obtain the target entity or the association relationship between the target entities in the dictionary space corresponding to the output features.

[0116] Step 204 can be implemented by a Feed-Forward module, such as Figure 3 shown.

[0117] The output feature is mapped to the dictionary space to obtain a feature vector in the dictionary space corresponding to the output feature, and the feature vector is normalized to obtain a target entity corresponding to the output feature and / or an association relationship between target entities.

[0118] For example, the output feature is 1*512, and the feature corresponding to the dictionary space is 512*10000, then the feature vector in the dictionary space corresponding to the output feature is 1*10000. The feature vector is normalized, for example, using a softmax function to obtain the corresponding probability, and the information corresponding to the position in the dictionary space with the largest probability is used as the decoding result corresponding to the tth moment.

[0119] It should be noted that the above decoding process is only an example. No matter what the specific decoding process is, it is necessary to interact the result obtained by the encoder (text encoding features) with the decoder to obtain the corresponding decoding result, so as to strengthen the connection between encoding and decoding and improve the accuracy of entity recognition and relationship extraction.

[0120] In the embodiment of the present application, the decoding result obtained by the last decoder is used as the processing result of the text structured processing, and the processing result displays the corresponding relationship triples in the form of a sequence. In the output sequence, the symbol "|" is used as a separator between relationship triples, and the head entity, tail entity and type between entities in the relationship triple are separated by a special symbol ";". As shown in Table 3, it is an input and output example.

[0121] Table 3 Input and output examples

[0122]

[0123] Figure 5 This is a schematic diagram of the structured information of the electronic medical record provided in the embodiment of the present application. Among them, for the text "right limbs numb and weak, unclear speech for half a day" in the electronic medical record, after the text is structured, the association relationship between entities is obtained. Figure 5 As shown in the figure, the entity name of "right limb" is "part", the entity types of "numbness and weakness of right limb" and "slurred speech" are "symptoms", and the entity type of "half day" is "onset time". And it can be obtained that there is an "attribute" relationship between "numbness and weakness of right limb", "slurred speech" and "half day", and it can be known from the relationship that both symptoms lasted for half a day.

[0124] It should be noted that the embodiments of the present application are described using the medical field as an example, but the methods in the embodiments of the present application can be applied to text structuring processing in any field.

[0125] The above steps 101 to 105 can be implemented by a text structured model, which includes an encoder and a decoder, corresponding to the encoding stage and the decoding stage respectively. Steps 101 to 104 correspond to the encoding stage, and step 105 corresponds to the decoding stage.

[0126] In one embodiment, the present application also provides a text structured processing method, which includes a training process of a text structured model. Figure 6 As shown, the text structuring processing method includes the following steps.

[0127] 301 , based on the entities and entity types in the knowledge dictionary, perform entity extraction and encoding processing on each training text information in the training text data set to be structured, and obtain training entity encoding features of each entity in the training text information.

[0128] Based on the entities and entity types in the knowledge dictionary, entity extraction is performed on each training text information in the structured training text data set to obtain each entity and the corresponding entity type in the training text information; each entity and the corresponding entity type is encoded to obtain the training entity encoding features of each entity in the training text information.

[0129] 302 , concatenating the training text character features and the training entity coding features corresponding to the training text information to obtain a training feature set including the training text character features and the training entity coding features.

[0130] 303, obtaining the training entity attention weight of each training feature in the training feature set relative to the training text information.

[0131] In one embodiment, obtaining the training entity attention weight includes: determining the correlation between each training feature in the training feature set; and determining the correlation as the training entity attention weight of each training feature relative to the training text information.

[0132] In one embodiment, the step of determining the correlation between each training feature in the training feature set includes: determining the correlation between each training text character feature and each training text character feature in the training feature set, determining the correlation between each training text character feature and each training entity coding feature, determining the correlation between each training entity coding feature and each training text character feature, and determining the correlation between each training entity coding feature and each training entity coding feature.

[0133] 304 , encoding the training text information according to the training entity attention weight to obtain a training text encoding feature corresponding to the training text information.

[0134] For each training feature in the training feature set, the training entity attention weight corresponding to the training feature is processed with each training feature in the training feature set; the training features obtained by the dot product processing are summed to obtain the training text encoding features corresponding to the training text information.

[0135] 305 , decoding the encoded features of the training text to obtain training structured information in the training text information, where the training structured information includes target entities and association relationships between target entities.

[0136] Based on the masked self-attention mechanism, the training input features at the current moment in the decoder are masked to obtain training mask features, where the training input features include the features input at the current moment and the features input before the current moment; the training mask features are summed and normalized; the normalized features and text encoding features are interactively processed to obtain the training output features of the decoder at the current moment; the training output features are mapped to the dictionary space to obtain the target entities and / or the association relationship between the target entities in the dictionary space corresponding to the training output features.

[0137] 306 , calculating a loss function according to the training structured information, and adjusting training parameters based on the loss function.

[0138] In one embodiment, the loss function of the present application may be Focal Loss, GHM Loss, or a joint loss function of Focal Loss and GHM Loss.

[0139] According to the loss function, the training parameters of the text structured model are adjusted in reverse transmission until the loss function converges, or until the number of training rounds reaches the preset number of rounds, or other end conditions are met, and the training is stopped. The training parameters involved can refer to the parameters involved in formula (1) and formula (3). It should be noted that the parameters involved in formula (1) and formula (3) are only part of the training parameters, and there are other training parameters not reflected in the formula.

[0140] It should be noted that the processing steps of the training process are the same as those of the application process. Please refer to the above process for details. The details will not be repeated here. However, the word "training" is added before all nouns in the training process to distinguish them.

[0141] All of the above technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described in detail here.

[0142] In order to better implement the text structured processing method of the embodiment of the present application, the embodiment of the present application also provides a text structured processing device. Figure 7 , Figure 7 The schematic diagram of the structure of the text structure processing device provided in the embodiment of the present application is as follows: The text structure processing device 400 may include an entity encoding module 401 , a feature concatenation module 402 , a weight acquisition module 403 , a text encoding module 404 , and a decoding module 405 .

[0143] The entity encoding module 401 is used to perform entity extraction and encoding processing on the text information to be structured based on the entities and entity types in the knowledge dictionary, and obtain entity encoding features of each entity in the text information.

[0144] In one embodiment, the entity encoding module 401 is specifically used to perform entity extraction on the text information to be structured based on the entities and entity types in the knowledge dictionary to obtain each entity and the corresponding entity type in the text information; and encode each entity and the corresponding entity type to obtain the entity encoding features of each entity in the text information.

[0145] In one embodiment, when the entity coding module 401 performs the step of encoding each entity and the corresponding entity type to obtain the entity coding features of each entity in the text information, it specifically performs: performing feature coding on each entity to obtain the entity text features corresponding to each entity; encoding each entity type to obtain the type coding features corresponding to each entity type; superimposing the entity text features corresponding to each entity and the corresponding type coding features to determine the entity coding features of each entity in the text information.

[0146] In one embodiment, when the entity encoding module 401 performs the step of extracting entities from the text information to be structured based on the entities and entity types in the knowledge dictionary to obtain the entities in the text information and the corresponding entity types, it specifically performs: comparing the text information to be structured with the entities in the knowledge dictionary to extract the entities in the text information; and determining the entity type corresponding to the entity in the text information based on the correspondence between the entities and entity types in the knowledge dictionary.

[0147] The feature concatenation module 402 is used to concatenate the text character features corresponding to the text information with the entity code features to obtain a feature set including the text character features and the entity code features.

[0148] The weight acquisition module 403 is used to obtain the entity attention weight of each feature in the feature set relative to the text information.

[0149] In one embodiment, the weight acquisition module 403 is specifically used to determine the correlation between each feature in the feature set, wherein each feature includes each text character feature and each entity encoding feature; and the correlation is determined as the entity attention weight of each feature in the feature set relative to the text information.

[0150] In one embodiment, when the weight acquisition module 403 executes the step of determining the correlation between each feature in the feature set, it specifically executes: determining the correlation between each text character feature and each text character feature in the feature set, determining the correlation between each text character feature and each entity coding feature, determining the correlation between each entity coding feature and each text character feature, and determining the correlation between each entity coding feature and each entity coding feature.

[0151] In one embodiment, when the weight acquisition module 403 executes the step of determining the correlation between each text character feature and each text character feature, it specifically performs: using the text parameter matrix, performing dot product processing on any text character feature in the feature set and the transpose of any text character feature in the feature set to obtain the dot product processing results of each text character feature and the transpose of each text character feature; normalizing the dot product processing results to obtain the correlation between each text character feature and each text character feature.

[0152] In one embodiment, when the weight acquisition module 403 executes the step of determining the correlation between each text character feature and each entity coding feature, it specifically performs: using the text entity parameter matrix to perform dot product processing on any text character feature in the feature set and any entity coding feature in the feature set to obtain the dot product processing results between each text character feature and each entity coding feature; normalizing the dot product processing results to obtain the correlation between each text character feature and each entity coding feature.

[0153] In one embodiment, when the weight acquisition module 403 executes the step of determining the correlation between each entity coding feature and each text character feature, it specifically performs: using the entity text parameter matrix to perform dot product processing on any entity coding feature in the feature set and any text character feature in the feature set to obtain the dot product processing result between each entity coding feature and each text character feature; normalizing the dot product processing result to obtain the correlation between each entity coding feature and each text character feature.

[0154] In one embodiment, the weight acquisition module 403 performs the step of determining the correlation between each entity coding feature and each entity coding feature, including: using the entity parameter matrix to perform dot product processing on any entity coding feature in the feature set and the transpose of any entity coding feature in the feature set to obtain the dot product processing results between each entity coding feature and each entity coding feature; normalizing the dot product processing results to obtain the correlation between each entity coding feature and each entity coding feature.

[0155] The text encoding module 404 is used to encode the text information according to the entity attention weight to obtain the text encoding feature corresponding to the text information.

[0156] In one embodiment, the text encoding module 404 is specifically used to perform entity extraction on the text information to be structured based on the entities and entity types in the knowledge dictionary to obtain each entity and the corresponding entity type in the text information; and encode each entity and the corresponding entity type to obtain the entity encoding features of each entity in the text information.

[0157] The decoding module 405 is used to decode the text encoding feature to obtain structured information in the text information, where the structured information includes a target entity and an association relationship between the target entities.

[0158] In one embodiment, the decoding module 405 is specifically used to perform mask processing on the input features of the decoder at the current moment based on the masked self-attention mechanism to obtain masked features, wherein the input features at the current moment include the current features input at the current moment and the input features input before the current moment; normalize and sum the masked features; interactively process the summed features and text encoding features to obtain the output features of the decoder at the current moment; map the output features to the dictionary space to obtain the target entity and / or the association relationship between the target entities in the dictionary space corresponding to the output features.

[0159] In one embodiment, the text structured processing device further includes a training module 406. The training module 406 is used to train the text structured model, specifically including: based on the entities and entity types in the knowledge dictionary, performing entity extraction and encoding processing on each training text information in the training text data set to be structured, and obtaining the training entity encoding features of each entity in the training text information; splicing the training text character features corresponding to the training text information with the training entity encoding features, and obtaining a training feature set including the training text character features and the training entity encoding features; obtaining the training entity attention weight of each training feature in the training feature set relative to the training text information; encoding the training text information according to the training entity attention weight to obtain the training text encoding features corresponding to the training text information; decoding the training text encoding features to obtain the training structured information in the training text information, and the training structured information includes the target entity and the association relationship between the target entities; calculating the loss function according to the training structured information, and adjusting the training parameters based on the loss function.

[0160] All of the above technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described in detail here.

[0161] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal or a server. Figure 8 As shown, Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0162] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, and executes various functions of the computer device 500 and processes data by running or loading software programs (computer programs) and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.

[0163] In the embodiment of the present application, the processor 501 in the computer device 500 will load the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502, thereby realizing the functions corresponding to any of the above-mentioned text structured processing methods. The specific implementation can be referred to the previous embodiment, which will not be repeated here.

[0164] Optional, such as Figure 8 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Figure 8 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0165] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 can include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. The touch panel can cover the display panel, and when the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of the touch event, and then the processor 501 provides corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the display panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.

[0166] In the embodiment of the present application, the touch display screen 503 is used to present a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface.

[0167] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.

[0168] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.

[0169] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0170] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0171] although Figure 8 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

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

[0173] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0174] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any text structuring processing method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0175] Acquire the data information to be identified in the data recognition scenario; generate text data and graph structure data corresponding to the data information to be identified, wherein the graph structure data is data formed based on the graph structure, and the graph structure data includes keywords in the data information to be identified and the association relationship between the keywords; perform a first feature extraction on the text data to obtain text coding features corresponding to the text data; perform a second feature extraction on the graph structure data to obtain graph coding features corresponding to the graph structure data; fuse the text coding features and the graph coding features to determine the recognition result corresponding to the data information to be identified.

[0176] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0177] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0178] Since the computer program stored in the storage medium can execute the steps in any text structuring processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any text structuring processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0179] The above is a detailed introduction to a text structured processing method, device, storage medium and computer equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A text structured processing method, characterized in that: include: Based on the entities and entity types in the knowledge dictionary, entity extraction and encoding processing is performed on the text information to be structured to obtain entity encoding features of each entity in the text information; Concatenate the text character features corresponding to the text information with the entity code features to obtain a feature set including the text character features and the entity code features; Obtaining an entity attention weight of each feature in the feature set relative to the text information; According to the entity attention weight, the text information is encoded to obtain a text encoding feature corresponding to the text information; Decoding the text encoding feature to obtain structured information in the text information, wherein the structured information includes a target entity, a target entity type corresponding to the target entity, and a relationship type between the target entity types; The step of obtaining the entity attention weight of each feature in the feature set relative to the text information includes: Determining correlations between features in the feature set, wherein the features include text character features and entity encoding features; The relevance is determined as an entity attention weight of each feature in the feature set relative to the text information.

2. The text structuring processing method according to claim 1, characterized in that: The step of determining the correlation between the features in the feature set comprises: Determine the correlation between each text character feature and each text character feature in the feature set, determine the correlation between each text character feature and each entity coding feature, determine the correlation between each entity coding feature and each text character feature, and determine the correlation between each entity coding feature and each entity coding feature.

3. The text structuring processing method according to claim 2, characterized in that: The step of determining the correlation between each text character feature and each entity encoding feature comprises: Using the text entity parameter matrix, performing dot product processing on any text character feature in the feature set and any entity coding feature in the feature set to obtain a dot product processing result between each text character feature and each entity coding feature; Normalizing the dot product processing result to obtain the correlation between each text character feature and each entity encoding feature; The step of determining the correlation between each entity encoding feature and each text character feature comprises: Using the entity text parameter matrix, perform dot product processing on any entity coding feature in the feature set and any text character feature in the feature set to obtain a dot product processing result between each entity coding feature and each text coding feature; The dot product processing result is normalized to obtain the correlation between each text character feature and each entity encoding feature.

4. The text structuring processing method according to claim 1, characterized in that: The step of encoding the text information according to the entity attention weight to obtain a text encoding feature corresponding to the text information includes: For each feature in the feature set, performing dot product processing on the entity attention weight corresponding to the feature and each feature in the feature set; The features obtained by the dot product processing are summed up to obtain the text encoding features corresponding to the text information.

5. The text structuring processing method according to claim 1, characterized in that: The step of performing entity extraction and encoding processing on the text information to be structured based on the entities and entity types in the knowledge dictionary to obtain entity encoding features of each entity in the text information includes: Based on the entities and entity types in the knowledge dictionary, entity extraction is performed on the text information to be structured to obtain each entity and the corresponding entity type in the text information; The entities and the corresponding entity types are encoded to obtain entity encoding features of the entities in the text information.

6. The text structuring processing method according to claim 5, characterized in that: The step of encoding each entity and the corresponding entity type to obtain entity encoding features of each entity in the text information includes: Performing feature encoding processing on each entity to obtain entity text features corresponding to each entity; Performing encoding processing on each entity type to obtain a type encoding feature corresponding to each entity type; The entity text features corresponding to each entity and the corresponding type coding features are superimposed to determine the entity coding features of each entity in the text information.

7. The text structuring processing method according to claim 5, characterized in that: The step of performing entity extraction on the text information to be structured based on the entities and entity types in the knowledge dictionary to obtain each entity in the text information and the corresponding entity type includes: Comparing the text information to be structured with entities in a knowledge dictionary to extract entities from the text information; According to the correspondence between entities and entity types in the knowledge dictionary, the entity type corresponding to the entity in the text information is determined.

8. The text structuring processing method according to claim 1, characterized in that: The step of decoding the text encoding feature to obtain structured information in the text information includes: Based on the masked self-attention mechanism, masking is performed on the input features at the current moment in the decoder to obtain masked features, where the input features at the current moment include the current features input at the current moment and the input features input before the current moment; Normalizing and summing the mask features; Interactively processing the summed features and the text encoding features to obtain the output features of the decoder at the current moment; The output feature is mapped to a dictionary space to obtain a target entity in the dictionary space corresponding to the output feature, and / or a target entity type corresponding to the target entity and / or a relationship type between target entity types.

9. The text structuring processing method according to claim 1, characterized in that: Also includes: Based on the entities and entity types in the knowledge dictionary, entity extraction and encoding processing is performed on each training text information in the training text data set to be structured, so as to obtain training entity encoding features of each entity in the training text information; The training text character features corresponding to the training text information are concatenated with the training entity coding features to obtain a training feature set including the training text character features and the training entity coding features; Obtaining a training entity attention weight of each training feature in the training feature set relative to the training text information; According to the training entity attention weight, the training text information is encoded to obtain a training text encoding feature corresponding to the training text information; Decoding the training text encoding features to obtain training structured information in the training text information, wherein the training structured information includes a target entity, a target entity type corresponding to the target entity, and a relationship type between the target entity types; A loss function is calculated according to the training structured information, and training parameters are adjusted based on the loss function.

10. A text structure processing device, characterized in that: include: An entity encoding module is used to perform entity extraction and encoding processing on the text information to be structured based on the entities and entity types in the knowledge dictionary to obtain entity encoding features of each entity in the text information; A feature concatenation module, used for concatenating the text character features corresponding to the text information with the entity code features to obtain a feature set including the text character features and the entity code features; A weight acquisition module, used to obtain the entity attention weight of each feature in the feature set relative to the text information; A text encoding module, used for encoding the text information according to the entity attention weight to obtain a text encoding feature corresponding to the text information; A decoding module, used for decoding the text encoding feature to obtain structured information in the text information, wherein the structured information includes a target entity, a target entity type corresponding to the target entity, and a relationship type between the target entity types; Wherein, the weight acquisition module is specifically used for: Determining correlations between features in the feature set, wherein the features include text character features and entity encoding features; The relevance is determined as an entity attention weight of each feature in the feature set relative to the text information.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the text structuring processing method according to any one of claims 1 to 9.

12. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the steps in the text structuring processing method according to any one of claims 1 to 9 by calling the computer program stored in the memory.