Micrograph-based entity attribution chain discrimination method and device, and storage medium
By using a micrograph-based entity affiliation chain discrimination method, the chain relationship between entities is directly constructed, solving the problems of low query efficiency and missing information in knowledge graphs, and achieving efficient entity relationship determination.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-14
- Publication Date
- 2026-03-24
AI Technical Summary
Existing knowledge graphs are inefficient when querying entity relationships and are prone to missing entities or chains, leading to inconvenience and inaccuracy in querying.
A micromap-based entity attribution chain discrimination method is adopted. By constructing an entity relationship classification model, all possible permutations and combinations of entity sets are obtained, attribution relationships are determined, leaf entities are found, and the longest attribution chain is found based on the micromap.
It can directly build chain relationships between entities without relying on a massive knowledge graph, reducing query costs and providing support for determining relationships when graph chains are missing.
Smart Images

Figure CN116484007B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis, and in particular to a method for determining entity affiliation chains based on micromaps. Background Technology
[0002] Based on the needs of analysis and data mining, we call things that are meaningful to us entities, and the connections between entities are called entity relationships. Entities and their relationships are important bases for our understanding, analysis, and even decision-making reasoning. In a specific domain, a chain-like structure composed of a large number of interconnected entity relationships is called the 'knowledge graph' of that domain. Knowledge graphs are of great significance in the era of big data intelligence and have broad application prospects. Entity relationships are the foundation for building knowledge graphs. Theoretically, a knowledge graph for a certain domain should cover all entity relationships in that domain. This brings a problem of inconvenient querying. When we need to obtain the chain relationship between several entities, we need to traverse the established knowledge graph to get the answer. As the number of queries increases, this undoubtedly increases the time cost. In addition, due to the limitations of current knowledge graph construction technology, the formed knowledge graph often has missing entities and missing chains. Simply querying the knowledge graph to obtain the relationship between two or more entities often does not yield satisfactory results. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a method for determining entity affiliation chains based on micromaps, in order to address the above-mentioned deficiencies of the prior art.
[0004] The technical solution adopted by this invention to solve its technical problem is:
[0005] On the one hand, a method for determining entity affiliation chains based on micromaps is constructed, the method comprising:
[0006] Obtain the set of entities to be analyzed, and randomly select two entities from the set and arrange them in order to obtain all possible combinations of entity permutations;
[0007] Input the names of the two entities in each of the entity permutations into the entity relationship classification model to determine whether the two entities in each of the entity permutations have a hierarchical relationship where the entity that comes first points to the entity that comes later.
[0008] Find all entities that have only one-way affiliation relationships to other entities as leaf entities. For each leaf entity, find the corresponding micrograph. Based on the micrograph, find the longest affiliation chain starting from that leaf entity.
[0009] Preferably, the entity relationship classification model comprises a word vector model and a vector relationship classification model; the inputting of the two entity names in each of the entity arrangement combinations into the entity relationship classification model comprises:
[0010] The entity names in each of the entity arrangement combinations are inputted into the trained word vector model, and the word vector model converts each of the inputted entity names into an entity word vector containing semantics in the corresponding field;
[0011] The two entity word vectors corresponding to each of the entity arrangement combinations are inputted into the trained vector relationship classification model with the arrangement order, so as to obtain whether the two entities in each of the entity arrangement combinations have the ownership relationship of the entity arranged in the front pointing to the entity arranged in the back.
[0012] Preferably, the finding of all the entities with only one-way ownership relationship pointing to other entities as leaf entities comprises:
[0013] The entity arrangement combinations with the output result obtained when the vector relationship classification model is inputted previously as the entity arrangement combinations to be analyzed are screened out;
[0014] All the entities involved in the entity arrangement combinations to be analyzed are determined as leaf entities, only the entity arranged in the front.
[0015] Preferably, the finding of the corresponding micrograph for each of the found leaf entities and the finding of the longest ownership chain starting from the leaf entity based on the found micrograph comprise:
[0016] The leaf entity is taken as a leaf node and a target node, and the following node expansion operation is performed to form a micrograph: all the entity arrangement combinations with the target node arranged in the front are found from the entity arrangement combinations to be analyzed, the entity arranged in the back in the found entity arrangement combinations is added to the micrograph as the parent node of the current target node, and all the latest parent nodes are taken as the target node again to perform the node expansion operation.
[0017] After all the node expansion operations are completed, the longest chain starting from the leaf node in the micrograph is taken as the longest ownership chain starting from the leaf entity.
[0018] Preferably, the method further comprises: acquiring a text, identifying all the entities from the text, and constituting the entity set.
[0019] In the second aspect, a judgment device for an entity ownership chain based on a micrograph is constructed, and the device comprises:
[0020] The entity grouping module is used to obtain the set of entities to be analyzed, and to randomly select two entities from the entity set and arrange them in order to obtain all possible entity permutations and combinations.
[0021] The entity relationship classification module is used to input the names of two entities in each entity permutation into the entity relationship classification model to obtain whether the two entities in each entity permutation have a belonging relationship where the entity that comes first points to the entity that comes later.
[0022] The chain finding module is used to find all entities that have only one-way affiliation relationships pointing to other entities as leaf entities. For each found leaf entity, a corresponding micro-graph is found, and the longest affiliation chain originating from that leaf entity is found based on the found micro-graph.
[0023] Preferably, the entity relationship classification module includes:
[0024] The entity vectorization submodule is used to input the entity name in each of the entity permutations into a pre-trained word vector model, which converts each input entity name into an entity word vector containing semantics in its corresponding domain.
[0025] The entity attribution relationship determination submodule is used to input the two entity word vectors corresponding to each entity permutation and combination, carrying the permutation order, into the pre-trained vector relationship classification model to obtain whether the two entities in each entity permutation and combination have an attribution relationship where the entity that comes first points to the entity that comes later.
[0026] Preferably, the chain finding module includes:
[0027] The leaf entity finding submodule is used to filter out the entity permutations and combinations whose output results are related to the vector relationship classification model when inputting the vector relationship classification model, and to identify only the first entity in the permutations and combinations to be analyzed as the leaf entity.
[0028] The chain-finding submodule is used to take the leaf entity as both a leaf node and a target node, and perform the following node expansion operations to form a micrograph: It searches for all entity permutations that precede the current target node from the entity permutations to be analyzed; adds the entities that follow the current target node as parent nodes to the micrograph; and performs the node expansion operation again on all the latest parent nodes as target nodes. After completing all node expansion operations, the longest chain originating from the leaf node in the micrograph is taken as the longest belonging chain originating from that leaf entity.
[0029] In three aspects, a device for determining entity attribution chains based on micromaps is constructed, characterized in that it includes a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements the steps of the method described in any of the preceding claims.
[0030] Fourthly, a storage medium is constructed that stores a computer program, which, when executed by a processor, implements the steps of the method described in any of the preceding methods.
[0031] The micrograph-based entity attribution chain determination method of the present invention has the following beneficial effects: Instead of relying on a pre-constructed complex knowledge graph to query the chain relationships between entities, this invention directly constructs chains in real time from the acquired set of entities to be analyzed. The entities to be analyzed are arranged in pairs, considering their sequential order, to obtain all possible entity permutations and combinations. A relationship classification model is used to determine the attribution relationship of each entity permutation and combination. Finally, based on multiple entity attribution relationships, all leaf entities are determined, and the complete attribution chain of each leaf entity is found through the longest chain. This method can obtain the attribution chain relationships between multiple entities without relying on a massive knowledge graph. It also provides support for establishing knowledge graphs to obtain entity relationships and determining relationships when parts of the graph chain are missing, while also reducing query costs. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort:
[0033] Figure 1 This is a flowchart of a preferred embodiment of the entity attribution chain discrimination method based on micromaps of the present invention;
[0034] Figure 2 This is a schematic diagram of the components of an entity relationship classification model;
[0035] Figure 3 This is a schematic diagram illustrating the specific application of the entity relationship classification model;
[0036] Figure 4 This is a diagram illustrating the ownership relationships of entities in an example;
[0037] Figure 5 This is a specific example of the micro-graph relationship chain diagram that was eventually found. Detailed Implementation
[0038] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Typical embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0040] The general idea of this invention is as follows: First, obtain the set of entities to be analyzed, and randomly select two entities from the set and arrange them in order to obtain all possible entity permutations and combinations; then, input the names of the two entities in each entity permutation and combination into the entity relationship classification model to obtain whether the two entities in each entity permutation and combination have a belonging relationship where the entity that comes first points to the entity that comes later; finally, find all entities that only have unidirectional belonging relationships pointing to other entities as leaf entities, find the corresponding micro-graph for each found leaf entity, and find the longest belonging chain starting from the leaf entity based on the found micro-graph.
[0041] To better understand the above technical solutions, the following will describe the above technical solutions in detail with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solutions of this application, rather than limitations on the technical solutions of this application. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0042] Example 1
[0043] refer to Figure 1 The entity attribution chain determination method based on micromaps in this embodiment includes:
[0044] S1: Text preprocessing to obtain the set of entities to be analyzed;
[0045] Text preprocessing primarily involves identifying semantic entities with specific meanings within a text segment; this is known as entity recognition. In practical applications, multiple entities may not be given individually, but rather relationships between them may be determined from a text segment. Therefore, step S1 is required to extract two or more entities from the text. Understandably, when multiple pairs of entities have already been identified, rather than extracting entities directly from the text, step S1 can be omitted.
[0046] Named entity recognition (NER) is currently a relatively mature method. For example, NER tools label each character (or word) in a text sequence to indicate whether it is part of a named entity. Generally, B stands for begin, representing the first character of the entity name; I stands for inside, representing the middle or last character of the entity name; and O stands for outside, representing characters outside the entity name. Suppose we have a text: 'Brake noise! It's not a malfunction; sometimes when I step on the brake pedal, there's a click.' The NER output based on this text would be as follows:
[0047] Brake Car Noise Isn't , Sometimes Brake Pedal Will , Have A Figure 2 Figure 3 Figure 4 Figure 3 Figure 4 Combination number , Entity A Entity B A whether belongs to B Engine compartment Antifreeze kettle Antifreeze kettle B I O O O O O O O O O O O O B I I I O O O O O O O
[0048] Based on the meaning of the NER labels, we can obtain two entities: brake and brake pedal. Of course, the NER labeling system has undergone many evolutions in later stages, from BIO to BIOES and BIOES+, which are enrichments to the basic BIO system.
[0049] Of course, since the method of the present invention can be applied to fields such as automobiles, medical fields, and biological fields, although existing entity recognition methods can realize entity recognition in many fields, in order to improve the recognition accuracy, an entity recognition model suitable for the field can be pre-trained using the knowledge of the applied field. During text preprocessing, a piece of text to be recognized can be directly input into the trained entity recognition model to obtain the set of entities to be analyzed in the text.
[0050] S2: Randomly select two entities from the entity set and arrange them in order to obtain all possible entity permutations and combinations;
[0051] Suppose that there are N entities (A, B, C, D, ...) identified in step S1, then N(N-1) entity permutations and combinations can be formed, such as AB, BA, AC, CA, ...
[0052] S3: Input the names of the two entities in each of the entity permutations into the entity relationship classification model to obtain whether the two entities in each of the entity permutations have a belonging relationship where the entity that comes first points to the entity that comes later.
[0053] The entity relationship classification model comprises two basic models: a word vector model and a vector relationship classification model. The word vector model converts entity names into vector representations containing semantics within their corresponding domain. This model is initially built upon a specific original corpus. The vector classification model determines whether two word vectors have a certain relationship. This model is initially built upon relation-labeled data used for training, and its word vectors are derived from the word vector model's vector output for entities. Through the entity relationship classification model, we can determine whether two entity names belong to a relationship.
[0054] Therefore, step S2 actually includes two sub-steps:
[0055] S21: Input the entity name in each of the entity permutations into the pre-trained word vector model, and the word vector model converts each input entity name into an entity word vector containing semantics in its corresponding domain;
[0056] S22: Input the two entity word vectors corresponding to each entity permutation and combination, carrying the permutation order, into the pre-trained vector relationship classification model to obtain whether the two entities in each entity permutation and combination have a belonging relationship where the entity that comes first points to the entity that comes later.
[0057] Understandably, before using entity classification models for prediction, we need to build our own word vector model and vector relationship classification model.
[0058] Defining the Training Scope of Word Vector Models: The significance of word vector models lies in converting words into dense vectors. The model is trained based on semantics and word position. The similarity relationships between semantically similar words are represented by vector relationships mapped from the words. Word vector models are constructed based on a certain amount of corpus data. To improve the performance of the trained word vector model with a limited corpus, we generally need to use texts similar to the predicted content as training samples. For example, if the final goal is to obtain entity relationships for automotive spare parts, the training text should be automotive industry-related knowledge text. Similarly, if the final entity relationship requires determining the attribution relationships between biological species, the word vector model should be trained with biological knowledge-related text; such relevant texts are often readily available.
[0059] Word vector model construction: This part mainly utilizes a large amount of acquired corpus text data to train a word vector encoder, i.e., a word vector model, using a deep learning model. Commonly used word vector models include Word2Vec and BERT. Theoretically, Word2Vec can only output word vectors from the training text, but BERT, due to its large pre-training corpus, can output word vectors for words not appearing in the training text. Whether it's Word2Vec, BERT, or other pre-trained encoding models, the basic idea is word vectorization; the similarity between single characters / words can be represented by word vectors. By constructing a word vector model for the research domain, for an input entity name in that domain, the word vector model can output a word vector representation that integrates the entity's meaning in that specific domain.
[0060] Vector Relation Classification Model Construction: This part mainly involves labeling the entities under study based on a certain relationship. A conventional classification model can be used, trained on labeled data. The entire training process includes the following: Relationship annotations for entities A and B are used for training, such as... Engine compartment Entity A obtains its corresponding word vector based on the word vector model constructed in step S21, and entity B obtains its corresponding word vector based on the word vector model constructed in step S21. The word vector of entity A is labeled as belonging to the word vector of entity B. The classification model is trained based on the labeled data, and the output of the vector classification model is whether there is a labeled relationship.
[0061] Taking the establishment of attribution relationships between automotive spare parts entities as an example, the basic structure of the label data used to train the vector relationship classification model for this process is shown in Table 1 below:
[0062] Table 1. Label data for the training vector relationship classification model.
[0063]
[0064]
[0065] In addition, during training, all labeled data is divided into a training set and a test set according to a certain ratio. The training set is used to train the vector relationship classification model. The test set uses the vector relationship classification model built from the training set for prediction, and the precision and recall are calculated based on the prediction results. The precision and recall are calculated based on the confusion matrix of the model, as shown in Table 2.
[0066] Table 2 Confusion Matrix
[0067]
[0068] The prediction performance of whether A belongs to B refers to the output of the model trained on the training set. The actual performance of whether A belongs to B is the true result of the labeled data. Taking TP as an example, its meaning is: this value means the number of samples in the test set whose actual belonging relationship is 1 and which are predicted to be 1.
[0069] Based on the confusion matrix above, the precision and recall of the trained model can be obtained, calculated as follows:
[0070]
[0071]
[0072] Based on the values of these two metrics, the classification accuracy of the vector relationship classification model established using the training set can be evaluated. By adjusting the parameters of the vector relationship classification model, the optimal model can be determined.
[0073] Based on this, word vector models and vector relationship classification models have been established, which can determine whether any input entity pair has a belonging relationship.
[0074] S4: Find all entities that have only one-way affiliation relationships to other entities as leaf entities. For each leaf entity found, find the corresponding micrograph. Based on the found micrograph, find the longest affiliation chain starting from that leaf entity.
[0075] For example, taking a single leaf entity as an example, refer to Engine compartment Assuming the ownership relationship of entities abcd should be... Generator Our goal is to find the longest chain within the dashed box.
[0076] Specifically, finding all entities that have only one-way attribution relationships pointing to other entities as leaf entities involves: selecting the permutations and combinations of entities with attribution relationships as the output results obtained when inputting the vector relationship classification model as the permutations and combinations of entities to be analyzed; and determining the first entity in the permutations and combinations of entities to be analyzed as the leaf entities.
[0077] Suppose the permutations and combinations of entities to be analyzed are in the following set A: (a, b), (b, c), (a, c), (c, d), (a, d), (b, d). Only a is a permutation that appears only at the beginning. b and c can appear either at the beginning or at the end. d can appear only at the end. Therefore, only a is a leaf entity.
[0078] It is understandable that there may be multiple leaf entities found, so for each leaf entity found, the longest belonging chain originating from that leaf entity must be found.
[0079] Specifically, the process involves identifying all entities with only unidirectional affiliations to other entities as leaf entities. For each leaf entity, a corresponding micrograph is created. Based on the micrograph, the longest affiliation chain originating from that leaf entity is found. This is achieved by first treating the leaf entity as both a leaf node and a target node, and then performing the following node expansion operation to form the micrograph: From the combinations of entities to be analyzed, all combinations of entities preceding the current target node are found. Entities following the current target node in these combinations are added to the micrograph as parent nodes of the current target node. Then, all the latest parent nodes are treated as target nodes, and the node expansion operation is performed again. Finally, after all node expansion operations are completed, the longest chain originating from the leaf node in the micrograph is taken as the longest affiliation chain originating from that leaf entity.
[0080] Or with Generator Taking as an example, the entity permutations to be analyzed are set A: (a, b), (b, c), (a, c), (c, d), (a, d), (b, d). We have already determined that the leaf node is 'a'. Starting from 'a', after step 1), we can find the entity permutations in set A where 'a' precedes 'a': (a, b), (a, c), (a, d). After step 2), we can find the parent nodes of 'a': b, c, d. Then, we take b, c, and d as the current nodes and execute step 1). When b is the current node, the entity permutations in set A where 'b' precedes 'b' are (b, c) and (b, d), so the parent nodes of b are c and d. When c is the current node, the entity permutations in set A where 'c' precedes 'd' are (c, d), so the parent node of c is d. When d is the current node, we find that there are no entity permutations in set A where 'd' precedes 'd', and so on. Finally, we will find several chains starting from a: a→b→c→d, a→c, a→d. We will take the longest chain starting from a, a→b→c→d, as the longest belonging chain starting from the leaf entity.
[0081] The following example of automotive equipment will be used to illustrate the process of this embodiment.
[0082] Step S1 extracts the entities to be studied from a text. For example, if there is a text, "There are traces of antifreeze splashed in the engine compartment of the vehicle, the antifreeze reservoir is empty, the alternator pulley is broken, and the alternator belt is missing, so it is determined that the pulley breakage is caused by the alternator malfunction", then the result of the automotive spare parts entity recognition is 5 entities: engine compartment, antifreeze reservoir, alternator, pulley, and belt.
[0083] Step S2 combines the five entities identified in step S1 in pairs according to their order, resulting in 5*(5-1) = 20 entity permutations and combinations, as shown in Table 3:
[0084] Table 3 Entity Permutation and Combination Table
[0085]
[0086]
[0087] Step S3 sequentially processes the 20 combinations from step S2 through the established entity relationship classification model to predict whether each combination pair represents a membership relationship. Taking a specific combination pair as an example, this process refers to... Engine compartment After prediction by the model, the entity attribution relationship of the entity permutation and combination will be obtained, as shown in Table 4 below. 0 means that A does not belong to B, and 1 means that A belongs to B.
[0088] Table 4 Entity Attribution Relationships in Entity Permutations and Combinations
[0089] Pulley Belt Belt Pulley 1 Figure 5 0 2 1 3 0 4 1 … … … … 19 0 20 0
[0090] Step S4: From Table 4, select all entity permutations and combinations where the model predicts a value of 1. From these selected permutations and combinations, identify entities that appear only at the beginning of the permutation / combination as leaf entities. For example, the leaf entities we found include coolant, pulley, and belt. For each leaf entity, starting from that leaf entity, recursively find all chains and identify the longest chain for that leaf entity. In this embodiment, coolant, pulley, and belt are all leaf entities, and their longest belonging chains need to be determined. Starting from these three entities, the three longest belonging chains can be determined: coolant reservoir-engine, pulley-generator-engine compartment, and belt-generator-engine compartment. The micrograph relationship chain formed by these three longest belonging chains is as follows: As shown.
[0091] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods.
[0092] Example 2
[0093] Based on the same inventive concept, this embodiment discloses a device for determining entity attribution chains based on micro-images, the device comprising:
[0094] The entity recognition module is used to acquire a piece of text, identify all entities from the text, and form the entity set, corresponding to step S1 in Embodiment 1;
[0095] The entity grouping module is used to obtain the set of entities to be analyzed, and to randomly select two entities from the entity set and arrange them in order to obtain all possible entity permutations and combinations, corresponding to step S2 in Embodiment 1;
[0096] The entity relationship classification module is used to input the names of two entities in each entity permutation into the entity relationship classification model to obtain whether the two entities in each entity permutation have a belonging relationship where the entity that comes first points to the entity that comes later, which corresponds to step S3 in Embodiment 1.
[0097] The chain finding module is used to find all entities that have only one-way affiliation relationships pointing to other entities as leaf entities. For each found leaf entity, a corresponding micro-graph is found. Based on the found micro-graph, the longest affiliation chain originating from the leaf entity is found, which corresponds to step S4 in Embodiment 1.
[0098] The entity relationship classification module includes:
[0099] The entity vectorization submodule is used to input the entity name in each of the entity permutations into a pre-trained word vector model, which converts each input entity name into an entity word vector containing semantics in its corresponding domain.
[0100] The entity attribution relationship determination submodule is used to input the two entity word vectors corresponding to each entity permutation and combination, carrying the permutation order, into the pre-trained vector relationship classification model to obtain whether the two entities in each entity permutation and combination have an attribution relationship where the entity that comes first points to the entity that comes later.
[0101] The chain finding module includes:
[0102] The leaf entity finding submodule is used to filter out the entity permutations and combinations whose output results are related to the vector relationship classification model when inputting the vector relationship classification model, and to identify only the first entity in the permutations and combinations to be analyzed as the leaf entity.
[0103] The chain-finding submodule is used to take the leaf entity as both a leaf node and a target node, and perform the following node expansion operations to form a micrograph: It searches for all entity permutations that precede the current target node from the entity permutations to be analyzed; adds the entities that follow the current target node as parent nodes to the micrograph; and performs the node expansion operation again on all the latest parent nodes as target nodes. After completing all node expansion operations, the longest chain originating from the leaf node in the micrograph is taken as the longest belonging chain originating from that leaf entity.
[0104] The functions of each functional module of the device described in the embodiments of the present invention can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.
[0105] The foregoing description involves various modules. It should be noted that the division into these modules in the above description is for clarity. However, in actual implementation, the boundaries between the various modules may be blurred. For example, any or all functional modules in this document may share various hardware and / or software elements. As another example, any and / or all functional modules in this document may be wholly or partially implemented by a shared processor executing software instructions. Furthermore, various software sub-modules executed by one or more processors may be shared among various software modules. Accordingly, unless expressly required, the scope of this invention is not limited by mandatory boundaries between various hardware and / or software elements.
[0106] Example 3
[0107] Based on the same inventive concept, this embodiment discloses a device for determining entity attribution chains based on micro-images, including a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements the steps described in Embodiment 1. For detailed implementation processes, please refer to the description of the above method embodiments, which will not be repeated here.
[0108] Example 4
[0109] Based on the same inventive concept, this embodiment discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in Embodiment 1. For detailed implementation processes, please refer to the description of the above method embodiments, which will not be repeated here.
[0110] In summary, this invention no longer utilizes a pre-constructed, complex knowledge graph to query the chain relationships between entities. Instead, it directly constructs chains in real-time from the acquired set of entities to be analyzed. The entities are arranged in pairs, considering their sequential order, to obtain all possible entity permutations and combinations. A relationship classification model is used to determine the affiliation of each entity permutation and combination. Finally, based on multiple entity affiliations, all leaf entities are identified, and the complete affiliation chain for each leaf entity is found through the longest chain. This method can obtain the affiliation chain relationships between multiple entities without relying on a massive knowledge graph. It also supports the construction of knowledge graphs to obtain entity relationships and to determine relationships when parts of the graph chain are missing, while simultaneously reducing query costs.
[0111] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for determining entity affiliation chains based on micromaps, characterized in that, The method includes: Obtain a text segment, identify all entities from the text to form an entity set to be analyzed, and randomly select two entities from the entity set and arrange them in order to obtain all possible entity permutations and combinations; Input the names of the two entities in each of the entity permutations into the entity relationship classification model to determine whether the two entities in each of the entity permutations have a hierarchical relationship where the entity that comes first points to the entity that comes later. Find all entities that have only one-way affiliation relationships pointing to other entities as leaf entities. For each leaf entity found, find the corresponding micrograph. Based on the found micrograph, find the longest affiliation chain starting from that leaf entity. The step of finding all entities that have only one-way affiliations to other entities as leaf entities includes: The entity permutations and combinations whose output results from the previous input vector relationship classification model are related to the entity permutations and combinations to be analyzed are selected. Among all entities involved in the permutation and combination of entities to be analyzed, only the entity that appears first in the permutation and combination is identified as the leaf entity; The process of finding the corresponding micro-graph for each found leaf entity and then finding the longest belonging chain originating from that leaf entity based on the found micro-graph includes: Using the leaf entity as both the leaf node and the target node, perform the following node expansion operation to form a micrograph: find all entity permutations that precede the current target node from the entity permutations to be analyzed, add the entities that follow the current target node as parent nodes to the micrograph, and perform the node expansion operation again on all the latest parent nodes as target nodes. After completing all node expansion operations, the longest chain originating from the leaf node in the micrograph is taken as the longest belonging chain originating from that leaf entity.
2. The method for determining entity affiliation chains based on micromaps according to claim 1, characterized in that, The entity relationship classification model includes a word vector model and a vector relationship classification model; the step of inputting the two entity names from each entity permutation and combination into the entity relationship classification model includes: The entity name in each of the entity permutations is input into a pre-trained word vector model, which converts each input entity name into an entity word vector containing semantics in its corresponding domain. For each of the entity permutations, the two entity word vectors corresponding to the permutation are input into the pre-trained vector relationship classification model, carrying the permutation order, to determine whether the two entities in each entity permutation have a belonging relationship where the entity that comes first points to the entity that comes later.
3. A device for determining entity attribution chains based on micro-images, characterized in that, The device includes: The entity grouping module is used to acquire a piece of text, identify all entities from the text to form a set of entities to be analyzed, and randomly select two entities from the entity set and arrange them in order to obtain all possible permutations and combinations of entities; The entity relationship classification module is used to input the names of two entities in each entity permutation into the entity relationship classification model to obtain whether the two entities in each entity permutation have a belonging relationship where the entity that comes first points to the entity that comes later. The chain finding module is used to find all entities that have only one-way affiliation relationships pointing to other entities as leaf entities, find the corresponding micro-graph for each found leaf entity, and find the longest affiliation chain starting from the leaf entity based on the found micro-graph. The chain-finding module includes: The leaf entity finding submodule is used to filter out the entity permutations and combinations with belonging relationships obtained from the previous input vector relationship classification model as the entity permutations and combinations to be analyzed. Among all the entities involved in the entity permutations and combinations to be analyzed, only the first entity in the permutation and combination is identified as the leaf entity. The chain-finding submodule is used to take the leaf entity as both a leaf node and a target node, and perform the following node expansion operations to form a micrograph: It searches for all entity permutations that precede the current target node from the entity permutations to be analyzed; adds the entities that follow the current target node as parent nodes to the micrograph; and performs the node expansion operation again on all the latest parent nodes as target nodes. After completing all node expansion operations, the longest chain originating from the leaf node in the micrograph is taken as the longest belonging chain originating from that leaf entity.
4. The device for determining entity attribution chains based on micro-images according to claim 3, characterized in that, The entity relationship classification module includes: The entity vectorization submodule is used to input the entity name in each of the entity permutations into a pre-trained word vector model, which converts each input entity name into an entity word vector containing semantics in its corresponding domain. The entity attribution relationship determination submodule is used to input the two entity word vectors corresponding to each entity permutation and combination, carrying the permutation order, into the pre-trained vector relationship classification model to obtain whether the two entities in each entity permutation and combination have an attribution relationship where the entity that comes first points to the entity that comes later.
5. A device for determining entity attribution chains based on micro-images, characterized in that, It includes a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the steps of the method as described in any one of claims 1-2.
6. A storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1-2.
Citation Information
Patent Citations
A Bayesian network-based method for analyzing the relationship between characters in web news data
CN109508385A
Relational information extraction method and device, electronic equipment and readable storage medium
CN111639185A