Question answering method and device based on thinking chain, equipment and storage medium
Through the large language model, the high labor cost and accuracy problems in the calculation of insurance expenses are solved, and the cost reduction and accuracy are achieved.
Patent Information
- Application Number
- CN202411074752.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-12-03
AI Technical Summary
In the premium calculation question and answer service of insurance products, question-and-answer based on thinking chains requires manual manual writing of complete inference processes, resulting in high labor costs and inference accuracy problems.
Through a large language model, the thinking chain reasoning is performed on the preset question samples, the first answer and reasoning explanation are generated, the thinking chain solution examples are automatically generated, and the premium calculation questions are obtained through the preset premium consultation channel, and the thinking chain reasoning is performed based on the automatically generated examples. , reduce labor costs and noise impact.
It realizes reducing labor costs in insurance cost calculation questions, improving the accuracy of thinking chain reasoning, reducing the variance of answer results, and avoiding the noise introduced by manual annotation.
Smart Images

Figure CN119066166A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a question-answering method, device, equipment and storage medium based on thought chain. Background Art
[0002] Thinking chain is a logical reasoning method based on large language models. At present, applying thinking chain to solve problems that require logical reasoning has become a hot research topic in question-answering using large language models.
[0003] In related technologies, when answering questions based on thought chains and context learning, it is necessary to create some examples with complete reasoning processes in advance for thought chains to learn models. However, in the premium calculation question-and-answer service corresponding to insurance products, when context learning is performed based on thought chains to calculate the insurance premiums that users need to pay, it is often necessary to manually write examples with complete reasoning processes in advance, which results in high labor costs for answering users' questions about insurance premium calculation based on thought chains.
[0004] Therefore, how to reduce the labor costs required when answering questions about insurance premium calculation based on the thought chain has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The main purpose of the embodiments of the present application is to propose a question-answering method, device, equipment and storage medium based on thought chaining, aiming to reduce the labor cost required for applying thought chaining for context learning to answer questions about insurance cost calculation.
[0006] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a question-answering method based on a thought chain, the method comprising:
[0007] Performing chain reasoning on preset question samples through a large language model to obtain a first answer and reasoning explanation for the question samples; wherein the question samples include questions about premium calculation;
[0008] Generate a thinking chain solution example according to the question sample, the first answer and the reasoning explanation;
[0009] A premium calculation question is obtained through a preset premium consultation channel, and a thought chain reasoning is performed on the premium calculation question according to the thought chain answer example to obtain a second answer to the premium calculation question.
[0010] In some embodiments, the premium consultation channel includes: an insurance intelligent customer service channel and a manual service channel; the method further includes:
[0011] Obtaining a first question about premium calculation through the insurance intelligent customer service channel, and obtaining a second question about premium calculation through the manual service channel;
[0012] Extracting target questions from the collected first questions and second questions according to a preset ratio, and constructing a question sample data set according to the target questions;
[0013] The question sample data set is randomly sampled to obtain the question sample.
[0014] In some embodiments, the method of performing chain reasoning on a preset question sample through a large language model to obtain a first answer and reasoning explanation for the question sample includes:
[0015] Inputting the question sample and the pre-created thought chain prompt into the large language model;
[0016] The large language model is used to perform chain of thought reasoning on the question sample according to the chain of thought prompts to obtain a first answer and a reasoning explanation for the question sample.
[0017] In some embodiments, the number of the question samples is multiple;
[0018] The step of generating a thinking chain solution example according to the question sample, the first answer and the reasoning explanation includes:
[0019] The plurality of question samples, the first answers to the plurality of question samples, and the reasoning explanations to the plurality of question samples are spliced together to generate a thinking chain solution example.
[0020] In some embodiments, performing a chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question includes:
[0021] Inputting the premium calculation question and the thought chain solution example into the large language model;
[0022] The large language model is used to perform chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question.
[0023] In some embodiments, the number of the question samples is multiple;
[0024] The step of generating a thinking chain solution example according to the question sample, the first answer and the reasoning explanation includes:
[0025] The question sample, the first answer and the reasoning explanation are grouped and spliced to generate multiple groups of thinking chain solution examples, each group of thinking chain solution examples includes: a target question sample in the question sample, the first answer to the target question sample and the reasoning explanation of the target question sample, and the number of the multiple groups of thinking chain solution examples is the same as the number of the question samples.
[0026] In some embodiments, performing a chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question includes:
[0027] Combining the premium calculation question with a set of thinking chain solution examples in the multiple sets of thinking chain solution examples to obtain multiple sets of model inputs;
[0028] Inputting the multiple groups of model inputs into the large language model;
[0029] Using the large language model, the thought chain reasoning is performed on the premium calculation question according to the thought chain answer examples in each group of model inputs, so as to obtain multiple alternative answers to the premium calculation question;
[0030] Voting analysis is performed on the multiple alternative answers to obtain a second answer to the premium calculation question.
[0031] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a question-answering device based on a thought chain, the device comprising:
[0032] An explanation generation module is used to perform thought chain reasoning on a preset question sample through a large language model to obtain a first answer and reasoning explanation of the question sample; wherein the question sample includes a question about premium calculation;
[0033] An example generation module, used for generating a thinking chain solution example according to the question sample, the first answer and the reasoning explanation;
[0034] The question-answering module is used to obtain premium calculation questions through a preset premium consultation channel, perform thought chain reasoning on the premium calculation questions according to the thought chain answering examples, and obtain a second answer to the premium calculation questions.
[0035] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0036] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0037] To achieve the above-mentioned purpose, the fifth aspect of the embodiments of the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0038] The question-answering method, device, equipment, storage medium and computer program product based on thought chain proposed in the present application first perform thought chain reasoning on question samples including questions about premium calculation through a large language model, so as to obtain a first answer and reasoning explanation of the question sample, and then automatically generate a thought chain answer example based on the question sample, the first answer and the reasoning explanation, and represent the complete reasoning process of the thought chain answer to the question about insurance cost calculation based on the thought chain answer example, and finally, obtain the premium calculation question through the preset premium consultation channel, and after obtaining the premium calculation question, perform thought chain reasoning on the premium calculation question according to the automatically generated thought chain answer example, so as to obtain the second answer to the premium calculation question.
[0039] In this way, compared with the related art method of manually writing explanations to perform thought chain reasoning, the present application automatically generates reasoning explanations about this type of questions based on the language reasoning ability of the large language model, and then automatically generates examples with complete reasoning processes for the thought chain to perform contextual learning. This eliminates the need to rely on manual annotations to generate examples for the thought chain to perform model learning, thereby reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of the steps of the question-answering method based on the thought chain provided in some embodiments of the present application;
[0041] Figure 2 A schematic diagram of the steps of the question-answering method based on the thought chain provided in the embodiment of the present application in other embodiments;
[0042] Figure 3 for Figure 1 A detailed flow chart of step S101;
[0043] Figure 4 for Figure 1 A detailed flow chart of step S103;
[0044] Figure 5 for Figure 1 Another detailed flow chart of step S103;
[0045] Figure 6 A schematic diagram of an algorithm logic of a question-answering method based on a thought chain provided in an embodiment of the present application in a preferred implementation;
[0046] Figure 7 A schematic diagram of the structure of a question-answering device based on a thought chain provided in an embodiment of the present application;
[0047] Figure 8 It is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0051] First, some nouns involved in this application are analyzed:
[0052] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0053] Large Language Models (LLMs): A deep learning model designed to understand, analyze, and generate human-like text. Large language models use large amounts of data to learn patterns, structures, and contexts in language, so that they can perform tasks such as text classification, sentiment analysis, summarization, and translation. Due to their ability to simulate human natural language capabilities, large language models have made major breakthroughs in the field of natural language processing, such as the natural language processing tool (Chat Generative Pre-trained Transformer, ChatGPT). Large language models have promoted progress in applications such as machine translation, text summarization, and dialogue systems, and have provided support for intelligent, personalized, and efficient services in various practical scenarios. With the continuous development of language processing application fields, large language models can play a role in different scenarios through a variety of natural language generation, understanding, and reasoning methods. As the capabilities of large language models continue to improve, the number of parameters that large language models need to process has become increasingly large. In order to reduce the number of parameters processed by the model, in-context learning (ICL) that does not require gradient reverse learning has gradually gained attention and has gradually become a new paradigm for natural language processing.
[0054] Chain-of-Thought (CoT): It is a very new concept in the field of artificial intelligence. In recent studies on large language models, the chain of thought was proposed to solve problems that require logical reasoning, such as mathematical reasoning. The chain of thought can reason and analyze problems by relying on the powerful language ability of the large language model, and finally output the answer to the problem. Therefore, the chain of thought can be regarded as a logical reasoning method based on the large language model, and is specifically used to solve problems that require reasoning and analysis. The basic idea of the chain of thought is to decompose the reasoning process into multiple steps, each of which is completed by a large language model, so as to achieve hierarchical reasoning of the problem. At present, most of the question-answering methods based on the chain of thought are simple zero-shot or few-shot with a few-shot using contextual learning methods. Among them, zero-shot cannot fully exert the language reasoning ability of the large language model because there are no examples for the chain of thought to learn the model, and few-shot requires a lot of manual annotations, which is very labor-intensive, time-consuming and other labor costs.
[0055] Natural language processing (NLP) is a technology that uses computers to process, understand and use human languages (such as Chinese, English, etc.). Natural language processing is a branch of artificial intelligence, an interdisciplinary subject between computer science and linguistics, and is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistics research related to language computing.
[0056] Information Extraction: It is a text processing technology that extracts specified types of entity, relationship, event and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data are all text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.
[0057] Next, the overall concept of this application is explained:
[0058] When answering questions based on thought chain and context learning, it is necessary to create some examples with complete reasoning processes in advance for thought chain model learning, which requires a lot of manual costs. Moreover, due to the uncertainty of manual writing, a large amount of inappropriate noise will inevitably be generated, which will affect the accuracy of question reasoning of large language models and increase the variance of the prediction results output by the model.
[0059] In the related art, in the premium calculation question-and-answer service corresponding to the insurance product, it is often necessary for humans to manually write examples with complete reasoning processes in advance, which results in high labor costs to answer users' questions about insurance cost calculation based on the thought chain.
[0060] Therefore, how to answer questions about insurance cost calculation based on thought chains without manually annotating examples with complete reasoning processes, thereby reducing the labor costs required, has become a technical problem that needs to be solved urgently.
[0061] In response to this problem, the embodiments of the present application provide a question-answering method, device, equipment, and storage medium based on thought chaining, which aims to reduce the labor cost required for applying thought chaining for contextual learning to answer questions about insurance cost calculation. The embodiments of the present application first perform thought chaining reasoning on question samples including questions about premium calculation through a large language model, thereby obtaining a first answer and reasoning explanation for the question sample, and then automatically generate a thought chaining answer example based on the question sample, the first answer, and the reasoning explanation, and represent the complete reasoning process of the thought chaining answer to the question about insurance cost calculation based on the thought chaining answer example, and finally, obtain the premium calculation question through a preset premium consultation channel, and after obtaining the premium calculation question, perform thought chaining reasoning on the premium calculation question according to the automatically generated thought chaining answer example, thereby obtaining the second answer to the premium calculation question.
[0062] In this way, the embodiment of the present application first automatically generates reasoning explanations about this type of question based on the language reasoning ability of the large language model, and then automatically generates examples with complete reasoning processes for context learning of the thinking chain, so that there is no need to rely on manual annotation to generate examples for the thinking chain to learn the model, thereby reducing labor costs. In addition, since examples can be automatically generated, the noise introduced by generating examples based on manual annotations can also be avoided, thereby improving the accuracy of the problem reasoning of the thinking chain based on the large language model and reducing the variance of the solution results output by the thinking chain.
[0063] Based on the overall concept of the present application described above, various specific embodiments of the question-answering method, device, equipment and storage medium based on the thought chain provided in the embodiments of the present application are proposed. First, the question-answering method based on the thought chain provided in the embodiments of the present application is described in detail.
[0064] It should be noted that the embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0065] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0066] In addition, in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0067] The question-answering method based on the chain of thinking provided in the embodiment of the present application relates to the field of artificial intelligence technology. The question-answering method based on the chain of thinking provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms and other basic cloud computing services. Cloud servers; software can be applications that implement question-answering methods based on chain of thinking, etc., but are not limited to the above forms.
[0068] For ease of understanding and explanation, the following text takes the question-answering method based on the thinking chain provided by the terminal device in the embodiment of the present application as an example to explain the present application in detail. The implementation of the question-answering method based on the thinking chain provided by the embodiment of the present application in any of the above-mentioned forms of subject application can refer to the process of the question-answering method based on the thinking chain applied by the terminal device described later.
[0069] Please refer to Figure 1 , Figure 1 The following is a flowchart of the steps of the question-answering method based on the thought chain provided in some embodiments of the present application. It should be understood that although Figure 1 The execution order of some method steps is shown in the figure, but based on different design requirements of actual applications, the question-answering method based on the thinking chain provided in the embodiment of the present application can certainly adopt an execution order different from the method steps shown in the figure. That is, Figure 1 The order of the steps in the method shown does not constitute a limitation on the execution logic order of the question-answering method based on the thinking chain provided in the embodiment of the present application. Figure 1 Reasonable changes in the order of the steps of the method shown should be included in the protection scope of the question-answering method based on the thinking chain provided in the embodiments of the present application.
[0070] like Figure 1 As shown, in some embodiments, the question-answering method based on thought chain provided in the embodiments of the present application may include but is not limited to steps S101 to S103.
[0071] Step S101, performing chain reasoning on preset question samples through a large language model to obtain a first answer and reasoning explanation for the question samples; wherein the question samples include questions about premium calculation.
[0072] When answering questions about insurance costs based on contextual learning of thought chains, the terminal device first obtains pre-built question samples, which include questions about insurance cost calculation. Then, the terminal device uses the large language model to perform thought chain reasoning on the obtained question samples, thereby obtaining the first answer and reasoning explanation of the question sample.
[0073] It should be noted that the large language model used by the terminal device to perform thought chain reasoning on the question sample includes but is not limited to large language model products such as LlaMa, Qwen, and AhatGLM. It should be understood that based on different design requirements of actual applications, in different feasible implementations, the specific types of large language model products that the terminal device can use may of course be different. The question-answering method based on thought chain provided in the embodiment of the present application does not limit the specific type of large language model.
[0074] In step S101 of some embodiments, when performing context learning based on thought chaining to answer questions about insurance premium calculation, the terminal device may first use the large language model to perform thought chaining reasoning on the question samples including questions about insurance premium calculation, thereby obtaining the first answer and reasoning explanation of the question samples. In other embodiments, the terminal device may also perform thought chaining reasoning on the question samples using the large language model in an idle state before answering questions about insurance premium calculation based on thought chaining, thereby obtaining the first answer and reasoning explanation of the question samples.
[0075] It should be understood that, based on different design needs of actual applications, the terminal device can of course also choose to use the large language model to perform thought chain reasoning on the question sample at other times before formally answering the question about insurance premium calculation based on the thought chain to obtain the first answer and reasoning explanation of the question sample, but is not limited to this.
[0076] Step S102, generating a thinking chain solution example according to the question sample, the first answer and the reasoning explanation.
[0077] After the terminal device uses the large language model to perform chain reasoning on the question sample to obtain the first answer and reasoning explanation of the question sample, it further combines the question sample, the first answer and the reasoning explanation to automatically generate a chain solution example. The chain solution example automatically generated by the terminal device can represent the complete reasoning process of the chain solution to the question about insurance cost calculation.
[0078] Step S103, obtaining a premium calculation question through a preset premium consultation channel, performing a thought chain reasoning on the premium calculation question according to the thought chain answer example, and obtaining a second answer to the premium calculation question.
[0079] When the terminal device formally performs contextual learning based on the thought chain to answer questions about insurance premium calculation, the terminal device first obtains the premium calculation question through the preset premium consultation channel, and then, the terminal device performs contextual learning on the previously automatically generated thought chain answer example through the thought chain, so as to perform thought chain reasoning on the currently obtained premium calculation question, thereby obtaining the second answer to the premium calculation question.
[0080] In some embodiments, after obtaining a premium calculation question, the terminal device can input the previously automatically generated thought chain solution example and the premium calculation question into the large language model, thereby using the large language model again to use the thought chain solution example as a prompt for context learning, and then perform thought chain reasoning on the premium calculation question to obtain a second answer to the premium calculation question.
[0081] In the steps S101 to S103 shown in the embodiment of the present application, the terminal device first automatically generates a reasoning explanation about this type of question based on the language reasoning ability of the large language model, and then automatically generates an example with a complete reasoning process for the thinking chain to perform context learning, so that there is no need to rely on manual annotation to generate examples for the thinking chain to perform model learning, which reduces labor costs. In addition, since the terminal device can automatically generate examples, it can also avoid the noise introduced by generating examples based on manual annotations, thereby improving the accuracy of the problem reasoning of the thinking chain based on the large language model and reducing the variance of the solution results output by the thinking chain.
[0082] Before the terminal device formally performs context learning based on the thought chain to answer questions about premium calculation, it obtains questions about premium calculation through the above-mentioned preset premium consultation channels, thereby constructing a question sample.
[0083] It should be noted that the preset premium consultation channels include, but are not limited to: insurance intelligent customer service channels and manual service channels. Among them, the insurance intelligent customer service channel can be an online customer service channel provided to users by terminal devices through applications associated with insurance products. The manual service channel can be a telephone hotline service channel provided to users by the service provider of the insurance product. It should be understood that based on the different design needs of actual applications, in different feasible implementations, the premium consultation channel can of course also include other methods or channels not listed here. The question-and-answer method based on the thinking chain provided in the embodiment of the present application does not limit the specific types of premium consultation channels.
[0084] Please refer to Figure 2 , Figure 2 A flowchart diagram of the steps of the question-answering method based on the thought chain provided in the embodiment of the present application in other embodiments.
[0085] like Figure 2 As shown, in some embodiments, based on this, the question-answering method based on the thought chain provided in the embodiments of the present application may also include but not limited to steps S201 to S203.
[0086] Step S201, obtaining a first question about premium calculation through the insurance intelligent customer service channel, and obtaining a second question about premium calculation through the manual service channel.
[0087] The terminal device provides an online customer service channel to the user through an application associated with the insurance product, and connects to the user question database corresponding to the manual service channel. In this way, when the terminal device receives a question sent by the user through the online customer service channel, it can obtain the first question about premium calculation by extracting information from the question sent by the user. In addition, when the terminal device detects that a second question about premium calculation raised by the user is added to the user question database, the second question can be obtained from the user question database.
[0088] It should be noted that the questions sent by the user and received by the terminal device through the online customer service channel may be the text content sent by the user to the online customer service when using the online customer service channel. The terminal device analyzes the text sent by the user to extract the user's personal information and user question information, etc., to obtain the first question about the premium calculation. In addition, the user question database may record the user's voice data output when the user consults the telephone customer service about insurance cost when using the telephone hotline service channel. The terminal device converts the user's voice data into text and further extracts information from the converted text to obtain the second question about the premium calculation.
[0089] Step S202, extracting target questions from the collected first questions and second questions according to a preset ratio, and constructing a question sample data set according to the target questions;
[0090] After obtaining the first question and the second question about premium calculation, the terminal device further extracts a certain number of target questions from the first question and the second question according to a preset ratio (for example, the number of first questions is 1:1 or 2:3, etc.), and then classifies the extracted target questions according to the classification labels, thereby constructing a question sample data set containing questions about premium calculation.
[0091] It should be noted that the terminal device can flexibly adjust the preset ratio according to the completeness of the information of the first question and the second question. For example, if the terminal device performs natural language processing on the first question and the second question and finds that the first question contains more information about premium calculation than the second question, the terminal device can adjust the preset ratio to 3:2 for the number of first questions to the number of second questions, so that when extracting target questions, a relatively larger number of target questions can be extracted from the first question according to the adjusted preset ratio.
[0092] Step S203: performing random sampling processing on the question sample data set to obtain the question samples.
[0093] After constructing the question sample data set, in order to improve the coverage of the model, the terminal device can perform random sampling on the constructed question sample data set, thereby randomly extracting one or more question samples about premium calculation from the question sample data set.
[0094] After that, the terminal device can use the large language model to perform thought chain reasoning on the extracted question samples, so as to obtain the first answer and reasoning explanation of the question sample.
[0095] In this embodiment, questions about premium calculation are obtained from premium consultation channels such as insurance intelligent customer service channels and manual service channels through terminal devices, and a question sample data set is constructed based on the obtained questions. Then, question samples are randomly extracted from the question sample data set to perform thought chain reasoning on the question samples using a large language model, thereby obtaining a first answer and reasoning explanation for the question samples. In this way, the terminal device can automatically generate a thought chain answer example with a complete reasoning process for answering questions about premium calculation based on a question sample and the first answer and reasoning explanation of the question sample.
[0096] In this way, the terminal device automatically generates a thought chain solution example by using a large language model, especially automatically generates the reasoning explanation of the example. Compared with the method of manually writing the reasoning explanation in the related technology, this can not only greatly reduce the labor cost, but also avoid the inaccuracy problem of manually writing the reasoning explanation, effectively reducing the data processing cost.
[0097] On the other hand, the terminal device obtains questions from the premium consultation channel, and does not require the questions to contain data with clear labels. This makes it easier to collect questions, and does not require a lot of complex preprocessing (such as data cleaning, structuring, and classification, etc.) for the collected questions. Instead, it takes advantage of the fault tolerance of the large language model to the noise structure of the data, and can directly build a question sample data set based on the extracted questions. In this way, the data processing cost can be further reduced. In addition, by building question sample data based on easier to obtain questions, there can also be more samples from different distributions in the question sample data set, making contextual learning based on the thinking chain to answer premium calculation questions more robust and robust.
[0098] In some embodiments, after extracting the target question, the terminal device can also manually annotate the extracted target question (for example, add a classification label to the question, modify the insurance product type corresponding to the premium consultation, etc.), and then the terminal device constructs a sample question data set based on the manually annotated target question. Alternatively, in other embodiments, the terminal device can directly use the manually written question about premium calculation as the target question, and then construct a sample question data set based on the target question alone, or construct a sample question data set based on the target question and the target question extracted from the first question and the second question.
[0099] When the terminal device uses the large language model to perform thought chain reasoning on the question sample, it can input the pre-created thought chain prompt into the large language model, so that the large language model can perform thought chain reasoning based on the thought chain prompt.
[0100] Please refer to Figure 3 , Figure 3 for Figure 1 Detailed flowchart of step S101 in FIG.
[0101] like Figure 3 As shown, in some embodiments, step S101 may include but is not limited to steps S301 to S302:
[0102] Step S301: input the question sample and the pre-created thought chain prompt into the large language model.
[0103] It should be noted that the pre-created thought chain prompt can be: an instruction of "analyze and answer questions step by step" pre-generated by the terminal device. Alternatively, the pre-created thought chain prompt can also be: an instruction of "analyze and answer questions step by step" pre-written by humans. The words "analyze and answer questions step by step" in the instruction can be considered as a thought chain prompt word, which is used to guide the large language model to perform model calculation to output the answer.
[0104] After the terminal device randomly extracts one or more question samples from the pre-constructed question sample data set, for each extracted question sample, the terminal device inputs the question sample together with the instruction of "analyzing and answering the question step by step" into the large language model.
[0105] Step S302: Perform thought chain reasoning on the question sample according to the thought chain prompt through the large language model to obtain a first answer and reasoning explanation for the question sample.
[0106] After the terminal device inputs the question sample together with the instruction of "analyze and answer the question step by step" into the large language model, the large language model can perform a step-by-step chain of thought reasoning analysis on the question sample according to the instruction of "analyze and answer the question step by step", and after the analysis is completed, output the first answer and reasoning explanation of the question sample.
[0107] For example, it is assumed that the terminal device randomly extracts K question samples from the above constructed question sample data set: Then, the terminal device responds to each question sample q i , the question sample q i Combined with the pre-generated instruction I: "Analyze and answer questions step by step" to form [q i ; I]. Then, the terminal device will [q i ; I] is input into the large language model LLM, so that the large language model LLM follows instruction I: "Analyze and answer questions step by step" to analyze the question sample q i Perform step-by-step chain reasoning analysis and output the question sample q after the analysis is completed i The first answer and reasoning explanation of K question samples are:
[0108] It should be noted that when the terminal device inputs the question sample and the pre-created thought chain prompt into the large language model, it also inputs the user's personal information content associated with the question sample into the model. For example, for a specific question sample and a label that needs to be classified, the terminal device can organize it according to "question sample" + "user personal information content" + "recall relevant information based on user questions" + "analyze and answer questions step by step", and input the organized data content into the large language model.
[0109] In this embodiment, question samples and thought chain prompts are input into the large language model through the terminal device, so that the large language model is used to automatically generate reasoning explanations. The terminal device can then generate examples with complete reasoning processes based on the reasoning explanations. This solves the problems of high costs and inaccurate model calculation results faced by manual explanation writing, and also reduces the cost of data preprocessing.
[0110] The number of question samples randomly extracted by the terminal device from the question sample data set is usually multiple. In this case, after obtaining the first answer and reasoning explanation for each question sample, the terminal device can choose to integrate multiple question samples, multiple first answers and reasoning explanations together to generate a thinking chain solution example, and then perform thinking chain reasoning on the premium calculation question based on the thinking chain solution example.
[0111] In some embodiments, when there are multiple question samples, the above step S102 generates a thinking chain solution example according to the question sample, the first answer and the reasoning explanation, which may include but is not limited to:
[0112] The plurality of question samples, the first answers to the plurality of question samples, and the reasoning explanations to the plurality of question samples are spliced together to generate a thinking chain solution example.
[0113] After the terminal device uses the large language model to perform chain reasoning on multiple question samples respectively, thereby obtaining the first answer and reasoning explanation for each question sample, the terminal device can generate a chain thought solution example by splicing the multiple question samples, the first answers to the multiple question samples, and the reasoning explanations of the multiple question samples in the form of "the first question sample, the first answer to the first question sample, and the reasoning explanation of the first question sample, the second question sample, the first answer to the second question sample, and the reasoning explanation of the second question sample,..., the Nth question sample, the first answer to the Nth question sample, and the reasoning explanation of the Nth question sample".
[0114] In a case where the terminal device generates a thought chain solution example by splicing multiple question samples, the first answers to the multiple question samples and the reasoning explanations to the multiple question samples, after the terminal device obtains the premium calculation question through the above-mentioned premium consultation channel, the terminal device can input the premium calculation question and the thought chain solution example into the large language model, and after using the large language model to learn the thought chain solution example, perform thought chain reasoning on the premium calculation question, thereby directly outputting the second answer to the premium calculation question.
[0115] Please refer to Figure 4 , Figure 4 for Figure 1 A detailed flow chart of step S103 in FIG.
[0116] like Figure 4 As shown, in some embodiments, in step S103, "performing a chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question" may include but is not limited to steps S401 to S402:
[0117] Step S401: input the premium calculation question and the thought chain solution example into the large language model.
[0118] After the terminal device generates a thought chain solution example by splicing multiple question samples, the first answers to each of the multiple question samples, and the reasoning explanations to each of the multiple question samples, and receives a premium calculation question sent by a user on how to calculate the insurance premium through the premium consultation channel, the terminal device organizes the premium calculation question and the thought chain solution example in the form of "premium calculation question + thought chain solution example", and then inputs the premium calculation question and the thought chain solution example into the large language model together.
[0119] Step S402: Performing chain of thought reasoning on the premium calculation question according to the chain of thought answer example through the large language model to obtain a second answer to the premium calculation question.
[0120] After the terminal device inputs the premium calculation question and the thought chain solution example into the large language model, the large language model can be used to perform contextual learning on the thought chain solution example, thereby performing step-by-step thought chain reasoning on the premium calculation question according to the complete process of reasoning and analysis in the thought chain solution example, and outputting the second answer to the premium calculation question after the reasoning and analysis is completed.
[0121] In this embodiment, multiple question samples, the first answers to the multiple question samples, and the reasoning explanations to the multiple question samples are spliced together by the terminal device to generate a thought chain solution example, and then the premium calculation question and the thought chain solution example are input into the large language model together, so that the premium calculation question is subjected to thought chain reasoning according to the thought chain solution example through the large language model to directly obtain the second answer to the premium calculation question. It is realized that the reasoning explanation is automatically generated based on zero-shot, and then the thought chain reasoning is performed on the premium calculation question based on a small number of prompts few-shot, so as to answer questions by maximizing the language reasoning ability of the large language model. In this way, compared with the method of performing thought chain reasoning by manually writing explanations in the related art, it is not necessary to rely on manual annotations to generate examples for the thought chain to learn the model, which reduces labor costs, and can also avoid the noise introduced by generating examples based on manual annotations, thereby improving the accuracy of the thought chain in reasoning problems based on the large language model.
[0122] When the terminal device randomly extracts multiple question samples from the question sample data set, after obtaining the first answer and reasoning explanation for each question sample, the terminal device can also choose to integrate each question sample and the first answer and reasoning explanation of the question sample to generate a thinking chain solution example, thereby obtaining multiple thinking chain solution examples, and then the terminal device performs thinking chain reasoning on the premium calculation question based on the multiple thinking chain solution examples.
[0123] Based on this, in some embodiments, when there are multiple question samples, the above step S102 generates a thinking chain solution example according to the question sample, the first answer and the reasoning explanation, and may also include but is not limited to:
[0124] The question sample, the first answer and the reasoning explanation are grouped and spliced to generate multiple groups of thinking chain solution examples, each group of thinking chain solution examples includes: a target question sample in the question sample, the first answer to the target question sample and the reasoning explanation of the target question sample, and the number of the multiple groups of thinking chain solution examples is the same as the number of the question samples.
[0125] After the terminal device uses the large language model to perform chain of thought reasoning on multiple question samples respectively, thereby obtaining the first answer and reasoning explanation for each question sample, the terminal device can group and splice the multiple question samples, the first answers to the multiple question samples, and the reasoning explanations of the multiple question samples in the form of "target question samples, the first answers to the target question samples, and the reasoning explanations of the target question samples", thereby generating a corresponding set of chain of thought solution examples for each target question sample.
[0126] In the case where the terminal device generates multiple groups of thought chain solution examples by grouping and splicing multiple question samples, the first answers to the multiple question samples and the reasoning explanations to the multiple question samples, after the terminal device obtains the premium calculation question through the above-mentioned premium consultation channel, the terminal device can input the premium calculation question and each group of thought chain solution examples into the large language model respectively, and after using the large language model to learn the respective thought chain solution examples, perform thought chain reasoning on the premium calculation question respectively, thereby outputting multiple alternative answers to the premium calculation question, and then, the terminal device analyzes the multiple alternative answers to obtain a second answer to the premium calculation question.
[0127] Please refer to Figure 5 , Figure 5 for Figure 1 Another detailed flowchart of step S103 is shown in FIG.
[0128] like Figure 5 As shown, in some embodiments, in step S103, "performing a chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question" may also include but is not limited to steps S501 to S502:
[0129] Step S501, combining the premium calculation question with a group of thinking chain solution examples in the multiple groups of thinking chain solution examples to obtain multiple groups of model inputs.
[0130] Step S502: input the multiple groups of model inputs into the large language model.
[0131] After receiving the premium calculation question sent by the user through the premium consultation channel about how to calculate the insurance premium, the terminal device combines the premium calculation question with each of the multiple sets of thought chain solution examples automatically generated in advance, thereby obtaining multiple sets of model inputs. Then, the terminal device inputs each set of model inputs into the large language model.
[0132] Step S503, using the large language model to perform chain reasoning on the premium calculation question according to the chain answer examples in each group of model inputs, to obtain multiple alternative answers to the premium calculation question.
[0133] After multiple sets of model inputs are input into the large language model, the terminal device can use the large language model to perform context learning on the question samples, first answers, and reasoning explanations in each set of model inputs, and then perform step-by-step chain reasoning on the premium calculation question in this set of model inputs, and then output an alternative answer to the premium calculation question. In this way, the terminal device performs this operation on each set of model inputs through the large language model, and can obtain multiple alternative answers to the premium calculation question.
[0134] Step S504: Perform voting analysis on the multiple candidate answers to obtain a second answer to the premium calculation question.
[0135] After the terminal device performs the same chain of reasoning for each set of model inputs to obtain multiple alternative answers to the premium calculation question, it further performs voting analysis on the multiple alternative answers, that is, for alternative answer 1, each time another alternative answer that is the same as alternative answer 1 is traversed, the two alternative answers are regarded as one alternative answer 1, and one more vote is cast for alternative answer 1, thereby obtaining the target alternative answer with the highest number of votes among the multiple alternative answers. Finally, the terminal device uses the target alternative answer as the second answer to the premium calculation question.
[0136] For example, it is assumed that the terminal device obtains each question sample q i The first answer is a i After the reasoning and explanation, the terminal device sends a question sample q i 、The sample question q i The first answer is a i Combined with reasoning explanations to form a set of thought chain solution examples [q i , a i Then, the terminal device receives the premium calculation question q sent by the user on how to calculate the insurance premium through the insurance intelligent customer service channel. test After that, the terminal device will ask q test Example of solving each thinking chain problem [q i , a i ] are concatenated together to generate multiple sets of model inputs [q i , a i ;q test Then, the terminal device inputs multiple sets of models into [q i , a i ;q test ] are input into the large language model LLM respectively, so that each group of model input [q i , a i ;q test ] in the premium calculation question qtest Perform a chain of reasoning to obtain the premium calculation question q test Multiple alternative answers Afterwards, considering that the large language model LLM uses multiple thought chain solution examples as prompts to ask questions about premium calculation q test In the case of reasoning analysis, if the answers obtained by the large language model LLM are the same, it can be said that they are common points from different sample distribution families. Therefore, it is more accurate to use the same answer as the final predicted output of the large language model. The terminal device can choose the answer from multiple alternative answers. In the process, the most common target alternative answer is selected by voting as the premium calculation question q test The final second answer a test ,Right now:
[0137]
[0138] In this embodiment, when a terminal device groups and splices multiple question samples, the first answers of each of the multiple question samples, and the reasoning explanations of each of the multiple question samples to generate multiple groups of thought chain solution examples, after the terminal device obtains the premium calculation question through the above-mentioned premium consultation channel, the premium calculation question and each group of thought chain solution examples can be input into the large language model respectively, so as to use the large language model to learn the respective thought chain solution examples, and then perform thought chain reasoning on the premium calculation question respectively, thereby outputting multiple alternative answers for the premium calculation question, and then the terminal device performs voting analysis on the multiple alternative answers, so as to use the target alternative answer with the highest number of votes as the final second answer to the premium calculation question. In this way, by using multiple thought chain solution examples to perform thought chain reasoning analysis on the premium calculation question respectively, and further voting on multiple alternative answers, it can not only improve the robustness of context learning based on thought chain to answer the premium calculation question, reduce the output variance of the model, but also avoid the uneven distribution of thought chain solution examples that may be caused by the limitation of the input length of the large language model, and thus avoid the prediction bias problem caused by the uneven distribution of thought chain solution examples.
[0139] Next, a preferred embodiment of the question-answering method based on the thought chain provided by the terminal device using the embodiment of the present application is proposed.
[0140] Please refer to Figure 6 , Figure 6 A schematic diagram of the algorithm logic of a question-answering method based on thought chain provided in an embodiment of the present application in a preferred implementation.
[0141] like Figure 6As shown, the terminal device randomly samples the constructed question sample data set, thereby randomly extracting K question samples from the question sample data set: Then, the terminal device responds to each question sample q i , the question sample q i Combined with the pre-generated instruction I: "Analyze and answer questions step by step" to form [q i ; I]. Then, the terminal device will [q i ; I] is input into the large language model LLM, so that the large language model LLM follows instruction I: "Analyze and answer questions step by step" to analyze the question sample q i Perform step-by-step chain reasoning analysis and output the question sample q after the analysis is completed i The first answer and reasoning explanation of K question samples are:
[0142] Afterwards, the terminal device sends a sample question q i 、The sample question q i The first answer is a i Combined with reasoning explanations to form a set of thought chain solution examples [q i , a i Then, the terminal device receives the premium calculation question q sent by the user on how to calculate the insurance premium through the insurance intelligent customer service channel. test After that, the terminal device will ask q test Example of solving each thinking chain problem [q i , a i ] are concatenated together to generate multiple sets of model inputs [q i , a i ;q test Then, the terminal device inputs multiple sets of models into [q i , a i ;q test ] are input into the large language model LLM respectively, so that each group of model input [q i , a i ;q test ] in the premium calculation question q test Perform a chain of reasoning to obtain the premium calculation question q test Multiple alternative answers Afterwards, considering that the large language model LLM uses multiple thought chain solution examples as prompts to ask questions about premium calculation q testIn the case of reasoning analysis, if the answers obtained by the large language model LLM are the same, it can be said that they are common points from different sample distribution families. Therefore, it is more accurate to use the same answer as the final predicted output of the large language model. The terminal device can choose the answer from multiple alternative answers. In the process, the most common target alternative answer is selected by voting as the premium calculation question q test The final second answer a test ,Right now:
[0143]
[0144] Also, see Figure 7 , Figure 7 A schematic diagram of the structure of a question-answering device based on thought chain provided in an embodiment of the present application.
[0145] like Figure 7 As shown, the embodiment of the present application also provides a question-answering device based on a thought chain, which can implement the above-mentioned question-answering method based on a thought chain. The device includes: an explanation generation module 701, an example generation module 702 and a question-answering module 703, wherein:
[0146] The explanation generation module 701 is used to perform a chain of thought reasoning on a preset question sample through a large language model to obtain a first answer and a reasoning explanation of the question sample; wherein the question sample includes a question about premium calculation;
[0147] An example generation module 702 is used to generate a thinking chain solution example according to the question sample, the first answer and the reasoning explanation;
[0148] The question answering module 703 is used to obtain premium calculation questions through a preset premium consultation channel, perform thought chain reasoning on the premium calculation questions according to the thought chain answering example, and obtain a second answer to the premium calculation questions.
[0149] In some embodiments, the premium consultation channel includes: an insurance intelligent customer service channel and a manual service channel. The question-answering device based on the thought chain provided in the embodiment of the present application also includes:
[0150] A sample processing module is used to obtain a first question about premium calculation through the insurance intelligent customer service channel, and to obtain a second question about premium calculation through the manual service channel; to extract a target question from the first question and the second question collected according to a preset ratio, and to construct a question sample data set based on the target question; and to perform random sampling on the question sample data set to obtain the question sample.
[0151] In some embodiments, the explanation generation module 701 is also used to input the question sample and the pre-created thought chain prompt into the large language model; and, through the large language model, perform thought chain reasoning on the question sample according to the thought chain prompt to obtain the first answer and reasoning explanation of the question sample.
[0152] In some embodiments, the number of the question samples is multiple. The example generation module 702 is further used to splice the multiple question samples, the first answers of the multiple question samples and the reasoning explanations of the multiple question samples to generate a thinking chain solution example.
[0153] In some embodiments, the question-answering module 703 is further used to input the premium calculation question and the thought chain answer example into the large language model; and, through the large language model, perform thought chain reasoning on the premium calculation question according to the thought chain answer example to obtain a second answer to the premium calculation question.
[0154] In some embodiments, the example generation module 702 is also used to group and splice the question samples, the first answers and the reasoning explanations to generate multiple groups of thinking chain solution examples, each group of thinking chain solution examples including: a target question sample in the question samples, the first answer to the target question sample and the reasoning explanation of the target question sample, and the number of the multiple groups of thinking chain solution examples is the same as the number of the question samples.
[0155] In some embodiments, the question-answering module 703 is further used to combine the premium calculation question with a group of thought chain solution examples in the multiple groups of thought chain solution examples to obtain multiple groups of model inputs; input the multiple groups of model inputs into the large language model; use the large language model to perform thought chain reasoning on the premium calculation question according to the thought chain solution examples in each group of model inputs to obtain multiple alternative answers to the premium calculation question; and perform voting analysis on the multiple alternative answers to obtain a second answer to the premium calculation question.
[0156] The specific implementation of the question-answering device based on thought chain provided in the embodiment of the present application is basically the same as the specific implementation of the question-answering method based on thought chain mentioned above, and will not be repeated here.
[0157] In addition, the embodiment of the present application further provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned question-answering method based on thought chain when executing the computer program. The computer device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0158] See also Figure 8, Figure 8 The hardware structure of a computer device according to another embodiment is shown, and the computer device includes:
[0159] The processor 801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0160] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the question-answering method based on the thinking chain of the embodiment of this application;
[0161] Input / output interface 803, used to implement information input and output;
[0162] The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0163] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);
[0164] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0165] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned question-answering method based on the thought chain.
[0166] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0167] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned question-answering method based on thought chain when executed by a processor.
[0168] The question-answering method based on thought chain, the question-answering device based on thought chain, the computer device, the computer-readable storage medium and the computer program product provided in the embodiments of the present application first perform thought chain reasoning on the question samples including the questions about the premium calculation through the large language model, so as to obtain the first answer and the reasoning explanation of the question samples, and then automatically generate the thought chain answer example based on the question samples, the first answer and the reasoning explanation, and represent the complete reasoning process of the thought chain answer to the question about the insurance cost calculation based on the thought chain answer example, and finally, obtain the premium calculation question through the preset premium consultation channel, and after obtaining the premium calculation question, perform thought chain reasoning on the premium calculation question according to the automatically generated thought chain answer example, so as to obtain the second answer to the premium calculation question.
[0169] In this way, by first automatically generating reasoning explanations about this type of question based on the language reasoning ability of the large language model, and then automatically generating examples with complete reasoning processes for contextual learning of the thinking chain, it is no longer necessary to rely on manual annotations to generate examples for the thinking chain to learn the model, thus reducing labor costs. In addition, since examples can be automatically generated, the noise introduced by generating examples based on manual annotations can also be avoided, thereby improving the accuracy of the problem reasoning of the thinking chain based on the large language model and reducing the variance of the solution results output by the thinking chain.
[0170] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0171] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0173] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0174] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0175] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0176] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0178] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or 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 multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0179] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A question-answering method based on thought chain, characterized in that: The method comprises: Performing chain reasoning on preset question samples through a large language model to obtain a first answer and reasoning explanation for the question samples; wherein the question samples include questions about premium calculation; Generate a thinking chain solution example according to the question sample, the first answer and the reasoning explanation; A premium calculation question is obtained through a preset premium consultation channel, and a thought chain reasoning is performed on the premium calculation question according to the thought chain answer example to obtain a second answer to the premium calculation question.
2. The method according to claim 1, characterized in that The premium consultation channels include: insurance intelligent customer service channels and manual service channels; The method further comprises: Obtaining a first question about premium calculation through the insurance intelligent customer service channel, and obtaining a second question about premium calculation through the manual service channel; Extracting target questions from the collected first questions and second questions according to a preset ratio, and constructing a question sample data set according to the target questions; The question sample data set is randomly sampled to obtain the question sample.
3. The method according to claim 1, characterized in that The method of performing chain reasoning on a preset question sample through a large language model to obtain a first answer and reasoning explanation of the question sample includes: Inputting the question sample and the pre-created thought chain prompt into the large language model; The large language model is used to perform chain of thought reasoning on the question sample according to the chain of thought prompts to obtain a first answer and a reasoning explanation for the question sample.
4. The method according to any one of claims 1 to 3, characterized in that The number of the question samples is multiple; The step of generating a thinking chain solution example according to the question sample, the first answer and the reasoning explanation includes: The plurality of question samples, the first answers to the plurality of question samples, and the reasoning explanations to the plurality of question samples are spliced together to generate a thinking chain solution example.
5. The method according to claim 4, characterized in that The performing a chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question includes: Inputting the premium calculation question and the thought chain solution example into the large language model; The large language model is used to perform chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question.
6. The method according to any one of claims 1 to 3, characterized in that The number of the question samples is multiple; The step of generating a thinking chain solution example according to the question sample, the first answer and the reasoning explanation includes: The question sample, the first answer and the reasoning explanation are grouped and spliced to generate multiple groups of thinking chain solution examples, each group of thinking chain solution examples includes: a target question sample in the question sample, the first answer to the target question sample and the reasoning explanation of the target question sample, and the number of the multiple groups of thinking chain solution examples is the same as the number of the question samples.
7. The method according to claim 6, characterized in that The performing a chain of thought reasoning on the premium calculation question according to the chain of thought answer example to obtain a second answer to the premium calculation question includes: Combining the premium calculation question with a set of thinking chain solution examples in the multiple sets of thinking chain solution examples to obtain multiple sets of model inputs; Inputting the multiple groups of model inputs into the large language model; Using the large language model, the thought chain reasoning is performed on the premium calculation question according to the thought chain answer examples in each group of model inputs, so as to obtain multiple alternative answers to the premium calculation question; Voting analysis is performed on the multiple alternative answers to obtain a second answer to the premium calculation question.
8. A question-answering device based on thought chain, characterized in that: The device comprises: An explanation generation module is used to perform thought chain reasoning on a preset question sample through a large language model to obtain a first answer and reasoning explanation of the question sample; wherein the question sample includes a question about premium calculation; An example generation module, used for generating a thinking chain solution example according to the question sample, the first answer and the reasoning explanation; The question-answering module is used to obtain premium calculation questions through a preset premium consultation channel, perform thought chain reasoning on the premium calculation questions according to the thought chain answering examples, and obtain a second answer to the premium calculation questions.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the question-answering method based on the thinking chain as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the question-answering method based on thought chain described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Insurance clause consultation automatic answering method, medium and system
CN117149955A
Question and answer pair construction method and device, electronic equipment and storage medium
CN117688160A
Large model calculation method and device, equipment and storage medium
CN117973531A
Model training method and device based on thinking chain
CN118114770A
Cited By
Risk detection method and device for answer data, equipment and storage medium
CN119311844A
