Text label labeling method and device based on knowledge graph, and computer device

By identifying and linking highly similar graph entities in the medical knowledge graph as annotation labels, the accuracy problem of medical text annotation is solved, and the uniqueness and consistency of labels are achieved, providing an efficient labeling foundation for medical text recommendation.

CN116467465BActive Publication Date: 2026-04-28PING AN TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2023-04-18
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately label medical texts in the medical field, especially when using medical knowledge graphs. Determining a unique and definite label for the same disease is a significant challenge.

Method used

By identifying the entity references of the text to be labeled, recalling candidate graph entities in a preset knowledge graph, calculating the similarity between the entity references and the candidate graph entities, filtering the target similarity that meets the preset conditions, and linking graph entities with high similarity as labeling tags.

Benefits of technology

It improved the accuracy and consistency of medical text labeling, providing a standardized labeling foundation for subsequent medical text recommendations and enhancing recall and ranking effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116467465B_ABST
    Figure CN116467465B_ABST
Patent Text Reader

Abstract

The application discloses a text label annotation method and device based on a knowledge graph, a storage medium and a computer device. The method comprises the following steps: recognizing an entity reference of a text to be annotated, recalling a candidate graph entity corresponding to the entity reference in a preset knowledge graph, calculating the similarity between the entity reference and the candidate graph entity based on the entity reference representation of the entity reference and the candidate graph entity representation of the candidate graph entity, screening a target similarity meeting a first preset condition, obtaining a to-be-linked entity reference and a to-be-linked graph entity corresponding to the target similarity, linking the to-be-linked entity reference and the to-be-linked graph entity, and taking all graph entities linked with the entity reference in the preset knowledge graph as annotation labels of the text to be annotated, thereby improving the accuracy of text label annotation using a knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of digital healthcare technology, and in particular to a text tagging method and apparatus, storage medium, and computer equipment based on knowledge graphs. Background Technology

[0002] Recommendation systems generally consist of an indexing layer, a recall layer, and a ranking layer. The indexing layer, as the foundation and prerequisite for the subsequent recall and ranking layers, needs to integrate relevant data to add diverse and accurate tags to massive amounts of content of varying quality and type (e.g., medical text). Therefore, appropriate content tags are a necessary condition for a good recommendation system. In recommendation scenarios, content recall is typically achieved by matching user profile tags with content tags, thus requiring a finite number of standardized content tags. Taking the medical field as an example: the set of tags for each type of disease needs to be a known finite number, and the tag name for the same disease needs to be unique and definite. In the process of building tags for medical text, it is necessary to use a medical knowledge graph to label the medical text. However, medical terms often vary greatly, making the appropriate labeling of medical text using a medical knowledge graph a highly challenging task. Summary of the Invention

[0003] In view of this, this application provides a method, apparatus, storage medium, and computer device for text labeling based on knowledge graphs, which improves the accuracy of text labeling using knowledge graphs.

[0004] According to one aspect of this application, a text tagging method based on knowledge graphs is provided, the method comprising:

[0005] Identify the entity references of the text to be labeled, and retrieve the candidate graph entities corresponding to the entity references in the preset knowledge graph;

[0006] Based on the entity reference representation of the entity reference and the candidate graph entity representation of the candidate graph entity, the similarity between the entity reference and the candidate graph entity is calculated, and the target similarity that meets the first preset condition is filtered to obtain the entity reference and the graph entity to be linked corresponding to the target similarity.

[0007] The entity to be linked is associated with the graph entity to be linked, and all graph entities in the preset knowledge graph that are linked with the entity to be linked are used as annotation tags for the text to be annotated.

[0008] Optionally, calculating the similarity between the entity reference and the candidate graph entity based on the entity reference's entity reference representation and the candidate graph entity's candidate graph entity representation includes:

[0009] Based on the entity reference representation M of the entity reference and the candidate graph entity representation E of the candidate graph entity, a similarity matrix W is calculated, where each element w in W... i,j =m i e j m i Let e ​​represent the i-th element in the entity reference representation M. j This represents the j-th element in the candidate graph entity representation E;

[0010] The similarity between the entity reference and the candidate graph entities is obtained based on the similarity matrix, where the similarity between the i-th entity reference and the j-th candidate graph entity is w. i,j .

[0011] Optionally, obtaining the similarity between the entity designation and the candidate atlas entity based on the similarity matrix includes:

[0012] The similarity matrix is ​​standardized to obtain a standard similarity matrix;

[0013] Based on the standard similarity matrix and the candidate graph entity representations, a weighted entity referential representation is calculated using a first weighting formula, wherein the first weighting formula is: m′ i w′ represents the weighted entity reference. i,j This represents the elements in the standard similarity matrix W′;

[0014] Based on the standard similarity matrix and the entity referential representation, a weighted candidate graph entity representation is calculated using a second weighting formula, wherein the second weighting formula is: e′ j Represents the weighted candidate graph entity representation;

[0015] Based on the weighted entity reference representation and the weighted candidate graph entity representation, the similarity between the entity reference and the candidate graph entity is calculated.

[0016] Optionally, calculating the similarity between the entity reference and the candidate graph entity based on the weighted entity reference representation and the weighted candidate graph entity representation includes:

[0017] The weighted entity reference representation sequence of the weighted entity reference representation is passed through a convolutional neural network to obtain an entity reference embedding vector, and the weighted candidate graph entity reference representation sequence of the weighted candidate graph entity representation is passed through a convolutional neural network to obtain a candidate graph entity embedding vector.

[0018] The entity reference embedding vector and the candidate graph entity embedding vector are combined to obtain the scoring vector. Based on the scoring vector and the preset ranking and scoring model, the similarity between the entity reference and the candidate graph entity is obtained.

