Knowledge graph construction method and device based on large model, equipment and medium

By using a large model-based approach for entity alignment and deduplication, combined with sharded storage and incremental updates, the problems of entity duplication and semantic conflicts in knowledge graphs are solved, improving the accuracy and adaptability of knowledge graphs and making them suitable for complex application scenarios.

CN120911564APending Publication Date: 2025-11-07NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510896236.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing technologies lack effective entity alignment and synonym disambiguation mechanisms in knowledge graph construction, leading to entity duplication, information redundancy, and semantic conflicts. This affects the overall accuracy and consistency of knowledge graphs and makes it difficult to handle complex semantic relationships and multi-source heterogeneous data, thus limiting their adaptability in cross-domain applications.

Method used

We adopt a large model-based approach, using attention mechanisms for multi-dimensional context representation and graph embedding algorithms to achieve entity alignment and deduplication. Combined with a sharded storage system and incremental update mechanism, we optimize the knowledge graph construction process.

Benefits of technology

It improves the semantic consistency and overall accuracy of knowledge graphs, enhances their expressive power and cross-domain adaptability in complex application scenarios, reduces reliance on manual annotation and construction costs, and achieves efficient multi-source data fusion and real-time updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911564A_ABST
    Figure CN120911564A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge graph construction method and device based on a large model, equipment and a medium, and relates to the technical field of knowledge graphs, and the knowledge graph construction method based on the large model comprises the following steps: determining structured text data of a knowledge graph to be constructed; inputting the structured text data into the large model to obtain multiple groups of first entity relationship pairs corresponding to the structured text data; based on a graph embedding algorithm, performing alignment processing on entities of different languages in the multiple groups of first entity relationship pairs to obtain a first entity relationship pair set; performing duplicate removal processing on entities in the first entity relationship pair set and corresponding relationship attributes among the entities to obtain a second entity relationship pair set; and based on the entity relationship pair set, constructing a knowledge graph corresponding to the structured text data. According to the method, efficient fusion of cross-source data is achieved, semantic consistency and overall accuracy in the knowledge graph are improved, the knowledge graph has higher expression ability and cross-domain adaptability, and the method is suitable for complex application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of knowledge graph, and in particular to a knowledge graph construction method and device based on a large model, equipment and a medium. BACKGROUND

[0002] At present, the knowledge graph construction technology mainly includes rule-driven method, shallow machine learning, deep learning model and large-scale pre-training language model developed in recent years. The rule-driven method depends on manually defined templates and rules, and realizes the extraction of entities and relationships through natural language processing technology (such as word segmentation, part-of-speech tagging, named entity recognition), but the efficiency is low and it is difficult to expand. The shallow machine learning method uses classifiers (such as support vector machine, naive Bayes) for entity and relationship classification, which has high automation, but it is difficult to deal with complex semantic structures. The deep learning model realizes the automatic extraction of complex text features through end-to-end training of neural networks, but its ability to process long text and polysemous relationships is limited. With the introduction of pre-training models (such as BERT, GPT), knowledge graph construction has made significant progress in semantic understanding and complex relationship recognition. The use of fine-tuned pre-training models can automatically extract complex entities and relationships from text, greatly improving the construction accuracy and efficiency of knowledge graph.

[0003] However, knowledge graph construction needs to integrate heterogeneous data from multiple sources (such as text, database, web page, etc.), and the existing technology has limited ability to handle the semantic consistency and redundancy elimination of heterogeneous data. The same entity may have multiple different representations in different data sources, and traditional methods lack effective entity alignment and synonym disambiguation mechanisms, resulting in entity duplication, information redundancy, and even semantic conflicts in the graph, which cannot identify long text, thereby affecting the overall accuracy and consistency of the knowledge graph. SUMMARY

[0004] The present application provides a knowledge graph construction method and device based on a large model, which solves the defects in the prior art that the lack of effective entity alignment and synonym disambiguation mechanism leads to entity duplication, information redundancy, and even semantic conflicts in the graph, thereby affecting the overall accuracy and consistency of the knowledge graph, realizes multi-dimensional context representation of entity relationship pairs through attention mechanism, effectively identifies complex relationships in long text, and then realizes entity alignment and entity deduplication through graph embedding algorithm, maintains the consistency of entity relationships, and realizes efficient fusion of cross-source data, improves the semantic consistency and overall accuracy of the knowledge graph, makes the knowledge graph have stronger expression ability and cross-domain adaptability, and is suitable for complex application scenarios.

[0005] The present application provides a knowledge graph construction method based on a large model, comprising the following steps: determining structured text data to be constructed into a knowledge graph; inputting the structured text data into a large model to obtain a plurality of groups of first entity relationship pairs corresponding to the structured text data; aligning entities in different languages in the plurality of groups of first entity relationship pairs based on a graph embedding algorithm and an attention mechanism to obtain a first set of entity relationship pairs; de-duplicating entities and corresponding relationship attributes between the entities in the first set of entity relationship pairs to obtain a second set of entity relationship pairs; constructing a knowledge graph corresponding to the structured text data based on the second set of entity relationship pairs.

