Vertical domain question answering system and method based on knowledge graph and large language model

By converting the text uploaded by users into a knowledge graph and using a large language model for entity recognition and relationship extraction, the problem of difficult balance between the accuracy and fluency of feedback content in the existing question-and-answer system is solved, and a higher knowledge base output stability and interpretability are achieved.

CN119646129APending Publication Date: 2025-03-18BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411501548.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Existing Q&A systems are difficult to balance the accuracy and fluency of feedback content, and lack interpretability and traceability.

Method used

A vertical domain question and answer system based on knowledge graph and large language model is adopted to generate reply by converting the text uploaded by users into knowledge graphs and using large language models for entity recognition and relationship extraction.

Benefits of technology

It improves the stability and accuracy of the content output of the knowledge base and enhances the interpretability and traceability of knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646129A_ABST
    Figure CN119646129A_ABST
Patent Text Reader

Abstract

The invention discloses a vertical domain question-answering system and method based on a knowledge graph and a large language model, and relates to the field of question-answering systems. The method comprises the following steps: S1, segmenting a text according to paragraphs to finish text preprocessing; s2, inputting each piece of information into a large language model, enabling the large language model to carry out entity recognition, and extracting entity information in the text; s3, converting the relation extraction task into a selection problem, and enabling the large language model to judge the relation between entities; s4, constructing a knowledge graph by using the extracted entity information and relation information; s5, performing entity identification and relation extraction on questions of the user; s6, searching corresponding entity information and relation information from the knowledge graph; s7, using the questions of the user and the information returned by the knowledge graph as Prompt and sending the Prompt to the large language model; and S8, the large language model generates a reply after reasoning. According to the method, the stability and the accuracy of the output content of the vertical domain question-answering system can be enhanced, and the interpretability and the traceability of knowledge 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 question-answering systems, and specifically provides a vertical field question-answering system and method based on a knowledge graph and a large language model. Background Art

[0002] Question answering system is an advanced form of information retrieval system, which can answer questions asked by users in natural language accurately and concisely. The main reason for the rise of its research is people's demand for fast and accurate information acquisition. Question answering system is a research direction in the field of artificial intelligence and natural language processing that has attracted much attention and has broad development prospects. Retrieval-based question answering system uses semantic search technology to compare user questions with questions in the data set to find the best matching answer.

[0003] There are currently two mainstream question-answering systems: one is a search-based question-answering system based on a knowledge graph or vector database, and the other is a generative question-answering system based on a large language model. Although the search-based question-answering system is highly interpretable and traceable, and can largely guarantee the accuracy of the output content, its feedback content is severely fragmented and cannot be effectively summarized and generalized. It needs to be manually summarized in series before it can be used. The generative question-answering system can generate corresponding answers based on user questions and can feedback logically clear content without excessive human involvement, but the system is prone to hallucination problems, resulting in unstable accuracy of feedback knowledge, and the output content cannot be traced and has poor interpretability.

[0004] How to ensure that the feedback content of the question-answering system is accurate, fluent, coherent and explainable is an important research direction at present. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a highly practical vertical field question-answering system and method based on knowledge graph and large language model.

[0006] The technical solution adopted by the present invention to solve its technical problem is: A vertical field question answering system and method based on knowledge graph and large language model, comprising the following steps: S1. Segment and cut the text in the uploaded file into paragraphs, collect the title and paragraph content information of different levels of each paragraph, and complete text preprocessing; S2. Input the information of each paragraph into the large language model, let the large language model perform entity recognition, and extract the entity information and entity-related description information in the text; S3. For each text segment, select entity pairs from the identified entities, transform the relationship extraction task into a selection problem, and let the large language model determine the relationship between entities; S4. Build a knowledge graph using the entity information and relationship information extracted from the uploaded text; S5. Perform entity recognition and relationship extraction on user questions; S6. Search the corresponding entity information and relationship information from the knowledge graph; S7, sending the user's question and the information returned by the knowledge graph as a prompt to the large language model; S8. After inference, the large language model generates a response.

[0007] Furthermore, in step S1, the text uploaded by the user is segmented into paragraphs, and the titles and paragraph contents at different levels of each paragraph are read and stored together to prepare for entity recognition and relationship extraction.

[0008] Furthermore, in step S2, the entity recognition capability of the large language model is improved through prompt word engineering and large language model fine-tuning technology, and entities and corresponding entity description information are extracted from each text segment.

[0009] Furthermore, in step S3, the relationship extraction task of the large language model is converted into a question-answering selection task, by asking the large language model what kind of relationship exists between the two entities in the above text, and letting the large language model select the correct option from the given options.

[0010] Furthermore, in step S4, the entity information identified by the large language model and the extracted relationship information are read into the Neo4j database respectively to construct a knowledge graph.

[0011] Furthermore, in step S5, a large language model is used to perform entity recognition and question-answer selection on the user's question to obtain the entities and corresponding relationships involved in the user's question.

[0012] Furthermore, in step S6, the entities and corresponding relationships identified in the user's question are used to query the knowledge graph to find text description information related to the entity and other entity information connected to the corresponding relationship.

[0013] Furthermore, in step S7, the message returned by the knowledge graph and the user's question are sent to the large language model as a prompt to assist it in generating an answer.