[0019] Optionally, the preset knowledge graph includes a graph entity index, which includes a graph entity ontology and at least one graph entity alias corresponding to the graph entity ontology; the step of recalling candidate graph entities corresponding to the entity designation in the preset knowledge graph includes:

[0020] For any entity designation, the entity designation is matched with the graph entity index to obtain a target graph entity index, wherein the graph entity ontology and / or any graph entity alias in the target graph entity index match the entity designation;

[0021] The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as candidate graph entities.

[0022] Optionally, determining the graph entity ontology and graph entity alias corresponding to the target graph entity index as candidate graph entities includes:

[0023] The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as the basic graph entity;

[0024] Calculate the deviation distance between the base map entity and the entity reference, and determine the base map entity corresponding to the deviation distance that meets the second preset condition as the candidate map entity.

[0025] Optionally, before using all graph entities in the preset knowledge graph that are linked to the entity reference as annotation tags for the text to be annotated, the method further includes:

[0026] According to preset association rules, obtain the associated graph entities corresponding to the graph entities to be linked;

[0027] Calculate the association confidence between the association graph entity and the entity reference, and filter the target association confidence that meets the third preset condition, and obtain the association graph entity corresponding to the target association confidence as a supplementary graph entity;

[0028] The entity to be linked refers to the entity in the supplementary graph.

[0029] According to another aspect of this application, a knowledge graph-based text tagging device is provided, the device comprising:

[0030] The entity recall module is used to identify the entity references of the text to be labeled, and to recall the candidate graph entities corresponding to the entity references in the preset knowledge graph.

[0031] The similarity calculation module is used to calculate the similarity between the entity reference and the candidate graph entity based on the entity reference representation of the entity reference and the candidate graph entity representation of the candidate graph entity, and to filter the target similarity that meets the first preset condition, and to obtain the entity reference and the graph entity to be linked corresponding to the target similarity.

[0032] The tag annotation module is used to link the entity reference to be linked with the graph entity to be linked, and to use all graph entities in the preset knowledge graph that are linked with the entity reference as annotation tags for the text to be annotated.

[0033] Optionally, the similarity calculation module is further configured to:

[0034] Based on the entity reference representation M of the entity reference and the candidate graph entity representation E of the candidate graph entity, a similarity matrix W is calculated, where each element in W... wi,j=iej m i Let e ​​represent the i-th element in the entity reference representation M. j This represents the j-th element in the candidate graph entity representation E;

[0035] The similarity between the entity reference and the candidate graph entities is obtained based on the similarity matrix, where the similarity between the i-th entity reference and the j-th candidate graph entity is w. i,j .

[0036] Optionally, the similarity calculation module is further configured to:

[0037] The similarity matrix is ​​standardized to obtain a standard similarity matrix;

[0038] Based on the standard similarity matrix and the candidate graph entity representations, a weighted entity referential representation is calculated using a first weighting formula, wherein the first weighting formula is: m′ i w′ represents the weighted entity reference. i,j This represents the elements in the standard similarity matrix W′;

[0039] Based on the standard similarity matrix and the entity referential representation, a weighted candidate graph entity representation is calculated using a second weighting formula, wherein the second weighting formula is: e′ j Represents the weighted candidate graph entity representation;

[0040] Based on the weighted entity reference representation and the weighted candidate graph entity representation, the similarity between the entity reference and the candidate graph entity is calculated.

[0041] Optionally, the similarity calculation module is further configured to:

[0042] The weighted entity reference representation sequence of the weighted entity reference representation is passed through a convolutional neural network to obtain an entity reference embedding vector, and the weighted candidate graph entity reference representation sequence of the weighted candidate graph entity representation is passed through a convolutional neural network to obtain a candidate graph entity embedding vector.

[0043] The entity reference embedding vector and the candidate graph entity embedding vector are combined to obtain the scoring vector. Based on the scoring vector and the preset ranking and scoring model, the similarity between the entity reference and the candidate graph entity is obtained.

[0044] Optionally, the entity recall module is further configured to:

[0045] For any entity designation, the entity designation is matched with the graph entity index to obtain a target graph entity index. The preset knowledge graph includes a graph entity index, which includes a graph entity ontology and at least one graph entity alias corresponding to the graph entity ontology. The graph entity ontology and / or any graph entity alias in the target graph entity index match the entity designation.

[0046] The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as candidate graph entities.

[0047] Optionally, the entity recall module is further configured to:

[0048] The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as the basic graph entity;

[0049] Calculate the deviation distance between the base map entity and the entity reference, and determine the base map entity corresponding to the deviation distance that meets the second preset condition as the candidate map entity.

[0050] Optionally, the labeling module is further configured to:

[0051] According to preset association rules, obtain the associated graph entities corresponding to the graph entities to be linked;

[0052] Calculate the association confidence between the association graph entity and the entity reference, and filter the target association confidence that meets the third preset condition, and obtain the association graph entity corresponding to the target association confidence as a supplementary graph entity;

[0053] The entity to be linked refers to the entity in the supplementary graph.

[0054] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described knowledge graph-based text tagging method.

[0055] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described knowledge graph-based text tagging method.

[0056] By employing the above technical solutions, this application provides a text tagging method and apparatus, storage medium, and computer device based on knowledge graphs. This method identifies entity references in the text to be tagged, recalls candidate graph entities corresponding to the entity references in a preset knowledge graph, calculates the similarity between the entity references and the candidate graph entities based on the entity reference representations and the candidate graph entity representations, and filters target similarities that meet a first preset condition. It then obtains the entity references and graph entities to be linked corresponding to the target similarities, links the entity references to the graph entities, and uses all graph entities in the preset knowledge graph linked to the entity references as tagging labels for the text to be tagged. By calculating the similarity between the entity references and the candidate graph entities, it determines the graph entity that best matches the entity reference, and then uses the graph entity as the tagging label for the text, thus improving the accuracy of text tagging.

