Knowledge graph construction method and system based on unsupervised learning

The knowledge graph is constructed through unsupervised learning methods, which solves the problem that traditional methods rely on manual definition rules and large amounts of labeled data, and realizes efficient and accurate knowledge extraction and graph construction, improving the credibility and task performance of the knowledge graph.

CN119474405AActive Publication Date: 2025-02-18BEIJING INFORMATION TECH COLLEGE
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411699183.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-02-18
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

The prior art relies on manual definition rules and a large amount of labeled data in the construction of knowledge graphs, resulting in high cost and low efficiency, and the quality and richness of extracted knowledge need to be improved.

Method used

Adopt the knowledge graph construction method based on unsupervised learning to improve data quality through preprocessing and word segmentation, use pre-trained language models to identify entities and eliminate ambiguity, use unsupervised models to extract entity relationships, and build entity relationship weight calculation formulas to improve knowledge The credibility of the map.

Benefits of technology

It reduces labor costs, improves the quality and efficiency of knowledge extraction, realizes efficient transformation from unstructured text to structured knowledge, and improves the credibility and task performance of the knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474405A_ABST
    Figure CN119474405A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of knowledge graphs, in particular to a knowledge graph construction method and system based on unsupervised learning, and the method comprises the steps: obtaining text data, carrying out the preprocessing of the collected text data, and carrying out the word segmentation of the text data, and obtaining a word segmentation result of the text data; based on a pre-training language model, performing entity recognition on the word segmentation result of the text data, and performing ambiguity elimination on an entity recognition result in the text data; an unsupervised model is adopted to extract entity relationships, and entities and entity relationship triples are generated; constructing an entity relationship weight calculation formula, mapping entity relationship weights into entity relationship confidence coefficients, and filtering entity relationships with confidence coefficient values lower than a threshold value; and constructing a knowledge graph of the text data based on the entities extracted from the text data and the entity relationship. According to the method, the efficiency and quality of knowledge graph construction are improved, and important knowledge support is provided for knowledge-driven applications such as intelligent search, questions and answers, recommendation and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph technology, and specifically to a method and system for constructing a knowledge graph based on unsupervised learning. Background Art

[0002] Knowledge graph is a structured semantic knowledge base used to describe entities and their relationships. It is widely used in intelligent search, question-answering systems, recommendation systems and other fields.

[0003] Traditional knowledge graph construction methods mainly rely on manually defined entities and large amounts of labeled data, which is time-consuming and labor-intensive.

[0004] Existing text knowledge graph construction methods are mainly divided into three categories: rule-based, supervised learning-based, and unsupervised learning-based.

[0005] The rule-based method requires manual definition of complex templates and rules and has poor generalization ability; the supervised learning-based method requires a large amount of high-quality labeled data and has high labor costs; the unsupervised learning-based method does not require manual definition of rules and labeled data and can automatically mine the knowledge contained in the text, but the quality and richness of the extracted knowledge needs to be improved.

[0006] In terms of entity recognition, traditional methods are mainly based on dictionary matching, conditional random fields and other methods, and have limited generalization capabilities.

[0007] In recent years, named entity recognition methods based on deep learning have made significant progress, especially pre-trained language models such as BERT and RoBERTa, which can make full use of semantic knowledge in large-scale corpora and greatly improve entity recognition effects.

[0008] However, it is not enough to just identify entities. It is also necessary to disambiguate entities with the same name and link them to standard entities in the knowledge base.

[0009] In terms of relationship extraction, early methods were mainly based on pattern matching, heuristic rules, etc., which were easily restricted by manually defined rules and patterns.

[0010] With the development of semantic parsing technology, researchers have proposed some relationship extraction methods based on supervised learning, which extract entity pairs and relationship trigger words from syntactic analysis trees or semantic dependency graphs, and then use classification models to determine the relationship type.

[0011] This type of method can handle complex sentence structures and extract implicit relationships, but it requires a large amount of labeled data.

