Question and answer method, device and system based on large language model and medium

By obtaining the recall script and matching large language models, the problem of creating content by task-based robots is solved, and the user's questions are accurately responded to the acquisition business scenario is achieved, and the accuracy and efficiency of the question-and-answer process is improved.

CN119106730APending Publication Date: 2024-12-10CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411250607.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The existing question-and-answer method based on large language models has the risk of generating fabricated or false content in task-based robots, and in the acquisition business scenario, users' consultations cannot be fully responded to in the initial script diagram, resulting in inaccurate responses.

Method used

By obtaining recall scripts, matching scripts with large language models, selecting and generating replies, using previous customer service to mine scripts from dialogue logs between users, and using large models to match scripts, avoiding careful design of script diagrams and model training, ensuring replies accuracy.

Benefits of technology

It achieves the accuracy and efficiency of the Q&A process without fabricating replies, and is suitable for customer service in complex scenarios, especially for C-end users' multiple expression compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106730A_ABST
    Figure CN119106730A_ABST
Patent Text Reader

Abstract

The invention discloses a question and answer method, device and system based on a large language model and a medium. Compared with the prior art, the embodiment of the invention obtains a recall script, performs large language model script matching on the recall script to obtain a reference script, and selects and generates a reply verbal skill according to the reference script. According to the scheme, the script is mined from all dialogue logs of the past customer service and the user, that is, the real dialogue between the past customer service and the user is a script, then the large model is adopted for script matching, and the user is replied according to the matched script. According to the scheme, a script graph does not need to be elaborately designed, script processing is simple and rapid, a model does not need to be trained, a large model is used for script selection, compiled replies cannot occur, and meanwhile the problems existing in an existing scheme can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a question-answering method, device, system and medium based on a large language model. Background Art

[0003] Now, for task-based robots, COT data (chain of thought) is usually used to fine-tune the big model. This method requires a large amount of COT data to be constructed. In the specific execution process, the big model may still generate fabricated and false content. The second method is to generate a very complete task process script diagram through a large amount of data mining, and then select the bifurcation point in the script diagram through the big model in the specific execution process. This method relies on the construction of the task process script diagram, and a very complex script diagram may appear. In the execution process, if the user does not reply according to the set script diagram, the task will not be able to proceed. Therefore, the existing model is not suitable for the acquisition business scenario. This scenario has a relatively certain process, but in the acquisition process, users may have some questions to consult. For example, when the customer service said: Please add the information 1 hospitalization medical record homepage 2 admission record 3 discharge summary, the user replied: These 3 are all from the doctor, right? This situation is a process consultation outside of acquisition, which cannot be fully drawn in the initial script diagram. When facing C-end users, fabricated replies cannot appear, so the above solution is not applicable to this scenario. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a question-answering method, device, system and medium based on a large language model that can be applied to artificial intelligence or other related fields. Its main purpose is to eliminate the need for elaborately designed script diagrams, and the script processing is simple and fast, and there is no need to train models. By using a large model to select scripts, there will be no fabricated replies, and the problems existing in the existing solutions can be solved at the same time.

[0005] The technical solution of the present invention is as follows:

[0006] A first aspect of the present invention provides a question answering method based on a large language model, comprising:

[0007] Get the recall script;

[0008] Matching the recalled scripts with a large language model script to obtain a reference script;

[0009] Select and generate response words based on the reference script.

[0010] In one embodiment, the step of obtaining the recalled script includes:

[0011] Identify the last execution node in the conversation record;

[0012] The script containing the previous execution node is recalled from the script library as a recalled script.

[0013] In one embodiment, the step of matching the recalled script with a large language model script to obtain a reference script includes:

[0014] truncate the recalled script to obtain a truncated script;

[0015] The truncated script is input into the large language model for script matching to obtain a reference script.

[0016] In one embodiment, the step of truncating the recalled script to obtain a truncated script includes:

[0017] Using the index corresponding to the last execution node in the recalled script as a reference node;

[0018] On the basis of the reference node, a preset number of nodes are moved downward to obtain a mobile node;

[0019] The nodes after the mobile node are truncated to obtain a truncated script.

[0020] In one embodiment, the step of inputting the truncated script into a large language model for script matching to obtain a reference script includes:

[0021] Input the truncated script into the promt of the large language model;

[0022] According to the content of the previous execution point in the truncated script, a promt containing the content of the previous execution point is produced;

[0023] The promt containing the content of the previous execution point is used as a reference script.

[0024] In one embodiment, the step of selecting and generating a response script according to the reference script includes:

[0025] Adding the conversation history between the current client and the user to the promt of the large language model;

[0026] Based on the reference script and the conversation history, select and generate customer service response words.

[0027] In one embodiment, the step of moving a preset number of nodes downward based on the reference node to obtain a mobile node includes:

[0028] On the basis of the reference node, two nodes are moved downward to obtain the mobile node.

[0029] A second aspect of the present invention provides an image rain removal device, comprising:

[0030] The acquisition module is used to obtain the recall script;

[0031] A first processing module is used to perform large language model script matching on the recalled script to obtain a reference script;

[0032] The second processing module is used to select and generate reply words according to the reference script.

[0033] A third aspect of the present invention provides a question-answering system based on a large language model, the system comprising at least one processor; and

[0034] a memory communicatively connected to the at least one processor; wherein,

[0035] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned question-answering method based on the large language model.

[0036] A fourth aspect of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned question-answering method based on the large language model.

[0037] Beneficial effects: The present invention discloses a question-answering method, device, system and medium based on a large language model. Compared with the prior art, the embodiment of the present invention obtains a recall script, matches the recall script with a large language model script, obtains a reference script, and selects and generates a reply script based on the reference script. This solution mines scripts from all previous conversation logs between customer service and users, that is, a real conversation between a customer service and a user in the past is a script, and then uses a large model to match the script, and replies to the user based on the matched script. This solution does not require elaborate design of the script diagram, the script processing is simple and fast, and there is no need to train the model. The use of a large model for script selection will prevent fabricated replies, and can solve the problems of existing solutions at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0039] Figure 1 A flow chart of a question-answering method based on a large language model provided by an embodiment of the present invention;

[0040] Figure 2A flowchart of step S100 in the question-answering method based on a large language model provided in an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of script 1 of a question-answering method based on a large language model provided in an embodiment of the present invention;

[0042] Figure 4 A schematic diagram of script 2 of a question-answering method based on a large language model provided in an embodiment of the present invention;

[0043] Figure 5 A schematic diagram of script 3 of the question-answering method based on a large language model provided in an embodiment of the present invention;

[0044] Figure 6 A schematic diagram of a script index library of a question-answering method based on a large language model provided in an embodiment of the present invention;

[0045] Figure 7 A flowchart of step S200 in the question-answering method based on a large language model provided in an embodiment of the present invention;

[0046] Figure 8 A schematic diagram of a truncated script 1 of a question-answering method based on a large language model provided in an embodiment of the present invention;

[0047] Fig. 9 A schematic diagram of a truncated script 2 of a question-answering method based on a large language model provided in an embodiment of the present invention;

[0048] Fig.10 A flowchart of step S220 in the question-answering method based on a large language model provided in an embodiment of the present invention;

[0049] Fig.11 A flowchart of step S300 in the question-answering method based on a large language model provided in an embodiment of the present invention;

[0050] Fig.12 A schematic diagram of functional modules of a question-answering device based on a large language model provided by an embodiment of the present invention;

[0051] Fig.13 A schematic diagram of the hardware structure of a question-answering system based on a large language model provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.

[0053] The question-answering method based on a large language model means that the robot customer service can match the appropriate script to reply to the user according to the questions asked by the user. That is, the script is mined from all the previous conversation logs between the customer service and the user. That is, the real conversation between a customer service and the user in the past is a script. Then the large model is used to match the script and reply to the user according to the matched script. The question-answering method based on a large language model can reply to the user's questions more accurately, especially for some special groups, such as the elderly or people with low cultural level, who sometimes cannot answer the questions asked by the customer service according to the specified style template. The question-answering method based on a large language model can be compatible with questions of various different expressions, so that users can ask questions through a variety of expressions, which greatly improves the efficiency of the question-answering process.

[0054] The application scenarios of the question-answering method based on the large language model can be in large shopping malls, hospitals, etc., which can provide corresponding consulting services to first-time users. Now for task-based robots, during the specific execution process, the large model may still generate fabricated and false content. The second way is to generate a very complete task flow script diagram through a large amount of data mining, and then select the bifurcation points in the script diagram through the large model during the specific execution process. This method relies on the construction of the task flow script diagram, and a very complex script diagram may appear. During the execution process, if the user does not reply according to the set script diagram, the task will not be able to proceed.

[0055] In order to solve the above problems, the present invention proposes a question-answering method based on a large language model. Figure 1 , Figure 1 A flowchart of an embodiment of the question-answering method based on a large language model provided by the present invention. The question-answering method based on a large language model provided in this embodiment is applied to a system consisting of a terminal device, a network and a server, wherein the network is a medium for providing a communication link between the terminal device and the server, which may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.; the operating system on the terminal device may include a handheld device operating system (iPhone operating system, iOS system), Android system or other operating system, and the terminal device is connected to the server through the network to achieve interaction, thereby performing operations such as receiving or sending data, and specifically may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, portable computers and desktop servers, etc. Figure 1 As shown, the method specifically comprises the following steps:

[0056] S100, obtaining a recall script;