[0057] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0058] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0059] Figure 1The illustration shows a flowchart of a knowledge graph-based text tagging method provided in an embodiment of this application;

[0060] Figure 2 This illustration shows a flowchart of another knowledge graph-based text tagging method provided in an embodiment of this application;

[0061] Figure 3 This illustration shows a flowchart of another knowledge graph-based text tagging method provided in an embodiment of this application;

[0062] Figure 4 This illustration shows a structural schematic diagram of a knowledge graph-based text tagging device provided in an embodiment of this application. Detailed Implementation

[0063] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0064] This embodiment provides a text tagging method based on knowledge graphs, such as... Figure 1 As shown, the method includes:

[0065] Step 101: Identify the entity reference of the text to be labeled, and retrieve the candidate graph entity corresponding to the entity reference in the preset knowledge graph.

[0066] A knowledge graph, known in library and information science as knowledge domain visualization or knowledge domain mapping, is a series of various graphs that display the development process and structural relationships of knowledge. It uses visualization techniques to describe knowledge resources and their carriers, mining, analyzing, constructing, drawing, and displaying knowledge and the interrelationships between them. Its main characteristics include: 1. The more times and the wider the scope of user searches, the more information and content the search engine can obtain. 2. Giving strings new meanings, rather than just simple strings. 3. Integrating all disciplines to facilitate coherence in user searches. 4. Finding more accurate information for users, making more comprehensive summaries, and providing more in-depth and relevant information. 5. Systematically presenting the knowledge system related to keywords to users. 6. Extracting useful information from the entire internet, allowing users to access more relevant public resources.

[0067] In the embodiments described above, Named Entity Recognition (NER) can be used to identify the entity references of the text to be annotated. Taking the medical field as an example, entity references can include diseases, drugs, and laboratory tests. Specifically, a framework of BERT (Bidirectional Encoder Representation from Transformers, a pre-trained language representation model) + CRF (Conditional Random Field) can be used. The pre-trained BERT model serves as the underlying text feature encoder, and the CRF model is then used to predict entity references, ultimately obtaining the entity references of the text to be annotated. Then, a preset knowledge graph is used to recall candidate graph entities corresponding to the entity reference. The preset knowledge graph can be a medical domain knowledge graph. For example, a medical text may include the following text content: "Metformin is a pancreatic drug currently used to treat diabetes". After identifying the aforementioned text content, the entity reference may include "diabetes" and "metformin". Among them, the attribute of "diabetes" is a disease, and the attribute of "metformin" is a drug. The candidate graph entities recalled by the medical domain knowledge graph for the entity reference "diabetes" may be "type 2 diabetes" or "adult diabetes".

[0068] Step 102: Based on the entity reference representation of the entity reference and the candidate graph entity representation of the candidate graph entity, calculate the similarity between the entity reference and the candidate graph entity, filter the target similarity that meets the first preset condition, and obtain the entity reference to be linked and the graph entity to be linked corresponding to the target similarity.

[0069] Next, entity references are transformed into entity reference representations, and candidate graph entities are transformed into candidate graph entity representations, so that similarity can be calculated based on entity reference representations and candidate graph entity representations. The specific representation transformation process can be as follows: input the entity reference into the aforementioned pre-trained BERT model, use the embedding of the CLS (classification) position output by the BERT model as the first entity reference representation, and use the entity reference to obtain the second entity reference representation by weighting it using the word2vec model and TF-IDF. Adding the first entity reference representation and the second entity reference representation yields the entity reference representation.

[0070] Similarly, the candidate graph entities are input into the aforementioned pre-trained BERT model. The embedding of the CLS (classification) position output by the BERT model is used as the first candidate graph entity representation. The candidate graph entities are weighted using the word2vec model and TF-IDF to obtain the second candidate graph entity representation. The first and second candidate graph entity representations are added together to obtain the candidate graph entity representation.

[0071] Next, based on the entity reference representation and the candidate graph entity representation, the similarity between the entity reference and the candidate graph entity is calculated. Target similarities that meet the first preset condition are then selected to identify whether the recalled candidate graph entities match their corresponding entity references. The first preset condition, for example, involves sorting the similarities and then selecting the top K based on a threshold, where K can be 3, 4, or 5, etc., to determine the target similarity. The entity reference and graph entity to be linked corresponding to the target similarity are then obtained for subsequent tagging of the medical text.

[0072] Step 103: Link the entity reference to be linked with the graph entity to be linked, and use all graph entities in the preset knowledge graph that are linked with the entity reference as annotation tags for the text to be annotated.

[0073] In the above embodiments of this application, the entity reference to be linked is linked to the graph entity to be linked, and all graph entities in the preset knowledge graph linked to the entity reference are used as annotation tags for the text to be annotated, thus completing the tagging of the text to be annotated. By mapping the entity reference predicted by the named entity recognition to the graph entities in the existing medical knowledge graph (which has millions of nodes and relationships including drugs, diseases, tests and examinations, and indications), the purpose of tag normalization can be achieved. At the same time, the annotated content tags can also serve as the basis for subsequent medical text retrieval, used to match medical text with user profile tags.

