A method and device for semi-automatic construction of domain knowledge graph

By annotating and modeling the original document of the book, and building a domain knowledge graph, the problem of weak correlation between big data is solved, and more comprehensive knowledge acquisition and data interconnection are achieved.

CN115757831BActive Publication Date: 2025-08-15NANKAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211502425.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-28
Publication Date
2025-08-15
Estimated Expiration
2042-11-28

AI Technical Summary

Technical Problem

In the prior art, as the data scale increases, the correlation between data is weak, making it difficult to effectively acquire knowledge when processing big data.

Method used

The semi-automated method is used to obtain entity relationship triplet data by annotating the original document of the book, and use the seq2seq model to generate subject and object descriptions, and combine the Bert model to predict entities and relationships to build a domain knowledge graph.

Benefits of technology

It improves the accuracy of data, reduces labor costs, and at the same time explores the potential relationships between data, building a more comprehensive domain knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757831B_ABST
    Figure CN115757831B_ABST
Patent Text Reader

Abstract

The present invention proposes a method and apparatus for semi-automatically constructing a domain knowledge graph, wherein the method comprises: annotating original book documents to obtain entity relationship triples within the domain, organizing them into structured data, and constructing a precisely annotated knowledge graph based on the structured data; generating subject and object descriptions based on the entity relationships and contextual content of the triples using a seq2seq model to complete the entity description information in the precisely annotated knowledge graph; performing entity and relationship predictions using a BERT model based on the precisely annotated knowledge graph with the completed entity description information, and combining the manually annotated entity relationship information to construct a domain knowledge graph. The present invention utilizes a semi-automated construction method and apparatus to improve data accuracy through manual annotation. Simultaneously, the semi-automated construction algorithm can mine potential relationships between data while reducing labor costs, thereby constructing a more comprehensive domain knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of knowledge graphs, automated construction, and natural language processing. Background Art

[0002] With the advent of the big data era and the advancement of computing in various fields, the characteristics of big data are becoming increasingly apparent. Data volumes are growing exponentially, but the correlations between data are relatively weak, making data processing difficult. Knowledge graphs are essentially used to describe the various entities and relationships between entities in the real world. Their basic unit is the "entity-relationship-entity" triple, which represents an entity and the relationship between two entities. As data volumes grow, so does the need for cognitive understanding of that data. Knowledge graphs, as a form of organization, effectively enhance our ability to glean knowledge from vast amounts of information.

[0003] To address the weak correlation between large amounts of data, a method and apparatus for semi-automated construction of domain knowledge graphs is proposed, covering multiple fields such as knowledge graphs and natural language processing. This semi-automated construction method and apparatus utilizes manual annotation to improve data accuracy. Furthermore, the semi-automated construction algorithm can reduce labor costs while exploring potential relationships between data, ultimately building a more comprehensive domain knowledge graph. Summary of the Invention

[0004] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0005] To this end, the purpose of the present invention is to propose a method and device for semi-automatic construction of domain knowledge graphs, which can be used to realize the semi-automatic construction of knowledge graphs within the domain, realize the interconnection of various knowledge while reducing human participation, and construct a more comprehensive domain knowledge graph.

[0006] To achieve the above objectives, the present invention proposes a method and apparatus for semi-automatically constructing a domain knowledge graph, comprising the following steps:

[0007] Annotate the original book documents to obtain entity relationship triples in the field, organize them into structured data, and build a precisely annotated knowledge graph based on the structured data;

[0008] Generate subject and object descriptions based on the seq2seq model according to the entity relationships and contextual content of the triple data, and complete the entity description information in the accurately annotated knowledge graph;

[0009] Based on the accurate annotation knowledge graph that completes the entity description information, the BERT model is used to predict entities and relationships, and the domain knowledge graph is constructed by combining the manually annotated entity relationship information.

[0010] In addition, the method and apparatus for semi-automatically constructing a domain knowledge graph according to the above embodiment of the present invention may also have the following additional technical features:

[0011] Furthermore, in one embodiment of the present invention, the tagging of the original book document to obtain entity relationship triples in the field, organizing the data into structured data, and constructing a precisely annotated knowledge graph based on the structured data includes:

