Question answering method, question answering device, computer program product and electronic equipment

By matching the question and answer decision tree and using historical dialogue information in the large language model, the bias problem when the large language model generates answers is solved, the accuracy and professionalism of knowledge question and answer are improved, and the accurate understanding of the input questions and the accuracy of the answers are ensured. sex.

CN118535690APending Publication Date: 2024-08-23YIDU CLOUD (BEIJING) TECH CO LTD

Patent Information

Application Number
CN202410530566.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-29
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Large language models can replicate biases in the training data when generating responses, resulting in inaccurate or misleading responses and an opaque decision-making process that makes it difficult to understand the reasons for model output.

Method used

By matching the question and answer decision tree with a large language model, combined with semantic understanding and historical dialogue information, reply information to user questions is generated to ensure the accuracy and professionalism of the answers.

Benefits of technology

It improves the accuracy and professionalism of knowledge question and answer, ensures accurate understanding of input questions and accuracy of answers, and reduces the opacity of model output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535690A
    Figure CN118535690A
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and provides a question answering method, a question answering device, a computer program product and electronic equipment. The method comprises the following steps: in response to input of inquiry information, matching a question and answer decision tree for the inquiry information according to a large language model; and under the condition of successful matching, answering the inquiry information based on the matched question and answer decision tree. According to the method, the big language model and the question and answer decision tree are fused to perform knowledge question and answer, the accuracy of semantic understanding of the inquiry information of the user is ensured through the big language model, the professionality of answering the inquiry information is ensured through the question and answer decision tree with professional knowledge, and the accuracy of question and answer decision is improved through fusion of the big language model and the question and answer decision tree.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of natural language processing, and in particular to a question-answering method, a question-answering device, a computer program product, and an electronic device. Background Art

[0002] Intelligent knowledge question answering refers to the process in which a user inputs a question to a computer, and the computer understands and processes the natural language of the question input by the user, thereby generating answer information and returning it to the user. Large language models have demonstrated excellent performance in multiple tasks such as question-answering systems, text generation, and natural language understanding. They can understand complex human language, integrate and utilize information learned from a large amount of training data, and provide answers and analysis on a wide range of topics.

[0003] However, large language models may replicate biases in the training data in the generated responses, resulting in inaccurate or misleading responses.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide a question-answering method and device, a computer program product, and an electronic device, thereby improving the accuracy of knowledge intelligent question-answering at least to a certain extent.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to a first aspect of the present disclosure, a question-answering method is provided, comprising: in response to input of query information, matching a question-answering decision tree for the query information through a large language model; and in case of successful matching, generating reply information for the query information based on the matched question-answering decision tree.

[0008] Optionally, in response to the input of query information, matching the query information with a question-answer decision tree through a large language model includes: in response to the input of query information, obtaining historical question-answer dialogue information based on the query information; inputting the query information and the historical question-answer dialogue information into the large language model, so that the large language model matches the question-answer decision tree for the query information according to semantic information of the query information.

[0009] Optionally, in response to the input of query information, matching the query information with a question and answer decision tree according to a large language model includes: in response to the input of query information, obtaining historical question and answer dialogue information based on the query information; inputting the query information and the historical question and answer dialogue information into a large language model to determine query intent information of the query information; inputting the query intent information into a preset matching model to match the question and answer decision tree for the query information through the preset matching model.

[0010] Optionally, when the match is successful, generating reply information for the inquiry information based on the matched question-answer decision tree includes: when the match is successful, determining a decision problem based on pre-configured questions and branch conditions in the matched question-answer decision tree, performing question-answer interaction based on the decision problem to obtain decision dependency information; determining a decision result of the inquiry information based on the acquired decision dependency information and the branch conditions of the decision tree; and generating reply information for the inquiry information based on the decision result.

[0011] Optionally, after answering the query information according to the decision result, the method also includes: saving the decision dependency information and the decision result; when the question-answering dialogue is not over, in response to the re-input of the query information, inputting the re-input query information, the decision dependency information and the decision result into the large language model, so as to match the question-answering decision tree for the re-input query information through the large language model.

[0012] Optionally, the method further includes: in case of a matching failure, generating reply information for the query information by using the large language model.

[0013] Optionally, the method also includes: in the event of a matching failure, determining intent information of the query information based on a large language model; determining an intent question based on the intent information, and performing a question-and-answer interaction based on the intent question to obtain input answer information for the question-and-answer interaction; inputting the query information and the input answer information into the large language model so that the large language model matches a question-and-answer decision tree for the query information; and generating reply information for the query information through the large language model when the number of interactive question-and-answer interactions performed by the large language model meets a preset number and no question-and-answer decision tree is matched.

[0014] According to a second aspect of the present disclosure, a question-answering device is provided, comprising: a decision tree matching module, configured to, in response to input of query information, match a question-answering decision tree for the query information through a large language model; and an answer module, configured to, when the match is successful, generate reply information for the query information based on the matched question-answering decision tree.

[0015] According to a third aspect of the present disclosure, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the steps of the question-answering method as described in the first aspect.

