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

By classifying and rewriting the questions entered by users, high-quality questions are generated, and intent classification is performed to call the corresponding response strategy, the question with low answer accuracy of the Q&A system when inputting low-quality questions is solved, and higher answer accuracy and recall rate are achieved.

CN120086344APending Publication Date: 2025-06-03IFLYTEK CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510417642.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

When the quality of questions entered by users is low, the answer accuracy of the big model-based question-and-answer system is low.

Method used

By classifying the original questions entered by the user, determining whether they are low-quality problems, and rewritten according to their low-quality types, high-quality problems are generated. Then, intent classification is performed for high-quality questions, and corresponding response strategies are called based on intent classification results, and answers are generated using the big model.

Benefits of technology

Improve the answer accuracy and recall rate of the Q&A system in the case of low-quality question input, ensuring targeted responses to different ideas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086344A_ABST
    Figure CN120086344A_ABST
Patent Text Reader

Abstract

The invention discloses a question and answer method and device, equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence, and the method comprises the steps: obtaining an original question input by a user, carrying out the quality classification of the original question, and determining whether the original question belongs to a low-quality question or not, and determining a low-quality type when the original question is the low-quality question; determining a high-quality problem based on the original problem and the quality classification result; wherein if the original problem is not the low-quality problem, the original problem is determined as a high-quality problem, and if the original problem is the low-quality problem, at least the original problem is rewritten corresponding to the low-quality type to which the original problem belongs, and the high-quality problem is obtained; performing intention classification on the high-quality questions to determine whether the high-quality questions are knowledge questions or not and knowledge types of the high-quality questions when the high-quality questions are the knowledge questions; and calling a large model to process the high-quality question according to a response strategy corresponding to the intention classification result to generate an answer to the high-quality question. According to the invention, the answering accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Currently, large models (LMs) have been widely used in fields such as knowledge question answering. However, when the quality of the user's input question is relatively low, such as when the question is complex or unclear, the answer accuracy rate will be relatively low. Summary of the Invention

[0003] In view of the above problems, this application provides a question-answering method, device, equipment, storage medium, and program product to improve the answer accuracy rate. The specific solutions are as follows:

[0004] The first aspect of this application provides a question-answering method, including:

[0005] Obtain the original question input by the user;

[0006] Perform quality classification on the original question to obtain a quality classification result; the quality classification result indicates whether the original question belongs to a low-quality question, and the low-quality type when the original question belongs to a low-quality question;

[0007] Determine a high-quality question based on the original question and the quality classification result; where if the original question is not a low-quality question, determine the original question as a high-quality question, and if the original question is a low-quality question, at least rewrite the original question according to the low-quality type to which the original question belongs to obtain a high-quality question;

[0008] Perform intention classification on the high-quality question to obtain an intention classification result; the intention classification result indicates whether the high-quality question is a knowledge-based question, and the knowledge type when it is a knowledge-based question;

[0009] Call the large model to process the high-quality question according to the response strategy corresponding to the intention classification result to generate the answer to the high-quality question.

[0010] In a possible implementation, the low-quality type to which the low-quality question belongs is one of a preset variety of low-quality types; the preset variety of low-quality types at least includes the following: multi-intention, intention ambiguity, and need for reference resolution.

[0011] In a possible implementation, at least rewriting the original question according to the low-quality type to which the original question belongs includes:

[0012] If the original problem belongs to a multi-intent problem, at least decompose the intent of the original problem to obtain multiple sub-problems as the high-quality problems; each sub-problem is a problem with a single intent or a problem with related intents.

[0013] If the original problem belongs to an ambiguous intent problem, at least clarify the intent of the original problem to obtain a high-quality problem with a clear intent.

[0014] If the original problem belongs to a problem that requires anaphora resolution, at least perform anaphora resolution on the original problem to obtain a high-quality problem with clear anaphora.

[0015] In a possible implementation, the at least rewriting the original problem corresponding to the low-quality type to which the original problem belongs includes:

[0016] Adding the original problem to the first problem slot of the first instruction template to obtain a first instruction; the first instruction template further includes a first task instruction, and the first task instruction is: clarify the intent, split multi-intents, and resolve anaphora for the original problem in the first problem slot.

[0017] Inputting the first instruction into the large model to obtain the high-quality problem output by the large model.

[0018] In a possible implementation, the at least rewriting the original problem corresponding to the low-quality type to which the original problem belongs includes:

[0019] Adding the original problem to the second problem slot of the second instruction template corresponding to the low-quality type to obtain a second instruction; the second instruction template further includes a second task instruction, and the second task instruction is: rewrite the original problem in the second problem slot corresponding to the low-quality type; where, if the low-quality type is multi-intent, the corresponding rewrite is to split multi-intents; if the low-quality type is ambiguous intent, the corresponding rewrite is to clarify the intent; if the low-quality type is anaphora resolution required, the corresponding rewrite is to resolve anaphora.

[0020] Inputting the second instruction into the large model to obtain the high-quality problem output by the large model.

[0021] In a possible implementation, the intent classification of the high-quality problem includes:

[0022] Perform a first classification process on the high-quality problem to determine whether the high-quality problem is a knowledge-based problem and the initial knowledge type when it belongs to a knowledge-based problem; the initial knowledge type is an online information source or professional knowledge.

[0023] If the initial knowledge type is professional knowledge, perform a second classification on the high-quality question to determine whether the high-quality question belongs to the target professional knowledge category question.

[0024] In a possible implementation, using the response strategy corresponding to the intention classification result to call a large model to process the high-quality question to generate an answer to the high-quality question includes:

[0025] If the high-quality question is not a knowledge-based question, directly call the large model to answer the high-quality question to generate an answer to the high-quality question;

[0026] If the high-quality question is a target professional knowledge category question, retrieve the target professional knowledge matching the high-quality question in the target professional knowledge base, and call the large model to answer the high-quality question with reference to the retrieved target professional knowledge to generate an answer to the high-quality question;

[0027] If the high-quality question is a non-target professional knowledge category question, directly call the large model to answer the high-quality question to generate an answer to the high-quality question; or, search the network for network knowledge matching the high-quality question, and call the large model to answer the high-quality question with reference to the retrieved network knowledge to generate an answer to the high-quality question;

