Search

CN-122019561-A - Question and answer method and device based on generation type large model, electronic equipment and storage medium

CN122019561ACN 122019561 ACN122019561 ACN 122019561ACN-122019561-A

Abstract

The application relates to a question-answering method, a question-answering device, electronic equipment and a storage medium based on a large generated model, which are applied to the technical field of computers, wherein the method comprises the steps of obtaining an original question input by a user; the method comprises the steps of determining information to be searched from an original problem based on a large generation model, determining a core entity most relevant to the information to be searched, a knowledge segment relevant to the core entity and a core entity embedded vector corresponding to the core entity based on a pre-built target knowledge graph, generating search content based on the information to be searched, the knowledge segment and the core entity embedded vector, updating the information to be searched based on the search content and the original problem, and repeatedly executing the generation process until an answer of the original problem is determined according to the generated search content.

Inventors

  • LI SHICHENG
  • WU FEI
  • ZHANG SONGCHENG
  • XU YANG
  • Cui Yasen

Assignees

  • 合肥讯飞数码科技有限公司

Dates

Publication Date
20260512
Application Date
20251204

Claims (10)

  1. 1. A question-answering method based on a generative large model, comprising the steps of: Acquiring an original problem input by a user; determining information to be retrieved from the original problem based on a generative large model; Executing the following generation process through the generation type large model: Determining a core entity most relevant to the information to be searched, a knowledge segment relevant to the core entity and a core entity embedding vector corresponding to the core entity based on a pre-constructed target knowledge graph, wherein the core entity embedding vector is used for indicating graph semantics of the core entity in the target knowledge graph; And repeatedly executing the generation process until the answer of the original question is determined according to the generated search content.
  2. 2. The method according to claim 1, wherein determining the core entity most relevant to the information to be retrieved based on a pre-constructed target knowledge-graph comprises: determining an initial entity in the information to be retrieved; and determining the entity with the highest knowledge correlation with the initial entity in the target knowledge graph as the core entity.
  3. 3. The method of claim 2, wherein the knowledge-relevance includes semantic relevance and entity relevance, and wherein determining the entity in the target knowledge-graph that has the highest knowledge-relevance to the initial entity as the core entity includes: Generating an initial entity vector of an initial entity in the information to be retrieved; generating an initial semantic vector of the information to be retrieved; determining entity embedding vectors of the target knowledge graph, wherein candidate entity embedding vectors are related to the initial entity vectors; generating candidate semantic vectors of candidate entities corresponding to the candidate entity embedding vectors; determining a target semantic vector most relevant to the initial semantic vector in the candidate semantic vectors based on the similarity between the initial semantic vector and each candidate semantic vector; And determining the candidate entity corresponding to the target semantic vector as the core entity.
  4. 4. The method of claim 1, wherein determining information to be retrieved from the original problem based on a generative large model comprises: Splitting the original problem into at least one sub-problem based on the generated large model; Determining a first target sub-problem to be retrieved from the at least one sub-problem; And determining the information to be retrieved from the target sub-problem.
  5. 5. The method of claim 1, further comprising, prior to obtaining the original question entered by the user: Constructing an initial knowledge graph of a target field, wherein the initial knowledge graph comprises entities of the target field and relations among the entities; Encoding the initial knowledge graph based on a graph convolution network to obtain entity embedding vectors of the entities, wherein the entity embedding vectors are used for representing graph semantics of the entities in the target knowledge graph, and the graph semantics comprise semantic positions of the entities in the target knowledge graph and association relations between the entities and other entities; the target knowledge-graph is determined based on the initial knowledge-graph and the entity-embedding vector.
  6. 6. The method of claim 1, further comprising, prior to obtaining the original question entered by the user: obtaining a training sample, wherein the training sample comprises a sample question and a sample real answer corresponding to the sample question; Determining at least one piece of information to be searched from the sample problem based on the large generation model, and executing the generation process on each piece of information to be searched to obtain a sample generation answer corresponding to each piece of information to be searched; Determining generated rewarding information of each sample generated answer based on the sample real answer by adopting a preconfigured rewarding rule; And optimizing the generated big model based on each generated rewards information.
  7. 7. The method of claim 6, wherein the reward rules comprise at least one of: Judging whether the sample generation answer is generated according to a specified generation rule; judging whether the sample generation answer covers a core entity in the sample question or not; And judging whether the sample generated answer is consistent with the sample real answer.
  8. 8. A question-answering apparatus based on a generative large model, comprising: the acquisition unit is used for acquiring the original problem input by the user; A determining unit, configured to determine information to be retrieved from the original problem based on a generative large model; The generation unit is used for executing a generation process through the generation type large model, wherein the generation process is performed by determining a core entity most relevant to the information to be searched, a knowledge segment relevant to the core entity and a core entity embedded vector corresponding to the core entity based on a pre-constructed target knowledge graph, the core entity embedded vector is used for indicating graph semantics of the core entity in the target knowledge graph, generating search content based on the information to be searched, the knowledge segment and the core entity embedded vector, updating the information to be searched based on the search content and the original problem, and repeatedly executing the generation process until an answer of the original problem is determined according to the generated search content.
  9. 9. An electronic device comprising a memory and a processor; the memory is connected with the processor and used for storing programs; The processor is configured to implement the question-answering method based on the generative large model according to any one of claims 1 to 7 by running the program in the memory.
  10. 10. A storage medium having stored thereon a computer program which, when executed by a processor, implements the generative large model based question-answering method according to any one of claims 1 to 7.

