Knowledge graph construction method based on word vector similarity and entity pushing

By combining word vector similarity and entity recommendation techniques with large language models and context consistency scoring, the problems of dynamic updating and insufficient semantic similarity of knowledge graphs are solved, achieving efficient and accurate knowledge graph construction and expansion.

CN121998053APending Publication Date: 2026-05-08ZHENGZHOU XINDA ADVANCED TECH RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHENGZHOU XINDA ADVANCED TECH RES INST
Filing Date
2025-12-26
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing knowledge graph construction methods lack the ability to continuously evolve and automatically update, making it difficult to adapt to dynamically changing environments. Furthermore, they are insufficient in semantic similarity calculation, which limits the accuracy and completeness of the graphs.

Method used

We employ a method based on word vector similarity and entity recommendation. Through word segmentation and vectorization, we combine a large language model to generate an entity candidate pool and calculate deep semantic relationships between entities. We then use dependency parsing and context consistency scoring to generate triples and write them into the knowledge graph.

Benefits of technology

It enables efficient construction and dynamic updating of knowledge graphs, improves the accuracy and scalability of entity links, supports the automatic discovery of new entities and relationships, and reduces ambiguity and mismatches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998053A_ABST
    Figure CN121998053A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge graph construction method based on word vector similarity and entity pushing, which comprises the following steps of: fragmenting an input text based on a SeqLab normal form model to obtain a semantic paragraph block set; inputting the semantic paragraph block set into a pre-trained large language model, and performing entity recognition and extraction to obtain an entity list; representing and splicing the obtained global semantic vector, the local semantic vector and the type vector to obtain word vector representation of the corresponding entity; calculating the cosine similarity with the existing entity vectors in the knowledge graph, and then according to the consistency score in the context, pushing out an optimal entity and adding the optimal entity into an optimal entity set; generating a triple and writing the generated triple into a knowledge graph; according to the method, the entity link error rate is effectively reduced, and automatic extension of the knowledge graph is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph construction technology, and in particular to a method for constructing a knowledge graph based on word vector similarity and entity recommendation. Background Technology

[0002] With the deep integration of big data and artificial intelligence technologies, knowledge graphs, as the core carrier of structured semantic knowledge, are demonstrating key value in areas such as intelligent search, question-answering systems, and decision-making reasoning, becoming an inevitable product of information technology's transition from data interconnection to intelligent interconnection. At the enterprise level, it can connect customer, product, and supply chain data scattered across different systems to form a unified knowledge view, thereby empowering intelligent risk control, personalized recommendations, and precision marketing. At the industry level, medical knowledge graphs assist clinical decision-making, financial knowledge graphs reveal risk transmission paths, and smart city knowledge graphs optimize the allocation of public resources.

[0003] The patent CN119204182B, authorized by the Ministry of Civil Aviation Administration of China, provides a method, system, and storage medium for constructing a knowledge graph in the civil aviation service field. It employs the BERT-BiLSTM-CRF algorithm to extract entities, obtaining interconnected entity vector sequences, feature vector sequences, and annotation sequences. A convolutional neural network model is used to extract sentence vectors and their contained entity vectors, and n filters are used to identify and extract a database of entity-relationship-entity triples. A conditional random field entity node integration model is used to integrate the annotation information, storing it as entity attribute values. The civil aviation knowledge graph is constructed by linking and fusing the triple database and the integrated entity attribute values. Existing solutions lack the ability to continuously evolve and automatically update knowledge graphs, making it difficult to adapt to dynamically changing environments. Furthermore, their semantic similarity calculation relies solely on cosine similarity, which is insufficient for depicting subtle semantic differences and complex relationships, limiting the accuracy and completeness of the graph. Therefore, this invention proposes a knowledge graph construction method based on word vector similarity and entity recommendation. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies by providing a knowledge graph construction method based on word vector similarity and entity recommendation. This method first segments and vectorizes the text, then inputs the processed text into a pre-trained large language model to generate an entity candidate pool. Next, target entities are recommended from the candidate pool based on word vector semantic similarity, and deep semantic relationships between entities are calculated. This method captures contextual semantic information in natural language through a word vector model, and automatically identifies potential entities and their relationships in the text by combining an entity recommendation mechanism, ultimately achieving efficient construction and dynamic updating of the knowledge graph.