[0028] If the high-quality question is an online information source category question, call the large model to identify the fields required for information query through the online information source; call the interface of the online information source so that the online information source processes the fields to obtain response data; call the large model to process the response data to generate an answer to the high-quality question.

[0029] In a possible implementation, the quality classification of the original question includes: performing quality classification on the original question through a pre-trained quality classification model; the quality classification model is trained through a preset training data set;

[0030] The preset training data set is obtained by generalizing a seed data set; the seed data set includes high-quality questions and various low-quality questions; the number of questions of each quality is not less than a preset number; the questions of each quality cover multiple industries, multiple scenarios, and various expression forms.

[0031] A second aspect of the present application provides a question and answer device, including:

[0032] An input module, configured to obtain an original question input by a user;

[0033] A quality classification module for classifying the quality of the original question to obtain a quality classification result, where the quality classification result indicates whether the original question belongs to a low-quality question and the low-quality type when the original question belongs to a low-quality question.

[0034] A determination module for determining a high-quality question based on the original question and the quality classification result. Specifically, if the original question is not a low-quality question, it is determined that the original question is a high-quality question; if the original question is a low-quality question, at least the original question is rewritten corresponding to the low-quality type to obtain a high-quality question.

[0035] An intent classification module for classifying the intent of the high-quality question to obtain an intent classification result, where the intent classification result indicates whether the high-quality question is a knowledge-based question and the knowledge type when it is a knowledge-based question.

[0036] A response module for processing the high-quality question by invoking a large model with the response strategy corresponding to the intent classification result to generate an answer to the high-quality question.

[0037] The third aspect of the present application provides a computer program product, including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement the question-and-answer method in the first aspect or any implementation manner of the first aspect.

[0038] The fourth aspect of the present application provides an electronic device, including at least one processor and a memory connected to the processor, where:

[0039] The memory is used to store a computer program.

[0040] The processor is used to execute the computer program so that the electronic device can implement the question-and-answer method in the first aspect or any implementation manner of the first aspect.

[0041] The fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the question-and-answer method in the first aspect or any implementation manner of the first aspect.

[0042] With the above technical solutions, the question-answering method, device, equipment, storage medium, and program product provided by this application, after obtaining the original question input by the user, first perform quality classification on the original question to determine whether the original question belongs to a low-quality question and the low-quality type when it is a low-quality question; determine a high-quality question based on the original question and the quality classification result; wherein, if the original question is not a low-quality question, determine the original question as a high-quality question, and if the original question is a low-quality question, at least rewrite the original question according to the low-quality type to which it belongs to obtain a high-quality question; then perform intent classification on the high-quality question to determine whether the high-quality question is a knowledge-based question and the knowledge type when it is a knowledge-based question; then call a large model to process the high-quality question according to the response strategy corresponding to the intent classification result to generate an answer to the high-quality question. By first performing quality classification on the questions input by the user and rewriting low-quality questions to obtain high-quality questions, this application increases the recall rate and accuracy of the answer content. When replying based on high-quality questions, it will perform intent classification on the high-quality questions and call a large model to process the high-quality questions according to the response strategy corresponding to the intent classification result to generate an answer to the high-quality question, further improving the accuracy of the answer while increasing the recall rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the original elements and elements are not necessarily drawn to scale.

[0044] Figure 1 It is a flowchart of an implementation of the question-answering method provided by this application;

[0045] Figure 2 It is a flowchart of an implementation of at least rewriting the original question according to the low-quality type to which the original question belongs provided by this application;

[0046] Figure 3 It is another flowchart of an implementation of at least rewriting the original question according to the low-quality type to which the original question belongs provided by this application;

[0047] Figure 4 It is a flowchart of an implementation of performing intent classification on high-quality questions provided by this application;

[0048] Figure 5 It is a schematic structural diagram of a question-answering device provided by this application;

[0049] Figure 6 It is a schematic structural diagram of an electronic device provided by this application. Detailed implementation manners

[0050] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, rather than intended to limit the present application.

[0051] The embodiments of the present application will be described below with reference to the accompanying drawings. Those of ordinary skill in the art will know that with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0052] The terms "first", "second", etc. in the specification, claims and above-mentioned accompanying drawings of the present application are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinguishing when describing objects with the same attributes in the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product or device including a series of units does not have to be limited to those units, but may include other units not clearly listed or inherent to these processes, methods, products or devices.

[0053] The inventors of the present application have found through research that in the knowledge Q&A scenario on the enterprise side, when the quality of the questions input by users is relatively high (for example, accurate description, clear expression, single intention, etc.), the accuracy of the enterprise-level large model in answering professional knowledge is relatively high. However, when the quality of the questions input by users is not high (for example, inaccurate description, vague expression, multiple intentions, etc.), the accuracy rate of the answers will be relatively low. Moreover, the enterprise-level large model is usually obtained through supervised fine-tuning (SFT) and prompt engineering optimization, which will make the large model tend to perform Q&A of professional knowledge and ensure the recall rate of professional knowledge questions. In the Q&A of general domain knowledge, it will also tend to answer in the way of professional domain answers (that is, retrieve relevant knowledge in the professional domain and refer to the retrieved professional knowledge for answering), and the recall rate and precision rate are relatively low.

[0054] In order to improve the Q&A accuracy rate based on the large model, the solution of the present application is proposed.

[0055] As Figure 1 shown, it is a flowchart of an implementation of the Q&A method provided by the embodiment of the present application, which may include:

[0056] Step S101: Obtain the question input by the user (for the convenience of narration and distinction, denoted as the original question).

[0057] The user can input the original question in any way such as text, voice, or image.

[0058] Optionally, the original question in text format input by the user can be received through a text input box;

[0059] Optionally, the voice input by the user can be collected through a voice collection device, and the voice is subjected to speech recognition to obtain the original question in text format;

[0060] Optionally, the text image input by the user can be received through an image input interface, and optical character recognition (OCR) is performed on the text image to obtain the original question in text format.

[0061] Step S102: Perform quality classification on the original question to obtain a quality classification result; the quality classification result characterizes whether the original question belongs to a low-quality question and the low-quality type when the original question is a low-quality question.

[0062] The pre-trained quality classification model can be used to perform quality classification on the original question to obtain a quality classification result. The quality classification model can be a small model (such as, for example, the BERT model, or the RoBerta model, etc.), or a large model. As an example, it can include but is not limited to large models of any of the following architectures: Transformer, PaLM (Pathways Language Model), T5 (Text-to-Text Transfer Transformer), etc.