[0014] Compared with the prior art, the vertical field question answering system and method based on knowledge graph and large language model of the present invention has the following outstanding beneficial effects: The present invention uses a large language model to automatically convert user-uploaded text into a knowledge graph, and uses the generated knowledge graph to assist the large language model in vertical field question answering, so as to enhance the stability and accuracy of the knowledge base output content, and improve the interpretability and traceability of knowledge. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 It is a flowchart of a vertical field question answering system and method based on knowledge graph and large language model; Figure 2 It is a schematic diagram of the entity recognition process in a vertical field question-answering system and method based on knowledge graph and large language model; Figure 3 It is a schematic diagram of the relationship extraction process in a vertical field question-answering system and method based on knowledge graph and large language model. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] A preferred embodiment is given below: Figure 1-3 As shown, in this embodiment, a vertical field question and answer system and method based on a knowledge graph and a large language model uses a large language model to automatically convert user uploaded text into a knowledge graph, and uses the generated knowledge graph to assist the large language model in vertical field question and answer.

[0019] The specific steps are: S1. Import the file into the knowledge storage module, load the text information in the document, set the similarity threshold, and complete the document slicing; use the BERT model to determine whether the similarity scores of two adjacent paragraphs are greater than the threshold from front to back in the order of the text. If so, merge the two paragraphs into one, otherwise cut them apart, and finally form multi-layer document slicing.

[0020] S2. Input the information of each paragraph into the large language model, let the large language model perform entity recognition, and extract the entity information and entity-related description information in the text.

[0021] S3. For each paragraph of text, select entity pairs from the identified entities, transform the relationship extraction task into a selection problem, and let the large language model determine the relationship between entities.

[0022] S4. Build a knowledge graph using the entity information and relationship information extracted from the uploaded text.

[0023] S5. Perform entity recognition and relationship extraction on user questions.

[0024] S6. Search for corresponding entity information and relationship information from the knowledge graph.

[0025] S7. Send the user's question and the information returned by the knowledge graph as a prompt to the large language model.

[0026] S8. After inference, the large language model generates a response.

[0027] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any technical solutions that conform to the above-mentioned specific implementations of the present invention and any appropriate changes or substitutions made by ordinary technicians in the relevant technical field shall fall within the patent protection scope of the present invention.

[0028] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A vertical field question answering system and method based on knowledge graph and large language model, characterized in that: Use the large language model to automatically convert the user-uploaded text into a knowledge graph, and use the generated knowledge graph to assist the large language model in vertical field question answering. The steps are as follows: S1. Segment and cut the text in the uploaded file into paragraphs, collect the title and paragraph content information of different levels of each paragraph, and complete text preprocessing; S2. Input the information of each paragraph into the large language model, let the large language model perform entity recognition, and extract the entity information and entity-related description information in the text; S3. For each text segment, select entity pairs from the identified entities, transform the relationship extraction task into a selection problem, and let the large language model determine the relationship between entities; S4. Build a knowledge graph using the entity information and relationship information extracted from the uploaded text; S5. Perform entity recognition and relationship extraction on user questions; S6. Search the corresponding entity information and relationship information from the knowledge graph; S7, sending the user's question and the information returned by the knowledge graph as a prompt to the large language model; S8. After inference, the large language model generates a response.

2. According to claim 1, a vertical field question answering system and method based on knowledge graph and large language model is characterized in that: In step S1, the text uploaded by the user is divided into paragraphs, and the titles and paragraph contents at different levels of each paragraph are read and stored together to prepare for entity recognition and relationship extraction.

3. A vertical field question answering system and method based on knowledge graph and large language model according to claim 2, characterized in that: In step S2, the entity recognition capability of the large language model is improved through prompt word engineering and large language model fine-tuning technology, and entities and corresponding entity description information are extracted from each text segment.

4. According to claim 3, a vertical field question-answering system and method based on knowledge graph and large language model is characterized in that, in step S3, the relationship extraction task of the large language model is converted into a question-answering selection task, by asking the large language model what kind of relationship exists between the two entities in the above text, so that the large language model selects the correct option from the given options.

5. A vertical field question answering system and method based on knowledge graph and large language model according to claim 4, characterized in that: In step S4, the entity information identified by the large language model and the extracted relationship information are read into the Neo4j database respectively to construct a knowledge graph.

6. A vertical field question answering system and method based on knowledge graph and large language model according to claim 5, characterized in that: In step S5, a large language model is used to perform entity recognition and question-answer selection on the user's question to obtain the entities and corresponding relationships involved in the user's question.

7. A vertical field question answering system and method based on knowledge graph and large language model according to claim 6, characterized in that: In step S6, the entities and corresponding relationships identified in the user's question are used to query the knowledge graph to find text description information related to the entity and other entity information connected to the corresponding relationship.

8. A vertical field question answering system and method based on knowledge graph and large language model according to claim 7, characterized in that: In step S7, the message returned by the knowledge graph and the user's question are sent to the large language model as a prompt to assist it in generating an answer.

Citation Information

Cited By

  • Customer service question and answer processing method and device

    CN120353902A

  • Project management-based question and answer system control method and device, and storage medium

    CN121279461A

  • Large model question answering method and device based on knowledge graph, medium and electronic equipment

    CN121935347A