[0005] To achieve the above objectives, the first aspect of the present invention provides a method for constructing a knowledge graph based on word vector similarity and entity recommendation, comprising the following steps: Based on the SeqLab paradigm model, the input text is segmented to obtain a set of semantic paragraph blocks; The set of semantic paragraph blocks is input into a pre-trained large language model for entity recognition and extraction to obtain an entity list; The semantic paragraph block and the entity list are input into a semantic coding model pre-trained on a domain training set. The global semantic vector, local semantic vector and type vector of each entity are extracted and concatenated to obtain the word vector representation of the corresponding entity. Calculate the cosine similarity between the word vector representation of the entity and the existing entity vectors in the knowledge graph; if the cosine similarity is greater than a certain threshold, it is included in the candidate entity set. Calculate the context consistency score of each candidate entity in the candidate entity set in the input text. If the score is greater than the preset context consistency score, it is recommended as the best entity and added to the best entity set. The optimal entity set is obtained from the same semantic paragraph block, and dependency parsing is performed on the existing entities to extract the relation types between entities, generate triples, and write the generated triples into the knowledge graph.

[0006] By concatenating vectors that integrate global semantics, local context, and type information, a comprehensive representation of multi-dimensional entity semantics is achieved, significantly enhancing the information richness of entity representation. Combining dependency parsing and context consistency scoring effectively improves the accuracy of relation extraction and entity linking, reducing ambiguity and mismatches. An adaptive matching strategy based on consistency scoring and similarity ranking enables the knowledge graph to possess self-optimization and correction capabilities. It supports the automated discovery and integration of newly emerging entities and relations, improving the scalability of the knowledge graph.

[0007] Using a cosine similarity threshold as a quantifiable benchmark, newly extracted entities can be automatically and quickly compared with a massive number of existing entities in the knowledge base, maintaining the accuracy of the existing knowledge base and preventing error propagation. A semantic encoding model pre-trained on a domain-specific training set is employed to ensure that entity representations better align with the semantic features of the specific domain.

[0008] In one possible embodiment, the method for obtaining the global semantic vector, the local semantic vector, and the type vector representation includes: Extract the overall paragraph semantics output by the semantic encoding model as a global semantic vector; From the output of the semantic coding model, the vector representation of the word sequence corresponding to the entity in the entity list is extracted, and the word sequence is subjected to average pooling to obtain the local semantic vector corresponding to each entity. Based on the fine-grained type identifiers of each entity in the entity list that are predefined in the knowledge base, the trainable type embedding matrix is ​​queried to obtain the type vector representation corresponding to each entity.

[0009] The above approach captures the macroscopic role and thematic association of an entity within the entire paragraph or document, focuses on the microscopic semantics of the entity's direct context, retains its most core and precise semantic information, and introduces structured prior knowledge from the knowledge base. The entity vector formed by combining these three elements combines context, focus, and knowledge, and can more comprehensively and accurately represent the true meaning of the entity.

[0010] In one possible embodiment, the method for obtaining a set of semantic paragraph blocks includes: The SeqLab paradigm model is used to perform coarse-grained breakpoint detection on the input text, obtaining forced breakpoint markers and predicting the probability value P of each sentence end, paragraph end, and title breakpoint. break ; If the input text contains a table, LaTeX, or list, then the structured content within it is identified and marked using regular expression rules to force breakpoints, thus obtaining forced breakpoint markers. Based on the probability value P break Using the forced breakpoint markers, the optimal segmentation is calculated through a dynamic programming algorithm to obtain a set of semantic paragraph blocks. The objective function of the dynamic programming is: ,

[0011] Where i represents the breakpoint position, len(i) is the length of the corresponding fragment block, L0 represents the target fragment length, and λ represents the preset length penalty coefficient.