[0074] By applying the technical solution of this embodiment, the entity reference of the text to be labeled is identified, and the candidate graph entities corresponding to the entity reference are recalled in a preset knowledge graph. Based on the entity reference representation of the entity reference and the candidate graph entity representation of the candidate graph entities, the similarity between the entity reference and the candidate graph entities is calculated, and the target similarity that meets the first preset condition is filtered. The entity reference to be linked and the graph entity to be linked corresponding to the target similarity are obtained, the entity reference to be linked and the graph entity to be linked are linked, and all graph entities in the preset knowledge graph that are linked to the entity reference are used as the labeling tags of the text to be labeled. By calculating the similarity between the entity reference and the candidate graph entities, the graph entity that best matches the entity reference is determined, and then the graph entity is used as the labeling tag of the text, which improves the accuracy of text labeling.

[0075] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another text tagging method based on knowledge graphs is provided, such as... Figure 2 As shown, the method includes:

[0076] Step 201: Identify the entity reference of the text to be labeled, and retrieve the candidate graph entity corresponding to the entity reference in the preset knowledge graph.

[0077] In the above embodiments of this application, the entity reference of the text to be labeled is identified by Named Entity Recognition (NER), and the candidate graph entity corresponding to the entity reference is recalled in a preset knowledge graph so that the graph entity can be determined based on the candidate graph entity, and the labeling of the text to be labeled can be completed according to the graph entity. The aforementioned preset knowledge graph may include a medical field knowledge graph.

[0078] Step 202: Calculate the similarity matrix W based on the entity reference representation M of the entity reference and the candidate graph entity representation E of the candidate graph entity, where each element w in W... i,j = i e j m i Let e ​​represent the i-th element in the entity reference representation M. j Let w represent the j-th element in the candidate graph entity representation E, and let w be the similarity between the i-th entity and the j-th candidate graph entity. i,j .

[0079] Next, to better represent entity references and candidate graph entities, the attention mechanism can be used to learn the association between entity references and candidate graph entities. Based on the entity reference representation M of the entity reference and the candidate graph entity representation E of the candidate graph entity, a similarity matrix W is calculated using the similarity matrix formula. Specifically, a similarity matrix W with dimensions |M|*|E| is calculated, where each element w of the similarity matrix W... i,j The similarity matrix W represents the similarity between the entity reference and the candidate graph entity. That is, the i-th row of the similarity matrix W represents the similarity between the i-th word of the entity reference and each word in the candidate graph entity. Then, the similarity between the entity reference and the candidate graph entity can be obtained based on the similarity matrix.

[0080] The formula for the similarity matrix is:

[0081] W = |M|*|E|

[0082] Where W represents the similarity matrix, w i,j Denotes the elements in the similarity matrix W, w i,j =m i ′e j ;

[0083] M represents the entity referential representation, M = {m1, m2, ... ?} |M|};

[0084] E represents the candidate graph entity representation, E = {e1, e2, ... ?} |e|};

[0085] m i Let e ​​represent the i-th element in the entity reference representation M. j This represents the j-th element in the candidate graph entity representation E, where 0 <i≤|M|,0<j≤|E|。

[0086] More specifically, "m1", "m2", etc., can be equivalent to the embedding representation of a single character. An embedding can have 768 dimensions. If the entity reference has 5 characters (|M| = 5), then the corresponding similarity matrix can be a 5*768 dimension matrix. Similarly, if the candidate graph entity has 7 characters (|E| = 7), then the corresponding similarity matrix can be a 7*768 dimension matrix. Transposing the candidate graph entity matrix yields a [5*768]*[768*7], i.e., a 5*7 similarity matrix.

[0087] When using w i,j =m′ i e jWhen characterizing the similarity between entity references and candidate graph entities, for example, if the aforementioned similarity matrix is ​​a 5*7 similarity matrix, w 2,3 This indicates the similarity between the second character of the entity's reference and the third character of the candidate graph entity.

[0088] Step 203: Standardize the similarity matrix to obtain a standard similarity matrix. Based on the standard similarity matrix and the candidate graph entity representations, calculate the weighted entity reference representation using a first weighting formula, wherein the first weighting formula is: m′ i w′ represents the weighted entity reference. i,j This represents an element in the standard similarity matrix W′.

[0089] Step 204: Based on the standard similarity matrix and the entity referential representation, calculate the weighted candidate graph entity representation using the second weighting formula, wherein the second weighting formula is: e′ j This represents the weighted candidate graph entity representation.

[0090] Next, the similarity matrix is ​​standardized to obtain a standard similarity matrix. For example, each row of the similarity matrix can be standardized using the soft max function, i.e., W′ = softmax(W), where W′ represents the standard similarity matrix. Then, elements in the candidate graph entities are used to characterize elements in the entity references. Similarly, elements in the entity references can also be used to characterize elements in the candidate graph entities.

[0091] Specifically, based on the standard similarity matrix W′ and the candidate map entity representation e j The weighted entity nomenclature m′ is calculated using the first weighting formula. i And based on the standard similarity matrix W″ and the entity referential representation m i The weighted candidate graph entity representation e is calculated using the second weighting formula. j So that the weighted entity designation m′ can be represented based on the weighted entity designation. i and the weighted candidate graph entity representation e′ j Calculate the similarity between the entity reference and the candidate graph entity.

[0092] The first weighting formula is:

[0093]

[0094] The second weighting formula is:

[0095]

[0096] Where, m′i e′ represents the weighted entity reference. j w′ represents the weighted candidate graph entity representation. i,j This represents an element in the standard similarity matrix W′.

[0097] Step 205: After passing the weighted entity reference representation sequence of the weighted entity reference representation through a convolutional neural network, obtain the entity reference embedding vector; and after passing the weighted candidate graph entity representation sequence of the weighted candidate graph entity representation through a convolutional neural network, obtain the candidate graph entity embedding vector.