[0063] The purpose of the quality classification of the original question in this application is to determine whether the original question is a low-quality question or a high-quality question, and if the original question is a low-quality question, what type of low-quality question it is. That is to say, the quality classification of the original question in this application is not a binary classification but a multi-classification.

[0064] Step S103: Determine a high-quality question based on the original question and the quality classification result; among them, if the original question is not a low-quality question, then determine the original question as a high-quality question. If the original question is a low-quality question, at least rewrite the original question corresponding to the low-quality type to which the question belongs to obtain a high-quality question.

[0065] This application configures different rewriting methods for questions of different low-quality types to rewrite the original question into a high-quality question.

[0066] In the case where the original question belongs to any low-quality type of question, the original question can be rewritten only by using the rewriting method corresponding to that low-quality type, or the original question can be rewritten by using the rewriting method corresponding to that low-quality type and at least one other low-quality type corresponding rewriting method.

[0067] Step S104: Perform intent classification on the high-quality question to obtain an intent classification result; the intent classification result indicates whether the high-quality question is a knowledge-based question and, when it is a knowledge-based question, the type of knowledge.

[0068] Based on the high-quality question, the user intent can be accurately determined. The intent classification of high-quality questions in this application is also multi-classification. In addition to being able to identify whether a high-quality question is a knowledge-based question, it can also identify which type of knowledge-based question it is when the high-quality question is a knowledge-based question.

[0069] Step S105: Call the large model to process the high-quality question according to the response strategy corresponding to the intent classification result to generate an answer to the high-quality question.

[0070] For different intent classification results, different response strategies are configured, and different response strategies call the large model in different ways.

[0071] The generated answer to the high-quality question is the answer to the original question.

[0072] When outputting the answer to the high-quality question, it can be directly displayed in text for the user to view, or it can be played in a voice broadcast mode for the user to listen to, or it can be displayed in text and played in a voice broadcast mode at the same time.

[0073] The question-answering method provided by the embodiments of this application first performs quality classification on the question input by the user, rewrites the low-quality question to obtain a high-quality question, thereby increasing the recall rate and accuracy of the answer content. When replying based on the high-quality question, intent classification is performed on the high-quality question, and the large model is called to process the high-quality question according to the response strategy corresponding to the intent classification result to generate an answer to the high-quality question, achieving targeted responses for different intents and further improving the accuracy of the answer while increasing the recall rate.

[0074] In an optional embodiment, when it is determined that the original question is a low-quality question, the low-quality type to which the original question belongs is one of a preset variety of low-quality types. Among them, the preset variety of low-quality types at least includes the following: multi-intent, ambiguous intent, and need for reference resolution.

[0075] A multi-intent problem refers to a problem that expresses multiple intents or requirements. The sentence structure of such a problem may be relatively complex, containing multiple clauses or various semantic relationships, such as parallelism, succession, etc.

[0076] An intent ambiguity problem means that the problem statement is unclear, the information is incomplete, or there is ambiguity, making it difficult for the question-answering system to accurately understand the user's true intent.

[0077] A coreference resolution problem in a problem refers to the existence of referential ambiguity in the problem. It is necessary to identify different expressions that refer to the same entity in the problem and divide them into the same equivalent set to eliminate the referential ambiguity in the problem and establish the association between different expressions.

[0078] In an optional embodiment, one implementation manner of at least rewriting the original problem corresponding to the low-quality type to which the original problem belongs may be:

[0079] If the original problem belongs to a multi-intent problem, at least perform intent decomposition on the original problem to obtain multiple sub-problems as high-quality problems.

[0080] Performing intent decomposition on the original problem means decomposing the original problem into multiple sub-problems, and each sub-problem is a problem with a single intent or a problem with related intents.

[0081] When the original problem belongs to a multi-intent problem, it is possible to only perform intent decomposition on the original problem. Further, it is also possible to perform intent clarification processing and / or coreference resolution processing on the original problem. As an example, first perform intent decomposition on the original problem, and then perform intent clarification processing and / or coreference resolution processing on each sub-problem obtained by the decomposition; as an example, directly perform intent decomposition and clarification processing on the original problem, so as to directly output the high-quality problems obtained by performing intent decomposition and clarification processing; as an example, directly perform intent decomposition and coreference resolution processing on the original problem, so as to directly output the high-quality problems obtained by performing intent decomposition and coreference resolution processing; as an example, directly perform intent decomposition, clarification processing, and coreference resolution processing on the original problem, so as to directly output the high-quality problems obtained by performing intent decomposition, clarification processing, and coreference resolution processing.

[0082] If the original problem belongs to an intent ambiguity problem, at least perform intent clarification processing on the original problem to obtain a high-quality problem with a clear intent.

[0083] Performing intent clarification processing on the original problem means parsing the most likely intent of the user in the original problem. As an example, it is possible to parse the most likely intent of the user in the target industry or target field in the original problem.

[0084] In the case where the original question belongs to the problem of ambiguous intention, it is possible to only clarify the intention of the original question. Further, it is also possible to disassemble the intention of the original question and / or resolve anaphora. As an example, the intention of the original question can be clarified first, and then the intention of the clarified question can be disassembled and / or anaphora can be resolved; as an example, the intention of the original question can be directly disassembled and clarified, so as to directly output a high-quality question obtained by disassembling and clarifying the intention; as an example, the original question can be directly clarified and anaphora can be resolved, so as to directly output a high-quality question obtained by clarification and anaphora resolution; as an example, the intention of the original question can be directly disassembled, clarified, and anaphora can be resolved, so as to directly output a high-quality question obtained by disassembling, clarifying, and anaphora resolution.

[0085] If the original question belongs to the problem that needs anaphora resolution, at least anaphora resolution of the original question should be performed to obtain a high-quality question with clear reference.

[0086] Performing anaphora resolution on the original question means identifying different expressions in the original question that refer to the same entity and establishing the association between different expressions.

