Knowledge mining method and device based on large language model and readable storage medium

Through knowledge mining methods based on large language models, diverse expression methods are generated and semantic disambiguation processing is solved, and the problem of insufficient semantic disambiguation ability in the existing technology is significantly improved.

CN119721204APending Publication Date: 2025-03-2810TH RES INST OF CETC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411757999.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Existing knowledge graph construction technologies are difficult to achieve semantic disambiguation when dealing with diverse expressions, resulting in a decrease in the accuracy and practicality of information redundancy and knowledge graphs.

Method used

A knowledge mining method based on a large language model is adopted to generate diversified natural language expressions of triples, and a semantic recall model is used to retrieve sentences with semantic similarity from the original document, combined with the semantic disambiguation of the big model, duplicate or redundant triples are removed.

Benefits of technology

It significantly improves the accuracy and completeness of the knowledge graph, can handle semantic disambiguation problems more accurately, adapt to the complexity of domain documents, and build a high-quality and structured domain knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721204A_ABST
    Figure CN119721204A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge mining method and device based on a large language model and a readable storage medium, and relates to the technical field of knowledge maps. According to the method, diversified natural language expressions of triads are generated through a large language model, and sentences with similar semantics are retrieved from an original document set by utilizing a semantic recall model, so that the large model analyzes different expressions of the same entity, the same relationship and the same attribute according to the sentences. And finally, by means of large model semantic disambiguation processing, repeated or redundant triads are effectively removed, and the accuracy and integrity of the knowledge graph are improved.
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 knowledge mining method, device and readable storage medium based on a large language model. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and may not constitute prior art.

[0003] In existing knowledge graph construction technologies, knowledge acquisition usually relies on extracting entities, relationships, and attributes from a large number of domain documents. However, due to the diversity and complexity of natural languages, when constructing knowledge graphs, we often encounter situations where multiple expressions refer to the same entity or relationship. This semantic ambiguity can lead to information redundancy in the knowledge graph and reduce the accuracy and practicality of the knowledge graph. Therefore, in the process of knowledge graph construction, semantic disambiguation of entities, relationships, and attributes becomes a key issue.

[0004] At present, most traditional knowledge graph construction methods mainly rely on rule matching or grammar-based relationship extraction technology. These methods are difficult to achieve effective disambiguation at the semantic level and have poor adaptability to diverse expressions. In addition, although some models based on machine learning or deep learning can provide a preliminary semantic understanding of text, they lack the ability to structure and flexibly express domain knowledge graphs, resulting in insufficient information richness in the constructed graphs and limited semantic disambiguation effects. Summary of the invention

[0005] The purpose of the present invention is to provide a knowledge mining method, device and readable storage medium based on a large language model to solve the problems in the prior art. The large language model is used to generate diversified natural language expressions of triples, and the semantic recall model is used to retrieve semantically similar sentences from the original document collection, so that the large model can analyze different expressions of the same entity, the same relationship and the same attribute based on these sentences. Finally, with the help of the semantic disambiguation processing of the large model, repeated or redundant triples are effectively removed, and the accuracy and completeness of the knowledge graph are improved.

[0006] The technical solution of the present invention is as follows:

[0007] A knowledge mining method based on a large language model, comprising:

[0008] Step S1: Collect and construct a set of knowledge documents related to the target domain, extract entities and relationships to generate a set of triples;

[0009] Step S2: Generate fluent text from the labeled triple relationship using a large language model, and repeat this process multiple times to obtain diverse expressions;

[0010] Step S3: Use the semantic recall model to find sentences in the document collection that are semantically similar to the generated sentence to form a set of related sentences;

[0011] Step S4: Based on the recalled related sentences, use the large language model to obtain different expressions of the same entity, relationship, and attribute to form a set of synonymous expressions;

[0012] Step S5: Perform a disambiguation operation on the triple set, delete redundant triples, and finally construct a disambiguated knowledge graph.

[0013] Furthermore, the step S1 comprises:

[0014] Step S11: Collect all knowledge documents related to the target domain to form a document set D = {d1, d2, ..., d n};

[0015] Step S12: For each knowledge document in the document set D, use the information extraction model IE to extract entities with important significance and the relationships between entities, and generate a triple set T i ;

[0016] Step S13: Summarize the triples of all knowledge documents to form a total triple set T; the triple set T contains the entity relationship information extracted from all knowledge documents;

[0017] Step S14: Using the large language model, extract all undisambiguated entity sets E, relationship sets R and attribute sets P for the triple set T.