[0012] Based on SeqLab model prediction, rule-based forced breakpoints, and dynamic programming optimization, this approach adapts to diverse writing styles and text types. Forced segmentation using regular expressions ensures the integrity of key structured content is not compromised, preventing the model from misclassifying it as part of ordinary paragraphs and making the segmentation results more reliable. The dynamic programming algorithm considers all potential breakpoint locations from a global perspective, seeking the overall optimal segmentation scheme, rather than simply making greedy decisions based on local probability thresholds. This avoids cascading errors caused by misjudgments of local breakpoints, improving the overall coherence and rationality of the segmentation results.

[0013] In one possible embodiment, the method for obtaining the context consistency score includes: Obtain the context information of candidate entity e in the candidate entity set; Calculate the consistency scores for sentence-level consistency (SentSim), topic-level consistency (TopicSim), and graph neighbor consistency (NeighborSim); among them... The sentence representation vector He of the sentence containing candidate entity e is calculated, and its cosine similarity with the sentence representation vector H(e) of the definition or summary sentence of candidate entity e in the knowledge base is used as the sentence-level consistency. The sentence-level consistency calculation formula is as follows: SentSim=cos(He,H(e)) The cosine similarity between the average vector Te of the top N keywords with the highest TF-IDF weights in the semantic paragraph block and the keyword vector T(e) of the encyclopedia entry for candidate entity e is used as the topic consistency. If candidate entity e has no keyword vector, a unit vector is used instead. The formula for calculating topic consistency is as follows: TopicSim=cos(Te,T(e)) Calculate the vector representation ve of candidate entity e and the set of neighboring entities {e} of candidate entity e in the knowledge graph. i The vector representation of {v} (ei) The average cosine similarity between the nodes is used as the graph neighbor consistency, and the formula for calculating the graph neighbor consistency is: ,

[0014] The context consistency score Ce of candidate entity e is calculated based on a weighted formula, wherein the context consistency score calculation formula is as follows: Ce=w1•SentSim+w2•TopicSim+w3•NeighborSim w1, w2, and w3 are weighting coefficients that are dynamically configured based on the text type. Relying solely on character matching of entity names or simple vector similarity can easily lead to incorrect links. Consistency scoring, by comprehensively measuring the fit between candidate entities and the current text context, can effectively identify entities that are truly mentioned in a specific context; it significantly reduces ambiguity and ensures that the linked entities are the actual objects referred to in the text.

[0015] In one possible embodiment, a method for training a trainable type embedding matrix includes: Extract fine-grained type labels corresponding to entities from the knowledge base, construct a type set, assign a trainable embedding vector to each type in the type set, form a type embedding matrix, and perform random initialization; During model training, the word vector representations of the candidate entities are fine-tuned based on the contrastive loss function to optimize the parameters of the trainable type embedding matrix.

[0016] The above scheme introduces a trainable type embedding matrix, which essentially transforms the structured labels of domain knowledge into continuous parameters that can be understood and optimized by neural networks. This makes the static type system dynamic and semantic, turning it into a computable knowledge unit. Through the training mechanism, it can be adapted to different domains and achieve customized optimization.

[0017] To achieve the above objectives, a second aspect of the present invention provides a knowledge graph construction system based on word vector similarity and entity recommendation, comprising: a segmentation module, an entity extraction module, a word vector generation module, an entity recommendation module, and a relationship construction module; The segmentation module is used to segment the input text based on the SeqLab paradigm model to obtain a set of semantic paragraph blocks. The entity extraction module is used to input the set of semantic paragraph blocks into a pre-trained large language model to perform entity recognition and extraction, and obtain an entity list. The word vector generation module is used to input the semantic paragraph block and the entity list into a semantic coding model pre-trained on a domain training set, extract the global semantic vector, local semantic vector and type vector of each entity and concatenate them to obtain the word vector representation of the corresponding entity. The entity recommendation module is used to calculate the cosine similarity between the word vector representation of the entity and the existing entity vectors in the knowledge graph; if the cosine similarity is greater than a certain threshold, it is included in the candidate entity set. The context consistency score of each candidate entity in the candidate entity set is used to calculate the context consistency score in the input text. If the score is greater than the preset context consistency score, it is recommended as the best entity and added to the best entity set. The relation construction module is used to obtain the best entity set and existing entities in the same semantic paragraph block, perform dependency parsing, extract the relation types between entities, generate triples, and write the generated triples into the knowledge graph.