[0006] According to the knowledge graph construction method based on a large model provided by the application, the step of inputting the structured text data into a large model to obtain a plurality of groups of first entity relationship pairs corresponding to the structured text data comprises: inputting the structured text data into the large model to obtain a plurality of groups of first candidate entity relationship pairs output by the large model corresponding to the structured text data; performing data enhancement processing on the structured text data to obtain enhanced structured text data; and determining the plurality of groups of first entity relationship pairs based on the enhanced structured text data and the plurality of groups of first candidate entity relationship pairs.

[0007] According to the knowledge graph construction method based on a large model provided by the application, the step of determining the plurality of groups of first entity relationship pairs based on the enhanced structured text data and the plurality of groups of first candidate entity relationship pairs comprises: obtaining a plurality of groups of entity relationship pair labels in the enhanced structured text data; inputting the enhanced structured text data into the large model to obtain a plurality of groups of second candidate entity relationship pairs output by the large model corresponding to the enhanced structured text data; constantly updating model parameters of the large model based on differences between the plurality of groups of second candidate entity relationship pairs and respective corresponding entity relationship pair labels to obtain a target large model; and determining the plurality of groups of first entity relationship pairs based on the plurality of groups of first candidate entity relationship pairs and a plurality of groups of third candidate entity relationship pairs corresponding to the target large model.

[0008] According to the knowledge graph construction method based on a large model provided by the application, before the step of constructing a knowledge graph corresponding to the structured text data based on the second set of entity relationship pairs, the method further comprises: constructing a sharded storage system; uniformly sharding text data corresponding to the second set of entity relationship pairs based on a partitioning hash algorithm to obtain a plurality of data shards; and storing the plurality of data shards in respective storage nodes in the sharded storage system and obtaining a first inverted index corresponding to each of the data shards.

[0009] According to the method, after the knowledge graph corresponding to the structured text data is constructed based on the second entity relationship pair set, the method further comprises: based on a window processing technology, monitoring new structured text data and extracting incremental knowledge in the new structured text data that meets an updating condition; based on the incremental knowledge, updating the knowledge graph to obtain an updated knowledge graph; storing the incremental knowledge in a corresponding storage node in the sharded storage system, and updating the first inverted index to obtain a second inverted index.

[0010] According to the method, after the knowledge graph corresponding to the structured text data is constructed based on the second entity relationship pair set, the method further comprises: based on a window processing technology, monitoring new structured text data and extracting incremental knowledge in the new structured text data that meets an updating condition; based on the incremental knowledge, updating the knowledge graph to obtain an updated knowledge graph; storing the incremental knowledge in a corresponding storage node in the sharded storage system, and updating the first inverted index to obtain a second inverted index.

[0011] According to the method, the attention mechanism comprises a self-attention mechanism and a multi-head attention mechanism, and the alignment processing of the entities of different languages in the multiple groups of first entity relationship pairs is performed based on the graph embedding algorithm and the attention mechanism to obtain a first entity relationship pair set, comprising: based on the self-attention mechanism and the multi-head attention mechanism, performing multi-dimensional context representation on the multiple groups of first entity relationship pairs to obtain multi-dimensional context features; based on the graph embedding algorithm and the multi-dimensional context features, performing alignment processing on the entities of different languages in the multiple groups of first entity relationship pairs to obtain the first entity relationship pair set.

[0012] The application further provides a knowledge graph construction device based on a large model, comprising the following modules: A first determination module is configured to determine structured text data of a knowledge graph to be constructed. An input module is configured to input the structured text data into a large model to obtain multiple groups of first entity relationship pairs corresponding to the structured text data. An alignment processing module is configured to perform alignment processing on entities of different languages in the multiple groups of first entity relationship pairs based on a graph embedding algorithm and an attention mechanism to obtain a first entity relationship pair set. A deduplication processing module is configured to perform deduplication processing on entities in the first entity relationship pair set and corresponding relationship attributes between the entities to obtain a second entity relationship pair set. A construction module is configured to construct a knowledge graph corresponding to the structured text data based on the second entity relationship pair set.

[0013] The application further provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the knowledge graph construction method based on a large model according to any one of the above when executing the computer program.

[0014] The application further provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the knowledge graph construction method based on a large model according to any one of the above.

[0015] The application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the knowledge graph construction method based on a large model according to any one of the above.

[0016] The application provides a knowledge graph construction method, device, equipment and medium based on a large model, which determines structured text data of a knowledge graph to be constructed; inputs the structured text data into a large model to obtain a plurality of groups of first entity relationship pairs corresponding to the structured text data; performs alignment processing on entities of different languages in the plurality of groups of first entity relationship pairs based on a graph embedding algorithm and an attention mechanism to obtain a first entity relationship pair set; performs deduplication processing on entities and corresponding relationship attributes between the entities in the first entity relationship pair set to obtain a second entity relationship pair set; and constructs a knowledge graph corresponding to the structured text data based on the second entity relationship pair set. In this way, the attention mechanism is used to perform multi-dimensional context representation on entity relationship pairs, complex relationships in long texts are effectively identified, the alignment of entities and the deduplication of entities are realized through the graph embedding algorithm, the consistency of entity relationships is maintained, efficient fusion of cross-source data is realized, the semantic consistency and overall accuracy in the knowledge graph are improved, the knowledge graph has stronger expression ability and cross-domain adaptability, and is suitable for complex application scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0018] Figure 1 is a flowchart of the knowledge graph construction method based on a large model provided by the application.

