An entity classification method and system based on massive knowledge graph and graph embedding

By introducing massive knowledge graphs and graph embedding technologies into entity classification, the graph embedding information of entities is generated and classified in combination with entity confidence, the problems of low accuracy and low universality of entity classification in the prior art are solved, and higher accuracy and universality are achieved.

CN114564579BActive Publication Date: 2025-03-11GUANGDONG HENGQIN SHUSHUSHUO STORY INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210103224.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-27
Publication Date
2025-03-11
Estimated Expiration
2042-01-27

AI Technical Summary

Technical Problem

The existing entity classification methods based on knowledge graphs have low accuracy and low versatility, making it difficult to effectively deal with massive cross-domain knowledge.

Method used

The entity classification method based on massive knowledge graphs and graph embedding is adopted to form a knowledge graph through named entity recognition models and relationship extraction models, and the graph embedding model is used to generate the entity's graph embedding information, and the entity confidence is classified. Finally, the knowledge graph is reprocessed to clear the noise of the classification result.

Benefits of technology

It improves the accuracy and recall of entity classification, enhances the universality and coverage of the method, and is suitable for business classification tasks in the big data field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564579B_ABST
    Figure CN114564579B_ABST
Patent Text Reader

Abstract

The present invention proposes an entity classification method and system based on massive knowledge graph and graph embedding, which relates to the technical field of natural language processing. Starting from massive corpus text, a named entity recognition model and a relationship extraction model are introduced to extract entities and relationships, and form a knowledge graph. Then, with the help of the graph embedding model, graph embedding information of various entities in the knowledge graph is generated, that is, a vector is used to represent an entity, and then the classification of entity nodes is realized based on the graph embedding information of each entity node and the entity confidence of the entity. Finally, the knowledge graph is used for reprocessing to remove the noise of the classification task results. The method has strong versatility, improves the accuracy and recall rate, and facilitates the realization of better business classification effects in the field of big data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and more specifically, to an entity classification method and system based on massive knowledge graphs and graph embedding. Background Art

[0002] In today's era of information explosion, massive amounts of new data and information are generated every day. Deeply mining the inherent patterns of the data, screening and summarizing effective information, and classifying the data will produce huge economic benefits.

[0003] However, there are two problems in realizing data utilization: 1. How to use the collected information systematically and in an organized manner? 2. How to mine the intrinsic patterns of the data to realize classification task applications in different scenarios? At present, for problem 1, we can adopt a database model for vertical fields. However, such a model ignores valuable cross-domain data, reduces the diversity of data, and thus affects the mining of intrinsic patterns of data and the accuracy and coverage of downstream tasks (such as data classification). At this time, knowledge graphs came into being.

[0004] The knowledge graph represents proper nouns such as people, place names, and book titles as entities, and represents the internal connections between entities as relationships. The entities are combined with relationships to form knowledge triples. In the application field of knowledge graphs, entity classification refers to extracting features from free text and using them for analysis to derive the specific type of a given entity. At present, coarse-grained entity classification is relatively easy, but fine-grained entity classification is a very challenging task. The prior art discloses a method and device for determining entity categories (such as: Modeling Relational Data with Graph Convolutional Networks), first obtaining a candidate data pair set containing at least one candidate data pair, and then using a convolutional neural network to determine whether at least one entity contained in the at least one candidate data pair belongs to at least one category contained in the candidate data pair based on the attribute information of the entity in the candidate data pair, the attribute value of the entity, and / or the attribute information of the category, and if so, marking the at least one category as the category of the at least one entity. This method determines the classification of entities from the perspective of improved annotation, expands the number of entity categories, and improves the accuracy of entity classification, thereby solving the problem of coarse and inaccurate entity classification granularity. However, compared to the colorful real world, knowledge graphs are far from perfect and need to be constantly updated and supplemented. This solution has low coverage and low versatility for massive cross-domain knowledge, so it is not applicable and is not conducive to the screening and induction of effective information. Summary of the invention

[0005] In order to solve the problems of low accuracy and low versatility in the current entity classification method based on knowledge graphs, the present invention proposes an entity classification method and system based on massive knowledge graphs and graph embeddings, which uses a graph embedding model to generate graph embeddings of various entities in the knowledge graph to complete the entity classification task and clear the noise in the classification task results.

[0006] In order to achieve the above technical effects, the technical solution of the present invention is as follows (see the process overview diagram Figure 4 ):