[0018] To achieve the above objectives, a third aspect of the present invention provides a computer device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the knowledge graph construction method based on word vector similarity and entity recommendation as described in the first aspect above.

[0019] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the steps of the knowledge graph construction method based on word vector similarity and entity recommendation as described in the first aspect above.

[0020] The beneficial effects of this invention are as follows: 1. Dynamic sharding is used to support parallel computing, significantly improving the overall construction efficiency under large-scale data; 2. Large language models, with their prior knowledge learned from massive amounts of text, demonstrate outstanding entity recognition and linking capabilities. They not only have high accuracy but also possess powerful zero-shot or few-shot entity discovery capabilities, effectively identifying novel entities that are not explicitly labeled in the training set. 3. A dual verification mechanism is constructed by combining word vector-based cosine similarity calculation with context-based deep semantic consistency reasoning. This fusion strategy can effectively identify and filter erroneous candidates caused by polysemy or name ambiguity, thereby significantly reducing the error rate of entity linking.

[0021] 4. Supports automated discovery and integration of newly emerging entities and relationships, improving the scalability of the knowledge graph. Attached Figure Description

[0022] Figure 1 This is a flowchart of the detection process provided in an embodiment of the present invention; Figure 2 This is a Baidu Encyclopedia image provided in an embodiment of the present invention; Figure 3 This is a news corpus graph provided in an embodiment of the present invention; Figure 4 This is a medical literature atlas provided in the embodiments of the present invention. Detailed Implementation

[0023] The technical solution of the present invention will be further described in detail below through specific embodiments.

[0024] To address the widespread problems of inaccurate word meaning mining and inaccurate entity selection in existing knowledge graph extraction methods based on natural language recognition technology, this paper refers to... Figure 1 This invention proposes a knowledge graph construction method based on word vector similarity and entity recommendation techniques. By segmenting and vectorizing the text, the segmented text is input into a large model. The similarity of the segmented vectors is used to recommend candidate entities, and the knowledge graph is updated based on contextual consistency scoring.

[0025] Example 1 This embodiment provides a method for constructing a knowledge graph based on word vector similarity and entity recommendation, including the following steps: Step S1: Based on the SeqLab paradigm model, the input text is segmented to obtain a set of semantic paragraph blocks; Specifically, methods for obtaining a set of semantic paragraph blocks include: The SeqLab paradigm model is used to perform coarse-grained breakpoint detection on the input text, obtaining forced breakpoint markers and predicting the probability value P of each sentence end, paragraph end, and title breakpoint. break ; If the input text contains a table, LaTeX, or list, then the structured content within it is identified and marked using regular expression rules to force breakpoints, thus obtaining forced breakpoint markers. It should be noted that since a text may contain not only text but also tables, formulas, lists, and other data, regular expressions can easily identify them, and obtain the probability value of the breakpoint while obtaining the forced breakpoint marker.

[0026] Based on the probability value P break Using the forced breakpoint markers, the optimal segmentation is calculated through a dynamic programming algorithm to obtain a set of semantic paragraph blocks. The objective function of the dynamic programming is: ,

[0027] Where i represents the breakpoint position, len(i) is the length of the corresponding fragment block, L0 represents the target fragment length, and λ represents the preset length penalty coefficient.

[0028] In this embodiment, the fragment size is dynamically set by the computer performance, with a value range of 256 characters to 1024 characters, and the fragment overlap is 25%; where len∈[256,1536] characters; L0 is the optimal length for the GPU, with a default of 1024.

[0029] Step S2: Input the set of semantic paragraph blocks into the pre-trained large language model to perform entity recognition and extraction, and obtain an entity list; In this embodiment, the large language model used is the RoBERTa-wwm-ext-large model, but BioBERT-large, MacBERT, DeBERTa-v3, etc. can also be used.

[0030] It should be noted that the entity list includes not only the entity itself, but also its location information in the text, entity type, and a list of candidate objects linked to the knowledge base.

