An entity type prediction method based on a probability model and a zero-shot classification model

By using a probabilistic model and a zero-shot classification model, we can filter triplet data from the knowledge graph to calculate entity type probabilities and perform text classification, thus solving the difficulty of entity type completion and achieving efficient and accurate entity type prediction.

CN117009527BActive Publication Date: 2025-12-0510TH RES INST OF CETC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311004493.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2025-12-05
Estimated Expiration
2043-08-08

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively address the lack of low-frequency entities, common-sense knowledge, and high-quality domain corpora in entity type prediction, leading to difficulties in entity type completion.

Method used

We employ a probabilistic model and a zero-shot classification model to select triplet data from the knowledge graph, calculate the entity type probability, and perform the final prediction using a zero-shot text classification model, thus avoiding reliance on external corpora and manual annotation.

Benefits of technology

This approach enables dynamic adjustment of entity candidate types driven by graph data, improving the accuracy of entity type prediction, avoiding problems caused by external data, and enhancing the performance of text classification models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009527B_ABST
    Figure CN117009527B_ABST
Patent Text Reader

Abstract

The application discloses an entity type prediction method based on a probability model and a zero sample classification model, which comprises the following steps: screening head entities and tail entities from a graph atlas as triple data of to-be-predicted entities respectively, and merging and summarizing to obtain a predicate set in the triple data; obtaining head entity types and tail entity types in triple data corresponding to each predicate in the predicate set as probabilities of the head entity types and the tail entity types in the triple data corresponding to the predicate being to-be-predicted entity types; arranging the probabilities of the head entity types and the tail entity types in the triple data corresponding to the predicate in descending order based on the result, and taking the entity types corresponding to the first N probabilities as candidate entity types of the to-be-predicted entities; splicing the triple data to form a to-be-classified text and a classification label, namely the candidate entity types, calling a zero sample text classification model, and obtaining a type prediction result of the to-be-predicted entities. The prediction efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and knowledge graph construction technology, and in particular to an entity type prediction method based on probabilistic models and zero-shot classification models. Background Technology

[0002] Entity type prediction is used to complete the knowledge graph by filling in missing concepts. It is also commonly known as entity typing. Compared to obtaining the isA relationship between entities and concepts from the data source, entity type prediction usually needs to rely on the existing attributes and relationships of entities in the knowledge graph, as well as information from the entire knowledge graph.

[0003] Currently, the main approach to entity type prediction is to increase the corpus. However, due to the lack of low-frequency entity-related knowledge, common-sense knowledge, and high-quality domain corpora, simply increasing the corpus is still insufficient to completely solve the problem of entity type prediction. Probabilistic model-based entity type prediction can construct heuristic rules or probabilistic models by examining entity-related information in the knowledge graph; these rules and probabilistic models can then be used to fill in the missing entity types in the graph. Zero-shot classification is a text classification method whose advantage lies in classifying text without any pre-labeled data; furthermore, zero-shot classification models support custom classification labels.

[0004] This invention proposes an entity type prediction method based on a probabilistic model and a zero-shot classification model, which can be applied to the quality control stage of knowledge graph construction and application. Based on the probabilistic model, entity attributes and relationships are used as intermediate variables to construct a probabilistic graphical model and obtain a candidate list of entity types. The candidate entity types are then used as text classification labels, and the final entity type is obtained based on a zero-shot classification model. Summary of the Invention

[0005] In view of this, the present invention provides an entity type prediction method based on a probabilistic model and a zero-shot classification model to solve the above-mentioned technical problems.

[0006] This invention discloses an entity type prediction method based on a probabilistic model and a zero-shot classification model, comprising:

[0007] Step 1: Select the triplet data from the graph where the head entity and tail entity are the entities to be predicted, and merge and summarize them to obtain the predicate set in the triplet data;

[0008] Step 2: Based on the head entity type and tail entity type in the triple data corresponding to each predicate in the predicate set, obtain the probability that the head entity type and tail entity type in the triple data corresponding to the predicate are the entity types to be predicted;

[0009] Step 3: Based on the descending order of the probabilities of the head entity type and tail entity type in the predicate correspondence triple data as the entity type to be predicted, take the entity types corresponding to the top N probabilities as the candidate entity types of the entity to be predicted.

[0010] Step 4: Concatenate the triplet data from Step 1 to form the text to be classified and the classification label, i.e., the candidate entity type. Call the zero-shot text classification model to obtain the type prediction result of the entity to be predicted.

[0011] Further, step 1 includes:

[0012] Triples are selected from the graph, with the head entity and tail entity being the entities to be predicted, representing the triples e. head Triples tail :