[0016] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the question-and-answer method as described in the first aspect of the above embodiment.

[0017] It can be seen from the above technical solutions that the question-answering method, question-answering device, and computer program product and electronic device implementing the question-answering method in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:

[0018] In the technical solutions provided by some embodiments of the present disclosure, for the question information input by the user, first, the semantic understanding of the question information is performed through the large language model, so as to match the question information with a question-answering decision tree according to the understood semantics, and then the question is answered according to the successfully matched question-answering decision tree. Based on the technical solution of the present disclosure, since the large language model can accurately understand many complex semantics, the flexibility of knowledge question-answering and the accuracy of understanding input questions can be improved, and the question-answering decision tree is generated based on knowledge in a professional field, so answering questions based on the question-answering decision tree can improve the accuracy and professionalism of the answers. The combination of the two ensures both the accuracy of understanding the input questions and the accuracy and professionalism of the output answers, thereby improving the accuracy of knowledge questions.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0021] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;

[0022] Figure 2 A schematic diagram showing a flow chart of a question-answering method in an exemplary embodiment of the present disclosure;

[0023] Figure 3 A flowchart showing a method for matching a question-answer decision tree in an exemplary embodiment of the present disclosure is shown;

[0024] Figure 4 A flowchart showing a method for answering inquiry information based on a question-answer decision tree in an exemplary embodiment of the present disclosure is shown;

[0025] Figure 5 A flowchart showing another method for matching a question-answer decision tree in an exemplary embodiment of the present disclosure;

[0026] Figure 6 A flowchart showing a knowledge question answering method integrating a large language model and a question answering decision tree in an exemplary embodiment of the present disclosure is shown;

[0027] Figure 7 A schematic diagram showing the composition of a question-answering device in an exemplary embodiment of the present disclosure is shown;

[0028] Figure 8 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0030] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.

[0031] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0032] Intelligent knowledge question answering is one of the important application directions in the field of artificial intelligence. By using technologies such as natural language processing, machine learning, or knowledge graphs, machines can automatically give accurate and effective answers to questions provided by users.

[0033] Large language models have demonstrated outstanding performance in multiple tasks such as question answering, text generation, and natural language understanding. They are able to understand complex human language, integrate and utilize information learned from large amounts of training data, and provide answers and analysis on a wide range of topics.

[0034] However, large language models may replicate biases in their training data in generated responses and, therefore, may generate inaccurate or misleading responses. In addition, the decision-making process of large language models is often opaque, making it difficult to understand why the model produces a specific output.

[0035] In order to solve the above problems, the present invention provides a question-answering method and device, which can be applied to Figure 1 In the system architecture of the exemplary application environment shown.

[0036] like Figure 1 As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be a terminal device such as a smart phone, a tablet computer, a desktop computer, a laptop computer, a smart wearable device, etc. The server 120 generally refers to a background system that provides services related to the question-answering method in this exemplary embodiment, and may be a server or a cluster formed by multiple servers. The terminal device 110 and the server 120 may be connected via a wired or wireless communication link to exchange data.

[0037] In an exemplary embodiment, the above-mentioned question-answering method can be performed by the terminal device 110. Accordingly, the question-answering device can be set in the terminal device 110 to implement the corresponding module functions. For example, the user inputs the inquiry information in the terminal device 110, and the terminal device 110 responds to the inquiry information input by the user, matches the inquiry information input by the user with the question-answering decision tree according to the large language model pre-configured in the terminal device 110, and in the case of successful matching, generates reply information for the inquiry information input by the user according to the question-answering decision tree pre-configured in the terminal device 110 and successfully matched, and outputs the reply information to feed back the reply information to the user in the form of voice, text or image.

[0038] In an exemplary embodiment, the above-mentioned question-answering method can be executed by the server 120. Accordingly, the question-answering device can be set in the server 120 to implement the corresponding module functions. For example, after the user enters the inquiry information in the terminal device 110, the terminal device 110 uploads the inquiry information to the server 120, and the server 120 matches the inquiry information with the question-answering decision tree according to the large language model, and generates reply information of the inquiry information based on the matched decision tree when the match is successful, and returns the reply information to the terminal device 110, so as to feedback the reply information to the user through the terminal device.

[0039] In an exemplary embodiment, the above-mentioned question-answering method can also be jointly performed by the terminal device 110 and the server 120. Accordingly, some modules of the question-answering device can be set in the terminal device 110, and some modules can be set in the server 120 to realize the corresponding module functions. For example, the user inputs the inquiry information in the terminal device 110, and the terminal device 110 matches the question-answering decision tree for the inquiry information according to the large language model pre-configured on the terminal device 110. In the case of a successful match, the terminal device 110 sends the identifier of the successfully matched question-answering decision tree to the server 120. The server 120 queries the corresponding question-answering decision tree according to the received identifier, and determines the reply information of the inquiry information according to the queried question-answering decision tree, and then returns the reply information to the terminal device 110.

[0040] It should be understood that Figure 1 The number of terminal devices and servers in the example is only illustrative. Any number of terminal devices and servers may be provided as required. For example, the server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0041] It is easy for those skilled in the art to understand that the above application scenarios are only used as examples and are not limited to the present exemplary embodiment.