[0031] It should be noted that in the knowledge graph construction process, the structured data format of the entity list is a set of candidate triples. This set of triples includes the head entity, the tail entity, and the semantic relation types extracted from the text. For example, see reference... Figure 2 Network security includes firewalls. Both network security and firewalls are head entities and tail entities, or tail entities and head entities, respectively. "Inclusion" is a semantic relationship type.

[0032] Step S3: Input the semantic paragraph block and the entity list into the semantic coding model pre-trained on the domain training set, extract the global semantic vector, local semantic vector and type vector of each entity and concatenate them to obtain the word vector representation of the corresponding entity; It should be noted that the semantic coding model used in this embodiment is the BERT model, but a semantic coding model based on Transformer can also be used.

[0033] Specifically, methods for obtaining global semantic vectors, local semantic vectors, and type vector representations include: Extract the overall paragraph semantics output by the semantic encoding model as a global semantic vector; From the output of the semantic coding model, the vector representation of the word sequence corresponding to the entity in the entity list is extracted, and the word sequence is subjected to average pooling to obtain the local semantic vector corresponding to each entity. Based on the fine-grained type identifiers of each entity in the entity list that are predefined in the knowledge base, the trainable type embedding matrix is ​​queried to obtain the type vector representation corresponding to each entity.

[0034] It should be noted that the fine-grained categories are predefined, such as Drug, Person, and Org. In this embodiment, the predefined categories are Encyclopedia, News, and Medicine.

[0035] Specifically, methods for training trainable type embedding matrices include: Extract fine-grained type labels corresponding to entities from the knowledge base, construct a type set, assign a trainable embedding vector to each type in the type set, form a type embedding matrix, and perform random initialization; During model training, the word vector representation of the entity is fine-tuned based on the contrastive loss function to optimize the parameters of the trainable type embedding matrix.

[0036] This can be understood as follows: the type embedding matrix is ​​an Excel spreadsheet, where each row represents a unique specific type in the knowledge base, and each column represents a dimension of the type vector. The value of the cell is the numerical value of the type in that dimension, which is the type vector. Trainable can be understood as the network parameters being automatically adjusted and optimized through the gradient descent algorithm, so that semantically similar types are also close to each other in the vector space.

[0037] Step S4: Calculate the cosine similarity between the word vector representation of the entity and the existing entity vectors in the knowledge graph; if the cosine similarity is greater than a certain threshold, it is included in the candidate entity set; calculate the context consistency score of each candidate entity in the candidate entity set in the input text; if it is greater than the preset context consistency score, it is recommended as the best entity and added to the best entity set. It should be noted that if the cosine similarity between the word vector representation of the entity and the existing entity vectors in the knowledge graph is less than or equal to a certain threshold, it will be included in the knowledge base as an existing entity in the knowledge graph. When multiple candidate entities have high context consistency scores, the recommended best entity is often not unique, but may be multiple entities with equal weight.

[0038] Specifically, methods for obtaining context consistency scores include: Obtain the context information of candidate entity e in the candidate entity set; Calculate the consistency scores for sentence-level consistency (SentSim), topic-level consistency (TopicSim), and graph neighbor consistency (NeighborSim); among them... The sentence representation vector He of the sentence containing candidate entity e is calculated, and its cosine similarity with the sentence representation vector H(e) of the definition or summary sentence of entity e in the knowledge base is used as the sentence-level consistency. The sentence-level consistency calculation formula is as follows: SentSim=cos(He,H(e)) It should be noted that, within the candidate entity set, candidate entity e is matched with entities in the knowledge base to determine its corresponding knowledge base entity e. The knowledge base is a predefined structure that contains contextual relationship information between candidate entities and knowledge base entities.

[0039] The cosine similarity between the average vector Te of the top N keywords with the highest TF-IDF weights in the semantic paragraph block and the keyword vector T(e) of the encyclopedia entry for entity e is used as the topic consistency. If entity e has no keyword vector, a unit vector is used instead. The formula for calculating topic consistency is as follows: TopicSim=cos(Te,T(e)) It should be noted that, within the candidate entity set, candidate entity e is matched with entities in the encyclopedia entry to determine its corresponding encyclopedia entry entity e. The encyclopedia entry has a predefined structure and contains contextual relationship information between the candidate entity and the encyclopedia entry entity.