[0013] Triples head =| <e,r i ,o i >|

[0014] Triples tail =| <o j ,r j ,e>|

[0015] Where, r i r j Let R represent the set of predicates in a triplet. head (e), R tail (e), r i ∈R head (e), r j ∈R tail (e) Both entity attributes and relation types are used as predicates of the triple, o i This indicates that when entity e is the head entity of a triplet, the corresponding tail entity, o, is... j This represents the head entity of the triplet when entity e is the tail entity of the triplet.

[0016] Further, step 2 includes:

[0017] Step 21: Calculate and count the head entity type and tail entity type in the triplet data corresponding to each predicate;

[0018] Step 22: Calculate the ratio of the number of triples corresponding to the head entity type and the tail entity type in Step 21 to the total number of triples corresponding to the predicate;

[0019] Step 23: Calculate the probability that the head entity type and tail entity type in the predicate corresponding triple data are the entity types to be predicted.

[0020] Further, step 21 includes:

[0021] Considering the case where the entity to be predicted, e, is the head entity, the Triples are counted and calculated sequentially. head The predicate is r i The proportion of triples to total triples p i ;

[0022] Considering the case where the entity to be predicted, e, is a tail entity, the Triples are counted and calculated sequentially. tail The predicate is r j The proportion of triples to total triples p j ;

[0023] When the entity to be predicted, e, is used as the head entity, the Triples are obtained by merging and summarizing. head Chinese predicate set |r n |;By querying the graph data, the word r was calculated and statistically analyzed. n When used as a triple predicate, the triple head entity types and their corresponding proportions are as follows:

[0024] |{type head_i ,p head_i}|

[0025] Among them, type head_i ∈Type head Indicates the header entity type; p head_i Indicates Triples head The type of the middle-head entity is type head_i The number of triples accounts for the predicate r n The proportion of the total number of all triples.

[0026] Further, step 22 includes:

[0027] When the entity to be predicted, e, is a tail entity, the Triples are obtained by merging and summarizing. tail set of predicates |r n |;By querying the graph data, the word r was calculated and statistically analyzed. n When used as a triple predicate, the triple head entity types and their corresponding proportions are as follows:

[0028] |{type tail_i ,p tail_i}|

[0029] Among them, type tail_i ∈Type tail Indicates the header entity type; p tail_i Indicates Triples tail The entity type of the middle tail is typetail_i The number of triples accounts for the predicate r n The proportion of the total number of all triples.

[0030] Furthermore, in step 23, the entity to be predicted, e, is of type type. tail_i The probability calculation process is as follows:

[0031]

[0032] in, This indicates that when the entity to be predicted, e, is used as the head entity, the type of the entity to be predicted, e, is type. head_i The probability of:

[0033]

[0034] This indicates that when the predicted entity e is a tail entity, the type of the entity e to be predicted is type. tail_i The probability of:

[0035]

[0036] Furthermore, according to the entity to be predicted, e is of type type tail_i The probability calculation process can be analogized to obtain the entity to be predicted, e, as type. tail_i The probability of.

[0037] Further, step 3 includes:

[0038] Calculate the type of entity e to be predicted in sequence. head Type tail The probabilities of each type are calculated, and the results are sorted in descending order. The entity types corresponding to the top N probabilities are taken as candidate entity types Type for the entity to be predicted, e.

[0039] Further, step 4 includes:

[0040] The triplet data is concatenated according to the following format to form the text to be classified and the classification label, where:

[0041] text=e+r0+o0+','+r1+o1','+...+r n +o n

[0042] Among them, r0, r1, r n The predicates in a triplet are o0, o1, and o2. nThis indicates the triplet tail entity when the entity to be predicted, e, is the triplet head entity, or the triplet head entity when the entity to be predicted, e, is the triplet tail entity.

[0043] Using the text and label data to be classified, the zero-shot text classification model is called to obtain the probability value of the text under the label. The label with the highest probability value is taken as the prediction result of the entity e to be predicted.

[0044] Because of the adoption of the above technical solution, the present invention has the following advantages:

[0045] 1. When predicting the entity type in a graph, this invention starts from the current graph data and only uses the data of the graph where the entity to be predicted is located, without involving external data such as corpus, thus avoiding various problems caused by manually annotated corpus.

[0046] 2. By leveraging heuristic probability models and zero-shot classification models, this invention can dynamically adjust the candidate types of entities to be predicted and the final predicted type as the map data changes, achieving true data-driven results.

[0047] 3. This invention improves the performance of zero-shot text classification models, thereby further enhancing the accuracy of entity type prediction. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0049] Figure 1 This is a flowchart illustrating an entity type prediction method based on a probability model and a zero-shot classification model, according to an embodiment of the present invention. Detailed Implementation

