Question and answer method and device, electronic equipment, storage medium and program product

By introducing intent recognition and knowledge graph query functions into the intelligent question-and-answer system, it dynamically adapts to user needs, solving the limitations of the existing system in the handling of complex problems, and improving the accuracy and reliability of answers.

CN119476307APending Publication Date: 2025-02-18SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411301907.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Existing intelligent question-and-answer systems show limitations, lack flexibility and adaptability when dealing with complex and unforeseen questions, making it difficult to guarantee the accuracy and reliability of the answers.

Method used

By obtaining the user's question text, performing intent recognition, determining the target query function, querying based on the knowledge graph, and generating answer text. The method includes obtaining text units, knowledge extraction, claim extraction and knowledge graph generation, and dynamically adapting to the different query needs of users.

Benefits of technology

It improves the accuracy and reliability of the answers of the intelligent question-and-answer system in complex scenarios, dynamically adapts to user needs, and ensures the stability and consistency of query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The invention provides a question and answer method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence. Performing intention recognition on the question text to obtain an intention recognition result; determining a target query function from a plurality of query functions based on the intention recognition result; based on the target query function, querying the knowledge graph to obtain a query result; and generating an answer text based on the query result. Through the mode, different query requirements and question and answer requirements of users can be dynamically adapted, the stability and consistency of query results can be improved, effective information of the knowledge graph can be fused, and accurate and reliable answer texts can be generated, so that the answer accuracy and reliability of the intelligent question and answer system can be ensured under the complex condition of dynamic change, and the user experience can be improved. And the real requirements of users on accurate questions and answers are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a question-answering method, device, electronic device, storage medium and program product. Background Art

[0002] Intelligent (Agent) question answering systems have been widely used in many fields, such as customer service, virtual assistants, and online education.

[0003] In the prior art, intelligent question answering systems usually rely on predefined rules or limited knowledge bases to achieve intelligent question answering, which makes the intelligent question answering systems show limitations when dealing with complex and unforeseen questions.

[0004] Since existing intelligent question-answering systems lack flexibility and adaptability, when faced with a dynamically changing knowledge environment, existing question-answering methods are difficult to maintain the accuracy and reliability of answers, and are difficult to meet users' actual needs for precise question-answering. Summary of the invention

[0005] The present invention provides a question-answering method, device, electronic device, storage medium and program product, which are used to solve the defects of the existing question-answering method that it is difficult to maintain the accuracy and reliability of the answer and difficult to meet the actual needs of users for accurate question-answering.

[0006] The present invention provides a question-answering method, comprising: obtaining a user's question text; performing intent recognition on the question text to obtain an intent recognition result; determining a target query function from multiple query functions based on the intent recognition result; querying a knowledge graph based on the target query function to obtain a query result; and generating an answer text based on the query result.

[0007] According to a question-answering method provided by the present invention, before obtaining the user's question text, it also includes: obtaining a text unit; the text unit is generated based on unstructured data; performing knowledge extraction on the text unit to obtain entity information and relationship information; based on the entity information and relationship information, performing claim extraction on the text unit to obtain claim information; the claim information is opinion information and assertions related to the entity information and relationship information; based on the entity information, relationship information and claim information, generating a knowledge graph.

[0008] According to a question-answering method provided by the present invention, knowledge is extracted from a text unit to obtain entity information and relationship information, including: inputting the text unit into a pre-trained large language model to obtain initial entity information and initial relationship information output by the large language model; disambiguating and summarizing the initial entity information and initial relationship information to obtain entity information and relationship information.

[0009] According to a question-answering method provided by the present invention, a knowledge graph is generated based on entity information, relationship information and claim information, including: generating an initial knowledge graph based on entity information, relationship information and claim information; clustering and optimizing the initial knowledge graph based on a community detection algorithm to generate a knowledge graph.

[0010] According to a question-answering method provided by the present invention, obtaining text units includes: obtaining document data; the document data is unstructured data; based on a layout analysis algorithm, parsing the document data to obtain structural features of the document data; based on the structural features, segmenting the document data to obtain at least one text unit.