[0019] Figure 2 is a structural diagram of the knowledge graph construction device based on a large model provided by the application.

[0020] Figure 3 is a structural schematic diagram of an electronic device provided by the present application. DETAILED DESCRIPTION

[0021] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below in conjunction with the accompanying drawings in the present application. Obviously, the described embodiments are a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0022] Knowledge graph, as a structured representation of knowledge, has been widely applied in search engines, recommendation systems, intelligent question answering, and other fields. However, despite the significant progress made in knowledge graph technology over the past few years, it still faces the following challenges: (1) High dependence on manual annotation: Rule-driven and shallow machine learning-based techniques heavily rely on manual annotation. These methods require a large amount of human effort to define rules and annotate data, increasing the construction cost and making the construction of knowledge graphs inefficient and difficult to expand. In addition, the quality of annotation directly affects the accuracy and completeness of the knowledge graph, and inconsistent annotation and human bias often lead to error accumulation in the construction of the knowledge graph. The root cause of this dependency problem lies in the lack of automated recognition of complex semantics in existing methods, which fail to fully utilize the advances in machine learning and natural language processing to achieve efficient and accurate automated construction. (2) Limited understanding and extraction of complex semantic relationships: Existing knowledge graph construction techniques have limitations in semantic understanding and relationship extraction, especially when dealing with long texts, polysemous words, and context-dependent relationships. For example, traditional shallow machine learning and deep learning models often fail to accurately capture semantic structures when identifying complex entity relationships, affecting the accuracy of knowledge extraction. Traditional techniques cannot support the accurate identification and extraction of multi-level entity relationships in complex contexts; (3) Insufficient fusion of multi-source heterogeneous data: Knowledge graph construction requires the integration of heterogeneous data from multiple sources (such as text, databases, web pages, etc.). However, existing techniques have limited ability to handle semantic consistency and redundancy elimination in heterogeneous data. The same entity may have multiple representations in different data sources, and traditional methods lack effective entity alignment and synonym disambiguation mechanisms, leading to entity duplication, information redundancy, and even semantic conflicts in the graph. This problem is particularly prominent in data with large domain span or involving multiple languages, affecting the overall accuracy and consistency of the knowledge graph; (4) Lack of real-time and dynamic expansion capabilities: In many application scenarios, knowledge graphs need to be updated in real-time to reflect the latest data changes. However, existing techniques lack the ability to update and dynamically expand in real-time, lacking effective incremental update mechanisms and real-time data processing capabilities, resulting in frequent full reconstruction during the update process, affecting real-time performance and system efficiency. This shortcoming is mainly due to the lack of stream processing and online learning techniques in traditional methods, making it difficult to adapt to high-speed data changes and limiting the application of knowledge graphs in rapidly evolving environments.

[0023] Based on the above problems, the application provides a knowledge graph construction method based on a large model, which effectively identifies complex relationships in long text through multi-dimensional context representation of entity relationship pairs by an attention mechanism, and then realizes entity alignment and entity deduplication through a graph embedding algorithm, maintains the consistency of entity relationships, and realizes efficient fusion of cross-source data, improves the semantic consistency and overall accuracy of the knowledge graph, makes the knowledge graph have stronger expression ability and cross-domain adaptability, and is suitable for complex application scenarios.

[0024] The application will be described below Figure 1 The application provides a knowledge graph construction method based on a large model, which can be applied to the construction of knowledge graphs in any field. The execution subject of the method can be an electronic device or a knowledge graph construction method based on a large model arranged in the electronic device. The knowledge graph construction method based on a large model can be realized by software, hardware, or a combination of both.

[0025] Figure 1 The application provides a knowledge graph construction method based on a large model, which can be applied to the construction of knowledge graphs in any field. The execution subject of the method can be an electronic device or a knowledge graph construction method based on a large model arranged in the electronic device. The knowledge graph construction method based on a large model can be realized by software, hardware, or a combination of both. Figure 1 As shown in the figure, the method comprises the following steps: Step 101, determining structured text data of a knowledge graph to be constructed.

[0026] Here, the structured text data can be directly obtained or obtained from different text data sources. The multiple initial data are preprocessed in format to obtain the structured text data. Here, the text data sources include but are not limited to new network websites, social media, databases, etc. The format processing includes but is not limited to cleaning, word segmentation, stop word removal, and format standardization processing, etc.

[0027] Step 102, inputting the structured text data into a large model to obtain multiple groups of first entity relationship pairs corresponding to the structured text data.

[0028] Here, the large model includes but is not limited to Bidirectional Encoder Representations from Transformers (BERT), Generative Pre-trained Transformer (GPT), etc.

[0029] It should be noted that a group of entity relationship pairs includes two entities and the relationship between the two entities, such as monkey-eat-banana, where monkey and banana are entities and eat is a relationship.

[0030] Specifically, the large model is used to extract multiple entity relationship pairs in the structured text data.

[0031] Optionally, the entity relationship pairs in the structured text data can be directly extracted by using the large model, or the large model can be fine-tuned and retrained to obtain a plurality of groups of first entity relationship pairs corresponding to the structured text data.