[0018] Furthermore, the step S2 comprises:

[0019] Step S21: inputting the triple set T into the large language model to generate corresponding natural language sentences;

[0020] Step S22: Set several generation parameters for the large language model so that the large language model generates k different sentence descriptions for each triple to form a sentence set

[0021] Step S23: Summarize the sentence sets generated by each triple and perform union to obtain the overall sentence set

[0022] Furthermore, the step S3 comprises:

[0023] Use the semantic recall model to recall the overall sentence set from the document set D in a vectorized manner The sentences in the text are semantically similar.

[0024] Furthermore, the step S3 specifically includes the following steps:

[0025] Step S31: Input a sentence set; for each sentence in the generated sentence set Input it into the semantic recall model to obtain the semantic vector of the sentence;

[0026] Step S32: vectorized semantic matching; the semantic recall model searches for sentences in the document set D that are semantically similar to sentence s;

[0027] Step S33: related sentence set; according to the similarity score calculated by the semantic recall model, the sentences with the highest similarity ranking are selected to form a related sentence set:

[0028] R s ={r1, r2, ..., r m}

[0029] Among them, R s represents the set of sentences semantically related to sentence s, r1, r2, ..., r m is the sentence that is most semantically relevant to sentence s.

[0030] Furthermore, the step S4 comprises:

[0031] Step S41: Combine the entity set E and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same entity as entity e.

[0032] Step S42: Combine the relation set R and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same relation as relation r;

[0033] Step S43: Combine the attribute set P and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same attribute as attribute p.

[0034] Furthermore, the step S5 comprises:

[0035] Step S51: disambiguating the triple set T;

[0036] Step S52: construct a knowledge graph for the disambiguated triple set.

[0037] Furthermore, the step S51 includes:

[0038] Traverse the triple set T from front to back. If the three fields of a triple t belong to the same expression set as the three fields of the previous triple, delete t.

[0039] The present invention also proposes a knowledge mining device based on a large language model, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned knowledge mining method based on a large language model when executing the computer program.

[0040] The present invention also proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the above-mentioned knowledge mining method based on a large language model.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] 1. The present invention generates diversified natural language expressions of triples through a large language model, and retrieves semantically similar sentences from the original document collection with the help of a semantic recall model to help the large model analyze different expressions of the same entity, relationship, and attribute. Finally, combined with the semantic disambiguation processing of the large model, repeated and redundant triples are effectively removed, significantly improving the accuracy and completeness of the knowledge graph.

[0043] 2. Compared with traditional methods, the advantage of the present invention is that it can handle semantic disambiguation problems more accurately, generate diversified expressions through a large language model, and recall multiple related sentences for the same triple. This method can better adapt to the complexity of domain documents and provide a new technical path for building high-quality, structured domain knowledge graphs. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flow chart of a knowledge mining method based on a large language model;

[0045] Figure 2 Schematic diagram of the overall framework of a knowledge mining method based on a large language model. DETAILED DESCRIPTION

[0046] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0047] The features and performance of the present invention are further described in detail below in conjunction with the embodiments.

[0048] Embodiment 1

[0049] See also Figure 1 A knowledge mining method based on a large language model, comprising:

[0050] Step S1: Collect and construct a knowledge document set related to the target domain, extract entities and relationships to generate a triple set; this step is done by Figure 2 The triplet extractor implementation in ;

[0051] Step S2: Generate fluent text from the marked triple relationship using a large language model, and repeat multiple times to obtain diverse expressions; that is, based on all the triples extracted above, generate multiple rich expression sentences for each triple using a large language model; this step is done by Figure 2 The triple expression generation module is implemented in the embodiment of the present invention; that is, the triple expression generation module has a built-in large language model;

[0052] Step S3: Use the semantic recall model to find sentences in the document collection that are semantically similar to the generated sentence to form a set of related sentences, ensuring that the extracted information is consistent with the semantics of the original content; this step is done by Figure 2 The semantic recall module in the embodiment is implemented; that is, the semantic recall module has a built-in semantic recall model;

[0053] Step S4: Based on the recalled related sentences, use the large language model to obtain different expressions of the same entity, relationship, and attribute to form a set of synonymous expressions;

[0054] Step S5: Perform a disambiguation operation on the triple set, delete redundant triples, and finally construct a disambiguated knowledge graph.

[0055] In this embodiment, specifically, step S1 includes:

[0056] Step S11: Collect all knowledge documents related to the target domain to form a document set D = {d1, d2, ..., d n};