[0042] Figure 2 FIG. 1 is a flow chart showing a question-answering method in an exemplary embodiment of the present disclosure. Figure 2 , the method comprising:

[0043] Step S210, in response to the input of the query information, matching the query information with a question-answer decision tree through a large language model;

[0044] Step S220: if the match is successful, generate reply information for the inquiry information based on the matched question-answer decision tree.

[0045] exist Figure 2 In the technical solution provided by the illustrated embodiment, for the question information input by the user, first, the semantic understanding of the question information is performed through the large language model, so as to match the question information with a question-answering decision tree according to the understood semantics, and then the question is answered according to the successfully matched question-answering decision tree. Based on the technical solution disclosed in the present invention, since the large language model can accurately understand many complex semantics, the flexibility of knowledge question-answering and the accuracy of understanding input questions can be improved, and the question-answering decision tree is generated based on knowledge in a professional field, so answering questions based on the question-answering decision tree can improve the accuracy and professionalism of the answers. The combination of the two ensures both the accuracy of understanding the input questions and the accuracy and professionalism of the output answers, thereby improving the accuracy of knowledge question-answering.

[0046] The following Figure 2 The specific implementation methods of each step in the embodiment shown are described in detail:

[0047] In step S210, in response to the input of query information, a question-answer decision tree is matched for the query information through a large language model.

[0048] Large Language Model (LLM) is a deep learning model based on massive data training. It can not only generate natural language text, but also deeply understand the meaning of text and handle various natural language tasks. In the present disclosure, the large language model may include a large language model using multiple transformer models at the bottom layer, that is, a large language model with a group of neural networks at the bottom layer. Of course, it may also include other large language models, and this exemplary embodiment does not make special restrictions on this.

[0049] In an exemplary embodiment, the inquiry information in the present disclosure may be one or more of text inquiry information, image inquiry information, and voice inquiry information.

[0050] In an exemplary implementation, the knowledge in the relevant field can be configured into different question-answer decision trees in advance according to the business scenario to generate a question-answer decision tree library corresponding to the business scenario. For example, for the field of pediatric medical care in the medical scenario, a question-answer decision tree for "children's fever assessment" and a question-answer decision tree for "children's cognitive impairment assessment" can be pre-configured.

[0051] In the present disclosure, each question-answering decision tree includes questions to be collected for decision making and decision branch conditions. In other words, the question-answering decision tree in the present disclosure is determined based on the decision questions and decision branch conditions and the decision results corresponding to the decision branch conditions.

[0052] Exemplarily, a specific implementation of step S210 may include: in response to input of query information, obtaining historical question-answering dialogue information based on the query information; inputting the query information and the historical question-answering dialogue information into a large language model, so that the large language model matches a question-answering decision tree for the query information according to the semantic information of the query information.

[0053] For example, historical question-and-answer dialogue information can be obtained based on the input time information of the query information. For example, the dialogue content that is within a preset time from the input time of the current query information and before the currently input query information can be used as the historical question-and-answer dialogue information, which is concatenated with the currently input query information to form the input content, which is input into the large language model. The large language model understands the semantics of the input content and matches the question-and-answer decision tree for the current query information from the question-and-answer decision tree library.

[0054] It should be noted that when the current query information and the historical question-and-answer dialogue information are concatenated, the concatenated length must be less than or equal to the maximum input length of the large language model. When the concatenated length is greater than the maximum input length of the large language model, the previous historical question-and-answer dialogue information can be deleted according to the chronological order, so that the concatenated text length is less than or equal to the maximum input length of the large language model.

[0055] In an exemplary embodiment, manual annotation may be performed first to generate a question-answer decision tree matching training data set. For example, corresponding question-answer decision tree labels may be manually added to different question corpora to generate question-answer pairs. For example, if the question corpus is "What should I do if a child has a fever", the corresponding answer is "Enter the 'Children's Fever Assessment' question-answer decision tree", thus generating a question-answer pair. Such a question-answer pair is a piece of training data, thereby generating a training data set. Based on the training data set, the existing pre-trained large language model is fine-tuned, that is, the pre-trained large language model is subjected to SFT (Scalable Fine-Tuning), so that the large language model learns how to match the question-answer decision tree according to the input information, so that the large language model has the ability to match the question-answer decision tree for the input information. At the same time, since the existing pre-trained large language model is subjected to fine-tuning training, the existing large language model still has the original function of understanding the input information and generating reply information. SFT fine-tunes the pre-trained language model to adapt it to specific tasks.

[0056] In another exemplary embodiment, a question-answer pair consisting of a question corpus and its corresponding question-answer decision tree may be added to the prompt words of a pre-trained large language model, so that the pre-trained large language model is newly equipped with the ability to match the question-answer decision tree with input information.