[0011] According to a question-answering method provided by the present invention, after generating a knowledge graph based on entity information, relationship information and claim information, it also includes: storing the knowledge graph in a database; generating a database query statement based on the graph structure of the knowledge graph and the user's query requirements; generating multiple query functions based on the database query statement; the query function is used to query the knowledge graph.

[0012] The present invention also provides a question-and-answer device, comprising: an acquisition module for acquiring a user's question text; an intention recognition module for performing intention recognition on the question text and obtaining an intention recognition result; a determination module for determining a target query function from multiple query functions based on the intention recognition result; a query module for querying a knowledge graph based on the target query function and obtaining a query result; and an answer module for generating an answer text based on the query result.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the question-and-answer methods described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the question-and-answer method described in any one of the above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the question-answering method described above is implemented.

[0016] The question-and-answer method, device, electronic device, storage medium and program product provided by the present invention obtain the user's question text; perform intent recognition on the question text to obtain intent recognition results; determine the target query function from multiple query functions based on the intent recognition results; query the knowledge graph based on the target query function to obtain query results; and generate an answer text based on the query results. Through the above method, in a complex question-and-answer scenario, a suitable target query function is selected according to the user's intent to query the knowledge graph, and an answer text is generated according to the query results. It can not only dynamically adapt to the user's different query needs and question-and-answer needs, and improve the stability and consistency of the query results, but also integrate the effective information of the knowledge graph to generate accurate and reliable answer texts, thereby ensuring the accuracy and reliability of the intelligent question-and-answer system's answers in dynamically changing complex situations, and meeting the user's actual needs for accurate question-and-answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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.

[0018] Figure 1 It is one of the flow charts of the question-answering method provided by the present invention.

[0019] Figure 2 This is the second flow chart of the question-answering method provided by the present invention.

[0020] Figure 3 It is a structural schematic diagram of the question-answering device provided by the present invention.

[0021] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not 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.

[0023] It should be noted that all actions of acquiring signals, information or data in the present invention are performed in compliance with the corresponding data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0024] See also Figure 1 , Figure 1 It is one of the flow charts of the question-answering method provided by the present invention. In this embodiment, the question-answering method is applied to an intelligent question-answering system (i.e., an Agent question-answering system), and the question-answering method includes steps S110 to S130, and each step is specifically as follows: S110: Obtain the user's question text.

[0025] In this embodiment, the Agent question-answering system includes a data parsing module, a knowledge graph construction module, an information retrieval module and an intelligent question-answering module.

[0026] Among them, the data analysis module is used to parse unstructured data through a layout analysis algorithm, and according to the analysis results, the document is segmented according to different granularities to obtain a number of text units.

[0027] The knowledge graph construction module is used to extract entities, relations, and key claims from text units through a large language model (LLM), and to summarize and disambiguate the entities, relations, and key claims to construct a knowledge graph.

[0028] The information retrieval module is used to generate query statements based on the entities and relationships in the knowledge graph, and generate Python query functions based on the query statements for the Agent question-answering system to call.

[0029] The intelligent question-answering module is used to analyze the user's question text to select the appropriate Python query function, extract the corresponding query parameters from the user's conversation text, execute the query operation, and generate the answer text based on the query results.

[0030] Specifically, the intelligent question and answer module can obtain the user's question text.

[0031] S120: Perform intent recognition on the question text to obtain an intent recognition result.

[0032] In this embodiment, the intelligent question and answer module includes an intention recognition module and a query execution and answer generation module.

[0033] The intent recognition module is used to analyze and recognize the user's question text using natural language processing (NLP) technology and large language model (LLM) to obtain the user's intent recognition result, which contains the user's query intent. This process ensures that the Agent question-answering system can correctly understand the user's question type and query requirements to select the most appropriate query strategy or query tool.

[0034] Specifically, the intent recognition module in the intelligent question and answer module can perform intent recognition on the question text to obtain intent recognition results.

[0035] S130: Determine a target query function from multiple query functions based on the intention recognition result.

[0036] Specifically, the query execution and answer generation module is used to select a suitable function from multiple Python query functions as the target query function based on the intent recognition result, so as to execute the corresponding query operation and obtain the query result.