[0007] An entity classification method based on massive knowledge graph and graph embedding, comprising:

[0008] S1. Obtain N corpus texts, and annotate the entities and entity relationships in the corpus texts to obtain an annotated dataset;

[0009] S2. Introduce named entity recognition model and relation extraction model, and use annotated data sets to train and test named entity recognition model and relation extraction model to perform entity recognition and relation extraction in massive corpus text; then form a knowledge graph based on entities and relations;

[0010] S3. Introduce a graph embedding model, use the graph embedding model to perform the prediction training task of associated entity nodes in the knowledge graph, and obtain the graph embedding information of each entity node;

[0011] S4. Determine the entity to be classified and calculate the entity confidence of the entity;

[0012] S5. Based on the graph embedding information of each entity node and the entity confidence of the entity, the classifier is used to perform the classification task of the entity to be classified, and the knowledge graph is used for reprocessing to obtain the final entity classification result.

[0013] In this technical solution, starting from massive corpus text, a named entity recognition model and a relationship extraction model are introduced to extract entities and relationships and form a knowledge graph. Then, with the help of a graph embedding model, graph embedding information of various entities in the knowledge graph is generated, that is, a vector is used to represent an entity, and then based on the graph embedding information of each entity node and the entity confidence of the entity, the entity nodes are classified. Finally, the knowledge graph is used for reprocessing to remove noise in the classification task results. It has strong versatility, improves the accuracy and recall rate of entity classification, and facilitates the realization of better business classification effects in the big data field.

[0014] Preferably, based on the Bert Chinese pre-training model, named entity recognition and relationship extraction tasks of the corpus text are added downstream of the Bert Chinese pre-training model to obtain a named entity recognition model and a relationship extraction model used for entity recognition and relationship extraction in the corpus text respectively; when the named entity recognition model and the relationship extraction model are used for entity recognition and relationship extraction of massive corpus text, the massive corpus text is constantly updated, and the knowledge graph formed based on entities and relationships is also constantly updated, which ensures the richness of cross-domain knowledge information and makes the constructed knowledge graph have better versatility and coverage.

[0015] Preferably, in step S2, an entity-relationship joint extraction model can be used to perform joint extraction, so as to simultaneously extract entity recognition and relationships in the corpus text.

[0016] Preferably, the graph embedding model is DeepWalk, RandomWalk or LINE.

[0017] Preferably, the process of using the graph embedding model to perform the prediction training task of associated entity nodes in the knowledge graph described in step S3 is:

[0018] S31. Select an initial entity node in the knowledge graph, combine the relationship type of the initial entity node in the knowledge graph, and use the graph embedding model to predict the terminal tail node with the initial entity node;

[0019] S32. Compare the node type, node name and node relationship of the predicted terminal tail node with the node type, node name and node relationship of the actual terminal node to determine whether they are correct. If correct, retain the current parameter weights of the graph embedding model and execute step S33; otherwise, adjust the parameter weights of the graph embedding model and return to step S31;

[0020] S33. Based on the graph embedding model, each entity node randomly walks to the adjacent entity nodes in the knowledge graph to obtain the local structure of each entity node in the knowledge graph, thereby obtaining the graph embedding information of each entity node.

[0021] Preferably, in step S4, after determining the entity to be classified, the entity confidence with the entity as the initial entity node is calculated, and the calculation process includes:

[0022] First, calculate the relationship confidence of the entity, the expression is:

[0023] Relationship confidence = min(100, voice contribution + knowledge confidence contribution),

[0024] Among them, voice contribution = voice weight * (ln (vol) * 10), voice weight represents the preset value, ln represents the natural logarithm, and vol represents the voice of the entity in the knowledge graph data;

[0025] Knowledge confidence contribution = knowledge confidence weight * voice coefficient * knowledge confidence;

[0026] Among them, the knowledge confidence weight is 0.7, which is the preset value; Index distance = 110-abs (initial node index-end node index), abs is the absolute value function, and 110 is the maximum value of the index distance preset by the algorithm;

[0027] Then, all the relationship confidences of the entity are sorted from large to small, and the top three relationship confidences are taken and the average is calculated as the entity confidence of the entity.

[0028] Preferably, after step S4 and before step S5, the method further includes: dividing a training set from the labeled data set, obtaining graph embedding information of entity nodes in the training set according to the graph embedding information of each entity node, and training a classifier using the training set based on the graph embedding information to obtain a trained classifier.