[0057] The pre-trained large language model that has been fine-tuned has the ability to match decision trees for more input information after learning from labeled data, so it has higher matching flexibility and a wider range of applications. However, fine-tuning training changes the parameters of the pre-trained large language model, so it may affect the original capabilities of the model. By configuring the addition of prompt words, the pre-trained large language model has the ability to match the question-answering decision tree. This does not change the parameters of the pre-trained model, so it has no effect on its original capabilities, but the number of prompt words is limited, so its matching ability is limited and the matching flexibility is poor. In actual use, you can choose according to business needs.

[0058] In an exemplary application scenario, in response to query information input by a user, the query information is input into a large language model, and after the large language model performs semantic understanding on the query information, a question-answer decision tree is matched for the query information input by the user based on the understood semantic text.

[0059] In the present disclosure, since the input information is input into the large language model, after the large language model performs semantic understanding on the input information, the large language model matches the question-answer decision tree according to the understood semantic text, rather than directly matching the question-answer decision tree according to the keywords of the input information. Based on the powerful semantic understanding ability of the large language model, the accuracy of question-answer decision tree matching can be improved.

[0060] Exemplarily, another specific implementation of step S210 is as follows: Figure 3 shown. Figure 3 A flowchart of a method for matching a question-answer decision tree in an exemplary embodiment of the present disclosure is shown. Figure 3 , the method may include steps S310 to S330. Wherein:

[0061] In step S310, in response to the input of the inquiry information, historical question-and-answer dialogue information is acquired based on the inquiry information.

[0062] Exemplarily, the specific implementation method of obtaining historical question-and-answer dialogue information can refer to the description of the above-mentioned related content, which will not be repeated here.

[0063] In step S320, the query information and the historical question-answer dialogue information are input into a large language model to determine the query intention information of the query information.

[0064] As mentioned above, the currently input query information and the historical question-and-answer dialogue information may be concatenated and input into the large language model. The specific implementation of the concatenation may also refer to the above-mentioned related content and will not be described in detail here.

[0065] For example, the input query information and historical question-and-answer dialogue information can be input into a large language model, and the large language model generates output text by understanding its semantics, and the output text generated by the large language model is determined as the query intent information.

[0066] In step S330, the inquiry intention information is input into a preset matching model to match a question-answer decision tree for the inquiry information through the preset matching model.

[0067] In an exemplary embodiment, the preset matching model may include any small machine learning model, whose parameter amount is much smaller than that of the large language model, which is only used for matching the question-answering decision tree in a specific field. For example, it may be a convolutional neural network model, a reinforcement learning model, a regular matching model, etc., which is not particularly limited in this exemplary embodiment.

[0068] For example, matching question-answer decision tree labels can be added to different corpora to generate training data sets. For example, the label "Children's fever assessment question-answer decision tree" can be added to the corpus "What to do if a child has a fever" to generate a training data. A training data set can be determined based on multiple such similar training data, and a small machine learning model can be trained based on the training data set to obtain a preset matching model.

[0069] In an exemplary application scenario, different fields may use a preset matching model.

[0070] In another exemplary application scenario, different fields correspond to different preset matching models. That is, training data for each field can be generated based on the labels of the question-answering decision tree for that field, and then a machine learning model can be trained using the training data for that field to obtain the preset matching model for that field.

[0071] When different fields correspond to different preset matching models, the intention information obtained in step S320 can be input into each preset matching model, and the question-answering decision tree with the highest confidence is selected as the candidate question-answering decision tree according to the confidence of the matching result of each preset matching model (which can be the confidence probability of the output result of the preset matching model). When the confidence of the candidate question-answering decision tree is greater than the confidence threshold, the candidate question-answering decision tree is determined to be a successfully matched question-answering decision tree, otherwise, it is determined that the question-answering decision tree fails to match.

[0072] When different fields correspond to different preset matching models, the intention information and the field to which the input query information belongs can also be determined through the large language model, and the corresponding preset matching model can be determined according to the field. The intention information is then input into the determined preset matching model to match the question-answer decision tree.

[0073] Through the above steps S310 to S330, compared with using a large language model for matching, since it does not require fine-tuning and training of the large language model, it will not affect the existing semantic understanding function of the large language model itself, but at the same time, it can improve the accuracy of determining the inquiry intent based on the powerful semantic understanding ability of the large language model. In this way, when the preset matching model is used to match the question-answering decision tree according to the inquiry intent determined by the large language model, the matching accuracy can be improved. In other words, without affecting the function of the large language model itself, the accuracy of the question-answering decision tree matching can be further improved.

[0074] Taking a total of 100 question-answer decision trees as an example, in an exemplary implementation, when performing matching, the model can determine the matching probability between these 100 question-answer decision trees and the input query information, and sort the matching probabilities. If the maximum matching probability is less than the probability threshold, the match is considered to have failed; otherwise, the match is successful, and the question-answer decision tree corresponding to the maximum matching probability is the successfully matched question-answer decision tree.

[0075] Next, continue to refer to Figure 2 In step S220, when the match is successful, response information for the inquiry information is generated based on the matched question-answer decision tree.