[0032] For example, the input of the structured text data into the large model to obtain a plurality of groups of first entity relationship pairs corresponding to the structured text data comprises: inputting the structured text data into the large model to obtain a plurality of groups of first candidate entity relationship pairs corresponding to the structured text data output by the large model; performing data enhancement processing on the structured text data to obtain enhanced structured text data; and determining the plurality of groups of first entity relationship pairs based on the enhanced structured text data and the plurality of groups of first candidate entity relationship pairs.

[0033] Optionally, the data enhancement processing includes but is not limited to synonym replacement, sentence disturbance, random insertion, deletion, exchange, etc.

[0034] Specifically, after obtaining the enhanced structured text data, the plurality of groups of first entity relationship pairs are determined based on the enhanced structured text data and the plurality of groups of first candidate entity relationship pairs.

[0035] Optionally, the method of determining the plurality of groups of first entity relationship pairs can be re-inputting the enhanced structured text data and the plurality of groups of first candidate entity relationship pairs into the large model to obtain the first entity relationship pairs, or determining a plurality of groups of second candidate entity relationship pairs corresponding to the enhanced structured text data, and determining the plurality of groups of first entity relationship pairs from the plurality of groups of first candidate entity relationship pairs and the plurality of groups of second candidate entity relationship pairs.

[0036] In the embodiments of the present application, by performing enhancement processing on the structured text data, the demand for manual annotation is significantly reduced, and the extracted entities and relationships based on the enhanced structured text data and the plurality of groups of first candidate entity relationship pairs have high accuracy and consistency, which provides the construction efficiency and knowledge coverage of the knowledge graph, effectively reduces the construction cost and improves the real-time performance of the graph.

[0037] Illustratively, the determining the plurality of first entity relationship pairs based on the enhanced structured text data and the plurality of first candidate entity relationship pairs comprises: obtaining a plurality of entity relationship pair labels in the enhanced structured text data; inputting the enhanced structured text data into the large model to obtain a plurality of second candidate entity relationship pairs output by the large model corresponding to the enhanced structured text data; based on the difference between the plurality of second candidate entity relationship pairs and the respective corresponding entity relationship pair labels, constantly updating the model parameters of the large model to obtain a target large model; and determining the plurality of first entity relationship pairs based on the plurality of first candidate entity relationship pairs and a plurality of third candidate entity relationship pairs corresponding to the target large model.

[0038] It should be noted that the plurality of entity relationship pair labels corresponding to the structured text data and the enhanced structured text data are partially or entirely the same, and therefore, if the entity relationship pair labels are labeled in the structured text data, only the entity relationship pair labels that are not labeled need to be labeled in the enhanced structured text data.

[0039] Optionally, the first entity relationship pair can be selected from the first candidate entity relationship pair and the third candidate entity relationship pair according to the confidence of each entity relationship pair, the candidate entity relationship pair with a confidence greater than or equal to a confidence threshold is retained, and the candidate entity relationship pair with a confidence less than the confidence threshold is deleted or the structured text data is processed again to extract the entity relationship pair again.

[0040] In the embodiment of the present application, the large model is trained by using the enhanced structured text data, the accuracy of extracting entities and relationships of the large model is improved, the construction efficiency and knowledge coverage of the knowledge graph are improved, the extracted entities and relationships have high accuracy and consistency, the construction cost is effectively reduced, and the real-time performance of the graph is improved.

[0041] In step 103, the entities in different languages in the plurality of first entity relationship pairs are aligned based on a graph embedding algorithm and an attention mechanism to obtain a first entity relationship pair set.

[0042] Here, the alignment processing refers to uniformly mapping the same or similar entities represented in different languages.

[0043] Here, the entities in the plurality of first entity relationship pairs are represented in context by the attention mechanism, the semantic understanding of the entities is performed according to the context representation, and then the same or similar entities represented in different languages are uniformly mapped according to the graph embedding algorithm.

[0044] Exemplarily, the attention mechanism includes a self-attention mechanism and a multi-head attention mechanism, and the alignment of entities in different languages in the multiple sets of first entity relation pairs is performed based on the graph embedding algorithm and the attention mechanism to obtain a first entity relation pair set, including: performing multi-dimensional context representation on the multiple sets of first entity relation pairs based on the self-attention mechanism and the multi-head attention mechanism to obtain multi-dimensional context features; and performing alignment of entities in different languages in the multiple sets of first entity relation pairs based on the graph embedding algorithm and the multi-dimensional context features to obtain the first entity relation pair set.

[0045] In the embodiment of the application, the entity relation pair is represented in multi-dimensional context by the self-attention mechanism and the multi-attention mechanism, the complex relationship in the long text is effectively identified, and then the alignment of entities and the deduplication of entities are realized by the graph embedding algorithm, the consistency of the entity relation is maintained, the efficient fusion of cross-source data is realized, the semantic consistency and the overall accuracy in the knowledge graph are improved, the knowledge graph has stronger expression ability and cross-domain adaptability, and is suitable for complex application scenarios.

[0046] Step 104: Deduplication is performed on the entities and the corresponding relation attributes between the entities in the first entity relation pair set to obtain a second entity relation pair set.

[0047] Here, the deduplication can be understood as synonym disambiguation or removal of duplicate relations.

[0048] Optionally, the deduplication can be performed by using the graph embedding algorithm.

[0049] The second entity relation pair set includes a standardized knowledge representation after deduplication.