[0012] The original text document of the book is annotated with triples in the form of<S,R,O> , S is the Subject, which is the subject of the triple, R is the Relation, which is the predicate, and O is the Object, which is the object of the triple; according to the annotation content, the original document of the book is organized into structured data information, and a precise annotation knowledge graph is constructed based on the structured information.

[0013] Furthermore, in one embodiment of the present invention, generating subject and object descriptions based on the seq2seq model according to the entity relationships and contextual content of the triple data to complete the entity description information in the accurately annotated knowledge graph includes:

[0014] The seq2seq model is used to splice the context content and the associated entities in the triple data into the encoder. The decoder decodes the data encoded by the encoder according to the decoding rules to generate entity description information. The seq2seq model includes an encoder and a decoder.

[0015] Furthermore, in one embodiment of the present invention, the accurately annotated knowledge graph based on the completed entity description information uses the BERT model to predict entities and relationships, and combines the manually annotated entity relationship information to construct a domain knowledge graph, including:

[0016] The BERT model is pre-trained based on the original book document using the retrieval enhancement TF_IDF method to supplement the retrieval information. Based on the pre-trained model, the triple data is used to fine-tune the downstream tasks, so that the model can automatically predict the triple data in an article in the same field or the unlabeled triple data in the original book document to form structured data; based on the structured data, the entity relationship data is updated and labeled with Cypher to construct a domain knowledge graph.

[0017] To achieve the above objectives, the second embodiment of the present invention proposes a domain knowledge graph annotation device, comprising:

[0018] The annotation module is used to annotate the original book documents to obtain entity relationship triples in the field, organize them into structured data, and build an accurately annotated knowledge graph based on the structured data;

[0019] A completion module is used to generate subject and object descriptions based on the seq2seq model according to the entity relationship and context content of the triple data, and to complete the entity description information in the precise annotated knowledge graph;

[0020] A construction module is used to predict entities and relationships through the BERT model based on the accurately annotated knowledge graph with completed entity description information, and to build a domain knowledge graph based on the manually annotated entity relationship information.

[0021] Furthermore, in one embodiment of the present invention, the marking module is further configured to:

[0022] The triples of the original book document are visually annotated, and the entities and the relationships between them are annotated by connecting lines between the entities to form triple data and generate structured data. According to the structured data and the manually annotated data, an accurately annotated knowledge graph is constructed.

[0023] Furthermore, in one embodiment of the present invention, the marking module further includes:

[0024] The statistical unit is used to count the number of entities and triples marked in the original text document of the book.

[0025] Furthermore, in one embodiment of the present invention, the statistical unit is further configured to:

[0026] According to the annotated data and the data predicted and generated by the seq2seq model, statistics of valid triples in the original text document of the book are performed on the basis of the domain knowledge graph.

[0027] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer device, which is characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method for semi-automatic construction of the domain knowledge graph as described above.

[0028] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, it implements the method of semi-automatic construction of the domain knowledge graph as described above.

[0029] The method for semi-automatic construction of a domain knowledge graph in an embodiment of the present invention extracts data from the original text information of the domain, performs data structuring processing, and then constructs a knowledge graph based on the structured data. The entity description information missing in the knowledge graph is then supplemented according to the seq2seq model, and then a more comprehensive knowledge graph in the domain is generated based on the annotation content and the prediction of the pre-trained model. The knowledge graph is stored in the Neo4j graph database. By constructing a knowledge graph, the knowledge in the domain can be interconnected. On the other hand, this patent mainly completes a domain knowledge graph triple annotation device, which annotates entities such as people, places, events, officials, institutions, documents, time, knowledge points, and the relationship information between entities in the book, and constructs a domain knowledge graph based on the relationship between the annotated entities and the entities. The present invention uses a semi-automatic construction method and device to improve the accuracy of the data by manual annotation. At the same time, the semi-automatic construction algorithm can reduce labor costs while mining the potential relationships between data to construct a more comprehensive domain knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0031] Figure 1 A schematic flow chart of a method for semi-automatically constructing a domain knowledge graph provided in an embodiment of the present invention.

[0032] Figure 2 This is a specific flow chart of the annotation tool provided by an embodiment of the present invention.

[0033] Figure 3 This is a demonstration interface of the annotation tool provided by an embodiment of the present invention.

[0034] Figure 4 This is the pre-training implementation process provided by the embodiment of the present invention.