[0012] Therefore, there is an urgent need for an end-to-end, efficient and accurate knowledge graph construction method that can fully mine the structured knowledge in text data, reduce labor costs, and improve the quality and efficiency of knowledge extraction.

[0013] The present invention is proposed in this context, and aims to provide a method and system for constructing a knowledge graph based on unsupervised learning. Summary of the invention

[0014] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for constructing a knowledge graph based on unsupervised learning, comprising: Acquire text data, preprocess the collected text data, and segment the text data to obtain segmentation results of the text data; Based on the pre-trained language model, entity recognition is performed on the word segmentation results of the text data, and the entity recognition results in the text data are disambiguated; Use unsupervised models to extract entity relationships and generate entity and entity relationship triplets; Construct an entity relationship weight calculation formula, map the entity relationship weight to the entity relationship confidence, and filter out entity relationships with confidence values ​​below a threshold; Based on the entities and entity relationships extracted from text data, a knowledge graph of text data is constructed.

[0015] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, the text data is preprocessed to remove label data and symbol data in the text data; based on a dictionary and a word segmentation tool, the text in the text data is divided into word sequences; Based on predefined dictionaries and rules, the text is segmented using the forward maximum matching algorithm: the text data Indicated by A sequence of words: ; Definition Dictionary , which contains Words: Scan text from left to right , find the longest word match; set up is the current scanning position, For the end position of the word , determine the substring Is it in the dictionary In; if the substring In the dictionary, As a word, Move to position; if the substring If it is not in the dictionary, Move to Repeat the scanning process until , get the word segmentation result of text data .

[0016] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, wherein: a RoBERTa pre-trained model is selected as an entity recognition model, and on the basis of the RoBERTa pre-trained model, the RoBERTa pre-trained model is adjusted to add a network layer specific to entity recognition, including a linear layer and a CRF layer; The word segmentation results are input into the adjusted model to obtain the label probability distribution of each word segmentation, and the Viterbi algorithm is used to decode to obtain the optimal label sequence; the entities and types are extracted to obtain the entity recognition results; For each entity recognition result, retrieve candidate entities with the same name from the knowledge base of the RoBERTa pre-trained model and calculate the entity With candidate entities Similarity ; Select the candidate entity with the highest similarity As a link object: in, is a collection of entities in the knowledge base. Link to selected candidate entity , to eliminate ambiguity.

[0017] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, the OpenIE model is selected as the unsupervised entity relationship extraction model; The preprocessed text data and entity recognition results are input into the OpenIE model. The OpenIE model extracts entity relationships through the steps of syntactic analysis, entity recognition, relationship trigger word recognition, relationship definition, and triple generation. The syntactic analysis includes using a dependency syntactic analyzer to perform syntactic analysis on the input text to identify the subject, predicate and object components of the sentence; The entity recognition includes locating an entity in a sentence using pre-recognized entity information; The relationship trigger word identification includes identifying trigger words representing entity relationships according to syntactic analysis results and predefined rules; The relationship definition includes defining the boundary of the entity relationship and extracting the entity relationship according to the trigger word and the location of the entity mention; The triple generation includes combining entity pairs and relationship descriptions into triples , representing the entity and entities There is a relationship between .

[0018] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, a formula for calculating entity relationship weights is constructed to calculate the relationship weights between entities: in, and Represents an entity; is the release date decay index of the text data; is the date on which the text data was published; is the current date; is the parameter; For text data Source index; and Entity and entities In the article The word frequency in For text data The maximum frequency of entities in .

[0019] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, wherein: for the extracted relationship , mapping entity relationship weights to entity and entity relationship confidences: in, It is the confidence of entity and entity relationship, indicating the credibility of the existence of entity and entity relationship.

[0020] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, the confidence threshold is set , filter out entities and entity relationships whose confidence does not meet the requirements: like , then the entity is considered and entities The relationship between them does not exist; like , then the entity is considered and entities There is a relationship between them.