[0050] Step 105: Based on the second entity relation pair set, a knowledge graph corresponding to the structured text data is constructed.

[0051] Here, all entity relation pairs in the second entity relation pair set can be represented in the form of a graph, where an entity represents a node and a relation represents an edge.

[0052] In the embodiment of the present application, by determining the structured text data to be constructed into a knowledge graph; inputting the structured text data into a large model to obtain a plurality of sets of first entity relationship pairs corresponding to the structured text data; based on a graph embedding algorithm and an attention mechanism, aligning the entities of different languages in the plurality of sets of first entity relationship pairs to obtain a first set of entity relationship pairs; performing deduplication processing on the entities and the corresponding relationship attributes between the entities in the first set of entity relationship pairs to obtain a second set of entity relationship pairs; and based on the second set of entity relationship pairs, constructing a knowledge graph corresponding to the structured text data. In this way, the attention mechanism is used to represent the entity relationship pairs in multiple dimensions, effectively identifying complex relationships in long text, and then the graph embedding algorithm is used to align the entities and deduplicate the entities, maintain the consistency of the entity relationships, and efficiently fuse cross-source data, improve the semantic consistency and overall accuracy of the knowledge graph, and make the knowledge graph have stronger expression ability and cross-domain adaptability, suitable for complex application scenarios. It should be noted that in many application scenarios, the knowledge graph needs to be updated in real time to reflect the latest data changes. However, the existing technology lacks the ability to update and dynamically expand in real time, lacks an effective incremental update mechanism and real-time data processing capability, resulting in the need for frequent full reconstruction of the knowledge graph during the update process, affecting real-time performance and system efficiency. Therefore, a sharded storage system and an incremental update mechanism are proposed for the update problem. The following is a description of the storage and update of the knowledge graph.

[0053] In the embodiment of the present application, before the knowledge graph corresponding to the structured text data is constructed based on the second set of entity relationship pairs, the method further comprises: constructing a sharded storage system; based on a partitioning hash algorithm, uniformly sharding the text data corresponding to the second set of entity relationship pairs to obtain a plurality of data shards; and storing the plurality of data shards in each storage node in the sharded storage system and obtaining a first inverted index corresponding to each data shard.

[0054] Here, the sharded storage system can be a sharded storage system of a distributed architecture, and the sharded storage system is a system that stores data in different storage nodes. The storage node can be a physical node or a virtual storage node.

[0055] The partitioning hash algorithm is a technique for uniformly distributing data to different partitions. The partitioning hash algorithm maps data shards to different partitions based on the use of a hash algorithm on the partition key.

[0056] Here, the inverted index refers to quickly locating document data containing the keywords according to the keywords. After storing each text data, a first inverted index is generated to quickly search for documents later, improving search efficiency.

[0057] In the embodiment of the present application, differentiated storage and retrieval strategies are adopted for cold data and hot data, for example, cold data adopts a low-cost mass storage device, and retrieval can adopt asynchronous query with low query frequency; hot data adopts a high-performance device for storage, supports real-time data query, and has high response speed.

[0058] In the embodiment of the present application, by sharded storage of data, the data processing and retrieval efficiency is significantly improved in a large-scale data environment, the computing and storage resource overhead is effectively reduced, and efficient construction and dynamic management of a knowledge graph in a distributed environment are realized.

[0059] Further, after the knowledge graph corresponding to the structured text data is constructed based on the second set of entity relation pairs, the method further comprises: monitoring new structured text data and extracting incremental knowledge meeting an update condition in the new structured text data based on a window processing technology; updating the knowledge graph based on the incremental knowledge to obtain an updated knowledge graph; storing the incremental knowledge into a corresponding storage node in the sharded storage system, and updating the first inverted index to obtain a second inverted index.

[0060] Here, the window processing technology refers to using a sliding window to obtain a certain amount of text data in the new structured text data, identifying whether there is incremental knowledge meeting the update condition in the amount of text data, and only when there is incremental knowledge, updating the knowledge graph according to the incremental knowledge to obtain an updated knowledge graph, and updating the stored inverted index corresponding to the text data.

[0061] Here, the update condition can be updating the attributes of an entity, or adding an entity or a relationship attribute between entities that does not exist in the current knowledge graph.

[0062] It should be noted that knowledge reasoning can be performed in the process of updating the knowledge graph, the data of the existing knowledge base is learned, the logical relationship in the data is understood, and the implicit relationship between entities is inferred.

[0063] In the embodiment of the present application, by the window processing technology and the incremental update mechanism, the knowledge graph is dynamically adapted to rapidly changing data sources, and real-time reflection of the latest information is realized.

[0064] Further, after the knowledge graph corresponding to the structured text data is constructed based on the second set of entity relation pairs, the method further comprises: performing multi-dimensional quality evaluation on the knowledge graph to obtain an evaluation result; in a case where the evaluation result does not satisfy an evaluation condition, retraining a large model or adjusting the structured text data; and re-constructing the knowledge graph based on the retrained large model and / or the adjusted structured text data.

[0065] Here, the multi-dimensional quality evaluation can include accuracy, consistency, timeliness, etc., and in the case that the evaluation result does not meet the respective evaluation conditions, the large model is retrained or the structured text data is adjusted, the entity relationship pairs are re-extracted, and then the knowledge graph is re-constructed.