[0076] For example, Figure 4 A flowchart of a method for answering inquiry information based on a question-answer decision tree in an exemplary embodiment of the present disclosure is shown. Figure 4 , the method may include steps S410 to S430. Wherein: in step S410, a decision question is determined according to the pre-configured questions and branch conditions in the matched question-answer decision tree, and a question-answer interaction is performed based on the decision question to obtain decision dependency information; in step S420, a decision result of the inquiry information is determined based on the obtained decision dependency information and the branch conditions of the decision tree; in step S430, a reply information for the inquiry information is generated according to the decision result.

[0077] As mentioned above, the question-and-answer decision tree in the present disclosure is generated based on the questions and branch conditions required for decision-making. Based on this, the decision dependency information can be collected from the user in a question-and-answer interactive manner according to the decision questions and branch conditions pre-configured in the question-and-answer decision tree. For example, the first decision question is returned to the user's terminal according to the root node of the question-and-answer decision tree, and then the branch corresponding to which branch condition is to be taken is determined according to the user's answer, so as to reach the node indicated by the branch condition, and then the next decision question is determined according to the node indicated by the branch condition and returned to the user's terminal, until the leaf node of the last layer of a branch of the question-and-answer decision tree is reached, thereby obtaining a decision result. In other words, the decision result can be determined based on a question-and-answer method according to the questions and branch conditions configured in the question-and-answer decision tree. Then, the large language model generates a reply message based on the decision result and returns it to the user.

[0078] In an exemplary embodiment, after answering the query information according to the decision result, the decision dependency information and the decision result can be saved. When the question-answering dialogue is not ended, in response to the re-input of the query information, the re-input query information, the decision dependency information and the decision result are input into the large language model to match the question-answering decision tree for the re-input query information according to the large language model.

[0079] For example, after answering the user's inquiry information according to the decision conclusion, if the question-and-answer dialogue is not over and the user enters the inquiry information again, it means that the user may have a new question based on the previous answer. For example, the user first enters the question "What should I do if my child has a high fever?", and the "Children's Fever Assessment" question-and-answer decision tree is matched according to the question. According to the interactive question-and-answer between the question-and-answer decision tree and the user, the final reply information given is "Need to take antipyretics." The user may enter the question "What antipyretics can I take for a fever" based on the reply information. Obviously, the inquiry question entered again is related to the previous reply information "Need to take antipyretics", and the reply information is determined based on the decision conclusion of the "Children's Fever Assessment Question-and-Answer Decision Tree", and the user is most likely asking "What antipyretics can I take for a child's fever?" When performing fever assessment, the "Children's Fever Assessment" question-and-answer decision tree should have asked about age. By age, it can be judged that the question the user asks again is related to people of that age, that is, the inquiry question entered again and the information collected by the previous "Children's Fever Assessment" question-and-answer decision tree may also be related.

[0080] Therefore, the information collected and the decision conclusions of the previous question-answering decision tree can be saved in the conversation record. In this way, when the user enters the query question again and the large language model matches the question-answering decision tree for the question entered again, the information collected and the decision conclusions given by the previous question-answering decision tree can also be taken into account, thereby more accurately understanding the user's true intention and improving the accuracy of question-answering decision tree matching.

[0081] It should be noted that the question-answering method in the present disclosure and the direct question-answering dialogue with the user are implemented by a large language model. The question-answering decision tree only returns the questions required for decision-making to the user when a decision is needed, and the user makes decision-related answers based on the questions required for decision-making. The interactive question-answering between the question-answering decision tree and the user does not belong to the process of question-answering dialogue, so it will not be used as historical dialogue content. Therefore, in the present disclosure, the user-related information and decision conclusions collected by the question-answering decision tree when making a decision are saved, so that when matching the question-answering decision tree for the next inquiry question, the information collected and the decision conclusions when the previous question-answering decision tree was saved can be referred to, which can improve the matching accuracy of the question-answering decision tree for the next inquiry question.

[0082] In an exemplary embodiment, whether to end the question-and-answer dialogue can be determined by the user's choice, such as configuring a control in the question-and-answer graphical user interface. In response to the user triggering the control, it is determined that the question-and-answer dialogue is ended; otherwise, it is determined that the question-and-answer dialogue is not ended.

[0083] In an exemplary embodiment, when the large language model fails to match the question-answer decision tree for the query question, the large language model generates reply information for the query information.

[0084] For example, when the large language model fails to match a question-answering decision tree to a query, the large language model can directly generate response information for the query based on its understanding of the query.

[0085] For example, Figure 5 A flowchart showing another method for matching a question-answer decision tree in an exemplary embodiment of the present disclosure is shown. Figure 5 , the method may include steps S510 to S540.

[0086] in:

[0087] In step S510, when the question-answer decision tree fails to match, the intention information of the query information is determined based on the large language model.

[0088] For example, when a user enters a query, the semantics of the query is first understood by the large language model, and the query is matched with the pre-configured question-answer decision tree. If the match fails, the semantics of the query can be understood by the large language model to determine the intent of the query.

[0089] In an exemplary embodiment, intent information may be pre-annotated for different corpora to generate a training data set, and the pre-trained large language model may be fine-tuned based on the training data set to enable it to have the ability to recognize the intent information of the input information.