[0087] In the case where the original question belongs to the problem that needs anaphora resolution, it is possible to only perform anaphora resolution on the original question. Further, it is also possible to disassemble the intention of the original question and / or clarify the intention. As an example, anaphora resolution of the original question can be performed first, and then the intention of the question after anaphora resolution can be disassembled and / or the intention can be clarified; as an example, the intention of the original question can be directly disassembled and anaphora can be resolved, so as to directly output a high-quality question obtained by disassembling and anaphora resolution; as an example, the original question can be directly clarified and anaphora can be resolved, so as to directly output a high-quality question obtained by clarification and anaphora resolution; as an example, the intention of the original question can be directly disassembled, clarified, and anaphora can be resolved, so as to directly output a high-quality question obtained by disassembling, clarifying, and anaphora resolution.

[0088] In an optional embodiment, a flowchart of one implementation of the above-mentioned at least rewriting the original question corresponding to the low-quality type to which the original question belongs is as Figure 2 shown, and may include:

[0089] Step S201: Add the original question to the first question slot of the first indication instruction template to obtain a first indication instruction.

[0090] The first indication instruction template also includes a first task instruction, and the first task instruction is: clarify the intention, split multiple intentions, and resolve anaphora of the original question in the first question slot.

[0091] In this application, a general Prompt template (hereinafter referred to as the general Prompt template) is designed. The task instructions in the general Prompt template require the large model to perform three types of rewrites on the original question, and each rewrite corresponds to a low-quality type. In this way, regardless of which low-quality type the original question belongs to, only by adding the original question to the general Prompt template to obtain the first instruction, and then inputting the first instruction into the large model, a high-quality question obtained by performing at least one rewrite on the original question can be obtained from the output of the large model.

[0092] Step S202: Input the first instruction into the large model to obtain the high-quality question output by the large model.

[0093] The large model performs at least one rewrite on the original question according to the first task instruction in the first instruction to obtain a high-quality question.

[0094] The rewriting ability of the large model can be obtained by training the general large model in a supervised fine-tuning manner. When performing supervised fine-tuning on the large model, the training samples are low-quality questions to be rewritten, and the label of each training sample is the high-quality question obtained by rewriting the training sample; the label of each training sample is obtained by performing at least one of the three rewrites of clarifying the intention, splitting multiple intentions, and resolving anaphora on the training sample.

[0095] When performing supervised fine-tuning on the large model, add the training sample to the first question slot of the first instruction template to obtain the first instruction corresponding to the training sample; input the first instruction corresponding to the training sample into the large model to obtain the high-quality question corresponding to the training sample output by the large model; and fine-tune the parameters of the large model with the goal that the high-quality question corresponding to the training sample output by the large model approaches the label of the training sample.

[0096] In this embodiment, the large model does not need to separately determine which low-quality type the original question belongs to. As long as the first instruction is input into the large model, the large model can know which low-quality type the original question belongs to. Moreover, if the original question only belongs to one low-quality type, the large model will perform the rewrite corresponding to one low-quality type on the original question. If the original question belongs to multiple low-quality types, the large model will perform the rewrites corresponding to multiple low-quality types on the original question.

[0097] In an optional embodiment, another implementation flowchart of at least performing a rewrite on the original question corresponding to the low-quality type to which the original question belongs provided by the embodiment of the present application is as Figure 3 shown, and may include:

[0098] Step S301: Add the original question to the second question slot of the second instruction template corresponding to the low-quality type to which the original question belongs, obtaining a second instruction.

[0099] The second instruction template further includes a second task instruction, and the second task instruction is: rewrite the original question in the second question slot according to the low-quality type to which the original question belongs;

[0100] Among them, if the low-quality type is multi-intent, the rewrite corresponding to the low-quality type is to split the multi-intent; if the low-quality type is ambiguous intent, the rewrite corresponding to the low-quality type is to clarify the intent; if the low-quality type is coreference resolution required, the rewrite corresponding to the low-quality type is coreference resolution.

[0101] Unlike Figure 2 in the embodiments shown where different low-quality types correspond to the same instruction template, in this embodiment, different low-quality types correspond to different instruction templates, and the task instructions in different instruction templates are different. Therefore, the obtained second instruction can only be used to rewrite the original question according to one low-quality type.

[0102] In the case where the low-quality type is ambiguous intent, the second instruction template may further include guiding information, which instructs the large model to tend to rewrite the original question in the direction of the target industry and field when rewriting the original question, so as to obtain a more accurate high-quality question.

[0103] In the case where the low-quality type is coreference resolution required, the second task instruction is: rewrite the original question in the second question slot according to the low-quality type to which the original question belongs, and the rewrite corresponding to this low-quality type is: perform step-by-step coreference resolution on the original question. That is to say, for the original question requiring coreference resolution, the second task instruction instructs the large model to give the steps for coreference resolution of the original question, so as to more accurately obtain a high-quality question with clear reference.

[0104] Step S302: Input the second instruction into the large model to obtain the high-quality question output by the large model.

[0105] The large model rewrites the original question according to the second task instruction in the second instruction to obtain a high-quality question.

[0106] In the case where the low-quality type is multi-intent, the high-quality question output by the large model is multiple sub-questions, and each sub-question is a single-intent question, or each sub-question is a question with related intents.

[0107] For example, assume the original question is "Book a flight to City A tomorrow and reserve a four-star hotel nearby". Decomposing the intent of this original question can yield the following sub-questions:

[0108] Sub-question 1: Query flights from [departure location] to City A tomorrow.

[0109] Sub-question 2: After the user selects a flight, confirm the flight reservation information (such as flight number, time, etc.).

[0110] Sub-question 3: Search for nearby four-star hotels with the airport or city center of City A as the reference point.

[0111] Sub-question 4: After the user selects a hotel, complete the reservation and synchronize the check-in time (default to match the arrival time on the flight ticket).

[0112] Among the above four sub-questions, sub-question 1 and sub-question 3 are both single-intent questions. Among them, sub-question 1 only contains the "flight query" intent, and sub-question 3 only contains the "hotel search" intent. While sub-question 2 and sub-question 4 are not single-intent questions but questions with associated intents. Among them, sub-question 2 includes the "user interaction" intent (i.e., selecting a flight) and the "system execution" intent (i.e., confirming the reservation), and sub-question 4 includes the "user interaction" intent (i.e., selecting a hotel) and the "system execution" intent (i.e., completing the reservation).

[0113] Of course, as an example, decomposing the intent of the original question "Book a flight to City A tomorrow and reserve a four-star hotel nearby" can yield the following single-intent sub-questions:

[0114] Sub-question 1: Query flights from [departure location] to City A tomorrow. The intent of this sub-question is the "flight query" intent.

[0115] Sub-question 2: The user selects a flight from the flight list. The intent of this sub-question is the "user interaction" intent.

[0116] Sub-question 3: The system confirms the reservation information of the selected flight. The intent of this sub-question is the "system execution" intent.

[0117] Sub-question 4: Query the list of nearby four-star hotels with the airport or city center of City A as the reference point. The intent of this sub-question is the "hotel search" intent.

[0118] Sub-question 5: The user selects a hotel from the hotel list. The intent of this sub-question is the "user interaction" intent.

[0119] Sub-question 6: The system completes the hotel reservation and synchronizes the check-in time (default to match the arrival time on the flight ticket). The intent of this sub-question is the "system execution" intent.

[0120] Specifically, whether it is decomposed into 4 sub - problems or 6 sub - problems is determined by the large - model based on the learned intention decomposition ability itself.

[0121] The rewriting ability of the large - model can be obtained by training a general large - model in a supervised fine - tuning manner. When performing supervised fine - tuning on the large - model, the training samples are low - quality problems to be rewritten, and the label of each training sample is the high - quality problem obtained by rewriting the training sample; the label of each training sample is obtained by one of the three rewritings: intention clarification, multi - intention splitting, and anaphora resolution of the training sample.

[0122] When performing supervised fine - tuning on the large - model, add the training sample to the second question slot of the second instruction template corresponding to the low - quality type to which the training sample belongs to obtain the second instruction corresponding to the training sample; input the second instruction corresponding to the training sample into the large - model to obtain the high - quality problem corresponding to the training sample output by the large - model; take the high - quality problem corresponding to the training sample output by the large - model approaching the label of the training sample as the goal, and fine - tune the parameters of the large - model.

[0123] In an optional embodiment, a flowchart of an implementation of classifying the intention of the high - quality problem is as Figure 4 shown, and may include:

[0124] Step S401: Perform a first classification process on the high - quality problem to determine whether the high - quality problem is a knowledge - type problem and the knowledge type (for the convenience of narration and distinction, denoted as the initial knowledge type) when it is a knowledge - type problem; the initial knowledge type is an online information source or professional knowledge.

[0125] The online information source may include, but is not limited to, any one of the following information sources: browsers, applications (APPs), applets, etc.

[0126] This application divides the intention classification of high - quality problems into two classification tasks. The first classification task is to determine whether the high - quality problem is a knowledge - type problem and the knowledge type when it is a knowledge - type problem; the second classification task is to determine whether a professional - knowledge - type problem is a target professional - knowledge - type problem.

[0127] Among them, the target professional knowledge refers to the professional knowledge learned by the large - model through supervised fine - tuning, and the non - target professional knowledge refers to the general knowledge learned by the large - model through pre - training (i.e., the general knowledge learned through pre - training). A target professional - knowledge - type problem refers to a problem involving the professional knowledge learned by the large - model through supervised fine - tuning, and a non - target professional - knowledge - type problem refers to a problem involving the general knowledge not learned by the large - model through supervised fine - tuning.

[0128] Any one of the following three methods can be used to determine whether a high-quality question is a knowledge-based question: Prompt engineering (i.e., using a large model), natural language processing (NLP) (i.e., using a small model), and regular expressions.

[0129] As an example, an implementation method for performing a first classification process on a high-quality question using a large model can be: adding the high-quality question to the third question slot in the third instruction template to obtain a third instruction; the third instruction template also includes a third task instruction, and the third task instruction is: determining whether the high-quality question in the third question slot is a knowledge-based question or a non-knowledge-based question, and the knowledge type when it is a knowledge-based question; inputting the third instruction into the large model to obtain a first classification result generated by the large model, and the first classification result is: the high-quality question is a knowledge-based question and the knowledge type when it is a knowledge-based question, or the high-quality question is a non-knowledge-based question.

[0130] As an example, an implementation method for performing a first classification process on a high-quality question using a small model can be: inputting the high-quality question into the small model to obtain a first classification result output by the small model, and the first classification result is the probability that the high-quality question belongs to each knowledge type and the probability of belonging to a non-knowledge-based category, which represents whether the high-quality question is a knowledge-based question and the specific knowledge type when it is a knowledge-based question.

[0131] As an example, for each knowledge type, multiple preset regular expressions corresponding to the knowledge type can be used to search for information in the high-quality question. If there is information specified by any regular expression, it is determined that the high-quality question belongs to the knowledge-based question of that knowledge type; otherwise, it is determined that the high-quality question does not belong to the knowledge-based question of that knowledge type; if the high-quality question does not belong to the knowledge-based question of any knowledge type, it is determined that the high-quality question does not belong to the knowledge-based question.

[0132] Step S402: If the initial knowledge type is professional knowledge, perform a second classification process on the high-quality question to determine whether the high-quality question belongs to the target professional knowledge-based question.

[0133] That is to say, the second classification process is used to determine whether the high-quality question involves the professional knowledge learned by the large model through supervised fine-tuning. Among them, if the high-quality question belongs to the target professional knowledge-based question, it means that the high-quality question involves the professional knowledge learned by the large model through supervised fine-tuning; otherwise, it means that the high-quality question does not involve the professional knowledge learned by the large model through supervised fine-tuning, but involves the general knowledge learned by the large model without supervised fine-tuning (i.e., through pre-training).

[0134] Optionally, an implementation method for performing supervised fine-tuning on the large model using the target professional knowledge can be:

[0135] The target expertise may include only the target expertise in one field, or may include the target expertise in multiple fields. For example, the target expertise only includes the expertise in the oil field. Or, the target expertise only includes the expertise in the tourism field, etc. Or, the target expertise includes the expertise in the oil field and the expertise in the tourism field. Or, the target expertise includes the expertise in the tourism field, the expertise in the oil field, and the expertise in the industrial field, etc.

[0136] For the target expertise in each field, relevant materials in the field to which the target expertise belongs are collected in advance (including but not limited to: journals, papers, industry reports, standards, textbooks, etc.) to form a text set.

