A question-answering method, device, storage medium and equipment based on a large model
By using a generative large language model to generate and filter candidate questions in the question-answer system, the problem of poor question preset and continuity in traditional question-and-answer systems is solved, and the diversity and quality of question-and-quality improvements are achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202411187514.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-08-28
AI Technical Summary
Traditional Q&A systems require preset questions and the recommended synonyms are often synonymous questions, resulting in poor continuity of Q&A dialogue and poor user experience.
Using a question-and-answer method based on a generative large language model, the initial question is input to the question-and-answer system, candidate questions are generated, and answerable target questions are obtained through filtering to ensure the diversity and continuity of the questions and improve the quality of the questions and answers. .
Optimize the Q&A system through generative large language model technology to avoid model illusions and unanswered questions, and improve user experience and Q&A quality.
Smart Images

Figure CN118708712B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of question-answering technology, and in particular to a question-answering method, apparatus, storage medium and device based on a large model. Background Art
[0002] The existing enterprise knowledge question-answering system generally adopts a question recommendation method that constructs an internal question-answering database, then matches semantically similar questions in the database based on user questions, and recommends them. The above method has the following problems:
[0003] Before a traditional question-answering system recommends questions, it is necessary to preset the questions in the system. Moreover, when recommending questions based on the traditional question-answering system, the recommended questions are often synonymous with the questions input by the user, resulting in poor continuity of the question-answering dialogue and poor user experience. Summary of the invention
[0004] The purpose of the present invention is to provide a question-answering method, apparatus, storage medium and device based on a large model, which can ensure the diversity and continuity of target questions while ensuring the quality of target questions, thereby improving the user experience.
[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a question answering method based on a large model, the method comprising: inputting an initial question sentence into a question answering system to obtain a corresponding answer sentence and a candidate question sentence, wherein the question answering system at least includes a generative large language model, and the candidate question sentence is generated by the generative large language model;
[0007] Filtering the candidate questions to obtain corresponding target questions, wherein the target questions are answerable for the generative large language model;
[0008] The answer sentence and the target question sentence are fed back.
[0009] Optionally, the question-answering system further includes a question-answering knowledge base, and the steps of inputting the initial question into the question-answering system to obtain the corresponding answer sentence and the candidate question sentence include:
[0010] Matching the initial question with the knowledge fragments in the question-answer knowledge base to determine the corresponding target knowledge fragments;
[0011] The initial question sentence and the target knowledge fragment are input into the generative large language model to obtain the answer sentence, which corresponds to the initial question sentence and the target knowledge fragment.
[0012] Optionally, the step of inputting the initial question into the question-answering system to obtain corresponding answer sentences and candidate question sentences further includes:
[0013] The initial question and the target knowledge fragment are input into the generative large language model as a first prompt word, and the generative large language model generates the candidate question according to the first prompt word.
[0014] Optionally, the step of filtering the candidate questions to obtain corresponding target questions includes:
[0015] Matching the candidate question with the knowledge fragments of the question-answering knowledge base to determine corresponding candidate knowledge fragments;
[0016] Input the candidate question sentence and the candidate knowledge fragment as a second prompt word into the generative large language model, and generate a candidate answer sentence according to the second prompt word by the generative large language model;
[0017] Evaluating the correlation between the candidate answer sentence and the candidate question sentence, and the correspondence between the candidate answer sentence and the candidate knowledge fragment;
[0018] The candidate questions are filtered based on the relevance evaluation result and the correspondence evaluation result to obtain the target question.
[0019] Optionally, the question intention pointed to by the candidate question is different from the question intention pointed to by the initial question.
[0020] Optionally, the knowledge fragments in the question-answer knowledge base are stored in the form of knowledge vectors, and the step of matching the initial question with the knowledge fragments in the question-answer knowledge base to determine the corresponding target knowledge fragments includes:
[0021] Determining a first vector corresponding to the initial question;
[0022] Matching the first vector with the knowledge vector; wherein the knowledge fragment corresponds to the knowledge vector;
[0023] A target knowledge vector is determined based on the matching degree between the first vector and the knowledge vector, and a knowledge segment corresponding to the target knowledge vector is determined as the target knowledge segment.
[0024] Optionally, the step of filtering the candidate questions based on the relevance evaluation result and the correspondence evaluation result to obtain the target question includes:
[0025] The generative large language model generates a question-answer continuity evaluation result for the candidate question sentence according to the first prompt word;
[0026] The candidate questions are filtered based on the question-answer continuity evaluation result, the relevance evaluation result, and the correspondence evaluation result to obtain the target question.
[0027] In a second aspect, an embodiment of the present application provides a question-answering device based on a large model, the device comprising:
[0028] A determination module is used to input the initial question into the question-answering system to obtain a corresponding answer sentence and a candidate question sentence, wherein the question-answering system at least includes a generative large language model, and the candidate question sentence is generated by the generative large language model; filter the candidate question sentence to obtain a corresponding target question sentence, wherein the target question sentence is answerable for the generative large language model;
[0029] A feedback module is used to provide feedback on the answer sentence and the target question sentence.
[0030] In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the large model-based question-answering method are implemented.
[0031] In a fourth aspect, an embodiment of the present application provides a question-answering device based on a large model, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the question-answering method based on a large model when executing the computer program.
[0032] This application has the following beneficial effects:
[0033] The present application inputs an initial question into a question-answering system, obtains a corresponding answer and candidate questions based on a generative large language model of the question-answering system, filters the candidate questions to obtain a corresponding target question, the target question is answerable for the generative large language model, and feeds back the answer and the target question. The present invention uses generative large language large model technology to optimize the question-answering system, solves the problem of poor continuity of preset questions and recommended questions in traditional question-answering systems, and obtains answerable target questions by filtering candidate questions, thereby avoiding the model illusion of the generative large language large model and the technical obstacle that the generated questions cannot be answered by the generative large language large model. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0035] Figure 1 A schematic diagram of the structure of a large model-based question-answering device provided in an embodiment of the present invention;
[0036] Figure 2 One of the flowcharts of a question-answering method based on a large model provided by an embodiment of the present invention;
[0037] Figure 3 A second flowchart of a question-answering method based on a large model provided in an embodiment of the present invention;
[0038] Figure 4 A third flowchart of a question-answering method based on a large model provided in an embodiment of the present invention;
[0039] Figure 5 A fourth flowchart of a question-answering method based on a large model provided in an embodiment of the present invention;
[0040] Figure 6 A schematic diagram of the structure of a question-answering device based on a large model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0042] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0044] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0045] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0046] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0047] After extensive research, the inventors found that in the existing question-and-answer system, due to the wide range of generation, it is easy to raise questions that the question-and-answer library cannot answer, and even model hallucinations may occur, resulting in a poor user experience.
[0048] In view of the discovery of the above problems, this embodiment provides a question-answering method, apparatus, storage medium and device based on a large model, which can obtain corresponding answer sentences and candidate questions based on the generative large language model of the question-answering system by inputting the initial question into the question-answering system, filter the candidate questions to obtain the corresponding target questions, the target questions are answerable for the generative large language model, and feedback the answer sentences and target questions. While ensuring the diversity and continuity of the target questions, the quality of the target questions is ensured, thereby improving the quality of question-answering, and then improving the user experience. The solution provided by this embodiment is described in detail below.
[0049] This embodiment provides a question-answering device based on a large model. In a possible implementation, the question-answering device based on a large model can be a user terminal, for example, the question-answering device based on a large model can be, but is not limited to, a server, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), and an image acquisition device, etc.
[0050] Please refer to Figure 1 , Figure 1 1 is a schematic diagram of the structure of the large model-based question-answering device 100 provided in an embodiment of the present application. The large model-based question-answering device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown. Figure 1Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0051] The large model-based question-answering device 100 includes a memory 120 and a processor 130 .
[0052] The memory 120 and the processor 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The processor 130 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the processor. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the processor 130.
[0053] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.
[0054] Please refer to Figure 2 , Figure 2 For application Figure 1 A flowchart of a large model-based question and answer method of the large model-based question and answer device 100 is provided. The method including various steps is described in detail below.
[0055] S201: Inputting an initial question into a question-answering system to obtain a corresponding answer and candidate questions.
[0056] The question-answering system at least includes a generative large language model, and the candidate questions are generated by the generative large language model.
[0057] S202: Filter candidate questions to obtain corresponding target questions.
[0058] Among them, the target question is answerable for the generative large language model.
[0059] S203: Feedback answer sentence and target question sentence.
[0060] It should be noted that the big model used in the big model-based question-answering method is a generative big language model, which is a deep learning model designed to generate natural language text. This type of model is trained with a large amount of text data, can understand and generate human language, and perform a variety of natural language processing tasks such as text generation, question-answering, translation, and summarization.
[0061] The initial question is input into the question-answering system to obtain the corresponding answer and candidate questions. The candidate questions are generated by the generative large language model in the question-answering system.
[0062] There are many ways to implement the generation of an answer sentence corresponding to an initial question. In one implementation method: based on the vector corresponding to the initial question, a knowledge vector with the highest matching degree with the vector corresponding to the initial question is obtained from the knowledge vector library in the question-answering system based on a vector matching method, and an answer sentence corresponding to the knowledge vector is obtained as the answer sentence corresponding to the initial question, wherein there is a corresponding relationship between the knowledge vector and the answer sentence.
[0063] In another implementation, the answer sentence corresponding to the initial question can be generated by a generative large language model.
[0064] Exemplarily, when a user uses the question-and-answer system, the user inputs an initial question into the question-and-answer system, such as: "What parts does the dishwasher evaluation index system include?", and the answer sentence corresponding to the initial question generated based on the generative large language model of the question-and-answer system can be "The dishwasher evaluation index system includes basic indicators, core indicators and innovative indicators", and the corresponding candidate questions generated based on the generative large language model can be "What are the basic indicators of dishwashers?", "What are the core indicators of dishwashers?", "What are the innovative indicators of dishwashers?", "What levels are the core indicators of dishwashers divided into", etc.
[0065] The generative large language model has the problem of model hallucination, and thus may generate disordered candidate questions. In addition, if the generative large language model has not yet learned the relevant knowledge, it may cause the candidate questions it generates to be unable to answer itself. In order to avoid these two results, the present invention filters the candidate questions generated by the model to obtain the target questions in the process of integrating the generative large language model into the question-answering system, thereby ensuring that the obtained target questions are answerable for the generative large language model, that is, ensuring that the target questions are correct and meaningful, and the corresponding answer basis for the answer to the target question can be found in the question-answering knowledge base.
[0066] The answer sentence corresponding to the initial question and the target question are fed back to the user, and the user can get the answer corresponding to the initial question and can continue to ask and answer questions based on the target question.
[0067] There are many ways to input the initial question into the question-answering system to obtain the corresponding answer and candidate questions. In one implementation, Figure 3 As shown, the following steps are included:
[0068] S201-1: Match the initial question with the knowledge fragments in the question-answering knowledge base to determine the corresponding target knowledge fragments.
[0069] S201-2: Input the initial question and the target knowledge fragment into the generative large language model to obtain an answer sentence, which corresponds to the initial question and the target knowledge fragment.
[0070] The implementation method of determining the target knowledge fragment based on the initial question can be: the knowledge fragments in the question-answer knowledge base are stored in the form of knowledge vectors, and the first vector corresponding to the initial question is determined, and the first vector is matched with the knowledge vector; wherein the knowledge fragment corresponds to the knowledge vector; the target knowledge vector is determined based on the degree of matching between the first vector and the knowledge vector, and the knowledge fragment corresponding to the target knowledge vector is determined as the target knowledge fragment, wherein there is a corresponding relationship between the knowledge fragment and the answer sentence.
[0071] There are many ways to calculate the matching degree between the first vector corresponding to the initial question and the knowledge vector in the question-answering knowledge base. In one implementation, the Euclidean distance between the first vector corresponding to the initial question and the knowledge vector can be calculated as the matching degree between the first vector of the initial question and the knowledge vector.
[0072] The cosine value between the first vector corresponding to the initial question and the knowledge vector may be calculated as the matching degree between the first vector of the initial question and the knowledge vector.
[0073] The Manhattan distance between the first vector of the initial question and the knowledge vector can be calculated as the matching degree between the first vector of the initial question and the knowledge vector.
[0074] After determining the degree of match between the first vector of the initial question and the knowledge vector, a knowledge segment corresponding to the knowledge vector having a degree of match higher than a preset threshold may be obtained as a target knowledge segment.
[0075] The initial question and the target knowledge fragment are used as the input of the generative large language model to obtain the answer sentence corresponding to the initial question and the target knowledge fragment.
[0076] Exemplarily, when the initial question is: "What parts does the dishwasher evaluation index system include", the target knowledge fragment determined from the question-and-answer knowledge base can be: "The dishwasher evaluation index system includes basic indicators, core indicators and innovative indicators. Basic indicators include safety performance, electromagnetic compatibility, cleaning index, and hazardous substances. Core indicators include energy efficiency index, drying index, water efficiency index, sterilization rate, noise and material flame retardancy; core indicators are divided into three levels, including leader level, which is equivalent to the 5-star level in the enterprise standard ranking list; quality level, which is equivalent to the 4-star level in the enterprise standard ranking list; and standard-compliant level, which is equivalent to the 3-star level in the enterprise standard ranking list", "Innovative indicators include antibacterial rate, mildew prevention, storage level, rinsing rate and harmful substances. Related indicators can be divided into two levels: leader level and quality level. The leader level is equivalent to the 5-star level in the enterprise standard ranking list; the quality level is equivalent to the 4-star level in the enterprise standard ranking list. Star level", input the initial question: "What parts does the dishwasher evaluation index system include?" and the above target knowledge fragment into the generative big prediction model, and output the answer sentence corresponding to the initial question and the target knowledge fragment: "The dishwasher evaluation index system includes basic indicators, core indicators and innovative indicators".
[0077] In one implementation method of obtaining corresponding answer sentences and candidate questions based on an initial question, the initial question sentence and the target knowledge fragment are input into a generative large language model as a first prompt word, and the generative large language model generates a candidate question sentence according to the first prompt word.
[0078] Exemplarily, a candidate question is generated according to the first prompt word and the first prompt word template in the generative large language model. The first prompt template may include a non-repetitive initial question of the user, and the candidate question can find an answer from the target knowledge segment.
[0079] For example, the first prompt word consists of the initial question "What parts does the dishwasher evaluation index system include?" and the target knowledge fragment can be: "The dishwasher evaluation index system includes basic indicators, core indicators and innovative indicators. Basic indicators include safety performance, electromagnetic compatibility, cleaning index, and hazardous substances. Core indicators include energy efficiency index, drying index, water efficiency index, sterilization rate, noise and material flame retardancy; core indicators are divided into three levels, including leader level, which is equivalent to the 5-star level in the enterprise standard ranking list; quality level, which is equivalent to the 4-star level in the enterprise standard ranking list; and standard-reaching level, which is equivalent to the 3-star level in the enterprise standard ranking list", "Innovation indicators include antibacterial rate, mildew prevention, storage level, rinsing rate and harmful substances. Relevant indicators can be divided into two levels: leader level and quality level. The leader level is equivalent to the 5-star level in the enterprise standard ranking list; the quality level is equivalent to the 4-star level in the enterprise standard ranking list. Star level", input the above first prompt word into the generative large language model, and based on the first prompt word and the first prompt word template, obtain candidate questions including: "What are the basic indicators of dishwashers?", "What are the core indicators of dishwashers?", "What are the innovative indicators of dishwashers?", "What levels are the core indicators of dishwashers divided into?" and "What levels are the basic indicators of dishwashers divided into?".
[0080] It should be noted that the question intention pointed out by the candidate question is different from the question intention pointed out by the initial question.
[0081] That is, when the initial question is "What parts does the dishwasher evaluation index system include", the intention of the initial question is to determine the evaluation index system of the dishwasher, and when the candidate question is "What are the basic indicators of the dishwasher", the intention of the candidate question is to determine the content of the basic indicators of the dishwasher. The intention of the candidate question is different from that of the initial question.
[0082] There are many ways to filter candidate questions to obtain corresponding target questions. In one implementation, Figure 4 As shown, the following steps are included:
[0083] S301: Match the candidate question with the knowledge fragments in the question-answering knowledge base to determine the corresponding candidate knowledge fragments.
[0084] The method of obtaining the candidate knowledge fragment corresponding to the candidate question from the question-answering knowledge base can be: determining the vector corresponding to the candidate question, calculating the matching degree between the vector corresponding to the candidate question and the knowledge vector corresponding to the knowledge fragment in the question-answering knowledge base, and obtaining the knowledge fragment corresponding to the knowledge vector exceeding the preset matching degree as the candidate knowledge fragment.
[0085] S302: Input the candidate question sentence and the candidate knowledge fragment as the second prompt word into the generative large language model, and the generative large language model generates a candidate answer sentence according to the second prompt word.
[0086] Exemplarily, a candidate answer sentence is generated according to the second prompt word and the second prompt word template in the generative large language model. That is, the second prompt word is filled in according to the requirements indicated by the second prompt word template. The second prompt template may include "Please obtain a candidate answer sentence based on "candidate question sentence" and "candidate knowledge fragment", the candidate answer sentence is related to the candidate question sentence, and the candidate answer sentence is derived from the candidate knowledge fragment.
[0087] For example, the second prompt word is composed of candidate questions and candidate knowledge fragments, in which the candidate questions include "What are the basic indicators of dishwashers?", "What are the core indicators of dishwashers?", "What are the innovative indicators of dishwashers?", "What levels are the core indicators of dishwashers divided into?" and "What levels are the basic indicators of dishwashers divided into?", and the candidate knowledge fragments include: "The evaluation index system of dishwashers includes basic indicators, core indicators and innovative indicators. Basic indicators include safety performance, electromagnetic compatibility, cleaning index, and harmful substances. Core indicators include energy efficiency index, drying index, water efficiency index, sterilization rate, noise and material flame retardancy; core indicators are divided into three levels, including leader level, which is equivalent to the 5-star level in the enterprise standard ranking list; high-quality level, which is equivalent to the 4-star level in the enterprise standard ranking list; standard-reaching level, which is equivalent to the 3-star level in the enterprise standard ranking list", "Innovation indicators include antibacterial rate, mildew prevention, storage level, rinsing rate and harmful substances, and related indicators can be divided into two levels: leader level and high-quality level. The leader level is equivalent to the 5-star level in the enterprise standard ranking list; the high-quality level is equivalent to the 4-star level in the enterprise standard ranking list. Star level", the above-mentioned second prompt word is input into the generative large language model according to the format and requirements of the second prompt word template to generate candidate answer sentences. For example, the candidate answer sentences may include: "The basic indicators of dishwashers include safety performance, electromagnetic compatibility, cleaning index, and hazardous substances", "The core indicators of dishwashers include energy efficiency index, drying index, water efficiency index, sterilization rate, noise and material flame retardancy", "The innovative indicators of dishwashers include antibacterial rate, mildew prevention, storage level, rinsing rate and harmful substances", "The core indicators of dishwashers are divided into three levels, including leader level, which is equivalent to the 5-star level in the enterprise standard ranking list; high-quality level, which is equivalent to the 4-star level in the enterprise standard ranking list; standard-reaching level, which is equivalent to the 3-star level in the enterprise standard ranking list?" and so on.
[0088] Finally, based on the second prompt word composed of the candidate question sentence and the candidate knowledge fragment and the second prompt word template in the generative large language model, a candidate answer sentence corresponding to the candidate question sentence is generated, so that the generative large language model can answer the candidate question sentence.
[0089] In one embodiment, a candidate question corresponding to and related to the initial question but having a different intention from the initial question can be generated based on the existing initial question and the target knowledge fragment obtained from the initial question, thereby ensuring the flexibility and diversity of the candidate questions.
[0090] S303: Evaluate the correlation between the candidate answer sentences and the candidate question sentences, and the correspondence between the candidate answer sentences and the candidate knowledge fragments.
[0091] Exemplarily, the higher the score of the correlation between the candidate answer sentence and the candidate question sentence, the higher the correlation between the candidate answer sentence and the candidate question sentence. For example, when the score of the correlation between the candidate answer sentence and the candidate question sentence is 1, the candidate answer sentence is considered to be 100% relevant to the candidate question sentence. When the score of the correlation between the candidate answer sentence and the candidate question sentence is 0, the candidate answer sentence is considered to be irrelevant to the candidate question sentence.
[0092] The correspondence between the candidate answer sentence and the candidate knowledge fragment indicates whether the basis for the answer can be found in the question-answering knowledge base.
[0093] Exemplarily, when the correspondence score between the candidate answer and the candidate knowledge segment is 1, it indicates that the answer corresponding to the candidate question can be found in the candidate knowledge segment. When the correspondence score between the candidate answer and the candidate knowledge segment is 0, it indicates that the answer corresponding to the candidate question cannot be found in the candidate knowledge segment.
[0094] S304: Filter candidate questions based on the relevance evaluation result and the correspondence evaluation result to obtain a target question.
[0095] The candidate questions are self-checked using a generative large language model, and filtered based on the relevance and correspondence evaluation results to exclude low-quality candidate questions, ensuring that the quality of the generated target questions is controllable.
[0096] There are many implementation methods for filtering candidate questions based on the relevance evaluation results and the correspondence evaluation results to obtain the target question. In one implementation method, Figure 5 As shown, the following steps are included:
[0097] S304-1: The generative large language model generates a question-answer continuity evaluation result for the candidate question according to the first prompt word.
[0098] Exemplarily, candidate questions and continuity evaluation results of candidate questions are generated according to the first prompt word and the first prompt word template in the generative large language model. That is, the first prompt word is filled in according to the requirements indicated by the first prompt word template. The first prompt template may include an initial question and a target knowledge fragment, and may also include an instruction for evaluating the question-answer continuity of the candidate question, so that the generative large language model generates corresponding question-answer continuity evaluation results while generating the candidate question, so as to use the question-answer continuity evaluation results for filtering the candidate question. It can be understood that the present invention ensures that the candidate question generated by the generative large language model has good question-answer continuity through two aspects, wherein, on the one hand, the question intention pointed to by the candidate question is different from the question intention pointed to by the initial question, and on the other hand, the generative large language model generates the corresponding question-answer continuity evaluation results while generating the candidate question, thereby ensuring that the generated candidate question is flexible and diverse, which helps to start a new round of dialogue with the user.
[0099] It should be noted that the higher the score indicated by the question-answer continuity evaluation result of the candidate question, the greater the probability that the corresponding candidate question will be selected by the user, that is, the question-answer continuity of the corresponding candidate question is better, and it is expected to start a new round of dialogue with the user.
[0100] For example, after the initial question and the target knowledge fragment are input into the generative large language model as the first prompt word, the question-answering continuity evaluation result for the candidate question is generated, such as:
[0101] Candidate question 1: What are the basic indicators of a dishwasher? Score: 0.83.
[0102] Candidate question 2: What are the core indicators of a dishwasher? Score: 0.76.
[0103] Candidate question 3: What are the innovation indicators of dishwashers? Score: 0.67.
[0104] Candidate question 4: What are the grades of the core indicators of dishwashers? Score: 0.72.
[0105] Candidate question 5: What are the grades of basic indicators of dishwashers? Score: 0.81. S304-2: Filter candidate questions based on the question-answer continuity evaluation results, relevance evaluation results, and correspondence evaluation results to obtain the target question.
[0106] The specific implementation method of filtering candidate questions based on the question-answer continuity evaluation results, the relevance evaluation results, and the correspondence evaluation results to obtain the target question can be:
[0107] In one example, the product of the question-answer continuity evaluation result, the relevance evaluation result, and the correspondence evaluation result is calculated to obtain the recommendation score corresponding to the candidate question, and the candidate questions are sorted from large to small according to the corresponding recommendation scores. A preset number of target recommendation scores with the top rankings are obtained from the sorting, and the candidate questions corresponding to the target recommendation scores are determined as the target questions.
[0108] In another example, the weight corresponding to the question and answer continuity evaluation result, the weight corresponding to the relevance evaluation result, and the weight corresponding to the correspondence evaluation result are determined respectively, and the first product of the question and answer continuity evaluation result and the corresponding weight is calculated, the second product of the relevance evaluation result and the corresponding weight is calculated, and the third product of the correspondence evaluation result and the corresponding weight is calculated. The sum of the first product, the second product, and the third product is calculated as the recommendation value of the corresponding candidate question, and the candidate questions are sorted from large to small according to the corresponding recommendation scores, and a preset number of target recommendation scores with the top rankings are obtained from the sorting, and the candidate questions corresponding to the target recommendation scores are determined as the target questions.
[0109] In another example, based on the combination of relevance evaluation and correspondence evaluation results, the quality score of the candidate question is obtained, the product of the question-answer continuity evaluation result and the quality score is calculated as the recommendation value of the corresponding candidate question, the candidate questions are sorted from large to small according to the corresponding recommendation scores, and a preset number of target recommendation scores with a high ranking are obtained from the sorting, and the candidate question corresponding to the target recommendation score is determined as the target question. Please refer to Figure 6 The present application embodiment also provides a method for applying Figure 1 The large model-based question-answering device 100 includes a large model-based question-answering apparatus 110, wherein the large model-based question-answering apparatus 110 includes:
[0110] The determination module 111 is used to input the initial question into the question-answering system to obtain a corresponding answer sentence and a candidate question sentence, wherein the question-answering system at least includes a generative large language model, and the candidate question sentence is generated by the generative large language model; filter the candidate question sentence to obtain a corresponding target question sentence, wherein the target question sentence is answerable for the generative large language model;
[0111] The feedback module 112 is used to provide feedback on the answer sentence and the target question sentence.
[0112] The present application also provides a large model-based question-answering device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer executable instructions, and when the computer executable instructions are executed by the processor 130, the large model-based question-answering method is implemented.
[0113] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the large model-based question-answering method is implemented.
[0114] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.
[0116] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0117] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A question-answering method based on a large model, characterized in that: Methods include: Inputting the initial question into a question-answering system to obtain a corresponding answer and a candidate question, wherein the question-answering system at least includes a generative large language model, and the candidate question is generated by the generative large language model; Filtering the candidate questions to obtain corresponding target questions, wherein the target questions are answerable for the generative large language model; providing feedback on the answer sentence and the target question sentence; The step of filtering the candidate questions to obtain the corresponding target questions includes: Matching the candidate question with knowledge fragments in the question-answering knowledge base to determine corresponding candidate knowledge fragments; Input the candidate question sentence and the candidate knowledge fragment as a second prompt word into the generative large language model, and generate a candidate answer sentence according to the second prompt word by the generative large language model; Evaluating the correlation between the candidate answer sentence and the candidate question sentence, and the correspondence between the candidate answer sentence and the candidate knowledge fragment; Filtering the candidate questions based on the relevance evaluation result and the correspondence evaluation result to obtain the target question; The step of inputting the initial question into the question-answering system to obtain the corresponding answer sentence and the candidate question sentence also includes: Input the initial question and the target knowledge fragment as the first prompt word into the generative large language model, and generate the candidate question according to the first prompt word by the generative large language model; The step of filtering the candidate questions based on the relevance evaluation result and the correspondence evaluation result to obtain the target question includes: The generative large language model generates a question-answer continuity evaluation result for the candidate question sentence according to the first prompt word; The candidate questions are filtered based on the question-answer continuity evaluation result, the relevance evaluation result, and the correspondence evaluation result to obtain the target question.
2. The method according to claim 1, characterized in that The question answering system further includes a question answering knowledge base, and the steps of inputting the initial question into the question answering system to obtain the corresponding answer sentence and candidate question sentences include: Matching the initial question with the knowledge fragments in the question-answer knowledge base to determine the corresponding target knowledge fragments; The initial question sentence and the target knowledge fragment are input into the generative large language model to obtain the answer sentence, which corresponds to the initial question sentence and the target knowledge fragment.
3. The method according to any one of claims 1 to 2, characterized in that: The question intention pointed to by the candidate question is different from the question intention pointed to by the initial question.
4. The method according to claim 2, characterized in that: The knowledge fragments in the question-answering knowledge base are stored in the form of knowledge vectors. The step of matching the initial question with the knowledge fragments in the question-answering knowledge base to determine the corresponding target knowledge fragments includes: Determining a first vector corresponding to the initial question; Matching the first vector with the knowledge vector; wherein the knowledge fragment corresponds to the knowledge vector; A target knowledge vector is determined based on the matching degree between the first vector and the knowledge vector, and a knowledge segment corresponding to the target knowledge vector is determined as the target knowledge segment.
5. A question-answering device based on a large model, characterized in that: The device comprises: A determination module is used to input the initial question into the question-answering system to obtain a corresponding answer sentence and a candidate question sentence, wherein the question-answering system at least includes a generative large language model, and the candidate question sentence is generated by the generative large language model; filter the candidate question sentence to obtain a corresponding target question sentence, wherein the target question sentence is answerable for the generative large language model; A feedback module, used for providing feedback on the answer sentence and the target question sentence; The determination module is specifically used for: Matching the candidate question with knowledge fragments in the question-answering knowledge base to determine corresponding candidate knowledge fragments; Input the candidate question sentence and the candidate knowledge fragment as a second prompt word into the generative large language model, and generate a candidate answer sentence according to the second prompt word by the generative large language model; Evaluating the correlation between the candidate answer sentence and the candidate question sentence, and the correspondence between the candidate answer sentence and the candidate knowledge fragment; Filtering the candidate questions based on the relevance evaluation result and the correspondence evaluation result to obtain the target question; The determining module is also used for: Input the initial question and the target knowledge fragment as the first prompt word into the generative large language model, and generate the candidate question according to the first prompt word by the generative large language model; The determining module is also used for: The generative large language model generates a question-answer continuity evaluation result for the candidate question sentence according to the first prompt word; The candidate questions are filtered based on the question-answer continuity evaluation result, the relevance evaluation result, and the correspondence evaluation result to obtain the target question.
6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A question-answering device based on a large model, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 4 when executing the computer program.