[0040] Calculate the vector representation of candidate entity e and the set of neighboring entities {e} of entity e in the knowledge graph. i The vector representation of {v} (ei)The average cosine similarity between the nodes is used as the graph neighbor consistency, and the formula for calculating the graph neighbor consistency is: ,

[0041] The context consistency score Ce between candidate entity e and entity e is calculated based on a weighted formula, wherein the context consistency score calculation formula is as follows: Ce=w1•SentSim+w2•TopicSim+w3•NeighborSim w1, w2, and w3 are weighting coefficients that are dynamically configured based on the text type.

[0042] It should be noted that the formula for calculating the cosine similarity between an entity vector and existing entity vectors in the knowledge graph is as follows: ,

[0043] Step S5: Obtain the best entity set and perform dependency parsing on the existing entities in the same semantic paragraph block, extract the relation types between entities, generate triples, and write the generated triples into the knowledge graph.

[0044] To verify the effectiveness of this embodiment, knowledge graphs were constructed for encyclopedia corpora, news corpora, and medical literature, respectively.

[0045] Encyclopedia corpus construction, reference Figure 2 ; Step S1: Data Sharding We retrieved 1000 entries related to "artificial intelligence" from Baidu Baike, with an average length of 1200 characters. Based on computer performance, we set the fragment size to 1024 characters and the overlap to 25%, resulting in 1250 fragments.

[0046] Step S2: Entity Extraction Each text was input into the Chinese RoBERTa-wwm-ext-large model with a batch size of 32, resulting in the extraction of 47,316 entities and an average recall rate of 93.1%.

[0047] Step S3: Word Vector Generation Take the [CLS] vector and perform average pooling, d=768 dimensions, to form an entity vector library.

[0048] Step S4: Calculate word vector similarity Compared with existing entities in CN-DBpedia, θ=0.75, the size of the candidate link set is reduced to 17% of the original.

[0049] Step S5: Entity Recommendation Top-1 link accuracy was 92.3%, 5830 new entities were discovered and assigned temporary IDs.

[0050] Step S6: Relationship Building Dependency parsing extracted 126,418 triples, and manual sampling extracted 200 triples, with an accuracy of 89.4%.

[0051] News corpus construction, reference Figure 3 ; Step S1: Data Sharding Data from Sina News from January to March 2024 was collected, totaling 500,000 articles with an average length of 600 characters. With a segment size of 512 characters and 25% overlap, approximately 620,000 segments were obtained.

[0052] Step S2: Entity Extraction Using the same large model as in Example 1, with a batch size of 64, 2,140,000 entities were extracted.

[0053] Step S3: Word Vector Generation Same as Example 1, d=768.

[0054] Step S4: Calculate word vector similarity θ=0.75, candidate set compression rate 83%.

[0055] Step S5: Entity Recommendation Top-1 link accuracy was 90.7%, and 236,000 new entities were discovered.

[0056] Step S6: Relationship Building A total of 5,830,000 triplet samples were collected, with 500 samples manually sampled, achieving a precision of 87.1%.

[0057] Medical literature construction, reference Figure 4 ; Step S1: Data Sharding We collected 100,000 open-source articles from PubMed Central, with an average length of 4,000 characters. We set the fragment size to 256 characters and the overlap to 25%, resulting in approximately 1.55 million fragments.

[0058] Step S2: Entity Extraction Using domain-specific fine-tuning of BioBERT-large, batch size = 16, 980,000 entities were extracted.

[0059] Step S3: Word Vector Generation d=768, domain vocabulary + UMLS semantic type constraints.

[0060] Step S4: Calculate word vector similarity θ=0.80, candidate set compression rate 79%.

[0061] Step S5: Entity Recommendation Top-1 link accuracy was 93.5%, and 118,000 new entities were discovered.

[0062] Step S6: Relationship Building A total of 1,460,000 triplet samples were collected, with 300 samples manually sampled, achieving a precision of 91.2%.