[0137] Key information extraction is performed on each text in the text set to obtain a key information set in the field to which the target expertise belongs. Each key information in the key information set corresponds to a text, and each key information includes an abstract and elements extracted from its corresponding text; among them, the elements may include at least some of the following: entities extracted from the text (such as person names, place names, organization names, dates, times, etc.), entity attributes (such as prices, quantities, colors, etc.), and relationships between entities (such as person relationships, event relationships, etc.), event information extracted from the text (such as event types, participants, times, places, etc.), etc.

[0138] Based on the key information set, a large model is used to process the key information set to generate a target expertise Q&A corpus. The target expertise Q&A corpus includes but is not limited to: questions that users may ask for the key information in the key information set, and answers to these questions.

[0139] Using the questions in the target expertise Q&A corpus and the questions in the non-target expertise Q&A corpus, a question sample set is constructed, and the knowledge classification model is trained in a supervised fine-tuning manner using the question sample set. When the target expertise only includes the target expertise in one field, the knowledge classification model can be a binary classification knowledge model. When the target expertise includes the target expertise in at least two fields, the knowledge classification model can be a multi-classification knowledge model.

[0140] When performing supervised fine-tuning on the knowledge classification model, the question samples are input into the knowledge classification model to obtain the classification results output by the knowledge classification model. Taking the classification results approaching the labels of the question samples as the goal, the parameters of the knowledge classification model are updated. The labels of the question samples represent whether the question samples belong to the target expertise category questions.

[0141] Furthermore, after the knowledge classification model is supervised and fine-tuned, the knowledge classification model can also be optimized and tested to ensure the performance and accuracy of the knowledge classification model.

[0142] In an optional embodiment, an implementation manner of using the response strategy corresponding to the intent classification result to call the large model to process the high-quality question to generate an answer to the high-quality question can be as follows:

[0143] If the high-quality question is not a knowledge-based question, directly call the large model to generate an answer to the high-quality question. That is, directly utilize the generation ability of the large model to answer the high-quality question and generate an answer to the high-quality question, without the need to retrieve other information for reference.

[0144] If the high-quality question is a target professional knowledge-based question, retrieve the target professional knowledge that matches the high-quality question in the target professional knowledge base, and call the large model to answer the high-quality question with reference to the retrieved target professional knowledge, generating an answer to the high-quality question. That is to say, if the high-quality question involves the professional knowledge learned by the large model through supervised fine-tuning, retrieve the target professional knowledge that matches the high-quality question in the target professional knowledge base to which the professional knowledge learned by the large model through supervised fine-tuning belongs, and input the retrieved target professional knowledge and the high-quality question into the large model, so that the large model can answer the high-quality question with reference to the retrieved target professional knowledge.

[0145] If the high-quality question is a non-target professional knowledge-based question, directly call the large model to generate an answer to the high-quality question; or, search the Internet for network knowledge that matches the high-quality question, and call the large model to answer the high-quality question with reference to the retrieved network knowledge, generating an answer to the high-quality question. That is to say, if the high-quality question does not involve the professional knowledge learned by the large model through supervised fine-tuning but only involves the general knowledge learned by the large model through pre-training, the generation ability of the large model can be directly utilized to answer the high-quality question and generate an answer to the high-quality question, without the need to retrieve other information for reference; or, network knowledge that matches the high-quality question can be searched on the Internet, and the retrieved network knowledge and the high-quality question can be input into the large model, so that the large model can answer the high-quality question with reference to the retrieved network knowledge.

[0146] If the high-quality question is an Internet information source-based question, call the large model to identify the fields required for information query through the Internet information source; call the interface of the Internet information source so that the Internet information source processes the above fields to obtain response data; call the large model to process the response data to generate an answer to the high-quality question.

[0147] Optionally, in the case where a high-quality question includes multiple sub-questions (i.e., the original multi-intent question is decomposed into multiple sub-questions), when using the response strategy corresponding to the intent classification result to call a large model to process the high-quality question, the multiple sub-questions can be answered one by one and output to the user in segments. When answering each sub-question, the large model can be called using the response strategy corresponding to the intent classification result to process the sub-question and generate the answer to the sub-question.

[0148] In an optional embodiment, one implementation manner of the above quality classification of the original question may be:

[0149] Perform quality classification on the original question through a pre-trained quality classification model (which can be a large model or a small model); the quality classification model is trained through a preset training data set.

[0150] The preset training data set is obtained by generalizing the seed data set. Among them, the seed data set includes preset high-quality questions and various preset low-quality questions; the number of questions of each quality is not less than the preset number; the questions of each quality cover multiple industries, multiple scenarios, and various expressions.

[0151] Optionally, various quality types of questions can be defined as the seed data set, and the seed data set includes high-quality questions and various low-quality questions. Low-quality questions may include, but are not limited to, the following types of low-quality questions: multi-intent, need for anaphora resolution, ambiguous intent, etc.

[0152] When collecting the seed data set, no less than the preset number (for example, 1000) of seed data for each type of low-quality question is collected. It is necessary to ensure that the collected high-quality questions cover multiple industries, multiple scenarios, and various expressions, and also ensure that each type of collected low-quality question also covers multiple industries, multiple scenarios, and various expressions.

[0153] A pre-trained large model (such as a general large model) can be selected, and prompt engineering can be used to optimize the large model to enhance the corpus generalization ability of the large model. Optionally, by designing diverse prompts, the model can better understand and process different forms of input, thereby improving its performance on unseen data.

[0154] Input the seed data set into the optimized large model, and use the generation ability of the large model to generate a large-scale corpus D for intent classification training. Optionally, a prompt with seed data can be designed, and the prompt instructs the large model to generate a corpus (i.e., a question) with the same low-quality type as the seed data. In the large-scale corpus D, the label of each corpus is whether the corpus belongs to a low-quality question and the low-quality type when it belongs to a low-quality question.

[0155] Optionally, the BERT model or RoBerta model (i.e., the small model) can be supervised-trained using the large-scale corpus D to obtain a quality classification model.

[0156] Optionally, the pre-trained large model can be supervised fine-tuned using the large-scale corpus D to obtain a quality classification model.

[0157] Corresponding to the method embodiment, the present application also provides a question-and-answer device. A schematic structural diagram of the question-and-answer device provided in the embodiment of the present application is as Figure 5 shown, and may include:

[0158] An input module 501, a quality classification module 502, a determination module 503, an intent classification module 504, and a response module 505;

[0159] Among them, the input module 501 is used to obtain the original question input by the user;