[0037] S140: Based on the target query function, query the knowledge graph to obtain query results.

[0038] After determining the target query function, the query execution and answer generation module can query the knowledge graph based on the target query function to obtain query results, which include relevant information in the knowledge graph.

[0039] Optionally, the relevant information in the knowledge graph includes direct factual data, inference results, or path relationships.

[0040] S150: Generate a response text based on the query result.

[0041] Furthermore, the query execution and answer generation module can combine the query results and the large language model to generate targeted answer text.

[0042] The question-answering method provided in this embodiment obtains the user's question text; performs intent recognition on the question text to obtain intent recognition results; based on the intent recognition results, determines the target query function from multiple query functions; based on the target query function, queries the knowledge graph to obtain query results; based on the query results, generates an answer text. Through the above method, in complex question-answering scenarios, a suitable target query function is selected according to the user's intent to query the knowledge graph, and an answer text is generated according to the query results. This can not only dynamically adapt to the user's different query needs and question-answering needs, and improve the stability and consistency of the query results, but also integrate the effective information of the knowledge graph to generate accurate and reliable answer texts, thereby ensuring the accuracy and reliability of the intelligent question-answering system's answers in dynamically changing complex situations, and meeting the user's actual needs for accurate question-answering.

[0043] In some embodiments, before obtaining the user's question text, it also includes: obtaining a text unit; the text unit is generated based on unstructured data; performing knowledge extraction on the text unit to obtain entity information and relationship information; based on the entity information and relationship information, performing claim extraction on the text unit to obtain claim information; the claim information is opinion information and assertions related to the entity information and relationship information; based on the entity information, relationship information and claim information, generating a knowledge graph.

[0044] Understandably, before obtaining the user's question text, it is necessary to build a knowledge graph.

[0045] See also Figure 2 , Figure 2 This is the second flow chart of the question-answering method provided by the present invention.

[0046] like Figure 2 As shown in FIG. 1 , before conducting intelligent question answering, it is necessary to first obtain document data, which is unstructured data; based on the layout analysis algorithm, the document data is parsed to obtain the structural features of the document data; based on the structural features, the document data is segmented to obtain at least one text unit T u .

[0047] Specifically, in this embodiment, the data analysis module includes a layout analysis module and a text segmentation module.

[0048] The layout analysis module can identify structural features in documents, such as titles, paragraphs, lists, tables, and charts. This process not only analyzes documents, but also identifies the logical structure of documents, such as chapter and section titles, thus providing a basis for subsequent text segmentation and information extraction. In addition, the layout analysis module can automatically adapt to different types of document formats, including PDF documents, Word documents, and HTML pages, to ensure the wide applicability of the Agent Question Answering System.

[0049] The text segmentation module can segment text into multiple text units, such as paragraphs or sentences, through natural language processing technology. This fine-grained segmentation helps improve the accuracy of subsequent data extraction and can identify important information blocks in the document to avoid information loss or misclassification.

[0050] Furthermore, knowledge is extracted from text units to obtain entity information and relationship information.

[0051] In this embodiment, the knowledge graph construction module includes an entity and relationship extraction module, a disambiguation and summarization module, a key claim extraction module, and a graph generation and enhancement module.

[0052] Among them, the entity and relationship extraction module is used to extract knowledge from text units and extract meaningful entities from text units. and relationship .

[0053] Specifically, the entity and relationship extraction module can use the large language model combined with the prompt word engineering to extract knowledge from text units, identify the core concepts in the text units and their mutual connections, and thus obtain entity and relationship .

[0054] Optionally, the text unit T u Input into the pre-trained large language model to obtain the initial entity information E and initial relationship information R output by the large language model. The extraction process of the initial entity information E and the initial relationship information R can be expressed by the following formula: .

[0055] Furthermore, the initial entity information E and the initial relationship information R are disambiguated and summarized to obtain the entity and relationship .

[0056] Specifically, the disambiguation and summarization module can disambiguate and summarize the extracted initial entity information E and initial relationship information R, remove redundant information, and merge similar or repeated initial entities and initial relationships.