[0090] In step S520, an intended question is determined based on the intention information, and a question-and-answer interaction is performed according to the intended question to obtain input answer information for the question-and-answer interaction.

[0091] For example, after determining the intent information based on the query information currently input by the user, an intent question can be generated based on the intent information and the intent question can be returned to the user, thereby conducting a question-and-answer interaction with the user to obtain the user's answer information to the intent question.

[0092] For example, the query information entered by the user is "What should I do if I have a fever?". Since the large language model cannot determine whether the user wants to ask "What should I do if an adult has a fever" or "What should I do if a child has a fever", it is impossible to match the user with an accurate question-answer decision tree based on the query information. Therefore, the intent information can be determined as "fever" based on the query information, and the intended question can be determined as "Do you want to ask about adult fever or child fever" or "In order to provide you with an accurate answer, please tell me your age", and then the answer information entered by the user for the question can be obtained.

[0093] In step S530, the query information and the input answer information are input into the large language model, so that the large language model matches the query information with a question-answer decision tree.

[0094] Continuing with the example listed in the above step S520, for example, the user enters the answer information "3 years old" for the intent question returned by the large language model, "In order to provide you with an accurate answer, please tell me your age", then the query information "What should I do if I have a fever" entered by the user and the answer information "3 years old" entered by the user for the intent question returned by the large language model are concatenated and input into the large language model as the input information of the large language model. The large language model can match the question-answer decision tree again based on the input information. This time, the large language model can match the query information to the "Children's Fever Assessment" question-answer decision tree based on the input answer information "3 years old".

[0095] In step S540, when the number of interactive question-answering performed by the large language model meets the preset number and no question-answering decision tree is matched, reply information for the inquiry information is generated by the large language model.

[0096] For example, in step S530, if the large language model fails to match the question-answering decision tree again based on the input answer information and the query information, the large language model can generate the intended question again based on the input answer information and the query information, return it to the user, and conduct another interactive question-answering with the user, and then match the question-answering decision tree for the query information again based on the input answer information of this interactive question-answering, the input answer information and the query information of the previous interactive question-answering, and in the case of a match failure, conduct the question-answering interaction again. If the number of question-answering interactions reaches the preset number of times, but there is still no successfully matched question-answering decision tree, the large language model will reply to the query information based on the input answer information and the query information of the question-answering interaction. If the question-answering decision tree is matched after a certain question-answering interaction that does not reach the preset number of times, the reply information of the query information is determined based on the question-answering decision tree.

[0097] Through the above-mentioned steps S510 to S540, if the first match is not successful, several question-and-answer interactions can be attempted with the user to see if the user can provide more information that is helpful for matching, so as to match the inquiry question to the question-and-answer decision tree as much as possible. Since the question-and-answer decision tree is generated based on expert knowledge, it can provide users with professional answers as much as possible, thereby improving the accuracy of the questions and answers.

[0098] For example, Figure 6 A flow chart showing a knowledge question answering method integrating a large language model and a question answering decision tree in an exemplary embodiment of the present disclosure is shown, with reference to Figure 6, the method may include steps S601 to S609. Wherein: in step S601, the query information input by the user is obtained, and the large language model matches the query information with a decision tree; in step S602, it is determined whether the decision tree is matched, if yes, then the process goes to step S603, otherwise, the process goes to step S607; in step S603, the decision tree takes over the conversation; in step S604, the decision tree collects the information required for the decision; in step S605, the decision tree gives a decision conclusion according to the decision rule; in step S606, the information collected by the decision tree and the decision conclusion are recorded, and the process goes to step S609; in step S607, the large language model answers the query information; in step S608, the conversation content between the large language model and the user is recorded; in step S609, it is determined whether to end the conversation, if yes, then the conversation is ended, if not, then the process goes to step S601 to repeat the above process.

[0099] For example, knowledge in related fields can be configured as different question-and-answer decision trees according to business scenarios. For example, in the medical field, question-and-answer decision trees such as "children's fever assessment" and "cognitive impairment assessment" can be pre-configured. Each question-and-answer decision tree contains questions to be collected and decision branch conditions. Users interact with the large language model in the form of dialogue. After the user enters information, the large language model understands the semantics of the user's input information based on the user's input information and historical dialogue content, and matches the user's input information with the pre-set question-and-answer decision tree. If a question-and-answer decision tree is matched (for example, if the user is asking "how to deal with a child's fever", the "children's fever assessment" question-and-answer decision tree will be matched), the decision engine will be transferred to the matched question-and-answer decision tree to take over the dialogue. The decision engine collects the information required for the decision in the form of a question-and-answer questionnaire based on the pre-configured questions and branch conditions in the matched question-and-answer decision tree, and determines the decision conclusion based on the branch conditions and the collected decision information. Finally, the user is provided with an expert-level decision conclusion, and the collected decision information and decision conclusion are saved in the dialogue record. The conversation is then continued by the large language model. If the question-answering conversation is not over, the large language model continues to interact with the user in the form of a conversation. If the question-answering decision tree is not matched, the large language model directly generates the answer. The question-answering system automatically records the query information entered by the user and the reply information generated by the large language model. Then, if the question-answering conversation is not over, the large language model continues to interact with the user in the form of a conversation to match the question-answering decision tree for the query information entered by the user again, and repeat the above process.