[0035] Figure 5 A schematic diagram of the process flow of a semi-automatic construction device for a domain knowledge graph provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0037] The following describes the method and device for semi-automatic construction of a domain knowledge graph according to an embodiment of the present invention with reference to the accompanying drawings.

[0038] Figure 1 A flowchart of a method and apparatus for semi-automatically constructing a domain knowledge graph provided in an embodiment of the present invention.

[0039] like Figure 1 As shown, the method and device for semi-automatic construction of the knowledge graph in this field include the following steps:

[0040] S101: Annotate the original book documents to obtain entity relationship triples in the field, organize them into structured data, and build a precisely annotated knowledge graph based on the structured data;

[0041] Furthermore, in one embodiment of the present invention, the original book document is annotated to obtain entity relationship triples in the field, which are organized into structured data, including:

[0042] The original text document of the book is annotated with triples in the form of<S,R,O> , S is the Subject, which is the subject of the triple, R is the Relation, which is the predicate, and O is the Object, which is the object of the triple; the original text document of the book is organized into structured data information according to the annotation content.

[0043] The device formats the marked data into formatted data, and the specific format is {"id":"1","type":"Person","name":"Confucius","altName":Zhongni, Kongqiu","hitpos":{"bookName":"Xunzi","pageStart":"271","pageEnd":"271","hitposStart":"44","hitposEnd":"46",},"relationship":"student","object":{"id":"2","type":"Person","name":"Zengzi","altName":"Zi Yu","hitpos":{"bookName":"Xunzi","pageStart":"271","pageEnd":"271","hitposStart":"44","hitposEnd":"46",},"relationship":"student d":"46"}}}, where id is the unique identifier of the entity, type is the type of the entity, name is the name, altNname is the alias of the name, bookName is the name of the book, pageStart is the starting page number in the document, pageEnd is the ending page number in the document, hitposStart is the specific starting position, hitposEnd is the specific ending position in the page number, relationship is the relationship between the two entities, and object is the location of the entity word of the object.

[0044] The flow chart of the marking device is as follows Figure 2 As shown. First, mark the entities in the document, and then mark the relationships between entities by dragging and dropping them according to the connections between the entities. Finally, you can select the entities with the same name and type to merge the entity relationships and remove duplicate data. The system demonstration interface is as follows Figure 3 shown.

[0045] Build a basic knowledge graph based on the annotated structured data, and use the following steps to predict and supplement the knowledge graph.

[0046] S102: Generate subject and object descriptions based on the seq2seq model according to the entity relationships and contextual content of the triple data, and complete the entity description information in the accurately labeled knowledge graph;

[0047] Furthermore, based on the entity relationships and context of the triple data, the subject and object descriptions are generated based on the seq2seq model to complete the entity description information in the accurate annotation knowledge graph, including:

[0048] The seq2seq model is used to splice the context content and the associated entities in the triple data into the encoder. The decoder decodes the data encoded by the encoder according to the decoding rules to generate the description information of the entity. The seq2seq model includes an encoder and a decoder.

[0049] Specifically, the common seq2seq (Sequence to Sequence) model's basic concept is that an encoder analyzes the input sequence and a decoder generates the output sequence. The model comprises an encoder and a decoder, known as an encoder-decoder structure. The encoder concatenates the context and associated entities in the triples. The decoder decodes the encoded data according to a decoding rule, generating descriptions of the related entities. The retrieval information is supplemented using the term frequency-inverse document frequency (TF-IDF) method. This method assumes that if a word or sentence appears frequently in an article and rarely in other articles, it has good category discrimination capabilities and is used to identify the most relevant articles. These search results are then used to pre-train the seq2seq model. During the fine-tuning phase, the input information is encoded and decoded together with the search results, enabling a better understanding of the semantics of the input information. This achieves a generative transition from specialized domain interpretation to general text interpretation. This makes it easier to provide more accessible explanations of specialized terms.

[0050] The pre-trained language model has the "three major" characteristics of big data, large model, and large computing power. On this basis, the pre-trained language model has achieved good results. It has made substantial improvements in many aspects of natural language processing. The pre-trained language model with a seq2seq structure is suitable for generation tasks. The Encoder part consists of five parts: word embedding, numerical change, layer-by-layer encoding, LN&dropout, and storage. The Decoder then continues to generate the input, and selects the generated sequence with the highest condition at each time step for inference generation. The Decoder part consists of six parts: word embedding, numerical change, layer-by-layer encoding, LN&dropout, storage, and obtaining generated words. The pre-training implementation process is as follows: Figure 4 shown.

[0051] S103: Based on the accurately annotated knowledge graph with completed entity description information, the BERT model is used to predict entities and relationships, and the domain knowledge graph is constructed in combination with the manually annotated entity relationship information.

[0052] Furthermore, based on the accurate annotation knowledge graph of the completed entity description information, the BERT model is used to predict entities and relationships, and the domain knowledge graph is constructed by combining the manually annotated entity relationship information, including:

[0053] Based on the original book document, the retrieval enhancement TF_IDF method is used to supplement the retrieval information for pre-training the Bert (Bidirectional Encoder Representations from Transformer) model. The model randomly masks words and makes predictions based on the context to better learn the semantic information in sentences. Alternatively, two sentences are concatenated together, and the input network is asked to determine whether they are adjacent sentences in the original text. Based on the pre-trained model, triple data is used to fine-tune downstream tasks, allowing the model to automatically predict triple data from an article in the same field or unlabeled triple data in the original book document to form structured data. Based on the structured data, the entity relationship data is updated and annotated in the knowledge graph using Cypher to construct a domain knowledge graph.

[0054] The method for semi-automatic construction of a domain knowledge graph in an embodiment of the present invention extracts data from the original text information of the domain, performs data structuring processing, and then constructs a knowledge graph based on the structured data. Then, the entity descriptions missing in the knowledge graph are supplemented according to the seq2seq model, and then a more comprehensive knowledge graph in the domain is supplemented according to the annotation content and the prediction of the pre-trained model. The knowledge graph is stored in the Neo4j graph database. By constructing a knowledge graph, the knowledge in the domain can be interconnected. On the other hand, this patent mainly completes a domain knowledge graph triple annotation device, which annotates entities such as people, places, events, officials, institutions, documents, time, knowledge points and the relationship information between entities in the book, and constructs a domain knowledge graph according to the relationship between entities. The present invention uses a semi-automatic construction method and device to improve the accuracy of the data by manual annotation. At the same time, the semi-automatic construction algorithm can reduce labor costs while mining the potential relationships between data to construct a more comprehensive domain knowledge graph.

[0055] To achieve the above objectives, the second embodiment of the present invention proposes a semi-automatic construction device for a domain knowledge graph. Figure 5 A schematic structural diagram of a device for semi-automatically constructing a domain knowledge graph provided in an embodiment of the present invention.

[0056] like Figure 5 As shown, the semi-automatic construction device of the domain knowledge graph includes: a labeling module 100, a completion module 200, and a construction module 300, wherein:

[0057] The annotation module is used to annotate the original book documents to obtain entity relationship triples in the field, organize them into structured data, and build a precise annotated knowledge graph based on the structured data;

[0058] The completion module is used to generate subject and object descriptions based on the entity relationships and context of the triple data based on the seq2seq model, and to complete the entity description information in the accurate annotation knowledge graph;

[0059] A construction module is used to predict entities and relationships through the BERT model based on the accurately annotated knowledge graph with completed entity description information, and to build a domain knowledge graph based on the manually annotated entity relationship information.

[0060] Furthermore, in one embodiment of the present invention, the annotation module is further configured to:

[0061] Visually annotate the triples of the original book documents, and use the method of connecting entities to annotate the entities and the relationship between them to form triple data and generate structured data. Based on the structured data and the manually annotated data, a precise annotated knowledge graph is constructed.

[0062] Furthermore, in one embodiment of the present invention, the marking module further includes:

[0063] The statistical unit is used to count the number of entities and triples marked in the original book document.

[0064] Furthermore, in one embodiment of the present invention, the statistical unit is further configured to:

[0065] According to the annotated data and the data generated by the seq2seq model prediction, the statistics of valid triples in the original book documents are performed based on the domain knowledge graph.

[0066] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer device, which is characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the semi-automatic construction method of the domain knowledge graph as described above.

[0067] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, it implements the semi-automatic construction method of the domain knowledge graph as described above.

[0068] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0069] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0070] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limiting the present invention. A person skilled in the art may change, modify, replace, and modify the above embodiments within the scope of the present invention.