[0029] Preferably, in step S5, based on the entity confidence of the entity, when using the classifier to perform the classification task of the entity to be classified, a classification threshold is set, and the entities to be classified whose entity confidence is greater than the classification threshold are classified.

[0030] Preferably, the process of reprocessing using the knowledge graph to obtain the final entity classification result in step S5 includes:

[0031] A. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, use the entity and relationship information stored in the graph database to find the alias of the initial entity node in the knowledge graph, if the alias and the initial entity node are classified as the same category of results, and the alias contains Chinese, and the initial entity node does not contain Chinese, then delete the initial entity node;

[0032] B. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, and search for the alias of the initial entity node in the knowledge graph. If the alias and the initial entity node are classified as the same category of results at the same time, and the alias does not contain Chinese, and the initial entity node contains Chinese, then delete the alias;

[0033] C. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, and search for the alias of the initial entity node in the knowledge graph. If the alias and the initial entity node are classified as the same category of results, and both the alias and the initial entity node contain Chinese, then retain the one with higher entity confidence between the initial entity node and the alias;

[0034] D. For entities to be classified that have nested relationships, retain the one with the highest entity confidence;

[0035] E. Add a query field for the removed entity name as a keyword for the reserved name to query the entity information.

[0036] The present application also proposes an entity classification system based on massive knowledge graph and graph embedding, the system is used to implement the entity classification method based on massive knowledge graph and graph embedding, including:

[0037] The annotated data set acquisition module unit is used to acquire N corpus texts and annotate entities and entity relationships in the corpus texts to obtain annotated data sets;

[0038] The knowledge graph construction unit loads the named entity recognition model and the relationship extraction model, and uses the annotated data set to train and test the named entity recognition model and the relationship extraction model to perform entity recognition and relationship extraction in massive corpus texts; then, based on the entities and relationships, a knowledge graph is formed;

[0039] A graph embedding information acquisition unit is used to load and introduce a graph embedding model, and use the graph embedding model to perform prediction training tasks for associated entity nodes in the knowledge graph to obtain graph embedding information for each entity node;

[0040] An entity confidence calculation unit, used to determine an entity to be classified and calculate the entity confidence of the entity;

[0041] The entity classification unit uses a classifier to perform the classification task of the entity to be classified based on the graph embedding information of each entity node and the entity confidence of the entity, and reprocesses it using the knowledge graph to obtain the final entity classification result.

[0042] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0043] The present invention proposes an entity classification method and system based on massive knowledge graph and graph embedding. Starting from massive corpus text, a named entity recognition model and a relationship extraction model are introduced to extract entities and relationships and form a knowledge graph. Then, the graph embedding model is used to generate graph embedding information of various entities in the knowledge graph, that is, a vector is used to represent an entity, and then the entity nodes are classified based on the graph embedding information of each entity node and the entity confidence of the entity. Finally, the knowledge graph is used for reprocessing to remove the noise of the classification task results. The method has strong versatility, improves the accuracy and recall rate, and facilitates the realization of better business classification effects in the big data field. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram showing a process flow of an entity classification method based on massive knowledge graph and graph embedding proposed in Embodiment 1 of the present invention;

[0045] Figure 2 A schematic diagram showing a final celebrity knowledge graph constructed by applying the entity classification method based on massive knowledge graph and graph embedding proposed in Example 1 of the present invention;

[0046] Figure 3 A diagram showing the implementation process of the complete process of Example 1 of the present invention;

[0047] Figure 4 A structural diagram showing the entity classification system based on massive knowledge graph and graph embedding proposed in Example 3 of the present invention. DETAILED DESCRIPTION

[0048] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0049] In order to better illustrate the present embodiment, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the actual size;

[0050] It is understandable to those skilled in the art that descriptions of certain well-known contents in the drawings may be omitted.

[0051] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0052] The positional relationships described in the drawings are only for illustrative purposes and should not be construed as limiting the present patent;

[0053] Example 1

[0054] This embodiment proposes an entity classification method based on massive knowledge graph and graph embedding. See the flowchart for Figure 1 , the specific steps include:

[0055] S1. Obtain N corpus texts, and annotate the entities and entity relationships in the corpus texts to obtain an annotated data set; "N" here refers to a sufficient number of corpus texts, corresponding to "large amount" and "massive". After obtaining the corpus texts, annotate them in sequence with pre-set labels to obtain an annotated data set.