[0057] That is, in the initial stage of knowledge graph construction, we first need to collect all knowledge documents related to the target field to ensure the comprehensiveness and accuracy of the content. The sources of documents can be different news websites, literature, reports, etc. After the collection is completed, these documents are organized into a unified document set D, where each document is denoted as d i The structured representation of a document collection is D = {d1, d2, ..., d n}, where n represents the total number of knowledge documents, providing basic data for the subsequent preprocessing and information extraction steps;

[0058] Step S12: For each knowledge document in the document set D, use the information extraction model IEQwen-7B-Chat to extract entities with important significance and the relationships between entities, and generate a triple set T i ;

[0059] That is, in the preprocessed document set D, command IE to extract the i Automatically identify the important entity pairs and their relationships in each knowledge document d i After being processed, a triple set T is generated i , where each triple represents an entity relationship, where e ij Represents an entity, r ij To express a relationship;

[0060] T i =(e i1 , r i1 , e i2 ), (e i3 , r i2 , e i4 ), ...

[0061] Step S13: Summarize the triples of all knowledge documents to form a total triple set T; the triple set T contains the entity relationship information extracted from all knowledge documents;

[0062] That is, after extracting triples from each knowledge document, the triple sets of all knowledge documents are summarized to form an overall triple set T. This set contains the entity relationship information extracted from all knowledge documents, expressed as:

[0063]

[0064] Step S14: Using the large language model, extract all undisambiguated entity sets E, relationship sets R and attribute sets P from the triple set T.

[0065] In this embodiment, specifically, step S2 includes:

[0066] Step S21: inputting the triple set T into the large language model to generate corresponding natural language sentences;

[0067] Specifically, suppose the triple set T contains multiple triples, each triple is represented as (e1, r, e2), where e1 and e2 are entities, and r is the relationship between them. These triples are input into the large language model LLM, which will generate corresponding natural language sentences based on the structure and semantics of each triple, expressing this structured triple in unstructured text; the goal of this step is to let the model generate a fluent and contextual text description for each triple;

[0068] Step S22: Set several generation parameters for the large language model to enhance diversity, so that the large language model generates k different sentence descriptions for each triple to form a sentence set

[0069] That is, in order to ensure the diversity of generated text, some generation parameters need to be set for the large language model, including a temperature of 0.8 and a top-k of 40 samples. The temperature parameter can control the diversity of generated content. Higher temperatures usually increase the variation of generated text, making sentences richer and more diverse. Top-k means that the model only selects from the k words with the highest probability when generating text, which can filter out irrelevant or inappropriate words, thereby maintaining the quality of generated content;

[0070] Step S23: Summarize the sentence sets generated by each triple and perform union to obtain the overall sentence set A diverse text representation containing all triples:

[0071]

[0072] That is, through these parameter settings, the large language model is required to generate 5 different sentence expressions for each triple. For example, for the triple (e1, r, e2), the model will generate multiple sentence descriptions to form a set Each sentence i They are all different expressions generated based on the same triple.

[0073] In this embodiment, specifically, step S3 includes:

[0074] Use the semantic recall model bge-m3 to recall the overall sentence set from the document set D in a vectorized manner The sentences in the text are semantically similar.

[0075] In this embodiment, specifically, step S3 includes the following steps:

[0076] Step S31: Input a sentence set; for each sentence in the generated sentence set Input it into the semantic recall model to obtain the semantic vector of the sentence;

[0077] Step S32: vectorized semantic matching; the semantic recall model searches for sentences in the document set D that are semantically similar to sentence s; it should be noted that, Figure 2 As shown, the document set D also needs to be encoded by the semantic encoding module and stored in the document vector library for calling in this step;

[0078] Step S33: related sentence set; according to the similarity score calculated by the semantic recall model, the sentences with the highest similarity ranking are selected to form a related sentence set:

[0079] R s ={r1, r2, ..., r m}

[0080] Among them, R s represents the set of sentences semantically related to sentence s, r1, r2, ..., r m is the sentence that is most semantically relevant to sentence s.

[0081] In this embodiment, specifically, step S4 includes:

[0082] Step S41: Combine the entity set E and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same entity as entity e.

[0083] Step S42: Combine the relation set R and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same relation as relation r;

[0084] Step S43: Combine the attribute set P and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same attribute as attribute p.

[0085] In this embodiment, specifically, step S5 includes:

[0086] Step S51: disambiguating the triple set T;

[0087] Step S52: construct a knowledge graph for the disambiguated triple set.

[0088] In this embodiment, specifically, step S51 includes:

[0089] Traverse the triple set T from front to back. If the three fields of a triple t belong to the same expression set as the three fields of the previous triple, delete t.

[0090] In this embodiment, specifically, a knowledge mining device based on a large language model is also proposed, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned knowledge mining method based on a large language model when executing the computer program; preferably, the computer program can be executed on a terminal device, such as a personal computer.

[0091] In this embodiment, specifically, a computer-readable storage medium is also proposed, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned knowledge mining method based on a large language model are implemented; however, the device of the present invention is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, apparatus or device.

[0092] The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0093] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0094] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0095] The above-mentioned embodiments only express the specific implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the protection scope of the present application. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the technical solution concept of the present application, and these all belong to the protection scope of the present application.

[0096] This background section is provided to generally present the context of the invention, and the work of the presently named inventors, the work to the extent described in this background section, and aspects of this section that did not constitute prior art at the time of application are neither explicitly nor implicitly admitted to be prior art to the present invention.

Claims

1. A knowledge mining method based on a large language model, characterized in that: include: Step S1: Collect and construct a set of knowledge documents related to the target domain, extract entities and relationships to generate a set of triples; Step S2: Generate fluent text from the labeled triple relationship using a large language model, and repeat this process multiple times to obtain diverse expressions; Step S3: Use the semantic recall model to find sentences in the document collection that are semantically similar to the generated sentence to form a set of related sentences; Step S4: Based on the recalled related sentences, use the large language model to obtain different expressions of the same entity, relationship, and attribute to form a set of synonymous expressions; Step S5: Perform a disambiguation operation on the triple set, delete redundant triples, and finally construct a disambiguated knowledge graph.

2. The knowledge mining method based on a large language model according to claim 1, characterized in that: The step S1 comprises: Step S11: Collect all knowledge documents related to the target domain to form a document set D = {d1, d2, ..., d n }; Step S12: For each knowledge document in the document set D, use the information extraction model IE to extract entities with important significance and the relationships between entities, and generate a triple set T i ; Step S13: Summarize the triples of all knowledge documents to form a total triple set T; the triple set T contains the entity relationship information extracted from all knowledge documents; Step S14: Using the large language model, extract all undisambiguated entity sets E, relationship sets R and attribute sets P for the triple set T.

3. The knowledge mining method based on a large language model according to claim 2, characterized in that: The step S2 comprises: Step S21: inputting the triple set T into the large language model to generate corresponding natural language sentences; Step S22: Set several generation parameters for the large language model so that the large language model generates k different sentence descriptions for each triple to form a sentence set Step S23: Summarize the sentence sets generated by each triple and perform union to obtain the overall sentence set 4. The knowledge mining method based on a large language model according to claim 3, characterized in that: The step S3 comprises: Use the semantic recall model to recall the overall sentence set from the document set D in a vectorized manner Sentences with similar semantics to the sentences in the sentence.

5. The knowledge mining method based on a large language model according to claim 4, characterized in that: The step S3 specifically includes the following steps: Step S31: Input a sentence set; for each sentence in the generated sentence set Input it into the semantic recall model to obtain the semantic vector of the sentence; Step S32: vectorized semantic matching; the semantic recall model searches for sentences in the document set D that are semantically similar to sentence s; Step S33: related sentence set; according to the similarity score calculated by the semantic recall model, the sentences with the highest similarity ranking are selected to form a related sentence set: R s ={r1,r2,…,r m} Among them, R s represents a set of sentences semantically related to sentence s, r1,r2,…,r m is the sentence that is most semantically relevant to sentence s.

6. The knowledge mining method based on a large language model according to claim 5, characterized in that: The step S4 comprises: Step S41: Combine the entity set E and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same entity as entity e; Step S42: Combine the relation set R and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same relation as relation r; Step S43: Combine the attribute set P and the recalled semantically related sentences R s Input the large language model and let the large language model extract different expressions of the same attribute as attribute p.

7. The knowledge mining method based on a large language model according to claim 6, characterized in that: The step S5 comprises: Step S51: disambiguating the triple set T; Step S52: construct a knowledge graph for the disambiguated triple set.

8. The knowledge mining method based on a large language model according to claim 7, characterized in that: The step S51 comprises: Traverse the triple set T from front to back. If the three fields of a triple t belong to the same expression set as the three fields of the previous triple, delete t.

9. A knowledge mining device based on a large language model, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a knowledge mining method based on a large language model as described in any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a knowledge mining method based on a large language model as described in any one of claims 1 to 8 are implemented.