[0057] S200, performing large language model script matching on the recalled script to obtain a reference script;

[0058] S300, selecting and generating a response script according to the reference script.

[0059] In this embodiment, to obtain the recalled script, the system first retrieves and obtains the previously created or stored draft scripts. These scripts will serve as the basis for generating new scripts and as data support for the subsequent generation of reply scripts.

[0060] The recalled scripts are matched with the large language model script to obtain a reference script. The recalled scripts are deeply analyzed and matched using the large language model to identify the structure, theme and style of the script, thereby generating one or more reference scripts to facilitate providing reference scripts for replying to subsequent user questions.

[0061] The system selects and generates reply lines based on the reference script. Based on the matching results, the system will select reference scripts that best match the original script. These scripts can reflect the core elements and creative direction of the original script. Based on the content and context of the reference script, the system will select and generate appropriate reply lines to ensure that the lines are consistent with the script context, and are consistent with the character setting and plot development.

[0062] Compared with the prior art, in the technical solution of the present invention, the embodiment of the present invention obtains a recall script, matches the recall script with a large language model script, obtains a reference script, and selects and generates a reply script based on the reference script. This solution mines scripts from all previous conversation logs between customer service and users, that is, a real conversation between a customer service and a user in the past is a script, and then uses a large model to match the script, and replies to the user based on the matched script. This solution does not require elaborate design of the script graph, the script processing is simple and fast, and there is no need to train the model. The use of a large model for script selection will prevent fabricated replies, and can simultaneously solve the problems of existing solutions and improve the accuracy of reply sending.

[0063] like Figure 2 As shown, in one embodiment, step S100 of obtaining the recalled script includes:

[0064] S110, identifying the last execution node in the conversation record;

[0065] S120. Recall the script containing the previous execution node from the script library as a recalled script.

[0066] In this embodiment, in order to obtain the recall script, it is necessary to identify the previous chat dialogue between the customer service and the user, analyze the user dialogue history, and identify the previous execution node of the current dialogue. For example, if the user's previous message is to send a document image, then "User: Send document image" is identified as the previous execution node. Based on the identified previous execution node, relevant dialogue segments containing the node are intercepted from the chat dialogue between the customer service and the user. These segments form the basis of the recall script.

[0067] For example, if the script intention execution list is: [["User: Send document picture"], ["Customer service: Missing document", "User: None"]], and the user conversation history is: [["User: Picture"], ["Customer service: Hello, you still need a medical invoice", "User: I'm outside, I'll go back and take pictures for you in the evening"]], then the previous execution node is: "User: Send document picture", and the relevant scripts are recalled from the script library: According to the previous execution node: "User: Send document picture", the script containing this node is found from the script library as the recalled script.

[0068] Recalling the script containing the last execution node from the script library. As the process of recalling the script, it involves searching the script library for a matching script based on the identified node information. The script library may contain multiple scripts, each of which defines a series of dialogue nodes and corresponding processing logic. The recalled script will be used as a reference script for the current dialogue to guide the next dialogue process or task execution.

[0069] It can be understood that for the acquisition of recalled scripts, the current dialogue record is first analyzed to determine the key nodes in the dialogue, that is, the previous execution node. This is usually a specific dialogue event or decision point, such as a question raised by the user or a response made by the system. According to the information of the previous execution node, the matching script is searched in the script library. The script library is a resource that stores multiple predefined scripts, each of which contains a series of dialogue nodes. For each script, the matching logic is defined to determine whether it matches the previous execution node. This may be based on keywords, dialogue structure, or specific dialogue tags. Once a matching script is found, it is recalled from the script library. The recalled script will contain the dialogue nodes and predefined processing logic related to the previous execution node. The recalled script is used as a reference script for the current dialogue to guide the next action of the dialogue system. This may include generating a system response, guiding the user to the next step, or triggering a specific dialogue process. According to the context of the current dialogue, the recalled script is adapted as necessary. This may involve adjusting the variables, parameters, or processes in the script to ensure consistency with the current dialogue scenario. Use the reference script to advance the dialogue process. The system performs corresponding tasks, such as asking questions, providing information, or executing specific business logic, according to the guidance in the script. During the conversation, the recalled script is dynamically adjusted and optimized based on user feedback and new interaction data. This helps improve the accuracy of the conversation and user satisfaction. The key information and user feedback during the conversation are recorded for subsequent script evaluation and optimization.

[0070] Specifically, this process may include the following steps: analyzing the conversation record to identify the previous execution node in the conversation; searching in the script library based on the identification information of the previous execution node; matching and recalling the script related to the previous execution node; using the recalled script as a reference script for subsequent conversation processing or task distribution.