[0100] Although large language models can handle complex queries and generate fluent answers, their output sometimes lacks professionalism and accuracy, and is easily affected by bias in the training data. Although decision tree-based question-answering systems perform well in terms of professionalism and accuracy, their application scope is limited by fixed decision paths, lacks flexibility, and cannot handle ambiguous or diverse user input.

[0101] In the present disclosure, the flexibility of the large language model and the professionalism and accuracy of the decision engine based on the decision tree are effectively combined. By introducing the decision tree engine to handle specific scenarios on the basis of the large language model question and answer, the accuracy and reliability of questions and answers in professional fields (such as medical and health questions and answers) are improved. At the same time, the ability of the large language model to handle complex queries is retained, and the flexibility of the question and answer and the naturalness of interaction with users are increased.

[0102] In addition, it should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0103] Furthermore, an exemplary embodiment of the present disclosure also provides a question-answering device. Figure 7 As shown, the question-answering device includes the following program modules: a decision tree matching module 710, which is configured to match a question-answering decision tree for the query information in response to the input of the query information through a large language model; an answer module 720, which is configured to generate reply information for the query information based on the matched question-answering decision tree when the match is successful.

[0104] In an exemplary implementation, based on the aforementioned embodiments, the above-mentioned decision tree matching module 710 can be specifically configured as follows: in response to the input of query information, obtaining historical question-answering dialogue information based on the query information; inputting the query information and the historical question-answering dialogue information into a large language model, so that the large language model matches a question-answering decision tree for the query information according to the semantic information of the query information.

[0105] In another exemplary embodiment, based on the aforementioned embodiment, the above-mentioned decision tree matching module 710 can be specifically configured as follows: in response to the input of query information, obtaining historical question-and-answer dialogue information based on the query information; inputting the query information and the historical question-and-answer dialogue information into a large language model to determine the query intention information of the query information; inputting the query intention information into a preset matching model to match a question-and-answer decision tree for the query information through the preset matching model.

[0106] In an exemplary embodiment, based on the aforementioned embodiment, the above-mentioned answer module 720 can be specifically configured as follows: in the case of successful matching, a decision problem is determined based on the pre-configured questions and branch conditions in the matched question-answer decision tree, and question-answer interaction is performed based on the decision problem to obtain decision dependency information; based on the acquired decision dependency information and the branch conditions of the decision tree, a decision result of the inquiry information is determined; and reply information for the inquiry information is generated based on the decision result.

[0107] In an exemplary embodiment, based on the aforementioned embodiments, the question-answering device 700 in the present disclosure may further include a saving module, which may be configured to: save the decision dependency information and the decision result; when the question-answering dialogue is not ended, in response to the re-input of the query information, input the re-input query information, the decision dependency information and the decision result into the large language model to match the question-answering decision tree for the re-input query information according to the large language model.

[0108] In an exemplary implementation, based on the above-mentioned embodiment, the above-mentioned answer module 720 may also be configured to: in the case of a matching failure, generate reply information for the inquiry information through the large language model.

[0109] In another exemplary embodiment, based on the aforementioned embodiment, the above-mentioned answer module 720 may also be configured as: in the event of a matching failure, determining the intent information of the query information according to the large language model; determining the intent question based on the intent information, and performing a question-and-answer interaction according to the intent question to obtain input answer information for the question-and-answer interaction; inputting the query information and the input answer information into the large language model so that the large language model matches a question-and-answer decision tree for the query information; and generating reply information for the query information through the large language model when the number of interactive question-and-answer interactions performed by the large language model meets a preset number and the question-and-answer decision tree is not matched.

[0110] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0111] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0112] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0113] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned question-answering method is implemented.

[0114] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.

[0115] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.

[0116] The code of the computer program can be written in one or more programming languages. Programming languages ​​such as C language, Java, C++, Python, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).

[0117] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals to run computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device can execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned question-answering method, which includes the following steps: in response to the input of query information, matching a question-answering decision tree for the query information according to a large language model; in the case of a successful match, generating reply information for the query information based on the matched question-answering decision tree.

[0118] By executing the above method steps through a computer program, since the large language model can accurately understand many complex semantics, it can improve the flexibility of knowledge question answering and the accuracy of understanding input questions. The question answering decision tree is generated based on professional knowledge, so answering questions based on the question answering decision tree can improve the accuracy and professionalism of the answers. The combination of the two ensures the accuracy of understanding of input questions and the accuracy and professionalism of output answers, thereby improving the accuracy of knowledge questions.

[0119] The exemplary embodiments of the present disclosure also provide an electronic device, such as the terminal device 110 or the server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface.

[0120] Reference below Figure 8 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 8 The electronic device 800 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0121] like Figure 8 As shown, the electronic device 800 may include: a processor 810 , a memory 820 , a bus 830 , an I / O (input / output) interface 840 , a network adapter 850 , and a display 860 .