[0056] S2. Introduce named entity recognition model and relation extraction model, and use annotated data sets to train and test named entity recognition model and relation extraction model to perform entity recognition and relation extraction in massive corpus text; then form a knowledge graph based on entities and relations;

[0057] In this embodiment, based on the Bert Chinese pre-training model, named entity recognition and relationship extraction tasks of the corpus text are added downstream of the Bert Chinese pre-training model to obtain a named entity recognition model and a relationship extraction model used for entity recognition and relationship extraction in the corpus text respectively; the named entity recognition model and the relationship extraction model are used to train the two models using annotated data sets before performing entity recognition and relationship extraction on massive corpus texts. In this embodiment, the named entity recognition model and the relationship extraction model are based on the long short-term memory network LSTM layer and the recurrent neural network. After the training is completed, they are used for entity recognition and relationship extraction.

[0058] When named entity recognition models and relationship extraction models are used to perform entity recognition and relationship extraction on massive corpus texts, the massive corpus texts are constantly updated, and the knowledge graph formed based on entities and relationships is also constantly updated, ensuring the richness of cross-domain knowledge information and making the constructed knowledge graph have better versatility and coverage.

[0059] S3. Introduce a graph embedding model, use the graph embedding model to perform the prediction training task of associated entity nodes in the knowledge graph, and obtain the graph embedding information of each entity node;

[0060] The graph embedding model may be DeepWalk, RandomWalk or LINE. In the present embodiment, the graph embedding model adopts DeepWalk, which can generate random walks on demand and is scalable. The process of generating random walks is efficient and trivially parallelized.

[0061] The process of using the graph embedding model to perform the training task of predicting associated entity nodes in the knowledge graph is as follows:

[0062] S31. Select an initial entity node in the knowledge graph, combine the relationship type of the initial entity node in the knowledge graph, and use the graph embedding model to predict the terminal tail node with the initial entity node;

[0063] S32. Compare the node type, node name and node relationship of the predicted terminal tail node with the node type, node name and node relationship of the actual terminal node to determine whether they are correct. If correct, retain the current parameter weights of the graph embedding model and execute step S33; otherwise, adjust the parameter weights of the graph embedding model and return to step S31;

[0064] S33. Based on the graph embedding model, each entity node randomly walks to the adjacent entity nodes in the knowledge graph to obtain the local structure of each entity node in the knowledge graph, thereby obtaining the graph embedding information of each entity node.

[0065] This process is actually implemented as graph embedding training. Let the "Zhang San" node be the initial node. The model will predict the terminal node based on the relationship type, such as "endorsement". The node type, node name and node relationship of the predicted terminal node ("old flower-brand") and the real node (such as the real node "Sanzi-name") are judged one by one to see if they are correct, so as to continuously adjust the weight of the neural network model to obtain more accurate results. When the prediction accuracy does not improve, the model stops training and obtains the graph embedding of each node.

[0066] After completing the training of graph embedding, classification is performed for different downstream classification tasks (such as industry multi-classification for brand entities and whether a person is a star or not), and step S4 is first performed:

[0067] S4. Determine the entity to be classified and calculate the entity confidence of the entity;

[0068] In step S4, after the entity to be classified is determined, the entity confidence with the entity as the initial entity node is calculated, and the calculation process includes:

[0069] First, calculate the relationship confidence of the entity, the expression is:

[0070] Relationship confidence = min(100, voice contribution + knowledge confidence contribution),

[0071] Among them, voice contribution = voice weight * (ln (vol) * 10), voice weight represents the preset value, ln represents the natural logarithm, and vol represents the voice of the entity in the knowledge graph data;

[0072] Knowledge confidence contribution = knowledge confidence weight * voice coefficient * knowledge confidence;

[0073] Among them, the knowledge confidence weight is 0.7, which is the preset value; Index distance = 110-abs (initial node index-termination node index), where abs is the absolute value function and 110 is the maximum index distance preset by the algorithm; for example, if Zhang San starred in Movie 2, the initial node is Zhang San, whose index in the text is 0, and the termination node is Movie 2, whose index in the text is 6, then the index distance is 6.

[0074] Then, all the relationship confidences of the entity are sorted from large to small, and the top three relationship confidences are taken and the average is calculated as the entity confidence of the entity.