[0071] In some cases, the recalled script may need further adaptation or adjustment to ensure consistency with the context and goals of the current conversation. This process may involve dynamic adjustment of the conversation flow, replacement of parameters, or updating of the conversation strategy. In this way, the system can handle complex conversation scenarios more flexibly and intelligently, and provide more accurate and personalized services.

[0072] Through this process, the dialogue system can handle complex dialogue scenarios more intelligently and provide more personalized and accurate services. At the same time, this also helps to improve the flexibility and scalability of the dialogue system, enabling it to adapt to changing dialogue needs and business rules.

[0073] like Figure 3 , Figure 4 , Figure 5 and Figure 6As shown, the specific execution steps of this embodiment are:

[0074] 1. The previous execution node in the current conversation record is: "User: Send document image"

[0075] 2. Go Figure 6 The script node index library in finds the previous execution node: "User: Send document image", and obtains the scripts that exist in this node: Script 1, Script 2. The index in Script 1 is 1, and the index in Script 2 is 1.

[0076] 3. Recall result: Script 1, Script 2. The index of the previous execution node in the script is: Script 1: 1, Script 2: 1.

[0077] Technical Effect: Obtaining recall scripts. In a customer service platform based on a large language model, obtaining recall scripts is a key step in the dialogue management system. This step involves screening out scripts that match the current user customer service dialogue from a huge script library. In this way, the system can quickly narrow down the range from thousands of possible options and locate those scripts that are most likely to meet user needs.

[0078] The process begins with a semantic analysis of the user's current input. Using natural language processing techniques such as semantic understanding, keyword extraction, and intent recognition, the system is able to interpret the user's needs and emotional tendencies. Based on this information, the system then searches the script library for existing scripts that contain the same or similar keywords and semantics.

[0079] This refined recall script will serve as the basis for generating more precise response scripts. The large language model will refer to these scripts to construct responses, ensuring that the response content not only solves the user's questions, but also maintains the consistency of the brand's voice and tone. This approach improves the relevance and quality of responses, significantly improving customer satisfaction and efficiency.

[0080] like Figure 7 As shown, in one embodiment, step S200 matches the recalled script with a large language model script to obtain a reference script, including:

[0081] S210, truncating the recalled script to obtain a truncated script;

[0082] S220, inputting the truncated script into a large language model for script matching to obtain a reference script.

[0083] In this embodiment, in natural language processing and dialogue systems, script recall is a key step, which involves retrieving the script that is most relevant to the current dialogue context from a large number of script libraries. In order to improve the accuracy of script matching, we need to truncate the recalled scripts to remove the interference of irrelevant nodes. First, we need to clarify the structure of the recalled script. A script usually consists of multiple execution nodes, each of which represents an action or response in a dialogue. In the recalled script, in addition to the nodes related to the previous execution node, some irrelevant nodes may also be included. These irrelevant nodes may be caused by redundant information in the script library or inaccurate matching algorithms. In short, by truncating the recalled scripts, we can effectively remove the interference of irrelevant nodes and improve the accuracy of script matching. This is of great significance for improving the user experience and response quality of the dialogue system.

[0084] In one embodiment, Figure 2 As shown, the step of truncating the recalled script to obtain the truncated script in step S210 includes:

[0085] S211, using the index corresponding to the last execution node in the recalled script as a reference node;

[0086] S212, based on the reference node, move downward a preset number of nodes to obtain a mobile node;

[0087] S213, truncating the nodes after the mobile node to obtain a truncation script.

[0088] In this embodiment, the index of the last executed node is extracted from the recalled script. This index will be used as a reference point for script analysis and creation. The index is used to accurately find the reference node in the node sequence of the script to provide a contextual basis for the subsequent creation. Starting from the reference node, the node position after the move is calculated according to the preset number of nodes to determine the new node position. This preset number can be based on the needs of the plot or a specific creation strategy to calculate the node position after the move. This position will be used as the starting point for truncating the script to ensure that the truncated script fragment is coherent in the plot. All script nodes after the moving node are truncated, that is, further script content acquisition or generation is stopped, and a relatively complete truncated script is obtained in terms of the plot. The truncated script fragment will be used for subsequent dialogue generation or plot development, providing a basis for maintaining plot coherence and creativity.

[0089] This detailed process ensures continuity and logic in the script creation process, while allowing creators to flexibly adjust the content and length of the script as needed.

[0090] like Figure 8 and Fig. 9As shown, the specific steps of this embodiment are:

[0091] 1. The recalled scripts are Script 1 and Script 2. The index of the previous execution node: "User: Send document image" in the script is: Script 1: 1, Script 2: 1.

[0092] 2. Move the script up or down a preset number of nodes based on the index of the last execution node to obtain the corresponding node index. In the script, cut off the node after the corresponding node index.

[0093] 3. Get the truncated script.