[0098] Step 206: Combine the entity reference embedding vector and the candidate graph entity embedding vector to obtain the scoring vector. Based on the scoring vector and the preset ranking and scoring model, obtain the similarity between the entity reference and the candidate graph entity.

[0099] Step 207: Filter target similarities that meet the first preset conditions, and obtain the entity references and graph entities to be linked corresponding to the target similarities.

[0100] Next, the weighted entity designation representation m′ is obtained. i and weighted candidate graph entity representation e′ j Then, the differences between the two and their corresponding original inputs can be analyzed separately. Specifically, the methods of subtraction and multiplication can be used to characterize and measure the differences between entity references and candidate graph entities from different perspectives.

[0101] Based on the weighted entity designation m′ i and the entity reference representation m i The entity reference representation sequence is calculated using the first serialization formula. and based on the weighted candidate graph entity representation e′ j and the candidate map entity representation e j The candidate map entity representation sequence is calculated using the second serialization formula. In order to calculate the similarity between the entity reference and the candidate graph entity based on the entity reference representation sequence and the candidate graph entity representation sequence;

[0102] The first serialization formula is:

[0103]

[0104] The second serialization formula is:

[0105]

[0106] in, Represents a sequence of entity references. This represents the candidate map entity representation sequence.

[0107] After obtaining richer information about entity references and candidate graph entities, in order to better mine the high-level semantics of entity references and candidate graph entities, the entity reference representation sequence is further refined. and candidate map entity representation sequence Each embedding is passed through a CNN (Convolutional Neural Network) layer to obtain an N-dimensional representation. Finally, the two embeddings are concatenated and input into the ranking and scoring model.

[0108] Specifically, calculation f out =[f m ,f e ], where f m f is the weighted entity reference sequence embedding vector. e f is the weighted candidate graph entity representation sequence embedding vector. out This is the vector to be scored.

[0109] According to the scoring vector f out The preset ranking and scoring model can obtain the entity references and the similarity between the candidate graph entities.

[0110] Specifically, f out =[f m ,f e After passing through a multilayer perceptron (MLP), the final output is obtained through an activation function, as shown in the following formula:

[0111]

[0112] Among them, "W2*RELU(W1*f out The part "+b1)+b2" is a multilayer perceptron (MLP), and the function sigmoid is the activation function.

[0113] The parameters "w1, w2" and "b1, b2" mentioned above are the parameters that the preset ranking and scoring model needs to learn. After passing through the sigmoid activation function, the output can be a specific number, i.e., the similarity score. For example, if the input is the embedding of the entity referencing "type 2 diabetes" and the input candidate graph entity is the embedding of "adult diabetes", the preset ranking and scoring model can obtain a similarity score between "type 2 diabetes" and "adult diabetes". In particular, when recalling candidate graph entities for "type 2 diabetes", N candidate graph entities can be recalled. Then, "type 2 diabetes" and its corresponding N candidate graph entities are respectively input into the ranking and scoring model to obtain the similarity score between each candidate graph entity and the entity referencing. Then, for the same entity referencing, the similarity scores of all candidate entities corresponding to the same entity referencing are sorted from high to low. For example, three similarity scores can be selected to obtain the graph entities.

[0114] Step 208: Link the entity reference to be linked with the graph entity to be linked, and use all graph entities in the preset knowledge graph that are linked with the entity reference as annotation tags for the text to be annotated.

[0115] In the above embodiments of this application, the entity reference to be linked is linked to the graph entity to be linked, and all graph entities in the preset knowledge graph that are linked to the entity reference are used as annotation tags for the text to be annotated to complete the tag annotation. This can efficiently annotate medical text with diverse and accurate tags, and at the same time lay a good foundation for recall and ranking in subsequent medical text recommendation scenarios. The standardized tags have also brought great growth to the medical text recommendation scenario.

[0116] By applying the technical solution of this embodiment, entity references of the text to be labeled are identified, and candidate graph entities corresponding to the entity references are recalled in a preset knowledge graph. Based on the entity reference representation M and the candidate graph entity representation E, a similarity matrix W is calculated, thereby obtaining a weighted entity reference representation and a weighted candidate graph entity representation to form a scoring vector. Based on the scoring vector and a preset ranking and scoring model, the similarity between the entity reference and the candidate graph entity is obtained. Based on the similarity, entity references and graph entities to be linked are obtained. The entity references to be linked are linked to the graph entities to be linked, and all graph entities in the preset knowledge graph linked to the entity references are used as labels for the text to be labeled. By using a ranking and scoring model based on a convolutional neural network to mine the high-level semantic information and semantic relationships between the entity references of medical texts and the candidate graph entities of the medical knowledge graph, the accuracy of graph entity selection is improved, thereby improving the accuracy of labeling.

[0117] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another text tagging method based on knowledge graphs is provided, such as... Figure 3 As shown, the method includes:

[0118] Step 301: Identify the entity references of the text to be annotated; for any entity reference, match the entity reference with the graph entity index to obtain the target graph entity index; determine the graph entity ontology and graph entity alias corresponding to the target graph entity index as the basic graph entity; wherein the graph entity ontology and / or any graph entity alias in the target graph entity index match the entity reference; the preset knowledge graph includes a graph entity index; the graph entity index includes a graph entity ontology and at least one graph entity alias corresponding to the graph entity ontology.