[0066] Here, the evaluation conditions can include respective evaluation quality thresholds.

[0067] Optionally, the knowledge graph can be evaluated immediately after each update, or the updated knowledge graph can be periodically evaluated at a fixed period.

[0068] In the embodiments of the present application, through the multi-dimensional evaluation system, the high quality of the knowledge graph is ensured, and technical support is provided for the stability and accuracy of the knowledge graph in a dynamic data environment.

[0069] In addition to the above-mentioned high dependence on artificial annotation, limited understanding and extraction ability of complex semantic relationships, insufficient fusion of source heterogeneous data, lack of real-time performance and dynamic expansion capability, etc., the knowledge construction method can also include insufficient generalization ability and cross-domain adaptability, and the existing knowledge graph construction technology is usually applicable to data in a specific field. When facing new fields or complex tasks, the generalization ability and robustness of the model are poor. Traditional shallow machine learning and part of the deep learning model lack the ability of domain adaptation, and large-scale pre-training models often need to be re-tuned when crossing domains. The model is difficult to effectively adapt to the semantic differences of different fields, which limits the application expansion of the knowledge graph in diversified scenarios. The root cause of this problem is that the existing technology fails to combine transfer learning and multi-task learning, and lacks an efficient adaptation mechanism for new domains.

[0070] To solve the problem of insufficient generalization ability and cross-domain adaptability, the present application can adjust the pre-training model for domain adaptability through transfer learning technology, introduce a feature extractor and an adversarial training module, so that the robustness and adaptability of the model in new domain tasks are enhanced, effectively improving the data security and compliance of the knowledge graph in multi-domain applications, and maintaining high accuracy and robustness in different tasks and domains, realizing the cross-domain application of the knowledge graph and the improvement of the intelligent level.

[0071] The following are application scenarios of the knowledge graph construction method based on large models provided by the present application.

[0072] The application scenario takes a cross-language medical knowledge graph construction method as an example for illustration, and specifically includes: (1) multi-language data acquisition and preprocessing, data (labeled as data A1, A2, etc.) is acquired from multi-language medical literature and databases, the text data of each language is cleaned, segmented and format standardized, and is converted into structured text data to ensure the consistency and standardization of multi-language data; (2) entity and relationship extraction of domain-specific models, a domain-specific pre-training model is used to extract medical entities and relationships from the preprocessed data A1, A2, etc. To improve the recognition accuracy of the model for medical terms, entity-relation pairs (labeled as data B1, B2, etc.) are generated by using model fine-tuning and data enhancement techniques (such as medical dictionary expansion), and high-confidence knowledge units are selected; (3) cross-language entity alignment and data fusion, when multi-language fusion is performed on the selected data B1, B2, etc., machine translation and bilingual word embedding techniques are used to align entities of different languages, and graph embedding algorithms are used for multi-language synonym disambiguation to ensure the semantic consistency and cross-language applicability of the medical knowledge graph, and a unified medical knowledge representation (labeled as data C) is generated; (4) cross-language distributed storage and dynamic indexing, data C is stored in a distributed storage system, the retrieval efficiency is optimized by using inverted indexing and multi-language retrieval mechanisms, and different language data is dynamically sharded by using partitioning hashing techniques to achieve efficient storage management for cross-language retrieval; (5) incremental updating and quality evaluation, window flow processing technology is used to monitor newly added multi-language medical data, and incremental updating is realized by using a sliding window to dynamically update medical knowledge that meets the conditions to the knowledge graph. The comprehensive quality of the knowledge graph is regularly checked in combination with multi-dimensional evaluation indexes such as accuracy, consistency and timeliness, and the data or model is adjusted when necessary to ensure the high quality and applicability of the medical knowledge graph in a cross-language environment.

[0073] The knowledge graph construction method based on a large model provided by the application greatly improves the efficiency of knowledge graph construction, reduces the dependence on manual annotation, and significantly reduces the labor and time costs; advanced multi-source data fusion and distributed processing techniques are used to optimize the data consistency, storage and processing efficiency of the knowledge graph, which can cope with large-scale and rapidly changing data environments, and the incremental updating and multi-dimensional quality evaluation mechanism ensures the real-time and accuracy of the knowledge graph, which is suitable for high dynamic application requirements.

[0074] The knowledge graph construction method based on a large model provided by the application greatly improves the efficiency of knowledge graph construction, reduces the dependence on manual annotation, and significantly reduces the labor and time costs; advanced multi-source data fusion and distributed processing techniques are used to optimize the data consistency, storage and processing efficiency of the knowledge graph, which can cope with large-scale and rapidly changing data environments, and the incremental updating and multi-dimensional quality evaluation mechanism ensures the real-time and accuracy of the knowledge graph, which is suitable for high dynamic application requirements.

[0075] Figure 2 is a structural schematic diagram of the knowledge graph construction device based on a large model provided by the application, as Figure 2As shown, the large model-based knowledge graph construction apparatus 200 comprises the following: A determination module 210 is configured to determine structured text data of a knowledge graph to be constructed. An input module 220 is configured to input the structured text data into a large model to obtain a plurality of groups of first entity relationship pairs corresponding to the structured text data. An alignment processing module 230 is configured to perform alignment processing on entities of different languages in the plurality of groups of first entity relationship pairs based on a graph embedding algorithm and an attention mechanism to obtain a first set of entity relationship pairs. A deduplication processing module 240 is configured to perform deduplication processing on entities and corresponding relationship attributes between the entities in the first set of entity relationship pairs to obtain a second set of entity relationship pairs. A construction module 250 is configured to construct a knowledge graph corresponding to the structured text data based on the second set of entity relationship pairs.