[0094] In a dialogue system or an automatic customer service system, in order to improve the quality of response to user questions, the system usually relies on pre-written scripts to generate replies. These scripts contain possible user questions and the corresponding optimal reply words. However, since scripts often contain a lot of content, directly recalled scripts may contain many reference samples of words that are irrelevant to the current problem. Therefore, accurately intercepting the script so as to retain only the content most relevant to the user's current problem is a key step to improve user experience. By moving on the basis of the reference node to obtain a mobile node, and then intercepting the script according to the mobile node to obtain a truncated script, the truncated script not only contains the corresponding reference samples of the previous execution node, but also deletes some irrelevant reference samples of words, which greatly improves the accuracy of subsequent replies to user questions.

[0095] like Figure 8 and Fig. 9 As shown, in one embodiment, the step of moving a preset number of nodes downward based on the reference node in step S212 to obtain a mobile node includes:

[0096] On the basis of the reference node, two nodes are moved downward to obtain the mobile node.

[0097] The specific steps of this embodiment are as follows:

[0098] 1. The recalled scripts are Script 1 and Script 2. The index of the previous execution node: "User: Send document image" in the script is: Script 1: 1, Script 2: 1.

[0099] 2. Move the script up or down 2 nodes based on the index of the last execution node, and obtain the corresponding node indexes: script 1:3, script 2:3.

[0100] 3. Script 1 cuts off the nodes after index 3, and then continues to cut off the user's words in the last node. Script 2 cuts off the nodes after index 3, and then continues to cut off the user's words in the last node.

[0101] 4. Get the script truncation result: Figure 8 and Fig. 9 shown.

[0102] In this embodiment, based on the reference node, two nodes are moved downward to obtain the mobile node. It should be noted that the number of mobile nodes should not be too many or too few, and moving two nodes is the most appropriate.

[0103] If the number of moved nodes is too small, if only one node is moved or no node is moved, the intercepted script may contain insufficient information and lack the necessary context to accurately match the user's question. Insufficient information may make it difficult for the system to accurately match the correct words, increasing the risk of replying with irrelevant or erroneous information. Replies with insufficient information may not be able to resolve the user's questions, resulting in decreased user satisfaction. It is easy to cause the total number of nodes in the truncated script to be too small, making it inconvenient to use it as a reference sample for subsequent word matching.

[0104] If the number of moves is too large, moving too many nodes will introduce a large amount of possibly irrelevant information, increase the system processing burden, and may also lead to deviations from the user's original intention. Too much information may make it difficult for the system to capture the core issue, thereby affecting the accuracy of the speech matching. Information overload may make the system response lengthy and off-topic, and the user may need to communicate multiple times to get a satisfactory answer. That is, if the number of moves is too large, it is easy to cause the speech matching accuracy to be poor when it is used as a reference sample for subsequent speech matching, which greatly reduces the accuracy of the response speech generation, resulting in the situation where the user asks a question and the customer service cannot reply or the reply question is incorrect.

[0105] Choosing to move two nodes usually ensures that the script fragment contains enough information while avoiding too much irrelevant content. Moving two nodes usually achieves a good balance, which ensures that enough context information is captured while avoiding introducing too much content that may be irrelevant to the user's question. The distance between the two nodes can cover enough information so that the captured script fragment contains the necessary context, which helps to understand the user's specific needs. Limiting the number of moving nodes helps to control the complexity of the processing process, so that the system can process and respond to users faster. That is, this number is a balance point based on experiments and experience. By moving an appropriate number of nodes, the system can match the script more accurately and reduce matching errors caused by script fragments that are too large or too small. This method ensures that when users ask questions, the system can provide accurate and timely responses, reduce the situation of being unable to respond or responding incorrectly, and improve user satisfaction. Through this series of steps and considerations, the dialogue system can effectively handle user questions and provide high-quality responses, thereby improving the overall user experience and system efficiency.

[0106] In one embodiment, Figure 3 As shown, step S220, inputting the truncated script into the large language model for script matching to obtain a reference script, includes:

[0107] S221, inputting the truncated script into the promt of the large language model;

[0108] S222, according to the content of the previous execution point in the truncated script, create a promt containing the content of the previous execution point;

[0109] S223. Use the promt containing the content of the previous execution point as a reference script.

[0110] In this embodiment, the screened and edited truncated script is loaded as input data into the prompt area of ​​the large language model. This step is to utilize the model's capabilities to generate coherent dialogue or plot development based on the contextual information of the script. Analyze the content of the previous execution point contained in the truncated script, which usually refers to the previous key node or event in the script. Based on this content, carefully craft a prompt containing detailed information of the previous execution point to ensure that the model can capture the continuity of the plot and the relevance of the context. Set the prepared prompt containing the content of the previous execution point as a reference script. This reference script prompt will serve as a basis for interacting with the model, guiding the model to understand and continue the specific context and style of the script, thereby generating a response or subsequent plot that conforms to the direction of the plot.