[0119] In the above embodiments of this application, the entity reference of the text to be labeled is identified. For any entity reference, the entity reference is matched with the graph entity index. Since medical terms often vary and there are synonym substitutions (such as stroke and cerebral infarction), by matching the entity reference with the graph entity index, the selection range when screening candidate graph entities can be expanded, so as to recall as many candidate graph entities as possible. Specifically, the atlas entity index consists of the atlas entity body and at least one atlas entity alias corresponding to the atlas entity body. For example, if the atlas entity body is "cerebral hemorrhage", then the atlas entity alias corresponding to the atlas entity body "cerebral hemorrhage" can be "cerebral hemorrhage". In this case, the corresponding atlas entity index includes "cerebral hemorrhage" and "cerebral hemorrhage", and the index name of the atlas entity index is the standard name, i.e., "cerebral hemorrhage". If the atlas entity body is "stroke", then the atlas entity alias corresponding to the atlas entity body "stroke" can be "cerebral stroke". In this case, the corresponding atlas entity index includes "stroke" and "cerebral stroke", and the index name of the atlas entity index is the standard name, i.e., "stroke".

[0120] Taking the graph entity ontology as "cerebral hemorrhage" and the corresponding graph entity alias as "cerebral hemorrhage" as an example, after matching the entity reference with the graph entity index through word matching, if either "cerebral hemorrhage" or "cerebral hemorrhage" is matched, a target graph entity index containing both "cerebral hemorrhage" and "cerebral hemorrhage" will be obtained. The graph entity ontology (cerebral hemorrhage) and the graph entity alias (cerebral hemorrhage) corresponding to the target graph entity index containing both "cerebral hemorrhage" and "cerebral hemorrhage" will be jointly determined as the basic graph entity. Specifically, the graph entity ontology and / or any graph entity alias in the target graph entity index match the entity reference. The preset knowledge graph includes a graph entity index, and the graph entity index includes a graph entity ontology and at least one graph entity alias corresponding to the graph entity ontology.

[0121] Step 302: Calculate the deviation distance between the basic map entity and the entity reference, and determine the basic map entity corresponding to the deviation distance that meets the second preset condition as the candidate map entity.

[0122] Next, the deviation distance between the basic atlas entity and the entity reference is calculated. The deviation distance may include editing distance and pinyin distance, etc. The basic atlas entity corresponding to the deviation distance that meets the second preset condition is determined as the candidate atlas entity. For example, the top N is selected according to the threshold. N can be 3, 4 or 5, etc., thereby determining one or more candidate atlas entities corresponding to each entity reference.

[0123] Step 303: Calculate the similarity between the entity reference and the candidate graph entity based on the entity reference's entity reference representation and the candidate graph entity's candidate graph entity representation.

[0124] Next, based on the entity reference representation of the entity reference and the candidate graph entity representation of the candidate graph entity, the similarity between the entity reference and the candidate graph entity is calculated to determine the graph entity with the best similarity to the entity reference, so that the graph entity can be labeled in the future.

[0125] Step 304: Filter target similarity that meets the first preset condition, obtain the entity reference to be linked and the graph entity to be linked corresponding to the target similarity, and link the entity reference to be linked and the graph entity to be linked.

[0126] Next, target similarity that meets the first preset condition is filtered, and the entity reference to be linked and the graph entity to be linked corresponding to the target similarity are obtained. The entity reference to be linked and the graph entity to be linked are then linked.

[0127] Step 305: Obtain the associated graph entity corresponding to the graph entity to be linked according to the preset association rules, and calculate the association confidence between the associated graph entity and the entity reference.

[0128] Step 306: Filter the target association confidence that meets the third preset condition, obtain the association graph entity corresponding to the target association confidence as a supplementary graph entity, and link the entity to be linked to the supplementary graph entity.

[0129] Step 307: Use all graph entities in the preset knowledge graph that are linked to the entity reference as annotation tags for the text to be annotated.

[0130] According to preset association rules, associated graph entities corresponding to the entity to be linked are obtained. Specifically, the entity to be linked can be tags such as disease, drug, and test. Based on the rich relationships in the medical knowledge graph, associations can be made with the corresponding department of the disease, the indications of the drug, commonly used drugs for the disease, and common diagnostic methods. The association confidence between the associated graph entity and the entity reference is calculated, and target association confidence that meets the third preset condition is selected. The associated graph entity corresponding to the target association confidence is obtained as a supplementary graph entity, and the entity reference to be linked is linked with the supplementary graph entity. For this purpose, the text content can be labeled with as many tags as possible, and relevant tags have been supplemented and some tag indexes have been added. Then, all graph entities in the preset knowledge graph that are linked with the entity reference are used as the annotation tags of the text to be annotated.

[0131] By applying the technical solution of this embodiment, entity references of the text to be annotated are identified. For any entity reference, the entity reference is matched with the graph entity index to obtain a target graph entity index. The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as basic graph entities. The deviation distance between the basic graph entities and the entity reference is calculated. The basic graph entities corresponding to the deviation distance that meets the second preset condition are determined as candidate graph entities. The similarity between the entity reference and the candidate graph entities is calculated to obtain the entity reference to be linked and the graph entity to be linked. Then, the associated graph entities are obtained based on the graph entities to be linked. The association confidence between the associated graph entities and the entity reference is calculated to obtain supplementary graph entities. The entity reference to be linked and the supplementary graph entities are linked. All graph entities in the preset knowledge graph that are linked to the entity reference are used as annotation tags for the text to be annotated. By matching the entity designation with the graph entity index, the selection range for filtering candidate graph entities is expanded, enabling the retrieval of as many candidate graph entities as possible. At the same time, by obtaining supplementary graph entities and linking the entity designation to be linked with the supplementary graph entities, the text content can be labeled with as many tags as possible.

[0132] Furthermore, as Figure 1 In terms of specific implementation, this application provides a text tagging device based on a knowledge graph, such as... Figure 4 As shown, the device includes:

[0133] The entity recall module 401 is used to identify the entity reference of the text to be labeled, and recall the candidate graph entity corresponding to the entity reference in the preset knowledge graph.