[0063] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0064] Example 2 Based on the same inventive concept, this application also provides a knowledge graph construction system based on word vector similarity and entity recommendation to implement the aforementioned system. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of the knowledge graph construction system based on word vector similarity and entity recommendation described below can be found in the above description of the knowledge graph construction method based on word vector similarity and entity recommendation, and will not be repeated here.

[0065] Specifically, a knowledge graph construction system based on word vector similarity and entity recommendation includes: a segmentation module, an entity extraction module, a word vector generation module, an entity recommendation module, and a relationship construction module; The segmentation module is used to segment the input text based on the SeqLab paradigm model to obtain a set of semantic paragraph blocks. The entity extraction module is used to input the set of semantic paragraph blocks into a pre-trained large model to perform entity recognition and extraction, and obtain an entity list; The word vector generation module is used to input the semantic paragraph block and the entity list into a semantic coding model pre-trained on a domain training set, extract the global semantic vector, local semantic vector and type vector of each entity and concatenate them to obtain the word vector representation of the corresponding entity. The entity recommendation module is used to calculate the cosine similarity between the word vector representation of the entity and the existing entity vectors in the knowledge graph; if the cosine similarity is greater than a certain threshold, it is included in the candidate entity set. The context consistency score of each candidate entity in the candidate entity set is used to calculate the context consistency score in the input text. If the score is greater than the preset context consistency score, it is recommended as the best entity and added to the best entity set. The relation construction module is used to obtain the best entity set and existing entities in the same semantic paragraph block, perform dependency parsing, extract the relation types between entities, generate triples, and write the generated triples into the knowledge graph.

[0066] Example 3 This application discloses a computer device. The computer device includes a processor and a memory. The processor, memory, and input / output interface are connected via a system bus, and a communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the computer program is executed by the processor, it implements the steps of the knowledge graph construction method based on word vector similarity and entity recommendation described in Embodiment 1.

[0067] Example 4 Based on the above embodiments, this embodiment provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the knowledge graph construction method based on word vector similarity and entity recommendation described in Embodiment 1.

[0068] The above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.

Claims

1. A method for constructing a knowledge graph based on word vector similarity and entity recommendation, characterized in that, The method includes the following steps: Based on the SeqLab paradigm model, the input text is segmented to obtain a set of semantic paragraph blocks; The set of semantic paragraph blocks is input into a pre-trained large language model for entity recognition and extraction to obtain an entity list; The semantic paragraph block and the entity list are input into a semantic coding model pre-trained on a domain training set. The global semantic vector, local semantic vector and type vector of each entity are extracted and concatenated to obtain the word vector representation of the corresponding entity. Calculate the cosine similarity between the word vector representation of the entity and the existing entity vectors in the knowledge graph; if the cosine similarity is greater than a certain threshold, it is included in the candidate entity set. Calculate the context consistency score of each candidate entity in the candidate entity set in the input text. If the score is greater than the preset context consistency score, it is recommended as the best entity and added to the best entity set. The optimal entity set is obtained from the same semantic paragraph block, and dependency parsing is performed on the existing entities to extract the relation types between entities, generate triples, and write the generated triples into the knowledge graph.

2. The knowledge graph construction method based on word vector similarity and entity recommendation according to claim 1, characterized in that, Methods for obtaining global semantic vectors, local semantic vectors, and type vector representations include: Extract the overall paragraph semantics output by the semantic encoding model as a global semantic vector; From the output of the semantic coding model, the vector representation of the word sequence corresponding to the entity in the entity list is extracted, and the word sequence is subjected to average pooling to obtain the local semantic vector corresponding to each entity. Based on the fine-grained type identifiers of each entity in the entity list that are predefined in the knowledge base, the trainable type embedding matrix is ​​queried to obtain the type vector representation corresponding to each entity.