[0075] Assuming that in a specific implementation, the knowledge graph and graph embedding formed by steps S1 to S4 are used to implement celebrity classification, which is used for celebrity image recognition and brand promotion for celebrities by enterprises, and to determine whether a node whose entity type is a person's name is a celebrity, after step S4 and before step S5, it also includes: dividing a training set from the labeled data set, obtaining the graph embedding information of the entity node in the training set according to the graph embedding information of each entity node, and training the classifier using the training set based on the graph embedding information. The training set data is the data with manual annotations, which helps the model learn how to classify. For example, in this task, the training set data annotates which people are celebrities or non-stars, such as Zhang San-star, Li Si-non-star, and obtains a trained classifier. A classifier refers to a classification function learned or a classification model constructed based on existing data, which can map data records to one of the given categories, so that it can be applied to classification tasks. In short, a classifier is a general term for methods of classifying samples in data mining, including decision trees, logistic regression, naive Bayes, neural networks and other algorithms.

[0076] S5. Based on the graph embedding information of each entity node and the entity confidence of the entity, the classifier is used to perform the classification task of the entity to be classified, and the knowledge graph is used for reprocessing to obtain the final entity classification result.

[0077] Based on the entity confidence of the entity, when using the classifier to perform the classification task of the entity to be classified, the classification threshold is set, and the entities to be classified whose entity confidence is greater than the classification threshold are classified, that is, the name nodes in the knowledge graph whose entity confidence is greater than the threshold are selected for classification to determine whether they are stars. The higher the entity confidence, the more reliable the entity is, and it appears in a large amount of text data and has a large number of relationships with other entities.

[0078] The process of reprocessing the knowledge graph to obtain the final entity classification result includes:

[0079] A. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, use the entity and relationship information stored in the graph database to find the alias of the initial entity node in the knowledge graph, if the alias and the initial entity node are classified as the same category of results, and the alias contains Chinese, and the initial entity node does not contain Chinese, then delete the initial entity node;

[0080] In this embodiment, the search operations mentioned in the knowledge graph are all performed in the database, and the entities and their attributes, as well as the relationships between entities are stored using a graph relationship library, such as Neo4j;

[0081] B. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, and search for the alias of the initial entity node in the knowledge graph. If the alias and the initial entity node are classified as the same category of results at the same time, and the alias does not contain Chinese, and the initial entity node contains Chinese, then delete the alias;

[0082] C. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, and search for the alias of the initial entity node in the knowledge graph. If the alias and the initial entity node are classified as the same category of results, and both the alias and the initial entity node contain Chinese, then retain the one with higher entity confidence between the initial entity node and the alias;

[0083] D. For entities to be classified that have nested relationships, retain the one with the highest entity confidence;

[0084] E. Add a query field for the removed entity name as a keyword for the reserved name to query the entity information. In this embodiment, the following post-processing is performed on the name of a person classified as a star (hereinafter referred to as A) in steps: with A as the initial node and the relationship type as "alias", the alias B of A is searched in the knowledge graph. If B and A are both classified as stars, and B contains Chinese, and A does not contain Chinese, then A is deleted; with A as the initial node and the relationship type as "alias", the alias B of A is searched in the knowledge graph. If B and A are both classified as stars, and B does not contain Chinese, and A contains Chinese, then B is deleted; with A as the initial node and the relationship type as "alias", the alias B of A is searched in the knowledge graph. If B and A are both classified as stars, and A and B are both Chinese, then the name with high confidence in A and B is retained; for names with nested relationships (such as Zhang San and San Zai), the name with high confidence is retained; the removed entity name is added to the query field as a keyword for the reserved name, which is used to query the relevant information of the entity, and then the final binary classification result of whether it is a star is output. The schematic diagram of the constructed final star knowledge graph can be seen in Figure 2 The specific implementation process of the above process can be found in Figure 3 .

[0085] Example 2

[0086] In this embodiment, in addition to the same process as in Embodiment 1, for entity recognition and relation extraction in step S2, an entity-relation joint extraction model can be used for joint extraction to extract entity recognition and relations in the corpus text at the same time. Specifically, the classic "End-to-End" model mentioned in "End-to-End Relation Extraction using LSTMs on Sequences and Tree Structures" or the model of the paper "Joint Extraction of Entities and Relations Based on a Novel Tagging Scheme" can be used for joint extraction.

[0087] Example 3