[0111] In this refinement process, each step is designed to ensure the accuracy and completeness of the script information so that the large language model can generate high-quality script content. Through precise prompt design, the model can be guided to better understand the context of the script, thereby creating more coherent, reasonable and creative script paragraphs.

[0112] In one embodiment, Fig.11 As shown, step S300 is a step of selecting and generating a reply script according to the reference script, including:

[0113] S310, adding the conversation history between the current client and the user to the promt of the large language model;

[0114] S320. Based on the reference script and the conversation history, select and generate customer service response words.

[0115] In this embodiment, the conversation history between the current customer and the user is integrated and input into the prompt of the large language model. This step involves extracting key information from the conversation to ensure that the model can understand the customer's needs, preferences, and previous communication content. Using a large language model, combined with the plot content in the reference script and the customer information in the conversation history, the model intelligently selects and generates appropriate customer service response scripts. The model will analyze the context, user emotions and needs in the conversation history, as well as the relevant information in the reference script to ensure that the generated scripts are consistent with the script settings and can respond to customers appropriately.

[0116] In this embodiment, an intelligent customer service response generation method based on user characteristics and conversation history is used. The method uses a large language model to automate and optimize the customer service response generation process. The following are the specific steps of the method:

[0117] 1. Determination of reference scripts:

[0118] Script fragments related to the current dialogue task are cut out and filtered from the script library as reference scripts. These scripts contain typical dialogue processes between users and customer service.

[0119] 2. Extraction of candidate response content:

[0120] Possible customer service response scripts are extracted from the reference scripts as candidate content for generating customer service responses. These candidate content will be used in the subsequent language model generation process.

[0121] 3. Collection of user conversation history:

[0122] Collect the current user's conversation history, including information such as the user's questions and uploaded pictures. This information is crucial for understanding user needs and generating appropriate customer service responses.

[0123] 4. Generate a prompt for the language model:

[0124] Using the collected reference scripts, user conversation history, and candidate customer service response scripts, we built a detailed prompt to guide the large language model to generate appropriate customer service responses. The prompt clearly defines the customer service role, user needs, and available response options.

[0125] 5. Response generation of language model:

[0126] The constructed prompt is input into the large language model. The model selects the most appropriate candidate response based on the information in the prompt and generates the final customer service response.

[0127] 6. Return of reply content:

[0128] The response content generated by the large language model is returned to the user, completing the entire intelligent customer service response generation process.

[0129] In this example, the user uploaded a picture and told the customer service that he would provide the required medical invoice after returning home in the evening. Based on the user's needs and conversation history, the large language model selected "OK, send it to me when you are free" as the most appropriate response, which not only reflects the understanding of the user's situation, but also keeps the conversation smooth and friendly.

[0130] Through this approach, the efficiency and quality of customer service response generation can be significantly improved, while providing users with a more personalized and considerate service experience.

[0131] The specific steps in this embodiment are:

[0132] 1. The script truncated in step S200 is used as a reference script:

[0133] Reference Script 1:

[0134] User: [picture].

[0135] Customer Service: Hello, [missing document name].

[0136] User: [picture].

[0137] Customer Service: Received. Your documents are complete.

[0138] Reference Script 2:

[0139] User: [picture].

[0140] Customer Service: Hello, [missing document name].

[0141] User: I'm not home today.

[0142] Customer Service: Okay, then send it to me when you have time.

[0143] 2. Based on the [reference script], obtain candidate customer service response content (reference the last customer service line in the script): [Customer service: Received, your documents are complete], [Customer service: Okay, send it to me when you have time].

[0144] 3. Get the recorded user conversation history from the current conversation record:

[0145] User: [picture].

[0146] Customer Service: Hello, you still lack medical invoices.

[0147] User: I'm outside. I'll take pictures for you when I get back in the evening.

[0148] 4. Based on the information in steps 1 to 3, generate a prompt for the large language model:

[0149] System: If you are a claims customer service representative, please select appropriate customer service response scripts from the candidate response scripts to reply to the user's information in the current conversation history based on the given reference scripts:

[0150] Input: Reference Script 1:

[0151] User: [picture].

[0152] Customer Service: Hello, [missing document name].

[0153] User: [picture].

[0154] Customer Service: Received. Your documents are complete.

[0155] Reference Script 2:

[0156] User: [picture].

[0157] Customer Service: Hello, [missing document name].

[0158] User: I'm not home today.

[0159] Customer Service: Okay, then send it to me when you have time.

[0160] Current conversation history:

[0161] User: [picture].

[0162] Customer Service: Hello, you still lack medical invoices.

[0163] User: I'm outside. I'll take pictures for you when I get back in the evening.

[0164] Candidate customer service response lines: [Customer service: Received, your documents are complete], [Customer service: Okay, send them to me when you have time].