[0160] The quality classification module 502 is used to perform quality classification on the original question to obtain a quality classification result; the quality classification result characterizes whether the original question belongs to a low-quality question, and the low-quality type when the original question belongs to a low-quality question;

[0161] The determination module 503 is used to determine a high-quality question based on the original question and the quality classification result; wherein, if the original question is not a low-quality question, it is determined that the original question is a high-quality question, and if the original question is a low-quality question, at least the original question is rewritten according to the low-quality type to which the original question belongs to obtain a high-quality question;

[0162] The intent classification module 504 is used to perform intent classification on the high-quality question to obtain an intent classification result; the intent classification result characterizes whether the high-quality question is a knowledge-based question, and the knowledge type when it is a knowledge-based question;

[0163] The response module 505 is used to call the large model to process the high-quality question with the response strategy corresponding to the intent classification result to generate an answer to the high-quality question.

[0164] The question-and-answer device provided in the embodiment of the present application first performs quality classification on the question input by the user, rewrites the low-quality question to obtain a high-quality question, thereby increasing the recall rate and accuracy of the answer content. When replying based on the high-quality question, it will perform intent classification on the high-quality question, and process the high-quality question with the response strategy corresponding to the intent classification result to generate an answer to the high-quality question, realizing targeted responses corresponding to different intents, and further improving the accuracy of the answer while increasing the recall rate.

[0165] That is to say, the present application modularizes the question-and-answer task (for example, task modules such as quality classification module, intention classification module, determination module, response module, etc.), allowing different task modules to process different questions, so that an ideal answer can be obtained after the question-and-answer process through the entire tool chain.

[0166] In an optional embodiment, the low-quality type to which the low-quality question belongs is one of a plurality of preset low-quality types; the plurality of preset low-quality types at least include the following: multiple intentions, ambiguous intention, and need for reference resolution.

[0167] In an optional embodiment, when the determination module 503 at least rewrites the original question corresponding to the low-quality type to which the original question belongs, it is used for:

[0168] If the original question is a multiple-intention question, at least decompose the intention of the original question to obtain a plurality of sub-questions as the high-quality questions; each sub-question is a question with a single intention or a question with related intentions;

[0169] If the original question is an ambiguous-intention question, at least perform intention clarification processing on the original question to obtain a high-quality question with a clear intention;

[0170] If the original question is a question that needs reference resolution, at least perform reference resolution on the original question to obtain a high-quality question with clear references.

[0171] In an optional embodiment, when the determination module 503 at least rewrites the original question corresponding to the low-quality type to which the original question belongs, it is used for:

[0172] Add the original question to the first question slot of the first indication instruction template to obtain a first indication instruction; the first indication instruction template further includes a first task instruction, and the first task instruction is: perform intention clarification, split multiple intentions, and reference resolution on the original question in the first question slot;

[0173] Input the first indication instruction into the large model to obtain the high-quality question output by the large model.

[0174] In an optional embodiment, when the determination module 503 at least rewrites the original question corresponding to the low-quality type to which the original question belongs, it is used for:

[0175] Add the original problem to the second problem slot of the second indication instruction template corresponding to the low-quality type to obtain a second indication instruction; the second indication instruction template further includes a second task instruction, and the second task instruction is: rewrite the original problem in the second problem slot according to the low-quality type; wherein, if the low-quality type is multi-intention, the corresponding rewrite is to split the multi-intention; if the low-quality type is ambiguous intention, the corresponding rewrite is to clarify the intention; if the low-quality type is need for reference resolution, the corresponding rewrite is reference resolution.

[0176] Input the second indication instruction into the large model to obtain a high-quality problem output by the large model.

[0177] In an optional embodiment, when the intention classification module 504 classifies the intention of the high-quality problem, it is used for:

[0178] Perform a first classification process on the high-quality problem to determine whether the high-quality problem is a knowledge-based problem and the initial knowledge type when it belongs to the knowledge-based problem; the initial knowledge type is an online information source or professional knowledge.

[0179] If the initial knowledge type is professional knowledge, perform a second classification process on the high-quality problem to determine whether the high-quality problem belongs to the target professional knowledge-based problem.

[0180] In an optional embodiment, when the response module 505 invokes the large model to process the high-quality problem with the response strategy corresponding to the intention classification result to generate an answer to the high-quality problem, it is used for:

[0181] If the high-quality problem is not a knowledge-based problem, directly invoke the large model to answer the high-quality problem and generate an answer to the high-quality problem.

[0182] If the high-quality problem is a target professional knowledge-based problem, retrieve the target professional knowledge matching the high-quality problem in the target professional knowledge base, and invoke the large model to answer the high-quality problem with reference to the retrieved target professional knowledge to generate an answer to the high-quality problem.

[0183] If the high-quality problem is a non-target professional knowledge-based problem, directly invoke the large model to answer the high-quality problem and generate an answer to the high-quality problem; or, search the network for network knowledge matching the high-quality problem, and invoke the large model to answer the high-quality problem with reference to the retrieved network knowledge to generate an answer to the high-quality problem.

[0184] If the high-quality problem is an Internet information source-related problem, call the large model to identify the fields required for information query through the Internet information source; call the interface of the Internet information source so that the Internet information source processes the fields to obtain response data; call the large model to process the response data to generate an answer to the high-quality problem.

[0185] In an optional embodiment, the quality classification of the original problem includes: performing quality classification on the original problem through a pre-trained quality classification model; the quality classification model is trained through a preset training data set;

[0186] The preset training data set is obtained by generalizing a seed data set; the seed data set includes high-quality problems and various low-quality problems; the number of problems of each quality is not less than a preset number; the problems of each quality cover multiple industries, multiple scenarios, and various expression forms.

[0187] An embodiment of the present application also provides an electronic device. Refer to Figure 6 As shown, it shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application can be a terminal device (such as a car machine, a large screen device, a smart home, a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.), or a server (which can be a single server, a server cluster, or a cloud server, etc.). Figure 6 The electronic device shown is only an example and should not bring any restrictions to the functions and usage scopes of the embodiments of the present application.

[0188] As Figure 6 shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.

[0189] Typically, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 can allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 6 an electronic device with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.

[0190] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions run on an electronic device, the electronic device implements any one of the Q&A methods provided by the embodiments of the present application.