[0088] like Figure 4 As shown, this embodiment proposes an entity classification system based on massive knowledge graph and graph embedding, which is used to implement the entity classification method based on massive knowledge graph and graph embedding described in Example 1 or Example 2, including:

[0089] The labeled data set acquisition module unit is used to obtain N corpus texts, and annotate the entities and entity relationships in the corpus texts to obtain a labeled data set; "N" refers to a sufficient number of corpus texts, corresponding to "large amount" and "massive". After obtaining the corpus texts, they are annotated in sequence with pre-set labels to obtain a labeled data set.

[0090] The knowledge graph construction unit loads the named entity recognition model and the relationship extraction model, and uses the annotated data set to train and test the named entity recognition model and the relationship extraction model to perform entity recognition and relationship extraction in massive corpus texts; then, based on the entities and relationships, a knowledge graph is formed;

[0091] A graph embedding information acquisition unit is used to load and introduce a graph embedding model, and use the graph embedding model to perform prediction training tasks for associated entity nodes in the knowledge graph to obtain graph embedding information for each entity node;

[0092] An entity confidence calculation unit, used to determine an entity to be classified and calculate the entity confidence of the entity;

[0093] The entity classification unit uses the classifier to perform the classification task of the entity to be classified based on the graph embedding information of each entity node and the entity confidence of the entity, and reprocesses it using the knowledge graph to obtain the final entity classification result.

[0094] Obviously, the above embodiments of the present invention are only examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. An entity classification method based on massive knowledge graph and graph embedding, characterized in that ,include: S1. Obtain N corpus texts, and annotate the entities and entity relationships in the corpus texts to obtain an annotated dataset; S2. Introduce named entity recognition model and relation extraction model, and use annotated data sets to train and test named entity recognition model and relation extraction model to perform entity recognition and relation extraction in massive corpus text; then form a knowledge graph based on entities and relations; S3. Introduce a graph embedding model, use the graph embedding model to perform the prediction training task of associated entity nodes in the knowledge graph, and obtain the graph embedding information of each entity node; The process of using the graph embedding model to perform the prediction training task of associated entity nodes in the knowledge graph described in step S3 is: S31. Select an initial entity node in the knowledge graph, combine the relationship type of the initial entity node in the knowledge graph, and use the graph embedding model to predict the terminal tail node with the initial entity node; S32. Compare the node type, node name and node relationship of the predicted terminal tail node with the node type, node name and node relationship of the actual terminal node to determine whether they are correct. If correct, retain the current parameter weights of the graph embedding model and execute step S33; otherwise, adjust the parameter weights of the graph embedding model and return to step S31; S33. Based on the graph embedding model, each entity node randomly walks to the adjacent entity node in the knowledge graph to obtain the local structure of each entity node in the knowledge graph, thereby obtaining the graph embedding information of each entity node; S4. Determine the entity to be classified and calculate the entity confidence of the entity; S5. Based on the graph embedding information of each entity node and the entity confidence of the entity, the classifier is used to perform the classification task of the entity to be classified, and the knowledge graph is used for reprocessing to obtain the final entity classification result.

2. The entity classification method based on massive knowledge graph and graph embedding according to claim 1 is characterized in that: In step S2, based on the Bert Chinese pre-training model, the named entity recognition and relationship extraction tasks of the corpus text are added downstream of the Bert Chinese pre-training model to obtain a named entity recognition model and a relationship extraction model for entity recognition and relationship extraction in the corpus text respectively; when the named entity recognition model and the relationship extraction model are used for entity recognition and relationship extraction of massive corpus text, the massive corpus text is constantly updated, and the knowledge graph formed based on entities and relationships is also constantly updated.

3. The entity classification method based on massive knowledge graph and graph embedding according to claim 1 is characterized in that: In step S2, an entity-relationship joint extraction model can also be used to perform joint extraction to simultaneously extract entity recognition and relationships in the corpus text.

4. The entity classification method based on massive knowledge graph and graph embedding according to claim 2 is characterized in that: The graph embedding model is DeepWalk, RandomWalk or LINE.