[0134] The similarity calculation module 402 is used to calculate the similarity between the entity reference and the candidate graph entity based on the entity reference representation of the entity reference and the candidate graph entity representation of the candidate graph entity, and to filter the target similarity that meets the first preset condition, and to obtain the entity reference and the graph entity to be linked corresponding to the target similarity.

[0135] The tag annotation module 403 is used to link the entity reference to be linked with the graph entity to be linked, and to use all graph entities in the preset knowledge graph that are linked with the entity reference as annotation tags for the text to be annotated.

[0136] Optionally, the similarity calculation module 402 is further configured to:

[0137] Based on the entity reference representation M of the entity reference and the candidate graph entity representation E of the candidate graph entity, a similarity matrix W is calculated, where each element in W... wi,j=iejm i Let e ​​represent the i-th element in the entity reference representation M. j This represents the j-th element in the candidate graph entity representation E;

[0138] The similarity between the entity reference and the candidate graph entities is obtained based on the similarity matrix, where the similarity between the i-th entity reference and the j-th candidate graph entity is w. i,j .

[0139] Optionally, the similarity calculation module 402 is further configured to:

[0140] The similarity matrix is ​​standardized to obtain a standard similarity matrix;

[0141] Based on the standard similarity matrix and the candidate graph entity representations, a weighted entity referential representation is calculated using a first weighting formula, wherein the first weighting formula is: m′ i w′ represents the weighted entity reference. i,j This represents the elements in the standard similarity matrix W′;

[0142] Based on the standard similarity matrix and the entity referential representation, a weighted candidate graph entity representation is calculated using a second weighting formula, wherein the second weighting formula is: e′ j Represents the weighted candidate graph entity representation;

[0143] Based on the weighted entity reference representation and the weighted candidate graph entity representation, the similarity between the entity reference and the candidate graph entity is calculated.

[0144] Optionally, the similarity calculation module 402 is further configured to:

[0145] The weighted entity reference representation sequence of the weighted entity reference representation is passed through a convolutional neural network to obtain an entity reference embedding vector, and the weighted candidate graph entity reference representation sequence of the weighted candidate graph entity representation is passed through a convolutional neural network to obtain a candidate graph entity embedding vector.

[0146] The entity reference embedding vector and the candidate graph entity embedding vector are combined to obtain the scoring vector. Based on the scoring vector and the preset ranking and scoring model, the similarity between the entity reference and the candidate graph entity is obtained.

[0147] Optionally, the entity recall module 401 is further configured to:

[0148] For any entity designation, the entity designation is matched with the graph entity index to obtain a target graph entity index. The preset knowledge graph includes a graph entity index, which includes a graph entity ontology and at least one graph entity alias corresponding to the graph entity ontology. The graph entity ontology and / or any graph entity alias in the target graph entity index match the entity designation.

[0149] The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as candidate graph entities.

[0150] Optionally, the entity recall module 401 is further configured to:

[0151] The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as the basic graph entity;

[0152] Calculate the deviation distance between the base map entity and the entity reference, and determine the base map entity corresponding to the deviation distance that meets the second preset condition as the candidate map entity.

[0153] Optionally, the labeling module 403 is further configured to:

[0154] According to preset association rules, obtain the associated graph entities corresponding to the graph entities to be linked;

[0155] Calculate the association confidence between the association graph entity and the entity reference, and filter the target association confidence that meets the third preset condition, and obtain the association graph entity corresponding to the target association confidence as a supplementary graph entity;

[0156] The entity to be linked refers to the entity in the supplementary graph.

[0157] It should be noted that other corresponding descriptions of the functional units involved in the knowledge graph-based text tagging device provided in this application embodiment can be found in the following references. Figures 1 to 3 The corresponding descriptions in the method will not be repeated here.

[0158] Based on the above, Figures 1 to 3 Accordingly, this application also provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described method. Figures 1 to 3 The text tagging method based on knowledge graphs is shown.

[0159] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.

[0160] Based on the above, Figures 1 to 3 The method shown, and Figure 4 To achieve the above objectives, the present application also provides a computer device, specifically a personal computer, server, network device, etc., as shown in the virtual device embodiment. This computer device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described objectives. Figures 1 to 3 The text tagging method based on knowledge graphs is shown.

[0161] Optionally, the computer device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Bluetooth interfaces, Wi-Fi interfaces), etc.

[0162] Those skilled in the art will understand that the computer device structure provided in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0163] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and stores the hardware and software resources of a computer device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software within the physical device.

[0164] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms, or by hardware. It identifies the entity reference of the text to be labeled, recalls candidate graph entities corresponding to the entity reference in a preset knowledge graph, calculates the similarity between the entity reference and the candidate graph entities based on the entity reference representation and the candidate graph entity representation, filters target similarities that meet a first preset condition, obtains the entity reference to be linked and the graph entity to be linked corresponding to the target similarity, links the entity reference to be linked and the graph entity to be linked, and uses all graph entities in the preset knowledge graph linked to the entity reference as annotation tags for the text to be labeled. By calculating the similarity between the entity reference and the candidate graph entities, the graph entity best suited to the entity reference is determined, and then the graph entity is used as the annotation tag for the text, improving the accuracy of text tag annotation.

[0165] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.

[0166] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.

Claims