[0021] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, the knowledge graph of the text data is constructed based on the entities and entity relationships extracted from the text data; an undirected weighted knowledge graph is defined. ,in Represents a collection of entity nodes, represents the entity relationship edge set, Represents the entity relationship weight set; For each triple that meets the confidence requirement , perform the following steps: Step a: The entity and entities Add to Node Collection middle: ; Step b: Entity relationships As an undirected edge Add to edge set middle: ; Step c: Assign entity relationship confidence As edge The weight is added to the weight set middle: ; Step d: If the entity and entities If there are multiple entity relationships, the relationship with the highest confidence is selected As an entity and entities The edges between: ; Repeat steps a to d until all triples that meet the confidence requirements have been processed.

[0022] As a preferred solution of the method for constructing a knowledge graph based on unsupervised learning described in the present invention, after processing all triples, the entity nodes are obtained. , entity relationship edge and entity relationship weights Undirected weighted knowledge graph composed of , where the node Indicates Entity; Edge Representing Entities and entities There is a semantic relationship between them; weight Represents edge The corresponding entity relationship confidence reflects the credibility of the entity relationship.

[0023] A system for constructing a knowledge graph based on unsupervised learning, which is used to implement a method for constructing a knowledge graph based on unsupervised learning, including: a data acquisition module, an entity recognition module, an entity relationship extraction module, an entity relationship weight calculation module, and a knowledge graph module; The data acquisition module is used to acquire text data, pre-process the collected text data, and segment the text data to obtain the segmentation results of the text data; The entity recognition module performs entity recognition on the word segmentation results of the text data based on the pre-trained language model, and eliminates ambiguity on the entity recognition results in the text data; The entity relationship extraction module uses an unsupervised model to extract entity relationships and generate entity and entity relationship triplets; The entity relationship weight calculation module constructs an entity relationship weight calculation formula, maps the entity relationship weight to the entity relationship confidence, and filters the entity relationships whose confidence values ​​are lower than a threshold; The knowledge graph module constructs a knowledge graph of text data based on entities and entity relationships extracted from text data.

[0024] Beneficial effects of the present invention: The present invention improves data quality through preprocessing and word segmentation, provides structured word sequence input for subsequent steps, and improves processing efficiency and accuracy.

[0025] The present invention utilizes a pre-trained language model for entity recognition and ambiguity elimination, fully utilizes the semantic knowledge learned by the model, and improves the accuracy and consistency of entity recognition.

[0026] The present invention adopts an unsupervised model to automatically extract entity relationships, without the need to manually define complex rules, reducing labor costs and extracting rich and comprehensive entity relationship knowledge.

[0027] The present invention constructs a weight calculation formula and filters low-confidence relationships, calculates weights based on multiple factors, and improves the credibility of entity relationships in the knowledge graph.

[0028] The present invention constructs a knowledge graph to achieve the conversion from unstructured text to structured knowledge, provides high-level semantic representation for knowledge-driven tasks, and improves task performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them: Figure 1 Provide a flow chart of the method for constructing an unsupervised learning knowledge graph for the present invention; Figure 2 A structural diagram of the unsupervised learning knowledge graph construction system provided by the present invention. DETAILED DESCRIPTION

[0030] In order to make the above-mentioned purposes, features and advantages of the present invention more understandable, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0031] Example 1 See also Figure 1 The first embodiment of the present invention provides a method for constructing a knowledge graph based on unsupervised learning.

[0032] S1: Acquire text data, preprocess the collected text data, and segment the text data to obtain segmentation results of the text data.

[0033] Acquire text data, preprocess the text data, remove label data and symbol data in the text data; divide the text in the text data into word sequences based on dictionaries and word segmentation tools.

[0034] Based on predefined dictionaries and rules, the text is segmented using the forward maximum matching algorithm: the text data Indicated by A sequence of words: .

[0035] Definition Dictionary , which contains Words: Scan text from left to right , find the longest word match.

[0036] set up is the current scanning position, For the end position of the word , determine the substring Is it in the dictionary In.