5. The entity classification method based on massive knowledge graph and graph embedding according to claim 4 is characterized in that: In step S4, after the entity to be classified is determined, the entity confidence with the entity as the initial entity node is calculated, and the calculation process includes: First, calculate the relationship confidence of the entity, the expression is: Relationship confidence = min(100, voice contribution + knowledge confidence contribution), Among them, voice contribution = voice weight * (ln (vol) * 10), voice weight represents the preset value, ln represents the natural logarithm, and vol represents the voice of the entity in the knowledge graph data; Knowledge confidence contribution = knowledge confidence weight * voice coefficient * knowledge confidence; Among them, the knowledge confidence weight is 0.7, which is the preset value; Index distance = 110-abs (initial node index-end node index), abs is the absolute value function, and 110 is the maximum value of the index distance preset by the algorithm; Then, all the relationship confidences of the entity are sorted from large to small, and the top three relationship confidences are taken and the average is calculated as the entity confidence of the entity.

6. The entity classification method based on massive knowledge graph and graph embedding according to claim 5 is characterized in that: After step S4 and before step S5, the method further includes: dividing a training set from the labeled data set, obtaining graph embedding information of entity nodes in the training set according to the graph embedding information of each entity node, and training a classifier using the training set based on the graph embedding information to obtain a trained classifier.

7. The entity classification method based on massive knowledge graph and graph embedding according to claim 6 is characterized in that: In step S5, based on the entity confidence of the entity, when using the classifier to perform the classification task of the entity to be classified, a classification threshold is set, and the entity to be classified whose entity confidence is greater than the classification threshold is classified.

8. The entity classification method based on massive knowledge graph and graph embedding according to claim 7 is characterized in that: The process of reprocessing using the knowledge graph to obtain the final entity classification result in step S5 includes: A. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, and use the entity and relationship information stored in the graph database in the knowledge graph to find the alias of the initial entity node. If the alias and the initial entity node are classified as the same category of results at the same time, and the alias contains Chinese, and the initial entity node does not contain Chinese, then delete the initial entity node; B. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, and search for the alias of the initial entity node in the knowledge graph. If the alias and the initial entity node are classified as the same category of results at the same time, and the alias does not contain Chinese, and the initial entity node contains Chinese, then delete the alias; C. For the initial entity node preliminarily classified by the classifier, determine its relationship type in the knowledge graph, and search for the alias of the initial entity node in the knowledge graph. If the alias and the initial entity node are classified as the same category of results, and both the alias and the initial entity node contain Chinese, compare the entity confidence of the initial entity node with the entity confidence of the alias of the initial entity node, and retain the entity with higher confidence; D. For entities to be classified that have nested relationships, retain the one with the highest entity confidence; E. Add a query field for the removed entity name as a keyword for the reserved name to query the entity information.

9. An entity classification system based on massive knowledge graph and graph embedding, characterized in that: The system is used to implement the entity classification method based on massive knowledge graph and graph embedding as described in claim 1, including: The annotated data set acquisition module unit is used to acquire N corpus texts and annotate entities and entity relationships in the corpus texts to obtain annotated data sets; The knowledge graph construction unit loads the named entity recognition model and the relationship extraction model, and uses the annotated data set to train and test the named entity recognition model and the relationship extraction model to perform entity recognition and relationship extraction in massive corpus texts; then, based on the entities and relationships, a knowledge graph is formed; A graph embedding information acquisition unit is used to load and introduce a graph embedding model, and use the graph embedding model to perform prediction training tasks for associated entity nodes in the knowledge graph to obtain graph embedding information for each entity node; The process of using the graph embedding model to perform the training task of predicting associated entity nodes in the knowledge graph is as follows: S31. Select an initial entity node in the knowledge graph, combine the relationship type of the initial entity node in the knowledge graph, and use the graph embedding model to predict the terminal tail node with the initial entity node; S32. Compare the node type, node name and node relationship of the predicted terminal tail node with the node type, node name and node relationship of the actual terminal node to determine whether they are correct. If correct, retain the current parameter weights of the graph embedding model and execute step S33; otherwise, adjust the parameter weights of the graph embedding model and return to step S31; S33. Based on the graph embedding model, each entity node randomly walks to the adjacent entity node in the knowledge graph to obtain the local structure of each entity node in the knowledge graph, thereby obtaining the graph embedding information of each entity node; An entity confidence calculation unit, used to determine an entity to be classified and calculate the entity confidence of the entity; The entity classification unit uses a classifier to perform the classification task of the entity to be classified based on the graph embedding information of each entity node and the entity confidence of the entity, and reprocesses it using the knowledge graph to obtain the final entity classification result.

Citation Information

Patent Citations

  • United query network space knowledge graph reasoning method and device

    CN111813949A

  • Domain knowledge pushing method based on knowledge graph

    CN112699246A