Claims

1. A method for semi-automatic construction of a domain knowledge graph, characterized in that: The following steps are involved: Annotate the original book documents to obtain entity relationship triples in the field, organize them into structured data, and build a precisely annotated knowledge graph based on the structured data; Generate subject and object descriptions based on the seq2seq model according to the entity relationships and contextual content of the triple data, and complete the entity description information in the accurately annotated knowledge graph; Based on the accurate annotation knowledge graph of the completed entity description information, the BERT model is used to predict entities and relationships, and the domain knowledge graph is constructed by combining the manually annotated entity relationship information; The accurate annotation knowledge graph based on the completed entity description information uses the Bert model to predict entities and relationships, and combines the manually annotated entity relationship information to construct a domain knowledge graph, including: According to the original book document, the retrieval information is supplemented by the retrieval enhancement TF_IDF method to pre-train the Bert model. Based on the pre-trained model, the triple data is used to fine-tune the downstream tasks, so that the model can automatically predict the triple data in an article in the same field or the unlabeled triple data in the original book document to form structured data; according to the structured data, the entity relationship data is updated and labeled using Cypher, a declarative graph query language, to construct a domain knowledge graph.

2. The method according to claim 1, wherein the tagging of the original book document to obtain entity relationship triples in the domain and organizing them into structured data comprises: The original text document of the book is annotated with triples in the form of<S,R,O> , S is Subject, which is the subject of the triple, R is Relation, which is the predicate, and O is Object, which is the object of the triple; the original book document is organized into structured data information according to the annotation content.