[0037] If the substring In the dictionary, As a word, Move to position; if the substring If it is not in the dictionary, Move to Repeat the scanning process until , get the word segmentation result of text data .

[0038] This step removes noise data by preprocessing and segmenting text data, converting unstructured text into structured word sequence representation, providing high-quality input data for subsequent entity recognition and relationship extraction steps, and improving the availability and processing efficiency of text data.

[0039] S2: Based on the pre-trained language model, perform entity recognition on the word segmentation results of the text data and eliminate ambiguity on the entity recognition results in the text data.

[0040] The RoBERTa pre-trained model is selected as the entity recognition model, and based on the RoBERTa pre-trained model, the RoBERTa pre-trained model is adjusted to add entity recognition specific network layers, including linear layers and CRF layers.

[0041] The word segmentation results are input into the adjusted model to obtain the label probability distribution of each word segmentation, and the Viterbi algorithm is used to decode to obtain the optimal label sequence; the entities and types are extracted to obtain the entity recognition results.

[0042] For each entity recognition result, retrieve candidate entities with the same name from the knowledge base of the RoBERTa pre-trained model and calculate the entity With candidate entities Similarity ; Select the candidate entity with the highest similarity As a link object: in, is a collection of entities in the knowledge base. Link to selected candidate entity , to eliminate ambiguity.

[0043] This step uses the pre-trained RoBERTa language model for entity recognition, making full use of the rich semantic knowledge learned by the model on large-scale corpus and improving the accuracy of entity recognition.

[0044] At the same time, through entity ambiguity elimination, the linking problem of entities with the same name is solved, and the accuracy and consistency of entity recognition results are improved.

[0045] S3: Use an unsupervised model to extract entity relationships and generate entity and entity relationship triplets.

[0046] The OpenIE model is selected as the unsupervised entity relationship extraction model; OpenIE is a model that can automatically discover entity relationship patterns from text without manually defining relationship templates or annotating training data.

[0047] The preprocessed text data and entity recognition results are input into the OpenIE model. The OpenIE model extracts entity relationships through the steps of syntactic analysis, entity recognition, relationship trigger word recognition, relationship definition, and triple generation.

[0048] The syntactic analysis includes using a dependency syntactic analyzer to perform syntactic analysis on the input text to identify the subject, predicate and object components of the sentence.

[0049] The entity recognition includes locating entities in a sentence using pre-recognized entity information.

[0050] The relationship trigger word identification includes identifying trigger words representing entity relationships based on syntactic analysis results and predefined rules.

[0051] The relationship definition includes defining the boundary of the entity relationship and extracting the entity relationship according to the trigger words and the positions of the entity mentions.

[0052] The triple generation includes combining entity pairs and relationship descriptions into triples , representing the entity and entities There is a relationship between .

[0053] For each identified entity pair , the OpenIE model may extract multiple relationship descriptions , generate multiple triple sets of triple sets output by the OpenIE model Representing Entities and entities There are multiple semantic relationships between them.

[0054] This step uses the OpenIE unsupervised model to extract entity relationships, which does not require manual definition of complex relationship templates and annotation of large amounts of training data, reducing labor costs. At the same time, this method can automatically discover a variety of entity relationship patterns contained in the text and extract rich and comprehensive entity relationship knowledge.

[0055] S4: Construct an entity relationship weight calculation formula, map the entity relationship weight to the entity relationship confidence, and filter out entity relationships with confidence values ​​lower than a threshold.

[0056] Construct the entity relationship weight calculation formula to calculate the relationship weight between entities: in, and Represents an entity; is the release date decay index of the text data; is the date on which the text data was published; is the current date; is the parameter; For text data Source index; and Entity and entities In the article The word frequency in For text data The maximum frequency of entities in .

[0057] For the extracted relationship , mapping entity relationship weights to entity and entity relationship confidences: in, It is the confidence of entity and entity relationship, indicating the credibility of the existence of entity and entity relationship.