[0050] The present invention will be further described in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art should fall within the protection scope of the present invention.

[0051] See Figure 1 This invention provides an embodiment of an entity type prediction method based on a probabilistic model and a zero-shot classification model, as detailed below:

[0052] Taking the type of entity e to be predicted as an example, the implementation of the present invention will be described as follows: Figure 1As shown, the entity type prediction method based on a probabilistic model and a zero-shot classification model provided in this embodiment of the invention includes the following steps:

[0053] S1: Entity candidate type acquisition based on probabilistic model.

[0054] S1.1: Relevant Triple Data Query. Extract the triple data of the entity with the name 'e' to be predicted from the graph, using it as the head entity and tail entity. head Triples tail .

[0055] Triples head =| <e,r i ,o i >|

[0056] Triples tail =| <o j ,r j ,e>|

[0057] Where, r i r j Let R represent the set of predicates in a triplet. head (e), R tail (e), r i ∈R head (e), r j ∈R tail (e) Both entity attributes and relation types are used as predicates of the triple, o i This represents the tail entity of the triplet when the entity to be predicted, e, is the head entity. j This represents the head entity of the triplet when the entity to be predicted, e, is the tail entity of the triplet.

[0058] S1.2: Calculation of the predicate proportion in relevant triples.

[0059] Considering the case where the entity to be predicted, e, is the head entity, the Triples are counted and calculated sequentially. head The predicate is r i The proportion of triples to total triples p i .

[0060] Consider the case where the entity to be predicted, e, is a tail entity. Calculate and statistically analyze the Triples sequentially. tail The predicate is r j The proportion of triples to total triples p j .

[0061] S1.3: Calculation of the proportion of predicate entity types.

[0062] Consider the case where the entity to be predicted, e, is the head entity. Merging and summarizing yields Triples. head set of predicates |r n |;By querying the graph data, the word r was calculated and statistically analyzed. n When used as a triple predicate, the triple head entity types and their corresponding proportions are as follows:

[0063] |{type head_i ,p head_i}|.

[0064] Among them, type head_i ∈Type head Indicates the header entity type; p head_i In the representation, the header entity type is type. head_i The number of triples accounts for the predicate r n The proportion of the total number of all triples.

[0065] Similarly, consider the case where the entity to be predicted, e, is a tail entity. Merging and summarizing yields Triples. tail set of predicates |r n |;By querying the graph data, the word r was calculated and statistically analyzed. n When used as a triple predicate, the triple header entity type and its corresponding proportion are |{type tail_i ,p tail_i}|.

[0066] Among them, type tail_i ∈Type tail Indicates the header entity type; p tail_i In the representation, the tail entity type is type. tail_i The number of triples accounts for the predicate r n The proportion of the total number of all triples.

[0067] S1.4: Calculation of entity candidate types.

[0068] Based on the results of S1.2 and 1.3, the type of the entity to be predicted, e, is calculated. tail_i The probability is:

[0069]

[0070] in, This indicates that, when used as a head entity, the type of the entity to be predicted, e, is type. head_i The probability of;

[0071]

[0072] This indicates that, when the entity to be predicted, e, is of type type, it is considered a tail entity. tail_i The probability of.

[0073]

[0074] Calculate sequentially those with Type head Type tail The probabilities of each type are calculated, and the results are sorted in descending order. The entity types corresponding to the top N (1≤N≤10) probabilities are taken as candidate entity types Type for the entity to be predicted, e.

[0075] S2: Entity type calculation based on zero-shot classification model.

[0076] S2.1: Construction of samples to be classified.

[0077] The triples retrieved from S1.1 head The data is concatenated according to the following format to form the text to be classified and the classification label, where:

[0078] text=e+r0+o0+','+r1+o1','+...+r n +o n

[0079] The classification label is the candidate entity category Type obtained from S1.

[0080] S2.2: Zero-shot text classification model call.

[0081] Using the text and label data to be classified, the zero-shot text classification model is called to obtain the probability value of the text under the label. The label with the highest probability value is taken as the prediction result of the entity e to be predicted.