[0057] Optionally, the initial entity information E and the initial relationship information R are disambiguated and summarized through feature analysis and similarity calculation, and the initial entities and initial relationships with similar names are merged into a standardized representation to obtain entity and relationship , the process of disambiguation and summarization can be expressed by the following formula: .

[0058] Optionally, the disambiguation process can be performed using a similarity function Representation: Assume that there are entity e1 and entity e2, Represents the similarity between entity e1 and entity e2; when When it is greater than a preset threshold θ, it can be considered that entity e1 and entity e2 are similar, and entity e1 and entity e2 can be merged.

[0059] Furthermore, based on the entity information and the relationship information, the text unit is subjected to claim extraction to obtain claim information.

[0060] The key claim extraction module can extract claims from text units based on entity information and relationship information, identify and extract important viewpoints or assertions related to entities and relationships, and obtain claim information. These claim information contains high-level information in document data and is an important source of semantic information in the knowledge graph.

[0061] Among them, it is claimed that the extraction process of K can be expressed by the following formula: .

[0062] Furthermore, a knowledge graph is generated based on entity information, relationship information and claim information.

[0063] Specifically, the graph generation and enhancement module can ,relation and propositions K, organized into a structured initial knowledge graph G; the nodes in the initial knowledge graph G represent entities, and the edges represent relationships.

[0064] Among them, the generation process of the initial knowledge graph G can be expressed by the following formula: .

[0065] Furthermore, based on the community detection algorithm, the initial knowledge graph is clustered and optimized to generate a knowledge graph.

[0066] Specifically, the graph generation and enhancement module can cluster and optimize the initial knowledge graph G through a community detection algorithm (such as the Leiden algorithm), and use graph embedding technology to generate an enhanced representation of the initial knowledge graph G to obtain a knowledge graph .

[0067] Among them, the knowledge graph The generation process can be expressed by the following formula: .

[0068] Among them, the knowledge graph It is an enhanced graph that generates embedded representations of nodes and edges through graph embedding technology to reveal hidden structures and patterns.

[0069] In some embodiments, knowledge extraction is performed on a text unit to obtain entity information and relationship information, including: inputting the text unit into a pre-trained large language model to obtain initial entity information and initial relationship information output by the large language model; disambiguating and summarizing the initial entity information and initial relationship information to obtain entity information and relationship information.

[0070] Specifically, the text unit T u Input into the pre-trained large language model to obtain the initial entity information E and initial relationship information R output by the large language model. The extraction process of the initial entity information E and the initial relationship information R can be expressed by the following formula: .

[0071] Furthermore, the initial entity information E and the initial relationship information R are disambiguated and summarized to obtain the entity and relationship .

[0072] Specifically, the disambiguation and summarization module can disambiguate and summarize the extracted initial entity information E and initial relationship information R, remove redundant information, and merge similar or repeated initial entities and initial relationships.

[0073] Optionally, the initial entity information E and the initial relationship information R are disambiguated and summarized through feature analysis and similarity calculation, and the initial entities and initial relationships with similar names are merged into a standardized representation to obtain entity and relationship , the process of disambiguation and summarization can be expressed by the following formula: .

[0074] Optionally, the disambiguation process can be performed using a similarity function Representation: Assume that there are entity e1 and entity e2, Represents the similarity between entity e1 and entity e2; when When it is greater than a preset threshold θ, it can be considered that entity e1 and entity e2 are similar, and entity e1 and entity e2 can be merged.

[0075] In some embodiments, a knowledge graph is generated based on entity information, relationship information and claim information, including: generating an initial knowledge graph based on entity information, relationship information and claim information; clustering and optimizing the initial knowledge graph based on a community detection algorithm to generate a knowledge graph.

[0076] Specifically, the graph generation and enhancement module can ,relation and propositions K, organized into a structured initial knowledge graph G; the nodes in the initial knowledge graph G represent entities, and the edges represent relationships.

[0077] Among them, the generation process of the initial knowledge graph G can be expressed by the following formula: .