[0165] 5. Get a reply from the big model:

[0166] The big model’s reply: [OK, send it to me when you have time].

[0167] 6. Return the large language model response content to the user.

[0168] When generating customer service responses, key factors to consider include conversation history and script content, and how to use large language models to synthesize this information to generate customer service responses that are both personalized and consistent with the story. This process helps improve the customer experience while maintaining the coherence and consistency of the script.

[0169] This process shows how natural language processing can achieve automated and personalized responses in customer service, reducing the workload of customer service staff, improving response speed and user satisfaction. By accurately understanding user needs and scenarios, the system can make quick and accurate decisions, thereby optimizing the entire service process. This not only improves efficiency, but also enhances user experience, allowing users to experience more humane and efficient services in their interactions with customer service staff.

[0170] Another embodiment of the present invention provides a question-answering device based on a large language model, such as Fig.12 As shown, the device 1 comprises:

[0171] An acquisition module 11 is used to acquire a recall script;

[0172] The first processing module 12 is used to perform large language model script matching on the recalled script to obtain a reference script;

[0173] The second processing module 13 is used to select and generate a reply script according to the reference script;

[0174] The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions, which is more suitable for describing the question and answer execution process based on a large language model than a program. For the specific implementation of each module, please refer to the corresponding method embodiment above, which will not be repeated here.

[0175] In one embodiment, the device 1 further comprises:

[0176] Identification module, used for the last execution node in the conversation record;

[0177] The recall module is used to recall the script containing the previous execution node from the script library as a recalled script.

[0178] In one embodiment, the first processing module 12 includes:

[0179] A truncation module, used for truncating the recalled script to obtain a truncated script;

[0180] The matching module is used to input the truncated script into the large language model for script matching to obtain a reference script.

[0181] In one embodiment, the truncation module includes:

[0182] A comparison unit, used to use the index corresponding to the last execution node in the recalled script as a reference node;

[0183] A mobile unit is used to move a preset number of nodes downward based on the reference node to obtain a mobile node

[0184] The interception unit is used to intercept the node after the mobile node to obtain the interception script.

[0185] In one embodiment, the matching module includes:

[0186] An input unit, used for inputting the truncated script into the promt of the large language model;

[0187] A production unit, used for producing a promt containing the content of the previous execution point according to the content of the previous execution point in the truncated script;

[0188] The output unit is used to use the promt containing the content of the previous execution point as a reference script.

[0189] In one embodiment, the second processing module 13 includes:

[0190] A synthesis unit, used to add the conversation history between the current client and the user to the promt of the large language model;

[0191] A generation unit is used for the large language model to select and generate customer service reply words based on the reference script and the conversation history.

[0192] Another embodiment of the present invention provides a question-answering system based on a large language model, such as Fig.13 As shown, the system 10 includes: one or more processors 110 and a memory 120, Figure 6 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0193] The processor 110 is used to complete various control logics of the system 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.

[0194] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the image deraining method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the question-answering method based on the large language model in the above method embodiment.

[0195] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the system 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the system 10 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.

[0196] One or more units are stored in the memory 120, and when executed by one or more processors 110, the question answering method based on the large language model in any of the above method embodiments is executed, for example, the following steps are executed:

[0197] Get the recall script;

[0198] Matching the recalled scripts with a large language model script to obtain a reference script;

[0199] Select and generate response words based on the reference script.

[0200] In one embodiment, the step of obtaining the recalled script includes:

[0201] Identify the last execution node in the conversation record;

[0202] The script containing the previous execution node is recalled from the script library as a recalled script.

[0203] In one embodiment, the step of matching the recalled script with a large language model script to obtain a reference script includes:

[0204] truncate the recalled script to obtain a truncated script;

[0205] The truncated script is input into the large language model for script matching to obtain a reference script.

[0206] In one embodiment, the step of truncating the recalled script to obtain a truncated script includes:

[0207] Using the index corresponding to the last execution node in the recalled script as a reference node;

[0208] On the basis of the reference node, a preset number of nodes are moved downward to obtain a mobile node;

[0209] The nodes after the mobile node are truncated to obtain a truncated script.

[0210] In one embodiment, the step of inputting the truncated script into a large language model for script matching to obtain a reference script includes:

[0211] Input the truncated script into the promt of the large language model;

[0212] According to the content of the previous execution point in the truncated script, a promt containing the content of the previous execution point is produced;

[0213] The promt containing the content of the previous execution point is used as a reference script.

[0214] In one embodiment, the step of selecting and generating a response script according to the reference script includes:

[0215] Adding the conversation history between the current client and the user to the promt of the large language model;

[0216] Based on the reference script and the conversation history, select and generate customer service response words.

[0217] In one embodiment, the step of moving a preset number of nodes downward based on the reference node to obtain a mobile node includes:

[0218] On the basis of the reference node, two nodes are moved downward to obtain the mobile node.

[0219] An embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the question-answering method based on a large language model in any of the above method embodiments is executed, for example, the following steps are performed:

[0220] Get the recall script;

[0221] Matching the recalled scripts with a large language model script to obtain a reference script;

[0222] Select and generate response words based on the reference script.

[0223] In one embodiment, the step of obtaining the recalled script includes:

[0224] Identify the last execution node in the conversation record;

[0225] The script containing the previous execution node is recalled from the script library as a recalled script.

[0226] In one embodiment, the step of matching the recalled script with a large language model script to obtain a reference script includes:

[0227] truncate the recalled script to obtain a truncated script;

[0228] The truncated script is input into the large language model for script matching to obtain a reference script.

[0229] In one embodiment, the step of truncating the recalled script to obtain a truncated script includes:

[0230] Using the index corresponding to the last execution node in the recalled script as a reference node;

[0231] On the basis of the reference node, a preset number of nodes are moved downward to obtain a mobile node;

[0232] The nodes after the mobile node are truncated to obtain a truncated script.

[0233] In one embodiment, the step of inputting the truncated script into a large language model for script matching to obtain a reference script includes:

[0234] Input the truncated script into the promt of the large language model;

[0235] According to the content of the previous execution point in the truncated script, a promt containing the content of the previous execution point is produced;

[0236] The promt containing the content of the previous execution point is used as a reference script.

[0237] In one embodiment, the step of selecting and generating a response script according to the reference script includes:

[0238] Adding the conversation history between the current client and the user to the promt of the large language model;

[0239] Based on the reference script and the conversation history, select and generate customer service response words.

[0240] In one embodiment, the step of moving a preset number of nodes downward based on the reference node to obtain a mobile node includes:

[0241] On the basis of the reference node, two nodes are moved downward to obtain the mobile node.

[0242] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0243] In summary, the present invention discloses a question-answering method, device, system and medium based on a large language model. Compared with the prior art, the embodiment of the present invention obtains a recall script, matches the recall script with a large language model script, obtains a reference script, and selects and generates a reply script based on the reference script. This solution mines scripts from all previous conversation logs between customer service and users, that is, a real conversation between a customer service and a user in the past is a script, and then uses a large model to match the script, and replies to the user based on the matched script. This solution does not require elaborate design of the script diagram, the script processing is simple and fast, and there is no need to train the model. The use of a large model for script selection will prevent fabricated replies, and can solve the problems of existing solutions at the same time.

[0244] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.

[0245] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A question-answering method based on a large language model, characterized in that: include: Get the recall script; Matching the recalled scripts with a large language model script to obtain a reference script; Select and generate response words based on the reference script.

2. The question-answering method based on a large language model according to claim 1, characterized in that: The step of obtaining the recall script includes: Identify the last execution node in the conversation record; The script containing the previous execution node is recalled from the script library as a recalled script.

3. The question-answering method based on a large language model according to claim 1, characterized in that: The step of matching the recalled script with a large language model script to obtain a reference script includes: truncate the recalled script to obtain a truncated script; The truncated script is input into the large language model for script matching to obtain a reference script.

4. The question-answering method based on a large language model according to claim 3, characterized in that: The step of truncating the recalled script to obtain a truncated script includes: Using the index corresponding to the last execution node in the recalled script as a reference node; On the basis of the reference node, a preset number of nodes are moved downward to obtain a mobile node; The nodes after the mobile node are truncated to obtain a truncated script.

5. The question-answering method based on a large language model according to claim 3, characterized in that: The step of inputting the truncated script into the large language model for script matching to obtain a reference script comprises: Input the truncated script into the promt of the large language model; According to the content of the previous execution point in the truncated script, a promt containing the content of the previous execution point is produced; The promt containing the content of the previous execution point is used as a reference script.

6. The question-answering method based on a large language model according to claim 1, characterized in that: The step of selecting and generating a response script according to the reference script includes: The conversation history between the current customer and the user is added to the promt of the large language model; based on the reference script and the conversation history, the words of the customer service reply are selected and generated.

7. The question-answering method based on a large language model according to claim 4, characterized in that: The step of moving a preset number of nodes downward on the basis of the reference node to obtain a mobile node comprises: On the basis of the reference node, two nodes are moved downward to obtain the mobile node.

8. A question-answering device based on a large language model, characterized in that: include: The acquisition module is used to obtain the recall script; A first processing module is used to perform large language model script matching on the recalled script to obtain a reference script; The second processing module is used to select and generate reply words according to the reference script.

9. A question-answering system based on a large language model, characterized in that: The system includes at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the question-answering method based on a large language model as described in any one of claims 1-7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the question-answering method based on a large language model as described in any one of claims 1-7.