[0058] Setting the confidence threshold , filter out entities and entity relationships whose confidence does not meet the requirements: like , then the entity is considered and entities The relationship between them does not exist; like , then the entity is considered and entities There is a relationship between them.

[0059] This step constructs an entity relationship weight calculation formula, comprehensively considers factors such as entity co-occurrence frequency, text time decay, and data source credibility, and obtains more accurate and comprehensive entity relationship weights; at the same time, the weights are mapped to confidence and low-confidence relationships are filtered out, thereby improving the credibility of entity relationships in the knowledge graph.

[0060] S5: Build a knowledge graph of text data based on the entities and entity relationships extracted from the text data.

[0061] Based on the entities and entity relationships extracted from the text data, construct a knowledge graph of the text data; define an undirected weighted knowledge graph ,in Represents a collection of entity nodes, represents the entity relationship edge set, Represents a set of entity relationship weights.

[0062] For each triple that meets the confidence requirement , perform the following steps: Step a: The entity and entities Add to Node Collection middle: ; Step b: Entity relationships As an undirected edge Add to edge set middle: ; Step c: Assign entity relationship confidence As edge The weight is added to the weight set middle: ; Step d: If the entity and entities If there are multiple entity relationships, the relationship with the highest confidence is selected As an entity and entities The edges between: ; Repeat steps a to d until all triples that meet the confidence requirements have been processed.

[0063] After processing all triples, we get , entity relationship edge and entity relationship weights Undirected weighted knowledge graph composed of , where the node Indicates Entity; Edge Representing Entities and entities There is a semantic relationship between them; weight Represents edge The corresponding entity relationship confidence reflects the credibility of the entity relationship.

[0064] Furthermore, in the process of entity recognition and relationship extraction, the diversity of entity relationships and information redundancy are sometimes contradictory. In this regard, our researchers have designed a creative algorithm and a balancing factor. By combining the creative algorithm with the introduction of the balancing factor, the credibility or confidence threshold affecting the source of the text data is calculated by the balancing factor. Specific supplementary steps S5'-S9: S6: Use adjacency matrix to represent knowledge graph and build a dynamic update mechanism for knowledge graph.

[0065] Knowledge Graph Represented as an adjacency matrix In the form of: ; in, Represents the number of entity nodes in the knowledge graph, Representing Entities and entities The relationship weight between , if the entity and entities If there is no relationship between .

[0066] Build a dynamic update mechanism for the knowledge graph and update the knowledge graph based on the newly added text data: Step 1: Preprocess, segment, identify entities, and extract relations on the newly added text data to obtain a new entity set , Relationship Set and weight set ; Step 2: Update the node set of the knowledge graph ; Step 3: Update the edge set of the knowledge graph ; Step 4: Update the weight set of the knowledge graph :for Each edge in ,if , then update the edge Weight: ;in, represents the new weight value, is the smoothing coefficient, which is used to balance the ratio of historical weights and new weights.

[0067] if , then the edge and weight Add to and middle: ; Step 5: Update the adjacency matrix of the knowledge graph : in, Indicates the number of newly added entity nodes. Represents the updated entity relationship weight.

[0068] By constructing a knowledge graph representation of text data, the transformation from unstructured text to structured knowledge is achieved. This knowledge graph can be used as a high-level semantic representation of text data and applied to various knowledge-driven tasks, such as information retrieval, question-answering systems, and recommendation systems, to fully explore and utilize the rich knowledge contained in text data and improve the performance and intelligence level of related tasks.

[0069] Example 2 See also Figure 2 ,The second embodiment of the present invention provides a system for building a knowledge graph based on unsupervised learning.

[0070] The module includes: a data acquisition module, an entity recognition module, an entity relationship extraction module, an entity relationship weight calculation module and a knowledge graph module.

[0071] The data acquisition module is used to acquire text data, pre-process the collected text data, and segment the text data to obtain the segmentation results of the text data.

[0072] The entity recognition module performs entity recognition on the word segmentation results of the text data based on the pre-trained language model, and eliminates ambiguity on the entity recognition results in the text data.