Description

Question and answer method and device based on generation type large model, electronic equipment and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to a question-answering method, device, electronic device, and storage medium based on a generative large model. Background With the rapid development of artificial intelligence, and in particular of generative large Models (GENERATIVE LARGE Language Models, LLMs), knowledge accuracy, reasoning ability and retrievability of Models are becoming research hotspots. When generating answers to user questions using a large model, the large model often requires that information related to the user questions be retrieved from an external database and then combined to generate results. However, in the retrieval process, the matching of the similarity of the text surface layer is often focused, and the answer is obtained through one retrieval step, so that the accuracy of generating the answer is low, and the answer requirement of the complex question is difficult to meet. Disclosure of Invention The application provides a question and answer method, a question and answer device, electronic equipment and a storage medium based on a large generated model, which are used for solving the problem of low accuracy of generated answers in the prior art. According to a first aspect of an embodiment of the present application, there is provided a question-answering method based on a generative large model, including: Acquiring an original problem input by a user; determining information to be retrieved from the original problem based on a generative large model; Executing the following generation process through the generation type large model: Determining a core entity most relevant to the information to be searched, a knowledge segment relevant to the core entity and a core entity embedding vector corresponding to the core entity based on a pre-constructed target knowledge graph, wherein the core entity embedding vector is used for indicating graph semantics of the core entity in the target knowledge graph; And repeatedly executing the generation process until the answer of the original question is determined according to the generated search content. Optionally, determining, based on a pre-constructed target knowledge graph, a core entity most related to the information to be retrieved includes: determining an initial entity in the information to be retrieved; and determining the entity with the highest knowledge correlation with the initial entity in the target knowledge graph as the core entity. Optionally, the knowledge correlation includes semantic correlation and entity correlation, and determining an entity with the highest knowledge correlation with the initial entity in the target knowledge graph as the core entity includes: Generating an initial entity vector of an initial entity in the information to be retrieved; generating an initial semantic vector of the information to be retrieved; determining entity embedding vectors of the target knowledge graph, wherein candidate entity embedding vectors are related to the initial entity vectors; generating candidate semantic vectors of candidate entities corresponding to the candidate entity embedding vectors; determining a target semantic vector most relevant to the initial semantic vector in the candidate semantic vectors based on the similarity between the initial semantic vector and each candidate semantic vector; And determining the candidate entity corresponding to the target semantic vector as the core entity. Optionally, determining information to be retrieved from the original problem based on the generated big model includes: Splitting the original problem into at least one sub-problem based on the generated large model; Determining a first target sub-problem to be retrieved from the at least one sub-problem; And determining the information to be retrieved from the target sub-problem. Optionally, before acquiring the original problem input by the user, the method further includes: Constructing an initial knowledge graph of a target field, wherein the initial knowledge graph comprises entities of the target field and relations among the entities; Encoding the initial knowledge graph based on a graph convolution network to obtain entity embedding vectors of the entities, wherein the entity embedding vectors are used for representing graph semantics of the entities in the target knowledge graph, and the graph semantics comprise semantic positions of the entities in the target knowledge graph and association relations between the entities and other entities; the target knowledge-graph is determined based on the initial knowledge-graph and the entity-embedding vector. Optionally, before acquiring the original problem input by the user, the method further includes: obtaining a training sample, wherein the training sample comprises a sample question