1. A text tagging method based on knowledge graphs, characterized in that, The method includes: Identify the entity references of the text to be labeled, and retrieve the candidate graph entities corresponding to the entity references in the preset knowledge graph; Based on the entity reference representation M of the entity reference and the candidate graph entity representation E of the candidate graph entity, a similarity matrix W is calculated, where each element in W... , This represents the i-th element in the entity reference representation M. Let the j-th element in the candidate graph entity representation E be the similarity between the i-th entity and the j-th candidate graph entity. ; The similarity matrix is ​​standardized to obtain a standard similarity matrix; Based on the standard similarity matrix and the candidate graph entity representations, a weighted entity referential representation is calculated using a first weighting formula, wherein the first weighting formula is: , This represents the weighted entity designation. Representing the standard similarity matrix Elements in; Based on the standard similarity matrix and the entity referential representation, a weighted candidate graph entity representation is calculated using a second weighting formula, wherein the second weighting formula is: , Represents the weighted candidate graph entity representation; The weighted entity reference representation sequence of the weighted entity reference representation is passed through a convolutional neural network to obtain an entity reference embedding vector, and the weighted candidate graph entity reference representation sequence of the weighted candidate graph entity representation is passed through a convolutional neural network to obtain a candidate graph entity embedding vector. The entity reference embedding vector and the candidate graph entity embedding vector are combined to obtain a scoring vector. Based on the scoring vector and a preset ranking and scoring model, the similarity between the entity reference and the candidate graph entities is obtained. The weighted entity reference representation sequence is calculated using a first serialization formula, and the weighted candidate graph entity representation sequence is calculated using a second serialization formula. The first serialization formula is: =[ , ,under( , ), many ( , )], The second serialization formula is: =[ , ,under( , ), many ( , )], This represents a weighted entity referential representation sequence. This represents a weighted candidate graph entity representation sequence; Filter target similarities that meet the first preset conditions, and obtain the entity references and graph entities to be linked corresponding to the target similarities; The entity to be linked is associated with the graph entity to be linked, and all graph entities in the preset knowledge graph that are linked with the entity to be linked are used as annotation tags for the text to be annotated.

2. The method according to claim 1, characterized in that, The preset knowledge graph includes a graph entity index, and the graph entity index includes a graph entity ontology and at least one graph entity alias corresponding to the graph entity ontology; The step of recalling candidate graph entities corresponding to the entity reference in the preset knowledge graph includes: For any entity designation, the entity designation is matched with the graph entity index to obtain a target graph entity index, wherein the graph entity ontology and / or any graph entity alias in the target graph entity index match the entity designation; The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as candidate graph entities.

3. The method according to claim 2, characterized in that, The step of determining the graph entity ontology and graph entity alias corresponding to the target graph entity index as candidate graph entities includes: The graph entity ontology and graph entity alias corresponding to the target graph entity index are determined as the basic graph entity; Calculate the deviation distance between the base map entity and the entity reference, and determine the base map entity corresponding to the deviation distance that meets the second preset condition as the candidate map entity.

4. The method according to claim 1, characterized in that, Before using all graph entities in the preset knowledge graph that are linked to the entity reference as annotation tags for the text to be annotated, the method further includes: According to preset association rules, obtain the associated graph entities corresponding to the graph entities to be linked; Calculate the association confidence between the association graph entity and the entity reference, and filter the target association confidence that meets the third preset condition, and obtain the association graph entity corresponding to the target association confidence as a supplementary graph entity; The entity to be linked refers to the entity in the supplementary graph.

5. A text tagging device based on a knowledge graph, characterized in that, The device includes: The entity recall module is used to identify the entity references of the text to be labeled, and to recall the candidate graph entities corresponding to the entity references in the preset knowledge graph. The similarity calculation module is used to calculate a similarity matrix W based on the entity reference representation M of the entity reference and the candidate graph entity representation E of the candidate graph entity, wherein each element in W... , This represents the i-th element in the entity reference representation M. Let the j-th element in the candidate graph entity representation E be the similarity between the i-th entity and the j-th candidate graph entity. ; The similarity matrix is ​​standardized to obtain a standard similarity matrix; Based on the standard similarity matrix and the candidate graph entity representations, a weighted entity referential representation is calculated using a first weighting formula, wherein the first weighting formula is: , This represents the weighted entity designation. Representing the standard similarity matrix Elements in; Based on the standard similarity matrix and the entity referential representation, a weighted candidate graph entity representation is calculated using a second weighting formula, wherein the second weighting formula is: , Represents the weighted candidate graph entity representation; The weighted entity reference representation sequence of the weighted entity reference representation is passed through a convolutional neural network to obtain an entity reference embedding vector, and the weighted candidate graph entity reference representation sequence of the weighted candidate graph entity representation is passed through a convolutional neural network to obtain a candidate graph entity embedding vector. The entity reference embedding vector and the candidate graph entity embedding vector are combined to obtain a scoring vector. Based on the scoring vector and a preset ranking and scoring model, the similarity between the entity reference and the candidate graph entities is obtained. The weighted entity reference representation sequence is calculated using a first serialization formula, and the weighted candidate graph entity representation sequence is calculated using a second serialization formula. The first serialization formula is: =[ , ,under( , ), many ( , )], The second serialization formula is: =[ , ,under( , ), many ( , )], This represents a weighted entity referential representation sequence. This represents a weighted candidate graph entity representation sequence; The similarity calculation module is also used to filter target similarities that meet the first preset conditions, and to obtain the entity reference to be linked and the graph entity to be linked corresponding to the target similarity. The tag annotation module is used to link the entity reference to be linked with the graph entity to be linked, and to use all graph entities in the preset knowledge graph that are linked with the entity reference as annotation tags for the text to be annotated.

6. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for text tagging based on knowledge graphs as described in any one of claims 1 to 4.

7. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the text tagging method based on knowledge graphs as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Knowledge-driven query-based entity linking method

    CN110888946A

  • Method and device for recognizing entity in text, and storage medium

    CN112380865A

  • Neural network-based knowledge graph entity linking method and apparatus, and electronic device

    CN114297398A