[0078] Furthermore, based on the community detection algorithm, the initial knowledge graph is clustered and optimized to generate a knowledge graph.

[0079] Specifically, the graph generation and enhancement module can cluster and optimize the initial knowledge graph G through a community detection algorithm (such as the Leiden algorithm), and use graph embedding technology to generate an enhanced representation of the initial knowledge graph G to obtain a knowledge graph .

[0080] Among them, the knowledge graph The generation process can be expressed by the following formula: .

[0081] In some embodiments, obtaining a text unit includes: obtaining document data; the document data is unstructured data; parsing the document data based on a layout analysis algorithm to obtain structural features of the document data; and segmenting the document data based on the structural features to obtain at least one text unit.

[0082] Specifically, before conducting intelligent question and answering, document data is first obtained, and the document data is unstructured data.

[0083] Furthermore, the layout analysis module can identify structural features in the document data, such as titles, paragraphs, lists, tables, and charts. This process can not only analyze the document, but also identify the logical structure of the document, such as chapters and section titles, thus providing a basis for subsequent text segmentation and information extraction. In addition, the layout analysis module can automatically adapt to different types of document formats, including PDF documents, Word documents, and HTML pages, to ensure the wide applicability of the Agent Question Answering System.

[0084] Furthermore, the text segmentation module can segment the text into multiple text units, such as paragraphs or sentences, through natural language processing technology. This fine-grained segmentation helps improve the accuracy of subsequent data extraction and can identify important information blocks in the document to avoid information loss or misclassification.

[0085] In some embodiments, after generating a knowledge graph based on entity information, relationship information and claim information, it also includes: storing the knowledge graph in a database; generating a database query statement based on the graph structure of the knowledge graph and the user's query requirements; generating multiple query functions based on the database query statement; and the query function is used to query the knowledge graph.

[0086] Specifically, after obtaining the knowledge graph, the knowledge graph is stored in a graph database.

[0087] Furthermore, based on the graph structure of the knowledge graph and the user's query requirements, a database query statement is generated.

[0088] Specifically, in this embodiment, the information retrieval module includes a query generation module and a tool generation module.

[0089] The query generation module is used to automatically generate Cypher query statements based on the graph structure of the knowledge graph and all possible query requirements of users. Cypher query statements are declarative graph query languages ​​used in graph databases.

[0090] Optionally, the generated query statements may cover multiple types of queries, including entity queries, relationship queries, and path queries.

[0091] Furthermore, based on the database query statement, multiple query functions are generated; the query functions are used to query the knowledge graph.

[0092] The tool generation module is used to automatically create multiple Python query functions based on the generated Cypher query statements. The query function encapsulates specific query logic and provides a parameterized interface, enabling the Agent question-answering system to dynamically execute query operations based on different query conditions.

[0093] Among them, each query function corresponds to a specific query task, and can generate corresponding Cypher statements according to input parameters, execute queries and return results.

[0094] With this approach, the system can handle multiple query requirements in a modular manner, ensuring flexibility and scalability.

[0095] The question-answering method provided in this embodiment accurately parses document data through a large language model and natural language processing technology, automatically constructs and optimizes a knowledge graph, and improves the accuracy of information retrieval. Further, through the query mode called by the tool, the Agent question-answering system can accurately generate query parameters, thereby improving the stability of the query and further improving the accuracy and robustness of the question-answering system.

[0096] The present invention also provides a question-answering device. Figure 3 , Figure 3 3 is a schematic diagram of the structure of the question-answering device provided by the present invention. In this embodiment, the question-answering device includes an acquisition module 310 , an intention recognition module 320 , a determination module 330 , a query module 340 and an answer module 350 .

[0097] The acquisition module 310 is used to acquire the user's question text.

[0098] The intention recognition module 320 is used to perform intention recognition on the question text and obtain an intention recognition result.

[0099] The determination module 330 is used to determine a target query function from multiple query functions based on the intention recognition result.

[0100] The query module 340 is used to query the knowledge graph based on the target query function to obtain query results.

[0101] The answer module 350 is used to generate an answer text based on the query result.

