Search

CN-122021930-A - Question and answer generation method and device, electronic equipment and storage medium

CN122021930ACN 122021930 ACN122021930 ACN 122021930ACN-122021930-A

Abstract

The application provides a question and answer generation method, a question and answer generation device, electronic equipment and a storage medium, and belongs to the technical field of data processing; the method comprises the steps of carrying out dimension decomposition on each semantic intention to obtain a plurality of semantic analysis dimensions corresponding to each semantic intention, randomly selecting one semantic analysis dimension corresponding to each semantic intention from the plurality of semantic analysis dimensions corresponding to the semantic intention to form a group of intention-dimension pairs, generating prompt words based on the intention-dimension pairs, and generating output answers based on the prompt words. The application solves the dilemma of insufficient diversity and impaired effectiveness in the prior art, and provides a universal and extensible scheme for generating the diversified questions and answers with controllable, interpretable and high quality.

Inventors

  • HE JUN
  • ZHU JIAN
  • SUN BO
  • ZHENG YONGHE
  • LIU XIUFENG

Assignees

  • 北京师范大学珠海校区

Dates

Publication Date
20260512
Application Date
20260305

Claims (10)

  1. 1. A question-answer generation method, comprising: Performing intention recognition on the input problem to obtain a plurality of semantic intentions; respectively carrying out dimension decomposition on each semantic intention to obtain a plurality of semantic analysis dimensions corresponding to each semantic intention; For each semantic intention, randomly selecting one from a plurality of semantic analysis dimensions corresponding to the semantic intention to form a group of intention-dimension pairs; after generating the prompt word based on each intention-dimension pair, generating an output answer based on the prompt word.
  2. 2. A question-answer generation method according to claim 1 in which the semantic intent is a noun phrase tag.
  3. 3. A question-answer generation method according to claim 1 in which the semantic analysis dimensions of the semantic intent are mutually orthogonal.
  4. 4. A question-answer generation method according to claim 1 in which the semantic analysis dimension is a noun phrase tag.
  5. 5. A question-answer generating device, comprising: The intention recognition module is used for carrying out intention recognition on the input problem to obtain a plurality of semantic intentions; the dimension decomposition module is used for respectively carrying out dimension decomposition on each semantic intention to obtain a plurality of semantic analysis dimensions corresponding to each semantic intention; The prompt construction module is used for randomly selecting one semantic meaning from a plurality of semantic analysis dimensions corresponding to the semantic meaning for each semantic meaning to form a group of meaning-dimension pairs; And the answer generation module is used for generating an output answer based on the prompt words after generating the prompt words based on each intention-dimension pair.
  6. 6. A question-answer generation method according to claim 5 in which the semantic intent is a noun phrase tag.
  7. 7. A question-answer generation method according to claim 5 in which the semantic analysis dimensions of the semantic intent are mutually orthogonal.
  8. 8. An electronic device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements the question-answer generation method of any one of claims 1 to 6 when the computer program is executed by the processor.
  9. 9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements a question-answer generation method as claimed in any one of claims 1 to 6.
  10. 10. A computer program product comprising a computer program which, when executed by a processor, implements a question-answer generation method as claimed in any one of claims 1 to 6.

Description

Question and answer generation method and device, electronic equipment and storage medium Technical Field The present application relates to the field of data processing technologies, and in particular, to a question and answer generating method, a question and answer generating device, an electronic device, and a storage medium. Background Large language models (Large Language Model, LLM) have recently made significant progress in question-and-answer generation tasks, capable of generating semantically related, grammatically smooth answers based on a given question. The question and answer generation is one of core tasks of natural language processing, is widely applied to scenes such as intelligent customer service, education assistance, information retrieval, man-machine interaction and the like, and the performance of the question and answer generation directly influences user experience and system reliability. Especially in open domain question-answering or complex reasoning scenarios, users often desire to obtain answers that are rich in content, multiple in view angle, and have interpretability, rather than a single, mechanical output. Thus, generating high quality and diversified answers has become an important indicator of the ability of modern question-answering systems. The current mainstream question-answer generation method mainly relies on a large language model in combination with a random decoding strategy, such as temperature sampling, core sampling, or multiple prompt sampling to obtain multiple answers. These approaches attempt to cover different answer possibilities by introducing randomness at the lemma level or making multiple queries on the same question. However, such strategies lack explicit modeling of answer semantic structures-when the model output distribution is highly concentrated, even if sampling randomness is increased, similar answers in dominant patterns tend to be repeatedly generated, and excessive randomness enhancement is also prone to semantic deviations, logic breaks, or fact errors. In addition, the existing methods generally do not consider the organization structure of answers in a high-level semantic dimension, so that exploration of answer space is unbalanced, and low-frequency but reasonable answer paths are difficult to effectively cover. In view of the foregoing, a technical solution is needed that can explicitly model answer semantic structures and guide diversified generation accordingly. Disclosure of Invention The application provides a question and answer generation method, a question and answer generation device, electronic equipment and a storage medium, which are used for solving the defect that the question and answer generation method in the prior art is difficult to realize full, controllable and structured exploration of an answer space while maintaining the validity of an answer under the condition of lacking semantic guidance. The application provides a question and answer generation method, which comprises the following steps: Performing intention recognition on the input problem to obtain a plurality of semantic intentions; respectively carrying out dimension decomposition on each semantic intention to obtain a plurality of semantic analysis dimensions corresponding to each semantic intention; For each semantic intention, randomly selecting one from a plurality of semantic analysis dimensions corresponding to the semantic intention to form a group of intention-dimension pairs; after generating the prompt word based on each intention-dimension pair, generating an output answer based on the prompt word. According to the question-answer generation method provided by the application, the semantic intention is a noun phrase label. According to the question-answer generation method provided by the application, the semantic analysis dimensions of the semantic intention are mutually orthogonal. According to the question-answer generation method provided by the application, the semantic analysis dimension is a noun phrase label. The application also provides a question and answer generating device, which comprises the following modules: The intention recognition module is used for carrying out intention recognition on the input problem to obtain a plurality of semantic intentions; the dimension decomposition module is used for respectively carrying out dimension decomposition on each semantic intention to obtain a plurality of semantic analysis dimensions corresponding to each semantic intention; The prompt construction module is used for randomly selecting one semantic meaning from a plurality of semantic analysis dimensions corresponding to the semantic meaning for each semantic meaning to form a group of meaning-dimension pairs; And the answer generation module is used for generating an output answer based on the prompt words after generating the prompt words based on each intention-dimension pair. According to the question and answer generating de