[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. An entity type prediction method based on a probabilistic model and a zero-shot classification model, characterized in that, The method comprises the following steps: Step 1: screening head entities and tail entities from the atlas as the triple data of the to-be-predicted entities, respectively, and merging and summarizing to obtain a predicate set in the triple data; Step 2: obtaining the head entity type and the tail entity type in the triple data corresponding to each predicate in the predicate set as the probability of the to-be-predicted entity type according to the head entity type and the tail entity type in the triple data corresponding to each predicate in the predicate set; Step 3: arranging the head entity type and the tail entity type in the triple data corresponding to each predicate in descending order of the probability of the to-be-predicted entity type, and taking the entity types corresponding to the top N probabilities as the candidate entity types of the to-be-predicted entities; Step 4: splicing the triple data in step 1 to form the text to be classified and the classification label, i.e., the candidate entity type, calling the zero-shot text classification model, and obtaining the type prediction result of the to-be-predicted entity; The step 2 comprises: Step 21: calculating and counting the head entity type and the tail entity type in the triple data corresponding to each predicate; Step 22: calculating the proportion of the number of triples corresponding to the head entity type and the tail entity type in step 21 to the number of all triples corresponding to the predicate, respectively; Step 23: calculating the probability of the head entity type and the tail entity type in the triple data corresponding to each predicate as the to-be-predicted entity type in turn; The step 21 comprises: Considering the case where the entity to be predicted, e, is the head entity, the Triples are counted and calculated sequentially. head The predicate is r i The proportion of triples to total triples p i ; In the case of considering the entity e to be predicted as the tail entity, the triples tail in which the predicate is r j are counted and calculated in sequence, and the proportion p j of the triples in which the predicate is r in the total triples is calculated. When the entity to be predicted e is the head entity, merge and aggregate the triples head The predicate set |r n |; by querying the graph data, calculate and count the word r n When the entity to be predicted e is the head entity, merge and aggregate the triples |{type head_i ,p head_i}| where type head_i ∈ Type head represents the head entity type; p head_i represents Triples head with head entity type type head_i as a proportion of the total number of triples with predicate r n .

2. The method of claim 1, wherein, The step 1 comprises: Head entity and tail entity are screened out from the atlas as triples of the to-be-predicted entity e head , Triples tail : Triples head =|<e,r i ,o i >| Triples tail =|<o j ,r j ,e>| wherein, r i , r j represents the predicate in the triple, and the corresponding set is represented as R head (e), R tail (e), r i ∈ R head (e), r j ∈ R tail (e), the entity attribute and the relationship type are both predicates of the triple, o i represents the tail entity of the triple corresponding to entity e as the head entity of the triple, and o j represents the head entity of the triple corresponding to entity e as the tail entity of the triple.

3. The method of claim 1, wherein, The step 22 comprises: When the entity to be predicted e is the tail entity, merge and aggregate the triples tail The predicate set |r n |; by querying the graph data, calculate and count the word r n When the entity to be predicted e is the tail entity, merge and aggregate the triples |{type tail_i ,p tail_i}| where type tail_i ∈ Type tail denotes the head entity type; p tail_i denotes Triples tail with tail entity type type tail_i as a proportion of the total number of triples with predicate r n .

4. The method of claim 3, wherein, In said step 23, the entity e to be predicted is of type type tail_i The calculation of the probability of the entity e to be predicted being of type type is: wherein, represents the probability that the type of the entity e to be predicted is type when the entity e to be predicted is the head entity head_i the probability that the type of the entity e to be predicted is type when the entity e to be predicted is the head entity denotes the probability that the type of the entity e to be predicted is type given that the entity e is predicted as tail entity tail_i denotes the probability that the type of the entity e to be predicted is type given that the entity e is predicted as tail entity 5. The method of claim 4, wherein, According to the calculation process of the probability of the entity e to be predicted being of the type type tail_i , the probability of the entity e to be predicted being of the type type tail_i is obtained by analogy.

6. The method of claim 4, wherein, The step 3 comprises: The probabilities of each type in Type head , Type tail of the to-be-predicted entity e are sequentially calculated, and the calculation results are arranged in descending order, and the entity types corresponding to the first N probabilities are taken as the candidate entity types Type of the to-be-predicted entity e.

7. The method of claim 1, wherein, The step 4 comprises: Splicing the triple data according to the following format to form the text to be classified text and the classification label label, wherein: text = e + r0+ o0+ ','+ r1+ o1+ ','+... + r n +o n wherein r0, r1, r n represents the predicate in the triple, o0, o1, o n represents the corresponding tail entity of the triple when the entity e to be predicted is the head entity of the triple, or the corresponding head entity of the triple when the entity e to be predicted is the tail entity of the triple; Using the text to be classified and the label data, calling the zero-shot text classification model, obtaining the probability value of the text text under the label, and taking the label with the highest probability value as the prediction result of the type of the to-be-predicted entity e.

Citation Information

Patent Citations

  • Structured data text generation method based on table hierarchical modeling

    CN110516213A

  • Knowledge verification model construction and analysis method based on probability soft logic

    CN111026877A