[0102] In some embodiments, the question-answering device also includes a generation module; the generation module is used to obtain text units; the text units are generated based on unstructured data; knowledge extraction is performed on the text units to obtain entity information and relationship information; based on the entity information and relationship information, claim extraction is performed on the text units to obtain claim information; the claim information is opinion information and assertions related to the entity information and relationship information; based on the entity information, relationship information and claim information, a knowledge graph is generated.

[0103] In some embodiments, a generation module is used to input a text unit into a pre-trained large language model to obtain initial entity information and initial relationship information output by the large language model; disambiguate and summarize the initial entity information and initial relationship information to obtain entity information and relationship information.

[0104] In some embodiments, the knowledge graph generation module is used to generate an initial knowledge graph based on entity information, relationship information and claim information; based on a community detection algorithm, the initial knowledge graph is clustered and optimized to generate a knowledge graph.

[0105] In some embodiments, a generation module is used to obtain document data; the document data is unstructured data; based on a layout analysis algorithm, the document data is parsed to obtain structural features of the document data; based on the structural features, the document data is segmented to obtain at least one text unit.

[0106] In some embodiments, a generation module is used to store the knowledge graph in a database; based on the graph structure of the knowledge graph and the user's query requirements, a database query statement is generated; based on the database query statement, multiple query functions are generated; and the query function is used to query the knowledge graph.

[0107] The invention also provides an electronic device. Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the question-answering method.

[0108] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a 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.

[0109] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the question-and-answer method provided by the above-mentioned methods.

[0110] The present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the question-and-answer methods provided by the above methods.

[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0113] Finally, 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A question-answering method, characterized in that: include: Get the user's question text; Performing intent recognition on the question text to obtain an intent recognition result; Based on the intention recognition result, determining a target query function from a plurality of query functions; Based on the target query function, query the knowledge graph to obtain query results; Based on the query results, an answer text is generated.

2. The question-answering method according to claim 1, characterized in that: Before obtaining the user's question text, the method further includes: Obtaining a text unit; the text unit is generated based on unstructured data; Performing knowledge extraction on the text unit to obtain entity information and relationship information; Based on the entity information and the relationship information, performing claim extraction on the text unit to obtain claim information; the claim information is viewpoint information and assertions related to the entity information and the relationship information; The knowledge graph is generated based on the entity information, the relationship information and the claim information.

3. The question-answering method according to claim 2, characterized in that: The step of extracting knowledge from the text unit to obtain entity information and relationship information includes: Inputting the text unit into a pre-trained large language model to obtain initial entity information and initial relationship information output by the large language model; The initial entity information and the initial relationship information are disambiguated and summarized to obtain the entity information and the relationship information.

4. The question-answering method according to claim 2, characterized in that: The generating the knowledge graph based on the entity information, the relationship information and the claim information includes: Generate an initial knowledge graph based on the entity information, the relationship information and the claim information; Based on the community detection algorithm, the initial knowledge graph is clustered and optimized to generate the knowledge graph.

5. The question-answering method according to claim 2, characterized in that: The obtaining text unit includes: Acquire document data; the document data is unstructured data; Based on the layout analysis algorithm, the document data is parsed to obtain the structural features of the document data; Based on the structural features, the document data is segmented to obtain at least one text unit.

6. The question-answering method according to claim 2, characterized in that: After generating the knowledge graph based on the entity information, the relationship information and the claim information, the method further includes: Storing the knowledge graph in a database; Generate a database query statement based on the graph structure of the knowledge graph and the query requirements of the user; Based on the database query statement, a plurality of query functions are generated; the query function is used to query the knowledge graph.

7. A question-answering device, characterized in that: include: The acquisition module is used to obtain the user's question text; An intention recognition module is used to perform intention recognition on the question text to obtain an intention recognition result; A determination module, configured to determine a target query function from a plurality of query functions based on the intention recognition result; A query module, used to query the knowledge graph based on the target query function to obtain query results; The answer module is used to generate an answer text based on the query result.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the question-answering method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the question-answering method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the question-answering method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Intelligent question answering method, system and equipment based on GraphRAG and medium

    CN119988572A