[0073] The entity relationship extraction module uses an unsupervised model to extract entity relationships and generate entity and entity relationship triplets.

[0074] The entity relationship weight calculation module constructs an entity relationship weight calculation formula, maps the entity relationship weight to the entity relationship confidence, and filters the entity relationships whose confidence values ​​are lower than a threshold.

[0075] The knowledge graph module constructs a knowledge graph of text data based on entities and entity relationships extracted from text data.

[0076] Example 3 The third embodiment of the present invention is different from the previous embodiment in that: If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.

[0077] Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.

[0078] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

[0079] For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by an instruction execution system, apparatus, or device or in conjunction with such instruction execution system, apparatus, or device.

[0080] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection having one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM).

[0081] In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0082] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof.

[0083] In the above embodiments, a plurality of steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.

[0084] For example, if implemented in hardware, as in another embodiment, it can be implemented using any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0085] Additionally, in order to provide a concise description of exemplary embodiments, all features of an actual embodiment may not be described (ie, those features that are not relevant to the best mode presently contemplated for carrying out the invention or those features that are not relevant to implementing the invention).

[0086] It will be appreciated that in the development of any actual implementation, as in any engineering or design project, numerous implementation-specific decisions may be made. Such a development effort may be complex and time-consuming, but will be a routine task of design, fabrication, and production for those of ordinary skill having the benefit of this disclosure without undue experimentation.

[0087] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for constructing a knowledge graph based on unsupervised learning, characterized in that: include: Acquire text data, preprocess the collected text data, and segment the text data to obtain segmentation results of the text data; Based on the pre-trained language model, entity recognition is performed on the word segmentation results of the text data, and the entity recognition results in the text data are disambiguated; Use unsupervised models to extract entity relationships and generate entity and entity relationship triplets; Construct an entity relationship weight calculation formula, map the entity relationship weight to the entity relationship confidence, and filter out entity relationships with confidence values ​​below the threshold; Based on the entities and entity relationships extracted from text data, a knowledge graph of text data is constructed.

2. The method for constructing a knowledge graph based on unsupervised learning according to claim 1, characterized in that: Get text data, pre-process the text data, remove the label data and symbol data in the text data; divide the text in the text data into word sequences based on the dictionary and word segmentation tools; use the forward maximum matching algorithm to segment the text based on the predefined dictionary and rules: Indicated by A sequence of words: ; Definition Dictionary , which contains Words: Scan text from left to right , find the longest word match; set up is the current scanning position, For the end position of the word , determine the substring Is it in the dictionary middle; If the substring In the dictionary, As a word, Move to position; if the substring If it is not in the dictionary, Move to Repeat the scanning process until , get the word segmentation result of text data .

3. The method for constructing a knowledge graph based on unsupervised learning according to claim 2, characterized in that: The RoBERTa pre-trained model is selected as the entity recognition model. Based on the RoBERTa pre-trained model, the RoBERTa pre-trained model is adjusted to add entity recognition-specific network layers, including linear layers and CRF layers. The word segmentation results are input into the adjusted model to obtain the label probability distribution of each word segmentation, and the Viterbi algorithm is used to decode to obtain the optimal label sequence. The entities and types are extracted to obtain the entity recognition results. For each entity recognition result, the candidate entities with the same name are retrieved from the knowledge base of the RoBERTa pre-trained model, and the entity in the knowledge base is calculated. With candidate entities Similarity ; Select the candidate entity with the highest similarity As a link object: in, is a collection of entities in the knowledge base. Link to selected candidate entity , to eliminate ambiguity.