[0076] In another embodiment, the input module 220 is specifically configured to: input the structured text data into a large model to obtain a plurality of groups of first candidate entity relationship pairs output by the large model corresponding to the structured text data; perform data augmentation processing on the structured text data to obtain augmented structured text data; and determine the plurality of groups of first entity relationship pairs based on the augmented structured text data and the plurality of groups of first candidate entity relationship pairs.

[0077] In another embodiment, the input module 220 is further specifically configured to: obtain a plurality of groups of entity relationship pair labels in the augmented structured text data; input the augmented structured text data into the large model to obtain a plurality of groups of second candidate entity relationship pairs output by the large model corresponding to the augmented structured text data; constantly update model parameters of the large model based on differences between the plurality of groups of second candidate entity relationship pairs and respective corresponding entity relationship pair labels to obtain a target large model; and determine the plurality of groups of first entity relationship pairs based on a plurality of groups of third candidate entity relationship pairs corresponding to the plurality of groups of first candidate entity relationship pairs and the target large model.

[0078] In another embodiment, after the knowledge graph corresponding to the structured text data is constructed based on the second set of entity relationship pairs, the large model-based knowledge graph construction apparatus 200 further comprises a storage module specifically configured to: construct a sharded storage system; uniformly shard text data corresponding to the second set of entity relationship pairs based on a partitioning hash algorithm to obtain a plurality of data shards; and store the plurality of data shards in respective storage nodes in the sharded storage system and obtain first inverted indexes corresponding to the data shards.

[0079] In another embodiment, after the knowledge graph corresponding to the structured text data is constructed based on the second set of entity relation pairs, the large model based knowledge graph construction apparatus 200 further comprises an updating module, specifically configured to: based on window processing technology, monitor new structured text data and extract incremental knowledge in the new structured text data that meets the updating condition; based on the incremental knowledge, update the knowledge graph to obtain an updated knowledge graph; store the incremental knowledge in the corresponding storage node in the sharded storage system, and update the first inverted index to obtain a second inverted index.

[0080] In another embodiment, after the knowledge graph corresponding to the structured text data is constructed based on the second set of entity relation pairs, the large model based knowledge graph construction apparatus 200 further comprises an evaluation module, specifically configured to: perform multi-dimensional quality evaluation on the knowledge graph to obtain an evaluation result; in the case that the evaluation result does not satisfy the evaluation condition, retrain the large model or adjust the structured text data; based on the retrained large model and / or the adjusted structured text data, re-construct the knowledge graph.

[0081] In another embodiment, the alignment processing module 230 is specifically configured to: based on the self-attention mechanism and the multi-head attention mechanism, perform multi-dimensional context representation on the multiple groups of first entity relation pairs to obtain multi-dimensional context features; based on a graph embedding algorithm and the multi-dimensional context features, perform alignment processing on entities of different languages in the multiple groups of first entity relation pairs to obtain a first set of entity relation pairs.

[0082] Figure 3 is a structural schematic diagram of an electronic device provided by the present application, as Figure 3As shown, the electronic device can include a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 complete mutual communication through the communications bus 840. The processor 810 can invoke the logic instructions in the memory 830 to execute the large model-based knowledge graph construction method, which includes: determining structured text data of a knowledge graph to be constructed; inputting the structured text data into a large model to obtain a plurality of first entity relationship pairs corresponding to the structured text data; based on a graph embedding algorithm and an attention mechanism, aligning entities of different languages in the plurality of first entity relationship pairs to obtain a first entity relationship pair set; performing deduplication processing on entities and corresponding relationship attributes between entities in the first entity relationship pair set to obtain a second entity relationship pair set; and based on the second entity relationship pair set, constructing a knowledge graph corresponding to the structured text data.

[0083] In addition, the logic instructions in the memory 830 described above can be implemented in the form of a software functional unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.

[0084] In another aspect, the present application also provides a computer program product comprising a computer program, which can be stored on a non-transitory computer-readable storage medium, and the computer program can be executed by a processor to enable a computer to perform the knowledge graph construction method based on a large model provided by the above method, which comprises: determining structured text data of a knowledge graph to be constructed; inputting the structured text data into a large model to obtain a plurality of first entity relationship pairs corresponding to the structured text data; performing alignment processing on entities of different languages in the plurality of first entity relationship pairs based on a graph embedding algorithm and an attention mechanism to obtain a first entity relationship pair set; performing deduplication processing on entities and corresponding relationship attributes between entities in the first entity relationship pair set to obtain a second entity relationship pair set; and constructing a knowledge graph corresponding to the structured text data based on the second entity relationship pair set.

[0085] In yet another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a knowledge graph construction method based on a large model provided by the above method, which comprises: determining structured text data of a knowledge graph to be constructed; inputting the structured text data into a large model to obtain a plurality of first entity relationship pairs corresponding to the structured text data; performing alignment processing on entities of different languages in the plurality of first entity relationship pairs based on a graph embedding algorithm and an attention mechanism to obtain a first entity relationship pair set; performing deduplication processing on entities and corresponding relationship attributes between entities in the first entity relationship pair set to obtain a second entity relationship pair set; and constructing a knowledge graph corresponding to the structured text data based on the second entity relationship pair set.