[0191] An embodiment of the present application also provides a computer-readable storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can be enabled to implement any one of the Q&A methods provided by the embodiments of the present application.

[0192] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationships between the modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.

[0193] Through the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits, etc. However, for this application, in more cases, software program implementation is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disc, etc., and includes several instructions to enable a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in various embodiments of this application.

[0194] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. Professional technicians can use different methods to implement the described functions for each specific solution, but such implementation should not be considered to exceed the scope of this application.

[0195] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, training device, or data center to another website, computer, training device, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store, or a data storage device such as a training device or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.

[0196] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.

[0197] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A question-answering method, characterized in that: include: Get the original question entered by the user; Performing quality classification on the original problem to obtain a quality classification result; The quality classification result indicates whether the original question is a low-quality question, and the low-quality type of the original question when the original question is a low-quality question; Determine a high-quality question based on the original question and the quality classification result; wherein, if the original question is not a low-quality question, determine the original question to be a high-quality question; if the original question is a low-quality question, at least rewrite the original question corresponding to the low-quality type to which the original question belongs to obtain a high-quality question; Performing intent classification on the high-quality questions to obtain intent classification results; the intent classification results indicate whether the high-quality questions are knowledge-based questions, and the type of knowledge when they are knowledge-based questions; The large model is called to process the high-quality question with the answer strategy corresponding to the intention classification result to generate an answer to the high-quality question.

2. The method according to claim 1, characterized in that The low-quality type to which the low-quality problem belongs is one of the preset multiple low-quality types; the preset multiple low-quality types include at least the following: multiple intentions, ambiguous intentions, and need for reference resolution.

3. The method according to claim 2, characterized in that At least rewriting the original question in accordance with the low-quality type to which the original question belongs includes: If the original problem is a multi-intention problem, at least the original problem is decomposed into multiple sub-problems as the high-quality problem; each sub-problem is a problem with a single intention, or a problem with associated intentions; If the original question is a question with ambiguous intent, at least the original question is processed to clarify the intent, so as to obtain a high-quality question with clear intent; If the original question is a question that requires coreference resolution, at least coreference resolution is performed on the original question to obtain a high-quality question with clear coreference.

4. The method according to claim 3, characterized in that The at least rewriting the original question corresponding to the low-quality type to which the original question belongs includes: Add the original question to the first question slot of the first instruction template to obtain a first instruction; the first instruction template also includes a first task instruction, and the first task instruction is: clarify the intent of the original question in the first question slot, split multiple intents, and resolve reference; The first instruction is input into the large model to obtain a high-quality question output by the large model.

5. The method according to claim 3, characterized in that: The at least rewriting the original question corresponding to the low-quality type to which the original question belongs includes: Add the original question to the second question slot of the second instruction template corresponding to the low-quality type to obtain a second instruction; the second instruction template also includes a second task instruction, and the second task instruction is: rewrite the original question in the second question slot corresponding to the low-quality type; wherein, if the low-quality type is multi-intention, the corresponding rewriting is splitting the multi-intention; if the low-quality type is ambiguous in intention, the corresponding rewriting is clarifying the intention; if the low-quality type requires reference resolution, the corresponding rewriting is reference resolution; The second instruction is input into the large model to obtain high-quality questions output by the large model.

6. The method according to claim 1, characterized in that The intent classification of the high-quality questions includes: Performing a first classification process on the high-quality question to determine whether the high-quality question is a knowledge-based question and an initial knowledge type when the question is a knowledge-based question; the initial knowledge type is an online information source or professional knowledge; If the initial knowledge type is professional knowledge, a second classification process is performed on the high-quality question to determine whether the high-quality question belongs to a target professional knowledge type question.

7. The method according to claim 6, characterized in that The calling of the large model to process the high-quality question using the answer strategy corresponding to the intention classification result to generate an answer to the high-quality question includes: If the high-quality question is not a knowledge-based question, directly call the large model to answer the high-quality question and generate an answer to the high-quality question; If the high-quality question is a question of target professional knowledge, target professional knowledge matching the high-quality question is retrieved from the target professional knowledge database, and the large model is called to answer the high-quality question with reference to the retrieved target professional knowledge, thereby generating an answer to the high-quality question; If the high-quality question is a non-target professional knowledge question, the large model is directly called to answer the high-quality question to generate an answer to the high-quality question; or, network knowledge matching the high-quality question is searched online, and the large model is called to answer the high-quality question with reference to the retrieved network knowledge to generate an answer to the high-quality question; If the high-quality question is an Internet-based information source question, the large model is called to identify the fields required for information query through the Internet-based information source; the interface of the Internet-based information source is called so that the Internet-based information source processes the fields and obtains response data; the large model is called to process the response data to generate an answer to the high-quality question.

8. The method according to claim 1, characterized in that: The quality classification of the original question includes: quality classification of the original question using a pre-trained quality classification model; the quality classification model is trained by a preset training data set; The preset training data set is obtained by generalizing the seed data set; the seed data set includes high-quality questions and multiple low-quality questions; the number of questions of each quality is not less than a preset number; and the questions of each quality cover multiple industries, multiple scenarios, and multiple expressions.

9. A question-answering device, characterized in that: include: Input module, used to obtain the original question input by the user; A quality classification module, used to perform quality classification on the original problem to obtain a quality classification result; The quality classification result indicates whether the original question is a low-quality question, and the low-quality type of the original question when the original question is a low-quality question; a determination module, configured to determine a high-quality question based on the original question and the quality classification result; wherein, if the original question is not a low-quality question, the original question is determined to be a high-quality question; and if the original question is a low-quality question, the original question is at least rewritten corresponding to the low-quality type to which the original question belongs to obtain a high-quality question; An intent classification module is used to perform intent classification on the high-quality questions to obtain intent classification results; the intent classification results indicate whether the high-quality questions are knowledge-based questions, and the type of knowledge when they are knowledge-based questions; The answering module is used to call the large model to process the high-quality question with the answering strategy corresponding to the intention classification result to generate an answer to the high-quality question.

10. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the question-answering method as claimed in any one of claims 1 to 8.

11. An electronic device, characterized in that: The electronic device comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the question-answering method as described in any one of claims 1 to 8.

12. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the question-and-answer method as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Question answering method and device, equipment, storage medium and program product

    CN120892528A

  • Question and answer interaction method based on multi-source data and storage medium

    CN121579660A