3. The knowledge graph construction method based on word vector similarity and entity recommendation according to claim 1, characterized in that, Methods for obtaining a collection of semantic paragraph blocks include: The SeqLab paradigm model is used to perform coarse-grained breakpoint detection on the input text, obtaining forced breakpoint markers and predicting the probability value P of each sentence end, paragraph end, and title breakpoint. break ; If the input text contains a table, LaTeX, or list, then the structured content within it is identified and marked using regular expression rules to force breakpoints, thus obtaining forced breakpoint markers. Based on the probability value P break Using the forced breakpoint markers, the optimal segmentation is calculated through a dynamic programming algorithm to obtain a set of semantic paragraph blocks. The objective function of the dynamic programming is: , Where i represents the breakpoint position, len(i) is the length of the corresponding fragment block, L0 represents the target fragment length, and ⋋ represents the preset length penalty coefficient.

4. The knowledge graph construction method based on word vector similarity and entity recommendation according to claim 1, characterized in that, Methods for obtaining context consistency scores include: Obtain the context information of candidate entity e in the candidate entity set; Calculate the consistency scores for sentence-level consistency (SentSim), topic-level consistency (TopicSim), and graph neighbor consistency (NeighborSim); among them... The sentence representation vector He of the sentence containing candidate entity e is calculated, and its cosine similarity with the sentence representation vector H(e) of the definition or summary sentence of candidate entity e in the knowledge base is used as the sentence-level consistency. The sentence-level consistency calculation formula is as follows: SentSim=cos(He,H(e)) The cosine similarity between the average vector Te of the top N keywords with the highest TF-IDF weights in the semantic paragraph block and the keyword vector T(e) of the encyclopedia entry for candidate entity e is used as the topic consistency. If candidate entity e has no keyword vector, a unit vector is used instead. The formula for calculating topic consistency is as follows: TopicSim=cos(Te,T(e)) Calculate the vector representation ve of candidate entity e and the vector representation {v} of the set of neighboring entities {eᵢ} of candidate entity e in the knowledge graph. (eᵢ) The average cosine similarity between the nodes is used as the graph neighbor consistency, and the formula for calculating the graph neighbor consistency is: , The context consistency score Ce of candidate entity e is calculated based on a weighted formula, wherein the context consistency score calculation formula is as follows: Ce=w1⋅SentSim+w2⋅TopicSim+w3⋅NeighborSim w1, w2, and w3 are weighting coefficients that are dynamically configured based on the text type.

5. The knowledge graph construction method based on word vector similarity and entity recommendation according to claim 2, characterized in that, Methods for training trainable type embedding matrices include: Extract fine-grained type labels corresponding to entities from the knowledge base, construct a type set, assign a trainable embedding vector to each type in the type set, form a type embedding matrix, and perform random initialization; During model training, the word vector representation of the entity is fine-tuned based on the contrastive loss function to optimize the parameters of the trainable type embedding matrix.

6. A knowledge graph construction system based on word vector similarity and entity recommendation, comprising: The module includes a segmentation module, an entity extraction module, a word vector generation module, an entity recommendation module, and a relationship construction module. The segmentation module is used to segment the input text based on the SeqLab paradigm model to obtain a set of semantic paragraph blocks. The entity extraction module is used to input the set of semantic paragraph blocks into a pre-trained large language model to perform entity recognition and extraction, and obtain an entity list. The word vector generation module is used to input the semantic paragraph block and the entity list into a semantic coding model pre-trained on a domain training set, extract the global semantic vector, local semantic vector and type vector of each entity and concatenate them to obtain the word vector representation of the corresponding entity. The entity recommendation module is used to calculate the cosine similarity between the word vector representation of the entity and the existing entity vectors in the knowledge graph; if the cosine similarity is greater than a certain threshold, it is included in the candidate entity set. The context consistency score of each candidate entity in the candidate entity set is used to calculate the context consistency score in the input text. If the score is greater than the preset context consistency score, it is recommended as the best entity and added to the best entity set. The relation construction module is used to obtain the best entity set and existing entities in the same semantic paragraph block, perform dependency parsing, extract the relation types between entities, generate triples, and write the generated triples into the knowledge graph.

7. A computer device, characterized in that: It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; A memory is used to store computer programs; a processor is used to execute the programs stored in the memory to implement the knowledge graph construction method based on word vector similarity and entity recommendation as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the knowledge graph construction method based on word vector similarity and entity recommendation as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Methods, systems, and storage media for constructing knowledge graphs in the civil aviation service sector

    CN119204182B