[0122] The memory 820 may include a volatile memory, such as a RAM 821, a cache unit 822, and may also include a non-volatile memory, such as a ROM 823. The memory 820 may also include one or more program modules 824, such program modules 824 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 824 may include each module in the above-mentioned device.

[0123] The processor 810 may include one or more processing units. For example, the processor 810 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.

[0124] The processor 810 can be used to execute executable instructions stored in the memory 820, such as the above-mentioned question-answering method, which includes the following steps: in response to the input of query information, matching a question-answering decision tree for the query information according to a large language model; in the event of a successful match, generating reply information for the query information based on the matched question-answering decision tree.

[0125] The above method is implemented through a computer program. Since the large language model can accurately understand many complex semantics, it can improve the flexibility of knowledge question answering and the accuracy of understanding input questions. The question-answering decision tree is generated based on professional knowledge, so answering questions based on the question-answering decision tree can improve the accuracy and professionalism of the answers. The combination of the two ensures the accuracy of the understanding of the input questions and the accuracy and professionalism of the output answers, thereby improving the accuracy of knowledge questions.

[0126] The bus 830 is used to realize the connection between different components of the electronic device 800, and may include a data bus, an address bus, and a control bus.

[0127] The electronic device 800 can communicate with one or more external devices 900 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 840 .

[0128] The electronic device 800 can communicate with one or more networks through the network adapter 850. For example, the network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 850 can communicate with other modules of the electronic device 800 through the bus 830.

[0129] The electronic device 800 may display a graphical user interface, such as a question-and-answer interaction interface, through the display 860 .

[0130] although Figure 8 Not shown, other hardware and / or software modules may also be provided in the electronic device 800, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0131] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0132] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".

[0133] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.

Claims

1. A question-answering method, It is characterized in that include: In response to the input of the query information, matching the query information with a question-answer decision tree through a large language model; In the case of a successful match, response information for the inquiry information is generated based on the matched question-answer decision tree.

2. The question-answering method according to claim 1, It is characterized in that In response to the input of the query information, matching the query information with a question-answer decision tree through a large language model includes: In response to the input of the inquiry information, acquiring historical question-and-answer dialogue information based on the inquiry information; The query information and the historical question-answering dialogue information are input into a large language model, so that the large language model matches a question-answering decision tree for the query information according to semantic information of the query information.

3. The question-answering method according to claim 1, It is characterized in that In response to the input of the query information, matching the query information with a question-answer decision tree through a large language model includes: In response to the input of the inquiry information, acquiring historical question-and-answer dialogue information based on the inquiry information; Inputting the query information and the historical question-and-answer dialogue information into a large language model to determine the query intention information of the query information; The inquiry intention information is input into a preset matching model to match a question-answer decision tree for the inquiry information through the preset matching model.

4. The question-answering method according to claim 1, It is characterized in that In the case of successful matching, generating reply information for the inquiry information based on the matched question-answer decision tree includes: In the case of successful matching, a decision problem is determined according to the pre-configured questions and branch conditions in the matched question-answer decision tree, and a question-answer interaction is performed based on the decision problem to obtain decision dependency information; Determining a decision result of the query information based on the acquired decision dependency information and the branch conditions of the decision tree; Generate reply information of the inquiry information according to the decision result.

5. The question-answering method according to claim 4, It is characterized in that After answering the inquiry information according to the decision result, the method further includes: Saving the decision dependency information and the decision result; When the question-answering dialogue is not ended, in response to the re-input of the query information, the re-input query information, the decision dependency information and the decision result are input into the large language model to match the question-answering decision tree for the re-input query information through the large language model.

6. The question-answering method according to any one of claims 1 to 5, It is characterized in that The method further comprises: In the event of a match failure, response information to the query information is generated using the large language model.

7. The question-answering method according to any one of claims 1 to 5, It is characterized in that The method further comprises: In case of a match failure, determining the intent information of the query information through the large language model; Determine an intended question based on the intention information, and perform a question-and-answer interaction according to the intended question to obtain input answer information for the question-and-answer interaction; Inputting the query information and the input answer information into the large language model so that the large language model matches a question-answer decision tree for the query information; When the number of interactive questions and answers performed by the large language model meets a preset number and no question-and-answer decision tree is matched, reply information for the query information is generated by the large language model.

8. A question-answering device, It is characterized in that include: A decision tree matching module is configured to match a question-answer decision tree for the query information in response to an input of the query information through a large language model; The answer module is configured to generate reply information for the inquiry information based on the matched question-answer decision tree when the match is successful.

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

10. An electronic device, It is characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the question-answering method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Large language model medical question-answering system based on medical record knowledge graph

    CN117056493A

  • Multi-round inquiry method based on diagnosis and treatment guidance tree and diagnosis and treatment inference engine

    CN117542509A

  • Medical question answering system based on large language model

    CN117851558A

  • Intelligent interaction method, electronic device, and storage medium

    WO2019153522A1

Cited By

  • Intelligent consultation interaction method and apparatus, device, and storage medium

    WO2026157077A1