3. The method according to claim 1, wherein generating subject and object descriptions based on the entity relationships and context of the triple data based on a seq2seq model to complete the entity description information in the accurately annotated knowledge graph comprises: The seq2seq model is used to splice the context content and the associated entities in the triple data into the encoder. The decoder decodes the data encoded by the encoder according to the decoding rules to generate entity description information. The seq2seq model includes an encoder and a decoder.

4. A semi-automatic construction device for a domain knowledge graph, characterized in that: include: The annotation module is used to annotate the original book documents to obtain entity relationship triples in the field, organize them into structured data, and build an accurately annotated knowledge graph based on the structured data; A completion module is used to generate subject and object descriptions based on the seq2seq model according to the entity relationship and context content of the triple data, and to complete the entity description information in the precise annotated knowledge graph; A construction module is used to predict entities and relationships using the BERT model based on the accurately annotated knowledge graph with complete entity description information, and to build a domain knowledge graph based on the manually annotated entity relationship information; The accurate annotation knowledge graph based on the completed entity description information uses the Bert model to predict entities and relationships, and combines the manually annotated entity relationship information to construct a domain knowledge graph, including: According to the original book document, the retrieval information is supplemented by the retrieval enhancement TF_IDF method to pre-train the Bert model. Based on the pre-trained model, the triple data is used to fine-tune the downstream tasks, so that the model can automatically predict the triple data in an article in the same field or the unlabeled triple data in the original book document to form structured data; according to the structured data, the entity relationship data is updated and labeled using Cypher, a declarative graph query language, to construct a domain knowledge graph.

5. The apparatus according to claim 4, wherein the marking module is further configured to: The triples of the original book document are visually annotated, and the entities and the relationships between them are annotated by connecting lines between the entities to form triple data and generate structured data. According to the structured data and the manually annotated data, an accurately annotated knowledge graph is constructed.

6. The apparatus according to claim 4, wherein the marking module further comprises: The statistical unit is used to count the number of entities and triples marked in the original text document of the book.

7. The apparatus according to claim 6, wherein the statistical unit is further configured to: According to the annotated data and the data predicted and generated by the seq2seq model, statistics of valid triples in the original text document of the book are performed on the basis of the domain knowledge graph.

8. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method for semi-automatic construction of a domain knowledge graph as described in any one of claims 1 to 3.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for semi-automatic construction of a domain knowledge graph as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Government affair domain knowledge graph automatic construction method and device based on deep learning

    CN113569050A

  • Triple information extraction method, apparatus, and device, and computer-readable storage medium

    WO2022116417A1