[0086] The device embodiments described above are only schematic, wherein the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment scheme. Those skilled in the art can understand and implement it without creative labor.

[0087] Those skilled in the art can clearly understand the technical solutions of the various embodiments from the above description of the embodiments, and the various embodiments can be implemented by means of software with the necessary general hardware platforms, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0088] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for constructing a knowledge graph based on a large model, characterized in that, The method comprises: determining structured text data to be constructed into a knowledge graph; inputting the structured text data into a large model to obtain a plurality of first entity relationship pairs corresponding to the structured text data; aligning entities in different languages in the plurality of first entity relationship pairs based on a graph embedding algorithm and an attention mechanism to obtain a first entity relationship pair set; de-duplicating entities and corresponding relationship attributes between the entities in the first entity relationship pair set to obtain a second entity relationship pair set; constructing a knowledge graph corresponding to the structured text data based on the second entity relationship pair set. 2.The large model-based knowledge graph construction method of claim 1, wherein, The method comprises: inputting the structured text data into a large model to obtain a plurality of first candidate entity relationship pairs output by the large model corresponding to the structured text data; performing data enhancement processing on the structured text data to obtain enhanced structured text data; determining the plurality of first entity relationship pairs based on the enhanced structured text data and the plurality of first candidate entity relationship pairs. 3.The large model-based knowledge graph construction method of claim 2, wherein, The method comprises: obtaining a plurality of entity relationship pair labels in the enhanced structured text data; inputting the enhanced structured text data into the large model to obtain a plurality of second candidate entity relationship pairs output by the large model corresponding to the enhanced structured text data; continuously updating model parameters of the large model based on differences between the plurality of second candidate entity relationship pairs and respective corresponding entity relationship pair labels to obtain a target large model; determining the plurality of first entity relationship pairs based on a plurality of third candidate entity relationship pairs corresponding to the plurality of first candidate entity relationship pairs and the target large model. 4.The large model-based knowledge graph construction method of claim 1, wherein, Before the method of constructing the knowledge graph corresponding to the structured text data based on the second entity relationship pair set, the method further comprises: constructing a sharded storage system; uniformly sharding text data corresponding to the second entity relationship set based on a partitioning hash algorithm to obtain a plurality of data shards; storing the plurality of data shards in respective storage nodes in the sharded storage system and obtaining first inverted indexes corresponding to the data shards. 5.The large model-based knowledge graph construction method of claim 4, wherein, After the method of constructing the knowledge graph corresponding to the structured text data based on the second entity relationship pair set, the method further comprises: monitoring new structured text data based on a window processing technique and extracting incremental knowledge in the new structured text data that meets an updating condition; updating the knowledge graph based on the incremental knowledge to obtain an updated knowledge graph; storing the incremental knowledge in a corresponding storage node in the sharded storage system and updating the first inverted indexes to obtain second inverted indexes. 6.The large model-based knowledge graph construction method of claim 1, wherein, After the method of constructing the knowledge graph corresponding to the structured text data based on the second entity relationship pair set, the method further comprises: The knowledge graph is multi-dimensionally quality evaluated to obtain an evaluation result; In a case where the evaluation result does not satisfy an evaluation condition, retraining a large model or adjusting the structured text data; Based on the retrained large model and / or the adjusted structured text data, the knowledge graph is reconstructed. 7.The large model-based knowledge graph construction method of claim 1, wherein, The attention mechanism includes a self-attention mechanism and a multi-head attention mechanism, and the different-language entities in the multiple groups of first entity relation pairs are aligned based on the graph embedding algorithm and the attention mechanism to obtain a first entity relation pair set, including: Based on the self-attention mechanism and the multi-head attention mechanism, the multiple groups of first entity relation pairs are represented in a multi-dimensional context to obtain multi-dimensional context features; Based on the graph embedding algorithm and the multi-dimensional context features, the different-language entities in the multiple groups of first entity relation pairs are aligned to obtain a first entity relation pair set. 8.A large model-based knowledge graph construction apparatus, characterized by comprising: It includes: A first determining module configured to determine structured text data of a knowledge graph to be constructed; An input module configured to input the structured text data into a large model to obtain multiple groups of first entity relation pairs corresponding to the structured text data; An alignment processing module configured to align different-language entities in the multiple groups of first entity relation pairs based on a graph embedding algorithm and an attention mechanism to obtain a first entity relation pair set; A deduplication processing module configured to deduplicate entities and corresponding relation attributes between the entities in the first entity relation pair set to obtain a second entity relation pair set; A constructing module configured to construct a knowledge graph corresponding to the structured text data based on the second entity relation pair set.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The processor executes the computer program to implement the large-model-based knowledge graph construction method in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the large-model-based knowledge graph construction method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method, device and equipment for constructing science and technology knowledge graph in power field and medium

    CN117390198A

  • Semi-supervised entity alignment method based on multi-hop attention mechanism

    CN118153679A

  • Industrial innovation knowledge graph dynamic construction method based on large language model

    CN120179832A