CN-115563274-B - Fine granularity entity classification method and interaction system based on knowledge injection
Abstract
A fine-grained entity classification method and interaction system based on knowledge injection are disclosed. The method comprises the steps of sending sentence, reference entity and knowledge graph triplet related information of the reference entity to a sentence level encoder, constructing a graph structure by feature representations of words, reference entity and triplet related information output by the sentence level encoder and sending the graph structure to the graph level encoder, and sending the sentence feature representation enhanced based on the knowledge output by the graph level encoder to an entity classification model for carrying out fine-grained entity classification on target phrases in sentences. The invention further utilizes the fact knowledge and sentences to construct a graph structure and encodes the graph structure based on the GNN on the basis of injecting the fact knowledge in the knowledge base into sentences in a sequential encoding mode and encoding the entities based on a sequence structure. Thereby, the method is used for the treatment of the heart disease. The entity classification model can jointly learn entity representation learning in sentences and knowledge graph structures, and conduct fine-grained entity classification with higher accuracy.
Inventors
- CHEN LIYI
- WANG RUNZE
- SHI CHEN
- ZHANG ZENGMING
- YUAN YIFEI
- JIANG FEIJUN
Assignees
- 浙江猫精人工智能科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20220920
Claims (11)
- 1. A fine-grained entity classification method based on knowledge injection, comprising: Sending sentences, the sentence mention entities and the knowledge-graph triples related information of the mention entities to a sentence-level encoder; Constructing a graph structure of the sentence output by the sentence-level encoder, including the feature representation of the word, the feature representation of the reference entity and the feature representation of the triplet-related information, and feeding the graph structure into the sentence-level encoder, and And feeding the sentence characteristic representation enhanced based on the knowledge output by the level encoder into an entity classification model for fine-grained entity classification of the target phrase in the sentence.
- 2. The method of claim 1, wherein feeding sentence, the sentence mention entity, and knowledge-graph triplet-related information of the mention entity into a sentence-level encoder comprises: And sending relation information of the sentence containing word information, the mentioned entity information and a plurality of knowledge-graph triples of the mentioned entity to the sentence-level encoder.
- 3. The method of claim 2, further comprising: sending the sentence into a pre-training language model, and embedding a word output by the pre-training language model as the word information; Feeding the mentioned entity into a pre-training knowledge embedding matrix, and embedding the entity output by the pre-training knowledge embedding matrix as the mentioned entity information, and And calculating entity embedding of a head entity and a tail entity in the knowledge-graph triplet as the relation information.
- 4. The method of claim 3, wherein feeding knowledge-graph triplet-related information for a sentence and the sentence-mentioning entity into a sentence-level encoder comprises: differentiating said word embedding, said entity embedding and relationship embedding using a type embedding matrix, said relationship embedding being said relationship information, and The word embedding, the entity embedding, and the relation embedding are concatenated using a start symbol and a split symbol, and the target phrase is labeled with a special symbol.
- 5. The method of claim 2, wherein the knowledge-graph triples of sentence-mentioned entities are triples having the mentioned entities as head entities and a number not exceeding a predetermined threshold.
- 6. The method of claim 2, wherein constructing the sentence output by the sentence-level encoder into a graph structure including a feature representation of a word, a feature representation of a reference entity, and a feature representation of triplet-related information comprises: respectively using the characteristic representation of the word, the characteristic representation of the mentioned entity and the characteristic representation of the relation as word node, entity node and relation node of the graph structure, wherein the characteristic representation of the triplet related information comprises the characteristic representation of the relation of the triplet, and Word nodes and related entity nodes are connected, and entity nodes and related relationship nodes are connected to construct edges of the graph structure.
- 7. The method of claim 6, wherein connecting word nodes and related entity nodes, and connecting entity nodes and related relationship nodes to construct edges of the graph structure comprises: characterizing connections from word nodes to related entity nodes and connections from entity nodes to related relationship nodes using forward edges, and Adding a reverse edge to the graph structure opposite to the forward edge direction, wherein the forward edge and the reverse edge have trainable weights.
- 8. The method of claim 2, further comprising: In the training stage, predicting entity classification categories based on natural language enhanced entity characteristics and relation characteristics output by the graph-level encoder is used as an auxiliary training task of the entity classification model.
- 9. An interaction system based on knowledge injection, comprising: a user input receiving unit for acquiring a query input by a user; A question matching unit for fine-grained classification of entities comprised in the query using the method according to any of the claims 1-8 and generating feedback according to the fine-grained classification, and And the feedback providing unit is used for providing the generated feedback to the user.
- 10. A computing device, comprising: Processor, and A memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method of any of claims 1-8.
- 11. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the method of any of claims 1-8.
Description
Fine granularity entity classification method and interaction system based on knowledge injection Technical Field The disclosure relates to the field of deep learning, and in particular to a fine-grained entity classification method and an interaction system based on knowledge injection. Background As a Natural Language Processing (NLP) base model, a pre-training language model (PLM, including BERT, roBERTa, XLNET, etc.) achieves excellent results in various downstream Natural Language Understanding (NLU) tasks, and has strong versatility. However, the mainstream pre-training language model is based on the public document, and learns general language knowledge from the unstructured document, ignoring learning of a large amount of knowledge information, in particular learning of structured Knowledge Graph (KG) information. This will result in the model not actually understanding a series of knowledge of the entities in reality and their relationships, etc., and will produce some negative output (say, the GPT model will output a assertion such as "sun has two eyes"), etc., and will greatly reduce the small sample learning ability of the model, the migration ability of domain knowledge, the generalization ability of general knowledge, etc. Therefore, when performing an important NLP task of fine-grained entity classification using PLM, there is a need to learn knowledge from a knowledge graph to improve classification accuracy. Therefore, how to learn knowledge from the information in the form of triples efficiently and accurately to improve the accuracy of classification of fine-grained entities is a problem to be solved by those skilled in the art. Disclosure of Invention One technical problem to be solved by the present disclosure is to provide a fine-grained entity classification method and an interaction system based on knowledge injection. The entity classification scheme of the invention further utilizes the fact knowledge and sentences to construct a graph structure and encodes the graph structure based on a Graph Neural Network (GNN) on the basis of injecting the fact knowledge in a knowledge base into sentences and encoding the entities based on a sequence structure, for example, in a sequential encoding manner. Thereby, the method is used for the treatment of the heart disease. The entity classification model can jointly learn entity representation learning in sentences and knowledge graph structures, and conduct fine-grained entity classification with higher accuracy. According to a first aspect of the present disclosure, there is provided a fine-granularity entity classification method based on knowledge injection, comprising feeding a sentence, a sentence mention entity, and knowledge-graph triplet related information of the mention entity into a sentence-level encoder, constructing a feature representation of the sentence output by the sentence-level encoder, a feature representation of the mention entity, and a feature representation of the triplet related information into a graph structure, and feeding the graph-level encoder, and feeding a sentence feature representation enhanced based on knowledge output by the graph-level encoder into an entity classification model for fine-granularity entity classification of a target phrase in the sentence. Optionally, sending the sentence, the sentence mention entity and the knowledge-graph triplet related information of the mention entity to a sentence-level encoder comprises sending the sentence comprising word information, the mention entity information and the relation information of the plurality of knowledge-graph triples of the mention entity to the sentence-level encoder. Optionally, the method further comprises feeding the sentence into a pre-training language model, embedding words output by the pre-training language model as the word information, feeding the mentioned entities into a pre-training knowledge embedding matrix, embedding entities output by the pre-training knowledge embedding matrix as the mentioned entity information, and calculating entity embedding of head entities and tail entities in the knowledge graph triples as the relation information. Optionally, sending sentence and knowledge-graph triplet related information for the sentence-mentioned entity to a sentence-level encoder includes distinguishing the word embedding, the entity embedding, and the relation embedding using a type embedding matrix, and concatenating the word embedding, the entity embedding, and the relation embedding using a start symbol and a split symbol, and tagging the target phrase with a special symbol. Optionally, the knowledge-graph triplet of the sentence mention entity is a knowledge-graph triplet having the mention entity as a head entity and not exceeding a predetermined threshold. Optionally, constructing the sentence output by the sentence-level encoder into a graph structure including a feature representation of a word, a feature representation