4. The method for constructing a knowledge graph based on unsupervised learning according to claim 3, characterized in that: Select OpenIE model as the unsupervised entity relationship extraction model; The preprocessed text data and entity recognition results are input into the OpenIE model. The OpenIE model extracts entity relationships through the steps of syntactic analysis, entity recognition, relationship trigger word recognition, relationship definition, and triple generation. The syntactic analysis includes using a dependency syntactic analyzer to perform syntactic analysis on the input text to identify the subject, predicate and object components of the sentence; The entity recognition includes locating an entity in a sentence using pre-recognized entity information; The relationship trigger word identification includes identifying trigger words representing entity relationships according to syntactic analysis results and predefined rules; The relationship definition includes defining the boundary of the entity relationship and extracting the entity relationship according to the trigger words and the locations of entity mentions; The triple generation includes combining entity pairs and relationship descriptions into triples , representing the entity and entities There is a relationship between .

5. The method for constructing a knowledge graph based on unsupervised learning according to claim 4, characterized in that: Construct the entity relationship weight calculation formula to calculate the relationship weight between entities: in, and Represents an entity; is the release date decay index of the text data; is the date on which the text data was published; is the current date; is the parameter; For text data Source index; and Entity and entities In the article The word frequency in For text data The maximum frequency of entities in .

6. The method for constructing a knowledge graph based on unsupervised learning according to claim 5, characterized in that: For the extracted relationship , mapping entity relationship weights to entity and entity relationship confidences: in, It is the confidence of entity and entity relationship, indicating the credibility of the existence of entity and entity relationship.

7. The method for constructing a knowledge graph based on unsupervised learning according to claim 6, characterized in that: Setting the confidence threshold , filter out entities and entity relationships whose confidence does not meet the requirements: If , then the entity is considered and entities The relationship between them does not exist; like , then the entity is considered and entities There is a relationship between them.

8. The method for constructing a knowledge graph based on unsupervised learning according to claim 7, characterized in that: Based on the entities and entity relationships extracted from the text data, construct a knowledge graph of the text data; define an undirected weighted knowledge graph ,in Represents a collection of entity nodes, represents the entity relationship edge set, Represents the entity relationship weight set; for each triple that meets the confidence requirement , perform the following steps: Step a: The entity and entities Add to Node Collection middle: ; Step b: Entity relationships As an undirected edge Add to edge set middle: ; Step c: Assign entity relationship confidence As edge The weight is added to the weight set middle: ; Step d: If the entity and entities If there are multiple entity relationships, the relationship with the highest confidence is selected As an entity and entities The edges between: ; Repeat steps a to d until all triples that meet the confidence requirements have been processed.

9. The method for constructing a knowledge graph based on unsupervised learning according to claim 8, characterized in that: After processing all triples, we get , entity relationship edge and entity relationship weights Undirected weighted knowledge graph composed of , where the node Indicates Entity; Edge Representing Entities and entities There is a semantic relationship between them; weight Represents edge The corresponding entity relationship confidence reflects the credibility of the entity relationship.

10. A system for constructing a knowledge graph based on unsupervised learning, which is used to implement a method for constructing a knowledge graph based on unsupervised learning, characterized in that: include: Data acquisition module, entity recognition module, entity relationship extraction module, entity relationship weight calculation module and knowledge graph module; The data acquisition module is used to acquire text data, pre-process the collected text data, and segment the text data to obtain the segmentation results of the text data; The entity recognition module performs entity recognition on the word segmentation results of the text data based on the pre-trained language model, and eliminates ambiguity on the entity recognition results in the text data; The entity relationship extraction module uses an unsupervised model to extract entity relationships and generate entity and entity relationship triplets; The entity relationship weight calculation module constructs an entity relationship weight calculation formula, maps the entity relationship weight to the entity relationship confidence, and filters the entity relationships whose confidence values ​​are lower than a threshold; The knowledge graph module constructs a knowledge graph of text data based on entities and entity relationships extracted from text data.

Citation Information

Patent Citations

  • Semi-open information extraction method and device

    CN112651234A

  • Chinese question and answer information extraction method, system and equipment and storage medium

    CN115357692A

  • Knowledge graph optimization method and device, electronic equipment and storage medium

    CN118536584A

  • Knowledge graph path mining method using conditional random field and relation extraction

    CN118627614A

  • Method and device for constructing power utilization safety knowledge graph

    CN118690841A