User question answering method and device, equipment and medium
Through the combination of intention reasoning model and domain professional model, it solves the problem of difficulty in integrating multiple intentions and lack of emotional consideration when chatbots handle complex user questions, and achieves high-quality, smooth and emotional response text generation.
Patent Information
- Application Number
- CN202411371133.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-21
AI Technical Summary
When existing chatbots handle complex questions from users, it is difficult to organically integrate multiple intent replies, which ignores the integrity and coherence of user questions, and lacks consideration and integration of emotional factors, resulting in lack of fluency and logic in response text. and temperature.
By obtaining the user's questioning information, put it into the preset intention to reason the template, use the intention to reason the model to generate the response strategy information, including the fusion strategy prompt template and the model input prompt text. The response fusion model integrates it into a coherent response text.
It improves the accuracy of intentional identification and the fluency and logic of the response text, enhances the naturalness and empathy of the dialogue, improves the user experience, and improves the efficiency of response generation.
Smart Images

Figure CN119336867A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to artificial intelligence technology, and in particular to a method for answering user questions and its device, equipment, and medium. Background Art
[0002] In the field of artificial intelligence, chatbots are an important tool for human-computer interaction. One of the core functions of their dialogue systems is to understand and respond to users' questions. With the development of technology, existing chatbots have been able to understand multiple user intentions through intent recognition models. However, although these systems have made some progress in recognition, they still have obvious shortcomings in integrating multiple recognized intents into a coherent and natural response text.
[0003] First, existing intent recognition models are often unable to organically integrate the response results of multiple intents. When users ask complex questions containing multiple intents, chatbots can recognize some of the intents, but when generating the final response text, they often simply mechanically splice the response information corresponding to each intent together. This processing method ignores the integrity and coherence of the user's questions, resulting in the lack of fluency and logic in the generated response text, which gives users a stiff and mechanical feeling.
[0004] Secondly, chatbots often lack consideration and integration of emotional factors when responding. Human-computer dialogue is not just an exchange of information, but also an emotional interaction. Users expect a chat partner who can understand their emotional needs and respond accordingly. However, when existing chatbots integrate reply information of multiple intentions, they often ignore the emotional factors in the conversation atmosphere, making the reply text lack warmth and empathy, and it is difficult to meet the needs of users at the emotional intelligence level.
[0005] In addition, the existing technology also lacks consideration of improving the efficiency of generating response texts when integrating the response information of multiple intents. When processing user questions with multiple intents, how to efficiently generate response texts is an important technical challenge. Existing methods are often inefficient in dealing with this problem and are unable to quickly provide users with satisfactory responses, affecting the user experience.
[0006] In summary, when dealing with complex user questions, existing technologies still face technical challenges such as how to organically integrate multiple intended response information, how to incorporate emotional factors, and how to improve the efficiency of response generation. The existence of these problems limits the ability of chatbots to provide high-quality and efficient dialogue services, affecting the overall communication experience of users. Therefore, optimizing chatbot technology to address these issues has become a technical bottleneck that needs to be broken through in this field. Summary of the invention
[0007] The purpose of the present application is to solve the above-mentioned problems and to provide a user question answering method and its corresponding device, equipment, and non-volatile readable storage medium.
[0008] According to one aspect of the present application, a method for answering user questions is provided, comprising the following steps: obtaining user question information generated by a conversation between a user and a chat robot, inserting the user question information into a preset intention reasoning prompt template to obtain an intention reasoning prompt text; calling a preset intention reasoning model, and generating answer strategy information based on the intention reasoning prompt text, wherein the answer strategy information includes a fusion strategy prompt template, a target intent contained in the user question information, and its corresponding model input prompt text; calling a domain professional model corresponding to each target intent, so that each domain professional model generates a corresponding intent task feedback text according to the model input prompt text corresponding to its target intent, and inserting each intent task feedback text into the fusion strategy prompt template to obtain a fusion strategy prompt text; calling an answer fusion model, and generating an answer text corresponding to the user question information based on the fusion strategy prompt text.
[0009] According to another aspect of the present application, a user question answering device is provided, comprising: a question preparation module, configured to obtain user question information generated by a conversation between a user and a chat robot, and to insert the user question information into a preset intention reasoning prompt template to obtain an intention reasoning prompt text; an analysis and coordination module, configured to call a preset intention reasoning model, and to generate answer strategy information based on the intention reasoning prompt text, wherein the answer strategy information includes a fusion strategy prompt template, a target intent contained in the user question information, and its corresponding model input prompt text; a domain generation module, configured to call domain professional models corresponding to each target intent, so that each domain professional model generates a corresponding intent task feedback text according to the model input prompt text corresponding to its target intent, and inserts each intent task feedback text into the fusion strategy prompt template to obtain a fusion strategy prompt text; a fusion optimization module, configured to call an answer fusion model, and to generate an answer text corresponding to the user question information based on the fusion strategy prompt text.
[0010] According to another aspect of the present application, a user question answering device is provided, comprising a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the user question answering method described in the present application.
[0011] According to another aspect of the present application, a non-volatile readable storage medium is provided, which stores a computer program implemented according to the user question answering method in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the method are executed.
[0012] Compared with the prior art, the technical solution of the present application has at least the following beneficial effects:
[0013] First, this application embeds user questions into preset intention reasoning prompt templates, uses intention reasoning models to effectively identify and process multiple intentions in questions, decomposes complex requirements into logically related target intentions, and generates response strategy information, including model input prompt text and fusion strategy prompt templates. This process not only improves the accuracy of intent recognition, but also organically integrates the feedback texts of multiple intentions through the response fusion model to generate coherent and logical response texts, solving the problem of lack of coherence in responses in the prior art.
[0014] Secondly, when identifying the target intention, this application uses the feature capture capability of the intent reasoning model to capture the logical connections between the target intentions and the emotional colors of the human-computer dialogue atmosphere, and accordingly generates model input prompt text and fusion strategy prompt templates corresponding to the domain professional model, ensuring that the response text can reflect the emotional color of the user's question, improving the chatbot's performance at the emotional intelligence level, and meeting the user's needs for emotional communication.
[0015] In addition, this application improves the efficiency of answer generation through systematic technical optimization. The prompt text and template generated by the intention reasoning model are directly used to construct the model input, which simplifies the processing flow, speeds up the answer generation, enables users to get faster and higher quality replies, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is an exemplary network architecture suitable for applying the user question answering method of the present application;
[0017] Figure 2 A flowchart of an embodiment of a method for answering user questions of the present application;
[0018] Figure 3 This is a functional block diagram of the user question answering device of this application;
[0019] Figure 4 This is a schematic diagram of the structure of a user question answering device used in this application. DETAILED DESCRIPTION
[0020] like Figure 1As shown, the implementation of the user question answering method of the present application covers the server 81 and the terminal device 80 in the network architecture. The server 81 undertakes the core task of executing the user question answering method. The server 81 realizes its core task by installing and running the computer program product implemented according to the user question answering method of the present application, including generating the corresponding answer text based on the user's question text, and storing each round of dialogue consisting of the question text and the answer text, which constitutes the dialogue data generated by the question and answer dialogue between the chat robot and the user. The terminal device 80 is the interface for the user to contact and use the chat robot. They are deployed through the corresponding application program, and communicate with the server 81 over the network to realize the sending and receiving of data.
[0021] In terms of application scenarios, the user question answering method of the present application is applicable to a variety of fields, and the functions of the chatbot can be customized according to different application requirements. For example, in the field of chat companions, the chatbot can be presented in the form of electronic pets or virtual digital people to provide users with an intimate communication experience; in online live customer service, the robot can answer audience inquiries in real time in the form of a virtual anchor / digital person to improve service efficiency; in the field of education and training, the robot acts as an online assistant to assist learners in obtaining information and solving problems.
[0022] Taking the chat companion application scenario as an example, the user interacts with the robot through the application on the terminal device. The application has a friendly user interface, presenting the chat robot as a virtual digital person, enhancing the user's immersion and desire for interaction. When the user asks questions or sends information to the chat robot, these inputs are sent to the server through the terminal device as question text. After the server receives the user's question text, it processes the data using the method of the present application to generate a corresponding answer text. The generated answer text is then sent back to the terminal device and displayed to the user in the tone of a virtual digital person on the user interface, completing a complete interaction process. On the server side, the conversation data generated by the question-and-answer dialogue between the chat robot and the user will be stored for backup, forming a historical chat record between them. By conducting in-depth data mining on the historical chat records between the user and the chat robot, it can also help the chat robot understand the user's question text more accurately, thereby generating a more accurate answer text for the corresponding question text.
[0023] See also Figure 2 According to a user question answering method provided by the present application, it can be implemented as a computer program product, which is installed and run in a terminal device or a server to provide a user question answering system. In some embodiments thereof, the following steps are included:
[0024] Step S3100: obtaining user question information generated by the conversation between the user and the chat robot, and inserting the user question information into a preset intention reasoning prompt template to obtain an intention reasoning prompt text;
[0025] During the human-computer dialogue between the user and the chat robot, when the user enters his question text through the corresponding user interface, the question text will be submitted to the chat robot, and the chat robot stores the historical chat records consisting of each question text and the corresponding answer text generated during the human-computer dialogue.
[0026] For the chatbot's user question answering system, in order to generate the corresponding answer text for the user's question, it is first necessary to obtain the conversation data between the user and the chatbot. Therefore, it will receive and process the questions input by the user through the chat interface, which can be provided in text, voice or other forms.
[0027] User question information may include any form of query or question provided by the user when interacting with the chatbot. Such information may include, but is not limited to, text messages, voice input, or instructions submitted through a graphical interface. The system converts user questions into a processable data format through integrated input recognition technology, such as voice recognition or text parsing algorithms. In other words, no matter what form of input, the user question answering system can convert the user input into the corresponding question text through the corresponding conversion technology.
[0028] In some embodiments, the user question information may be the question text corresponding to the user's input at that time. In other embodiments, the user question information may not only include the question text corresponding to the user's input at that time, but also include the historical chat records generated by the user's previous human-computer dialogue with the chat robot. The historical chat records may include multiple rounds of dialogue data between the user and the robot, and each round of dialogue data includes a question-answer pair, that is, a question text of the user and the corresponding answer text fed back by the chat robot. It is not difficult to understand that further including historical chat records in the user question information can provide richer context information for the question text given by the user at that time, which is convenient for the subsequent accurate recognition of the user's intention contained in the user question information.
[0029] After converting the user's question into text information, the system can use a preset intention reasoning prompt template to further generate an intention reasoning prompt text, so as to input the intention reasoning prompt text into the intention reasoning model, guide the intention reasoning model to complete the user's intention analysis, and determine one or more target intentions of the user. The intention reasoning prompt template can be designed according to a predetermined data structure. In one embodiment, it includes instruction content, predefined fields, and format specifications that are used to guide the intention reasoning model to understand the complex requirements in the user's question information.
[0030] For example, the system can provide predefined intent reasoning prompt templates that cover common user question types and scenarios. For example, if the user's question is about the weather forecast, the template will include relevant fields for weather queries, such as date, location, etc., to ensure that the system can capture the specific needs of the question more accurately and efficiently.
[0031] In addition, the system can also provide a flexible template adaptation mechanism to handle non-standard or ambiguous questions. Through natural language processing technology, the system can identify and parse the semantic content of user input and map it to the most appropriate intent reasoning prompt template. For ease of understanding, the following is an example of the data structure of a more practical intent reasoning prompt template:
[0032] Task description: This section provides an overall description of the user question processing task, clearly states the target intent that the model needs to recognize, and generates the corresponding processing strategy.
[0033] For example: "Please analyze the following user question information and identify all the intents contained in it. For each identified intent, treat it as a corresponding task and generate a model input prompt text. This model input prompt text will be used to guide the domain professional model corresponding to the intent to generate the corresponding intent task feedback text. In addition, please build a fusion strategy prompt template to be used to fuse these intent task feedback texts into the same answer text in the subsequent steps. In the process of completing the task, please pay attention to identifying the complex requirements in the user's question information in order to accurately identify the multiple target intents that may be contained, and when generating the model input prompt text and the fusion strategy prompt template, ensure that they always maintain logical association and emotional coordination with the user's question information."
[0034] User question information: This is the core part of the template, which contains the actual question asked by the user. The model will perform intent recognition and analysis based on this question content.
[0035] For example: "User asked: 'I plan to travel to Yunnan in December, do you have any suggestions?'"
[0036] Intent recognition instructions: This part contains specific instructions that guide the intent reasoning model on how to identify the various target intents contained in the user's question information.
[0037] For example: "Recognize the intent in the question, such as scheduling, location, activity suggestions, etc., and generate an explicit model input prompt text for each intent."
[0038] Model input hint text generation instructions: This section instructs the model on how to generate model input hint text for each recognized intent.
[0039] For example: “For each intent identified, generate a model input prompt text containing key information (such as time, place, activity) so that the domain-specific model can provide accurate feedback.”
[0040] Fusion strategy prompt template generation instructions: This part instructs the model on how to build a fusion strategy prompt template to fuse the feedback texts generated by professional models in different fields into a coherent response.
[0041] For example: "Build a fusion strategy prompt template that includes guidance on logical associations and emotional coloring to ensure that the final response text is not only accurate in information but also in harmony with the user's question context and emotional needs."
[0042] From the above examples, we can see that the intent reasoning prompt template can provide clear guidance for the large language model, enabling it to effectively handle complex user questions and generate high-quality response strategy information. The use of this template enables the chatbot to communicate with users more intelligently and naturally. The design of the intent reasoning prompt template is relatively flexible, as long as it semantically reflects the various relevant instructions required to solve the task. These instructions may include but are not limited to: logical reasoning control instructions that reflect the logical association between the identified target intents, task intent recognition instructions that reflect the control model's recognition of each target intent in the user's question information, task prompt generation instructions that reflect the control model's generation of model input prompt templates corresponding to each target intent, and fusion strategy generation instructions that reflect the control model's generation of fusion strategy prompt templates, etc.
[0043] In specific implementation, this step can be performed in a variety of ways. For example, it can be integrated into the front-end interface of the chatbot, and the text input by the user is directly captured and sent to the back-end for processing; or in a voice interaction scenario, the user's voice input is first converted into text and then processed according to a preset template. In either case, the purpose is to ensure that the system can accurately understand and respond to the user's questions. In this way, the chatbot can provide users with more accurate and personalized answering services.
[0044] Step S3200: calling a preset intention inference model, and generating response strategy information based on the intention inference prompt text, wherein the response strategy information includes a fusion strategy prompt template, the target intention contained in the user question information, and the corresponding model input prompt text;
[0045] In the user question answering system, once the intent inference prompt text is obtained and constructed, the preset intent inference model can be called to generate the answer strategy information. This step is the core link of the system processing user questions. It aims to conduct in-depth analysis of user question information through advanced intent inference models and formulate accurate answer strategies accordingly. The intent inference model can be implemented using a large language model, such as llama or other pre-trained generative models based on Transformer.
[0046] The input of the intention reasoning model is the intention reasoning prompt text constructed in the previous step. Under the guidance of the prompt text, the intention reasoning model can generate corresponding response strategy information for application in subsequent steps.
[0047] The answer strategy information includes several main components: fusion strategy prompt template, target intent and model input prompt text corresponding to the target intent. There is correspondence between the target intent and the model input prompt template. The target intent can be used to determine the corresponding domain professional model, and the model input prompt template corresponding to the target intent is used to provide input for the domain professional model to guide the domain professional model to generate the corresponding output as the intention task feedback text.
[0048] The fusion strategy prompt template is a framework that guides how to fuse the feedback texts generated by multiple domain professional models into a coherent and unified response. The data structure of this template can be pre-defined in the intent reasoning generation template, and then inherited to the intent reasoning prompt text. Among them, in the fusion strategy prompt template generated by the intent reasoning model according to the intent reasoning prompt text, it is necessary to explain in detail how the intent task feedback texts of the domain professional models corresponding to each target intent should be combined, including their logical order, which information to highlight, and how to adjust the language style to match the user's question context.
[0049] The model input prompt text is generated for each identified target intent. It provides the necessary basic information and corresponding control instructions for the domain professional model to generate accurate feedback. Similarly, the model input prompt text is also implemented by the intent reasoning model according to the natural language instructions given by the intent reasoning prompt text. The intent reasoning prompt text can standardize the natural language instructions, data structure, data content, data format, etc. of the model input prompt text corresponding to each domain professional model, so that the generated model input prompt text can be accurately understood and executed by the corresponding domain professional model.
[0050] In the specific implementation, the intention reasoning model will analyze the instruction content and user question information in the intention reasoning prompt text, identify one or more target intentions in the question, realize the task decomposition of the user's potential complex needs, and generate response strategy information based on this.
[0051] For example, consider a user asking "I plan to travel to Yunnan in December, do you have any suggestions?" In this scenario, the intent reasoning model will identify at least two key target intents: time query (December) and location query (Yunnan). For each target intent, the model will generate corresponding model input prompt text, such as "Query the weather conditions in December" and "Recommend tourist attractions in Yunnan". At the same time, the model will also build a fusion strategy prompt template to guide how to integrate weather information and travel suggestions into a comprehensive response text.
[0052] Corresponding to the above example, the following is a specific example of the fusion strategy prompt template generated by the intent reasoning model and the two model input prompt texts:
[0053] The fusion strategy prompt template is used to guide how to integrate the feedback texts obtained from professional models in different fields into a unified response. In the context of a user asking "I plan to travel to Yunnan in December, do you have any suggestions?", the template will specify in detail how to combine weather information and travel suggestions. The following is an example template, and the actual finalized template content may vary depending on the characteristics of the large language model:
[0054] / / Start of example
[0055] Task requirements: Integrate the following intention task feedback texts generated by professional models in different fields to form a travel suggestion that is both logical and meets emotional needs.
[0056] Logical order:
[0057] Weather Overview: First, we will introduce the weather conditions in Yunnan in December, including the average temperature and rainfall probability, to provide basic information for travel plans.
[0058] Travel suggestions: Recommend suitable tourist attractions and activities based on weather conditions, ensuring that the suggestions match the weather conditions.
[0059] Key points:
[0060] Emphasize that Yunnan's mild climate in December is suitable for outdoor activities.
[0061] Users are reminded to prepare appropriate clothing and rain gear to cope with possible rainfall.
[0062] Language style adjustment:
[0063] Maintain a friendly and advisory language style that fits the context of the user seeking travel advice.
[0064] Intent task feedback text list:
[0065] [Replace this with the intention task feedback text generated by professional models in various fields]
[0066] / / End of example
[0067] Model input prompt text is generated for each target intent, guiding the corresponding domain professional model to provide necessary information. For the above user question information, there are two target intents: time query and location query.
[0068] Target Figure 1 : Time query
[0069] Model input prompt text: "Please provide the weather forecast for Yunnan in December 2024, including key information such as average temperature and rainfall probability."
[0070] Target Figure 2 : Location search
[0071] Model input prompt text: "Based on the weather conditions in December 2024, recommend popular tourist attractions and seasonal activities in Yunnan."
[0072] The input prompt texts of these two models will be sent to the weather professional model and the tourism professional model respectively. Each model processes the corresponding request according to its expertise and generates the intention task feedback text. These feedback texts are then integrated according to the fusion strategy prompt template to form a comprehensive answer to the user's question.
[0073] In one embodiment, a pre-trained large language model can be used as a basis, and fine-tuned by a small sample training method to obtain an intention inference model. The training samples for fine-tuning the intention inference model include the user's question text and the corresponding answer strategy information, and the answer strategy information includes the fusion strategy prompt template and the target intent and its corresponding model input prompt text, which are specifically described as follows:
[0074] First, each training sample contains a user question text, which is the basic data that the model needs to analyze and understand. The question text is collected from actual conversations between users and chatbots, covering a variety of scenarios and intentions to ensure that the model has a wide range of applicability in practical applications.
[0075] Second, each question text is equipped with one or more intent labels, which clearly indicate the main intent contained in the question text. For example, if a user asks "What clothes should I wear when I go to Beijing tomorrow?", its intent labels include "weather query" and "clothing advice". These labels help guide the model to identify and distinguish different intents in questions.
[0076] In addition to the intent label, the training samples also contain other response strategy information, which is the key for the model to generate high-quality responses. Other response strategy information includes fusion strategy prompt templates and model input prompt texts, which guide the model on how to fuse task feedback texts with different intents into a coherent and unified response. For example, for the above question, the fusion strategy prompt template can guide the model to first provide Beijing's tomorrow's weather forecast, and then give clothing suggestions based on the weather conditions.
[0077] In addition, training samples can also include historical chat records, which provide contextual information about the user's questions and help the model understand the user's intentions and needs more accurately. For example, if the user mentioned an interest in outdoor activities in a previous conversation, the model can consider more factors related to outdoor activities when processing questions about the weather.
[0078] It can be seen that the training samples used to fine-tune the intent inference model are multi-dimensional, including user question text, intent labels, response strategy information, and historical chat records. These samples provide the model with rich information, enabling it to accurately identify and process users' complex intents in practical applications and obtain high-quality response strategy information.
[0079] Step S3300: calling the domain professional models corresponding to each target intent, making each domain professional model generate the corresponding intent task feedback text according to the model input prompt text corresponding to its target intent, and inserting each intent task feedback text into the fusion strategy prompt template to obtain the fusion strategy prompt text;
[0080] After the intent reasoning model analyzes the user's question text and generates the answer strategy information, it can call the domain-specific models corresponding to each target intent. These models are responsible for generating the corresponding intent task feedback text based on the model input prompt text corresponding to their respective target intent.
[0081] Domain professional models can be models specially trained for specific fields or tasks, or can be obtained by training with a few samples based on a large language model. They can provide accurate and effective information in the corresponding fields and / or professional scopes. Exemplary domain professional models include, but are not limited to, story professional models that are good at telling stories, time professional models that are good at processing time information, chat professional models that are good at chatting with users, customer service professional models that are good at solving problems for users in terms of products or services, weather professional models that are good at providing weather query services, and tourism professional models that provide tourism inquiries, etc. Those skilled in the art can equip one or more such domain professional models as needed, pre-associate each domain professional model with the label of its corresponding intent, and provide a list for calling the corresponding domain professional model through the label. For example, a weather professional model can provide detailed weather forecasts, while a tourism professional model can recommend tourist attractions and activities. In this application, the domain professional model is designed to receive specific and clear model input prompt texts, which are generated by the intention reasoning model, and each model input prompt text contains the key information and requests corresponding to the corresponding target intent in the user's question information.
[0082] Let's continue with the user's question text "I plan to travel to Yunnan in December, do you have any suggestions?". This question has been analyzed by the intent reasoning model and two target intents have been identified: time query (December) and location query (Yunnan). For these two target intents, the system has generated corresponding model input prompt texts as shown in the previous example, which are requesting the weather forecast for Yunnan in December and recommending tourist attractions and activities based on weather conditions.
[0083] These model input prompt texts are then fed into the corresponding domain professional models. The weather professional model analyzes the model input prompt text for time queries and generates a detailed forecast of Yunnan's weather in December, including information such as temperature and precipitation probability, which constitutes the intent task feedback text. The tourism professional model analyzes the model input prompt text for location queries and provides popular tourist attractions and seasonal activities in Yunnan as intent task feedback text.
[0084] Continuing with the previous example, the following are the corresponding results obtained by the two domain-specific models according to their respective model input prompt texts:
[0085] Target Figure 1 : Time query
[0086] Intent task feedback text: "The weather forecast for Yunnan in December 2024 shows that the average temperature for the month is about 15°C, and it is expected to rain for 10 days with a probability of 30%."
[0087] Target Figure 2 : Location search
[0088] Intent task feedback text: "Based on the weather conditions in December, recommended attractions include Lijiang Ancient Town, Naxi culture and history, Cangshan Mountain and Erhai Lake, Cuihu Park, etc."
[0089] The two intention task feedback texts are generated by the weather professional model and the tourism professional model respectively. They provide specific and practical information according to the requirements of the model input prompt text. These feedback texts can then be used to generate the final response text to respond to the user's question. However, it is not difficult for readers to find that if the two feedback texts are simply pieced together as a response text, the response text will be very mechanical and obscure, so it is necessary to use the fusion strategy prompt template to realize the fusion strategy prompt text, and then use the response fusion model to generate a better quality response text.
[0090] The generated intent task feedback text is then inserted into the fusion strategy prompt template, replacing the corresponding preset tags to form a fusion strategy prompt text. The fusion strategy prompt text can guide how to integrate the intent task feedback texts in different fields into a coherent and unified response. As shown in the previous example, the template can stipulate that the weather conditions are introduced first, and then tourist attractions and activities are recommended based on the weather, to ensure that the final response text is comprehensive and logical. The following is the specific content of a fusion strategy prompt text obtained by embedding the intent task feedback texts of professional models in various fields into the fusion strategy prompt template based on the principles suggested by the previous example:
[0091] / / Example fusion strategy prompt text
[0092] Task requirements: Integrate the following intention task feedback texts generated by professional models in different fields to form a travel suggestion that is both logical and meets emotional needs.
[0093] Logical order:
[0094] Weather Overview: First, we will introduce the weather conditions in Yunnan in December, including the average temperature and rainfall probability, to provide basic information for travel plans.
[0095] Travel suggestions: Recommend suitable tourist attractions and activities based on weather conditions, ensuring that the suggestions match the weather conditions.
[0096] Key points:
[0097] Emphasize that Yunnan's mild climate in December is suitable for outdoor activities.
[0098] Users are reminded to prepare appropriate clothing and rain gear to cope with possible rainfall.
[0099] Language style adjustment:
[0100] Maintain a friendly and advisory language style that fits the context of the user seeking travel advice.
[0101] Intent task feedback text list:
[0102] Weather forecast: "The weather forecast for Yunnan in December 2024 shows that the average temperature for the month is about 15°C, and there are expected to be 10 days of rainfall with a probability of 30%."
[0103] Travel recommendations: "Based on the weather conditions in December, recommended attractions include Lijiang Old Town, Naxi culture and history, Cangshan Mountain and Erhai Lake, and Cuihu Park.
[0104] / / End of example
[0105] It should be noted that domain-specific models can be independent modules or components integrated into a larger system. They can be pre-trained large language models or customized models trained specifically for specific tasks. Either way, the selection and design of domain-specific models is to ensure that the system can provide the most accurate and professional information to meet the user's query needs.
[0106] In this way, the system can ensure that the feedback texts generated by each domain professional model are accurate and professional, and integrate these texts into comprehensive and coherent responses to user questions through the guidance of the fusion strategy prompt template. This not only improves the quality of the response, but also improves user satisfaction and the practicality of the system.
[0107] Step S3400: calling the answer fusion model to generate an answer text corresponding to the user's question information based on the fusion strategy prompt text.
[0108] In order to generate the final response text, the fusion strategy prompt text obtained above can be input into a preset response fusion model, and the response fusion model generates a corresponding response text according to the prompt information in the fusion strategy prompt text.
[0109] According to the example of the fusion strategy prompt text in the previous article, suppose that after the fusion strategy prompt text is input into the answer fusion model, the following answer text is obtained:
[0110] "Hello! Here are some suggestions for your plan to travel to Yunnan in December. According to the weather forecast, the average temperature in Yunnan in December is about 15℃, and it is expected to rain for 10 days with a probability of 30%. Therefore, it is recommended that you bring clothes suitable for spring and autumn, and prepare rain gear in case of emergency. In such climatic conditions, it is recommended that you visit the ancient city of Lijiang and experience the Naxi culture and history. At the same time, Cangshan Mountain and Erhai Lake in Dali are also ideal tourist destinations, where you can enjoy the tranquil scenery of lakes and mountains. In addition, December is the best season to watch red-billed gulls, and you can participate in the gull feeding activity in Cuihu Park in Kunming. I hope these suggestions will be helpful for your trip, and I wish you a pleasant journey!"
[0111] By comparing the difference between the answer text of the above example and the two intention task feedback texts generated by the weather professional model and the tourism professional model, it is not difficult to understand that when integrating this information, the answer fusion model also considers the various prompt information in the fusion strategy prompt text. According to the overall requirements of task requirements, logical order, and language style adjustment, the answer text not only complies with the logical association of the narrative captured by the intention reasoning model in the process of decomposing tasks to identify multiple target intentions, but also significantly enriches the emotional color. The answer text also emphasizes the mild climate and suitability of outdoor activities in Yunnan in December based on key information, and reminds users to prepare appropriate clothing and rain gear. In addition, according to the requirements of language style adjustment, the friendly and suggestive nature of the answer is maintained to meet the context of users seeking travel advice. This answer text not only provides the information required by users, but also presents it in a friendly and suggestive language style, which meets the emotional needs of users and makes the answer more humane and satisfactory. In this way, the answer fusion model ensures that the answers generated by the chatbot are both accurate and attractive, improving the user's communication experience.
[0112] The answer fusion model can be based on a pre-trained large language model, such as a model based on the Transformer architecture, llama, etc. These models have been pre-trained on a large amount of text data, thus having a strong ability to understand natural language. The core task of the answer fusion model is to fuse the intent task feedback text generated by multiple domain professional models into a coherent and unified answer based on the fusion strategy prompt text. This requires the model to not only have excellent language understanding capabilities, but also be able to generate natural and accurate answers based on the context.
[0113] In order to make the answer fusion model better adaptable to specific application scenarios, fine-tuning training is usually performed on the basis of pre-training. Fine-tuning training is a process of further optimizing model parameters on specific task data, with the goal of making the model better adaptable to the target task. In the user question answering system, the data for fine-tuning training is usually a set of labeled question-answer pairs, which contain the fusion strategy prompt text as the user's question and the corresponding high-quality answer.
[0114] When fine-tuning, you first need to prepare a labeled training set that includes the above question-answer pairs. Then, input this data into the pre-trained language model and adjust the model parameters to make the model more accurate when processing these specific question-answer pairs. When fine-tuning, you can use a few-sample training method to provide a limited number of question-answer pairs for training, with a small learning rate to avoid drastically changing the knowledge that the pre-trained model has learned, while optimizing for specific tasks.
[0115] During the fine-tuning process, the model learns how to generate responses that are both logical and emotional based on the user's questions and the feedback text generated by the domain-specific model. In this way, the response fusion model can generate more natural, accurate, and user-friendly answers, thereby improving the overall performance and user experience of the user question answering system.
[0116] After fine-tuning training is completed, the response fusion model will be able to prompt texts based on the fusion strategy, and integrate feedback texts from different fields into coherent responses. These responses are not only informative and accurate, but the language style and emotional color also match the user's questions, achieving a high-quality human-computer dialogue experience.
[0117] After the final response text is determined, it can be formatted and packaged through the back-end processing module of the user question response system to adapt to different user interfaces and interaction methods. For example, in a text chat scenario, the response text can be directly displayed in the chat window; in a voice interaction scenario, the response text can be converted into voice first, and then played to the user's terminal device in audio form for playback.
[0118] While presenting the response text to the user, the system also performs data storage operations. This includes storing the user's question text, the response text generated by the chatbot, and the context information of the entire conversation in the database. The stored data is not only used to record historical chat records for subsequent queries and analysis, but also serves as an important resource for optimizing and training chatbot models. For example, by analyzing the historical chat records of user questions and system responses, the intent reasoning model and domain expertise model can be further adjusted and improved to improve the accuracy and naturalness of future conversations.
[0119] It can be seen from the description of the above embodiments that the present application has the following significant technical advantages and beneficial effects:
[0120] First, the present application embeds the user's question information into the preset intention reasoning prompt template to obtain the corresponding intention reasoning prompt text. With the help of the intention reasoning prompt text, the intention reasoning model is controlled to effectively identify and process multiple intentions in the user's question information. This technical solution can decompose the complex requirements in the user's question into multiple target intentions with logical associations, and each target intention can correspond to a task. In order to generate the intention task feedback text corresponding to each task and finally obtain the answer text corresponding to the user's question information, the intention reasoning model is responsible for generating the answer strategy information. The answer strategy information includes not only the model input prompt text corresponding to each task for guiding the corresponding domain professional model to generate the intention task answer text, but also the fusion strategy prompt template determined by reversely deducing the intention task prompt text generated by these domain professional models according to the intention recognition logic. With the help of the fusion strategy prompt template, the intention task feedback text corresponding to each target intention can be organically fused into the final answer text through the answer fusion model. It can be seen that the present application not only improves the accuracy of intention recognition, but also makes the subsequent answer generation more targeted and efficient by generating the fusion strategy prompt template and the model input prompt text, which effectively solves the problem of simple mechanical splicing, lack of logic and coherence of multiple intentions in the prior art.
[0121] Secondly, the application generates the model input prompt text and the corresponding fusion strategy prompt template of the domain professional model corresponding to each target intention in the process of identifying the target intention by the intention reasoning model, so that the intention reasoning model can naturally capture the logical association between each intention and the emotional characteristics in the user's question information during the intention recognition process. Therefore, it is inevitable to ensure that each model input prompt text and the fusion strategy prompt template follow the logical association corresponding to the complex needs in the user's question information, and ensure that each subsequent generation link can respond to the emotional factors expressed in the user's question information. The final generated response text realizes the response to the emotional color in the user's question information, ensuring that the response text can properly reflect and respond to the user's emotional state while responding to the logical association of each target intention in the user's question information. Therefore, the application can not only generate information-rich and logically clear responses, but also adjust the emotional expression of the response text according to the different emotional needs of the user, so that the chat robot's reply is more empathetic and humane, thereby significantly improving the user's satisfaction and communication experience at the emotional intelligence level, and effectively solving the problem of ignoring emotional factors and lack of temperature in the prior art.
[0122] In addition, this application has also significantly improved the efficiency of answer text generation through systematic technical optimization. The intention reasoning model of this application is responsible for generating model input prompt texts corresponding to professional models in various fields and fusion strategy prompt templates corresponding to answer fusion models. This prompt text and prompt template are subsequently used to construct the input of the corresponding model, eliminating a large number of intermediate processing links for preparing prompt texts or prompt templates separately, so that this application can quickly and accurately process multiple intentions in user questions, and efficiently integrate feedback texts from professional models in different fields, reducing unnecessary calculations and waiting time, so that the chatbot can generate high-quality answer texts in a short time, so that the system composed of each model can generate answer texts in a highly end-to-end manner, effectively solving the problem of low answer generation efficiency and inability to quickly respond to user questions in the prior art.
[0123] Based on any embodiment of the method of the present application, a preset intention inference model is called, and response strategy information is generated based on the intention inference prompt text, including steps S3210 to S3240 executed by the intention inference model. To facilitate understanding of this process, it is assumed that the specific content of the intention inference prompt text is as follows:
[0124] / / Start of example
[0125] Task description: Please analyze the following user questions and identify all the intents contained in them. For each identified intent, generate the corresponding model input prompt text and build a fusion strategy prompt template to fuse the feedback texts in various fields into a unified response text.
[0126] User question: I am going to Beijing on a business trip next week. What kind of clothes should I wear? What is the weather like there? Please also recommend some must-see attractions.
[0127] Intent recognition: Identify the intent in questions, including clothing suggestions for business trips, weather forecasts, and recommendations for tourist attractions.
[0128] Model input hint text generation: Generate explicit model input hint text for each intent.
[0129] -Clothing suggestions: Generates a request for weather conditions and clothing suggestions for Beijing next week.
[0130] -Weather query: Generates a request for the weather forecast for Beijing next week.
[0131] - Attractions recommendation: Generate a request to recommend must-see attractions in Beijing.
[0132] Fusion strategy prompt template generation: Construct a fusion strategy prompt template to integrate clothing suggestions, weather forecasts, and attraction recommendations into a coherent response text.
[0133] / / End of example
[0134] In the above example, the semantics provided by the "task description" part can respectively play the role of logical reasoning control instructions, task intent recognition instructions, task prompt generation instructions, and fusion strategy generation instructions, while the semantics provided by information such as intent recognition, model input prompt text generation, and fusion strategy prompt template generation can play the role of enhancing the corresponding instructions. It can be seen that in this embodiment, the intent reasoning prompt text inherited from the intent reasoning prompt template can be used to carry logical reasoning control instructions, task intent recognition instructions, task prompt generation instructions, and fusion strategy generation instructions, thereby controlling the intent reasoning model to generate corresponding response strategy information.
[0135] The following will combine this exemplary intention inference prompt text to more vividly illustrate how steps S3210 to S3240 are implemented.
[0136] Step S3210: decomposing the complex requirements contained in the user's question information into multiple tasks with logical associations according to the logical reasoning control instructions in the intention reasoning prompt text;
[0137] The intention reasoning model mainly decomposes the complex requirements in the user's question into multiple tasks with logical associations based on the logical reasoning control instructions contained in the semantics provided in the "task description" section. For example, a user asks "I am going to Beijing on a business trip next week. What clothes should I wear? What's the weather like there? Please recommend some must-see attractions." It contains three subtasks: clothing suggestions, weather forecasts, and tourist attraction recommendations. The model will identify these subtasks and prepare corresponding processing procedures for each task.
[0138] Step S3220, according to the task intention recognition instruction in the intention reasoning prompt text, determine the target intention corresponding to each task based on the deep semantics of the user question information;
[0139] The model combines the semantics of the "task description" part and mainly determines the implicit task intent recognition instructions based on the semantics provided by the "intention recognition" part, and deeply analyzes the deep semantics of each task to determine the specific target intent of each task. For example, for the clothing recommendation task, the model will recognize that the user needs to get clothing recommendations based on the climate conditions in Beijing next week; for the weather forecast task, the model will recognize that the user needs to understand the specific weather conditions in Beijing next week; for the tourist attraction recommendation task, the model will recognize that the user needs to get travel recommendations in Beijing.
[0140] Step S3230, generating a model input prompt text corresponding to each task according to the task prompt generation instruction in the intention reasoning prompt text;
[0141] The model combines the semantics of the "task description" part and mainly determines the implicit task prompt generation instructions based on the semantics of the "model input prompt text generation" part, and generates the corresponding model input prompt text for each task. These texts will serve as input to the domain professional model to generate specific feedback. For example, the model may generate the following text:
[0142] Clothing suggestions: Request for weather conditions and clothing suggestions for Beijing next week.
[0143] Weather query: Request the weather forecast for Beijing next week.
[0144] Attractions recommendation: Request recommendations for must-see attractions in Beijing.
[0145] Step S3240, generate a fusion strategy prompt template according to the fusion strategy generation instructions in the intention reasoning prompt text, and the fusion strategy prompt template is used to guide the response fusion model to correspond to the complex requirements, and fuse the intention task feedback texts generated by the domain professional models corresponding to each task into the response text. The intention task feedback text is generated by the domain professional model based on the model input prompt text of the corresponding task.
[0146] The model combines the semantics of the "task description" part and mainly constructs a fusion strategy prompt template based on the fusion strategy generation instructions contained in the semantics of the "fusion strategy prompt template generation" part.
[0147] The intention task feedback text obtained by the professional models in various fields can be replaced into the fusion strategy prompt template, and finally the fusion strategy prompt text of the following example is obtained:
[0148] / / Fusion strategy prompt template example starts
[0149] Task requirements: Integrate the following intention task feedback texts generated by professional models in different fields to form a travel suggestion that is both logical and meets emotional needs.
[0150] Logical order:
[0151] 1. Weather Overview: First, introduce Beijing's weather forecast for next week, including temperature range, rainfall probability, etc., to provide basic information for travel plans.
[0152] 2. Clothing suggestions: Provide clothing suggestions based on the weather forecast, such as recommending to bring clothes suitable for spring and autumn, and prepare rain gear in case of emergency.
[0153] 3. Travel recommendations: Based on weather conditions, recommend suitable tourist attractions and activities, ensuring that the recommendations match the weather conditions.
[0154] Information highlights:
[0155] -Highlight Beijing's climatic conditions next week, such as moderate temperatures, suitable for outdoor activities.
[0156] -Remind users to prepare appropriate clothing and rain gear according to the weather forecast.
[0157] Language style adjustment:
[0158] - Maintain a friendly and advisory tone that fits the context of the user seeking travel advice.
[0159] Intent task feedback text list:
[0160] - Clothing advice feedback text: "According to Beijing's weather forecast for next week, it is recommended to bring a light jacket and rain gear as light rain is expected."
[0161] - Weather query feedback text: "Beijing's weather forecast for next week shows that the temperature will be between 15℃ and 20℃, with a 60% probability of rainfall."
[0162] -Feedback text for attraction recommendations: "Due to weather conditions, we recommend that you visit indoor attractions such as the Palace Museum, and the Summer Palace during sunny hours."
[0163] / / End of fusion strategy prompt template example
[0164] This fusion strategy prompt text will guide the answer fusion model on how to integrate the feedback texts generated by professional models in different fields into a coherent answer text. The template will explain in detail how to organize the final answer based on logical associations and semantic relationships to ensure that the answer is both comprehensive and accurate.
[0165] Through this series of steps, the intention inference model can effectively process complex questions from users and generate accurate response strategy information, thus providing a solid foundation for subsequent response generation. This approach not only improves the accuracy and relevance of responses, but also improves user experience, allowing chatbots to communicate with users more intelligently and naturally.
[0166] Based on any embodiment of the method of the present application, calling the answer fusion model, generating the answer reply information corresponding to the user question information based on the fusion strategy prompt text, including the answer fusion model performing the following steps:
[0167] Step S3410: Optimize the text quality of each intention task feedback text according to the text optimization strategy in the fusion strategy prompt text, and obtain each optimized feedback text accordingly;
[0168] For ease of understanding, this embodiment continues to use the fusion strategy prompt text of the previous embodiment for further explanation.
[0169] The answer fusion model first optimizes the feedback text of each intent task according to the text optimization strategy in the fusion strategy prompt text. The text optimization strategy involves improving the readability, accuracy and relevance of the text, ensuring that each feedback text is logically coherent, linguistically smooth, and consistent with the context of the user's question.
[0170] The text optimization strategy is embodied by integrating the semantics provided by certain parts of the strategy prompt text. For example, in the previous embodiment, the corresponding parts with the text optimization strategy semantics, mainly the "task requirements" and "logical order" parts, provide guidance on how each feedback text should be organized and presented, which helps the model identify and strengthen the key information points of each feedback text, while the "information focus" part guides the model to highlight the most important information, such as weather conditions, clothing suggestions, etc., which helps to improve the relevance and usefulness of the text.
[0171] Step S3420: According to the text fusion strategy in the fusion strategy prompt text, semantically fuse each optimization feedback text according to the logical association relationship between each target intention identified by the intention reasoning model to obtain a fused feedback text;
[0172] Next, the model semantically fuses the optimized feedback texts according to the text fusion strategy in the fusion strategy prompt text. This step requires the model to understand the logical connections between different feedback texts and integrate them into a unified narrative.
[0173] The text fusion strategy is reflected through the semantics provided by certain parts of the fusion strategy prompt text. For example, in the previous embodiment, the corresponding part with the text fusion strategy semantics mainly includes two parts: "logical order" and "intent task feedback text list". Among them, the "logical order" part clarifies how the various feedback texts should be arranged in sequence, which helps the model determine the order of text fusion. The "intent task feedback text list" provides specific feedback texts generated by professional models in various fields. The model fuses these texts according to the specified logical order and relationship.
[0174] Step S3430: According to the context adjustment strategy in the fusion strategy prompt text, adjust the text expression in the fusion feedback text to obtain a response text, so that the response text is coordinated with the event logic and emotional color in the context information provided by the user question information.
[0175] Finally, the model adjusts the fused feedback text according to the contextual adjustment strategy in the fusion strategy prompt text to ensure that the final response text is consistent with the event logic and emotional color in the context information of the user's question.
[0176] The context adjustment strategy is reflected by integrating the semantics provided by certain parts of the strategy prompt text. For example, in the previous embodiment, the corresponding part with the context adjustment strategy semantics is mainly in the "language style adjustment" part, which guides the model on how to adjust the language style to meet the emotional needs and context of the user's question, which helps the model generate more natural responses that are closer to user expectations.
[0177] According to the fusion strategy prompt text of the previous embodiment, after being processed by the response fusion model, the specific content of the exemplary response text can be obtained as follows:
[0178] "Hello! According to the weather forecast for Beijing next week, it is recommended that you bring a light coat and rain gear, as light rain is expected and the temperature will be between 15℃ and 20℃. In such climatic conditions, the Palace Museum is a good choice, where you can enjoy the rich historical relics comfortably indoors. If it is sunny, the lake and mountain scenery of the Summer Palace is not to be missed. I hope these suggestions can make your business trip more enjoyable!"
[0179] Obviously, compared with the simple mechanical splicing of the original intention task feedback text of professional models in various fields, this response text more effectively reflects the coordination of event logic and emotional color. It not only provides practical information, but also takes into account the emotional needs of users, making the response more humane and empathetic.
[0180] This embodiment mainly benefits from the efficient operation of the intention reasoning model and the precise guidance of the fusion strategy prompt template. With the help of the fusion strategy prompt template in the answer strategy information of the intention reasoning model, the model input prompt text is automatically and quickly generated. The fusion strategy prompt text further ensures that the feedback text obtained from professional models in various fields can be organically integrated, guiding the answer fusion model to form a logically coherent, information-rich and emotionally coordinated high-quality answer text. This process not only improves the speed and accuracy of answer generation, but also improves the naturalness of the answer and user satisfaction, allowing the chatbot to provide a more humane and empathetic dialogue service, representing an important advancement in dialogue system technology in the field of artificial intelligence.
[0181] On the basis of any embodiment of the method of the present application, user question information generated by the dialogue between the user and the chat robot is obtained, and the user question information is inserted into a preset intention reasoning prompt template to obtain an intention reasoning prompt text, including:
[0182] Step S3110: In response to a user question event, historical chat records generated by questions and answers between the chat robot and the user are obtained according to a preset conversation cycle, wherein the historical chat records include multiple rounds of conversations, and each round of conversation includes a question text submitted by the user and a corresponding answer text output by the chat robot;
[0183] When a user submits a question through the chat interface, the system triggers an event handler. The program actively obtains the historical chat records between the chatbot and the user according to the preset conversation cycle. The conversation cycle can be set flexibly, either according to the number of conversation rounds of human-computer dialogue, such as the first 30 rounds of conversation data, or according to the duration, such as the first 30 minutes. The historical chat record is a collection of multiple rounds of conversations, each of which includes the user's question text and the chatbot's answer text. The purpose of obtaining historical chat records is to provide rich context information for the current user's question, so as to more accurately understand the user's true intention.
[0184] Step S3120: splicing the question text carried in the user question event with the historical chat record to form user question information;
[0185] After obtaining the historical chat records, the question text carried in the current user question event is spliced with these historical chat records to form complete user question information, which not only includes the user's latest question, but also combines the previous conversation content. This splicing method allows the system to consider the continuity and relevance of user questions, thereby more comprehensively understanding user needs.
[0186] Step S3130: call the intention reasoning prompt template, replace the preset label in the intention reasoning prompt model with the user question information, and obtain the intention reasoning prompt text.
[0187] Finally, the preset intention reasoning prompt template is called. This template contains structured information used to guide the intention reasoning model to understand the user's question. The system replaces the preset tags in the template with the relevant content in the user's question information to generate the intention reasoning prompt text. This text is the input of the intention reasoning model in the subsequent steps, which directly affects the generation of the response strategy information.
[0188] This embodiment provides a more comprehensive and in-depth method for understanding user intent by combining historical chat records and current user questions. This method not only improves the accuracy of intent recognition, but also enhances the relevance and personalization of the response text. By using the intention reasoning prompt template, the system is able to generate more accurate response strategy information, thereby generating a more natural and user-friendly response text. In addition, this method also improves the efficiency of response text generation because it reduces the need for additional data processing, allowing the system to respond quickly to user questions. In general, this embodiment significantly improves the performance and user experience of the chatbot by comprehensively utilizing historical conversation data and current questions.
[0189] Based on any embodiment of the method of the present application, calling the domain professional models corresponding to each target intent, so that each domain professional model inputs a prompt text according to the model corresponding to its target intent, and generates a corresponding intent task feedback text, including:
[0190] Step S4100: Determine the domain professional model corresponding to each target intent from the preset domain professional model list information;
[0191] In this embodiment, a mapping relationship is established between each prepared domain professional model and the intent label in advance and stored in a database to provide domain professional model list information. Accordingly, according to the target intent identified by the user's question information, the corresponding domain professional model is determined from the preset domain professional model list information.
[0192] Step S4200: When there is a target intent for which a corresponding domain professional model cannot be determined from the domain professional model list information, a preset general model is called as the domain professional model corresponding to the target intent;
[0193] Although domain-specific models can provide highly specialized answers, sometimes there are cases where the target intent cannot be directly mapped to a specific domain-specific model. In this case, a preset general model can be called. This general model is also a multi-purpose model based on a large language model, which can handle multiple types of questions. Although it may not be as professional as a professional model, it can provide basic and general answers to ensure that the system can give corresponding intent task feedback text for all types of user question information.
[0194] Step S4300: input the model input prompt text corresponding to each target intent into the domain professional model corresponding to the target intent to obtain the corresponding intent task feedback text.
[0195] Once the domain-specific or general model that handles each target intent is determined, the system will input the model input prompt text corresponding to the target intent into the selected model. The model input prompt text contains the key information and context of the user's question, allowing the domain-specific model to generate a detailed and accurate feedback text based on this information. This feedback text is the direct answer to the intent task, which will be used to construct the final response text.
[0196] This embodiment ensures comprehensive coverage and efficient processing of user questions by combining domain-specific models and general models. Domain-specific models can provide in-depth and accurate answers, while general models ensure adaptability to unknown or ambiguous intents. In addition, through precise model input prompt text, each model can generate high-quality feedback, thereby improving the overall conversation experience. This strategy of combining professional and general processing capabilities not only improves the accuracy and professionalism of responses, but also enhances the robustness of the system and user satisfaction. Compared with other embodiments that rely only on professional models or lack flexible processing mechanisms, this embodiment demonstrates its obvious advantages in handling diverse user intentions, especially in scenarios that require expertise and flexible adaptability.
[0197] Based on any embodiment of the method of the present application, calling the domain professional models corresponding to each target intent, so that each domain professional model inputs a prompt text according to the model corresponding to its target intent, and generates a corresponding intent task feedback text, including:
[0198] Step S5100: When the target intent is a time-related intent, determine a time professional model as the corresponding domain professional model, and replace the time information dynamic label carried by the model input prompt text corresponding to the target intent with the real-time time information;
[0199] When the user's question is identified as a time-related intent, the system will determine a time-specific model to handle such requests. In this embodiment, the time-specific model is a domain-specific model designed specifically for processing time-related queries. In order to cooperate with the work of the time-specific model, the intent reasoning prompt template can also add a guiding intent reasoning model to add a time information dynamic tag to the model input prompt text corresponding to the time-specific model. Then, the system will replace the time information dynamic tag (such as "{current_time}") in the model input prompt text with real-time time information. This dynamic replacement ensures the accuracy and real-time nature of the time information, so that the intent task feedback text generated by the time-specific model can reflect the current actual time status.
[0200] Step S5200: Determine a target time calculation plug-in that matches the time task information according to the time task information derived from the user's question information in the model input prompt text carrying the real-time time information;
[0201] Since the corresponding target intent is a time-related intent, the model input prompt text will also include time task information derived from the user's question information. For example, for "Please determine the weather conditions in Guangzhou 3 days later", the time task information corresponding to the date 3 days from today is provided. Therefore, time calculation is required to determine the date 3 days later. At this time, it is necessary to determine the target time calculation plug-in corresponding to the date calculation.
[0202] Time calculation plugins are modules designed to handle specific types of time calculations. They can include but are not limited to the following:
[0203] Date calculation plug-in: used to calculate future dates or past dates, such as "3 days later" or "1 month ago".
[0204] Time difference calculation plug-in: calculate the difference between two time points, such as "remind me 30 minutes before the meeting starts".
[0205] Holiday Calculation Plugin: Determine if a specific date is a public holiday or a working day.
[0206] Time zone conversion plug-in: handles time conversion issues across time zones.
[0207] It is not difficult to understand that by analyzing the keywords and context in the model input prompt text, the required time calculation type can be determined, thereby determining the corresponding target time calculation plug-in. For example, suppose the user asks "When is the National Day?", and the model input prompt text contains the time task information "Determine the date of the National Day". The system will select the holiday calculation plug-in to handle this request.
[0208] Step S5300, calling the target time calculation plug-in to calculate the time result information based on the specific time information in the time task information, and adding it to the time task information in the model input prompt text;
[0209] After the target time calculation plug-in is determined, the system will call the plug-in and pass in specific time information, such as the current date in the real-time information and the date of a specific event in the time task information. The time calculation plug-in will calculate the required time results based on this information and add this result information to the model input prompt text, making the instruction information provided by the model input prompt text more direct and accurate.
[0210] Step S5400: The time professional model generates a corresponding intention task feedback text according to the model input prompt text containing the time result information.
[0211] The model input prompt text received by the time professional model has been subjected to necessary time calculations by the target time calculation plug-in, and contains specific time information such as the current date, the date of a specific event, etc. This time result information enables the time professional model to generate an accurate, specific and direct response to the user's question.
[0212] According to the processing of this implementation, if a user asks "What is the weather forecast in 3 days?", the model input prompt text will contain the specific information "date in 3 days" after being processed by the time calculation plug-in. The time professional model generates a detailed weather forecast feedback text based on this date and real-time weather data, such as "3 days later, that is, May 29, 2024, the weather forecast in Guangzhou shows cloudy, with a temperature between 22℃ and 28℃."
[0213] This embodiment significantly improves the accuracy and efficiency of time-related intent processing through precise time information processing and dynamic time calculation plug-in calls. By directly integrating real-time time information and time calculation results into the model input prompt text, the system can generate more accurate and direct replies. This method not only improves the accuracy and relevance of replies, but also optimizes the user experience, especially in scenarios that require precise time and date calculations. Compared with other embodiments that may rely on static time data or cannot handle complex time calculations, this embodiment demonstrates its unique advantages in automated and intelligent processing of time-related issues, providing users with more reliable and convenient services. In addition, through real-time updates and precise calculations, the system ensures the timeliness and accuracy of replies, further enhancing user trust and satisfaction.
[0214] On the basis of any embodiment of the method of the present application, in the step of calling the domain professional models corresponding to each target intent, making each domain professional model input a prompt text according to the model corresponding to its target intent, and generating the corresponding intent task feedback text, when the target intent is a chat intent, calling the chat expert model as the corresponding domain professional model, wherein the training process of the chat expert model includes:
[0215] Step S6100: calling an external large language model, generating multiple rounds of dialogue data according to preset character setting labels and data type labels, and obtaining optimized dialogue data generated by correcting the character setting style of the multiple rounds of dialogue data;
[0216] In order to train a chat expert model by ourselves, we need to prepare corresponding training samples. Each training sample is composed of multiple rounds of conversation data. These multiple rounds of conversation data can be automatically generated with the help of an external mature large language model to improve preparation efficiency.
[0217] By calling an external large language model to generate multiple rounds of conversation data, preset character labels and data type labels can be provided to the external large language model to ensure that the generated conversation data conforms to specific character settings and content styles. Character labels can include personality traits, language style, knowledge areas, etc., while data type labels involve the topic or scene of the conversation. For example, if the chat expert model is designed to be a friendly and knowledgeable virtual assistant, the system will generate conversation data using corresponding character labels and data type labels to reflect this setting.
[0218] For the multi-round dialogue data generated by the external large language model, other manual or automatic technical means can be used to correct the character style, optimize the specific text, obtain the tuned dialogue data, and use the tuned dialogue data as the actual training sample. It can be seen that the purpose of this step is to create a diverse and consistent dialogue data set to provide a basis for subsequent training.
[0219] Step S6200: fine-tune the pre-trained basic large language model using the tuned dialogue data;
[0220] Fine-tuning the pre-trained basic large language model using the training samples of the tuning dialogue data reserve can achieve the process of optimizing the basic large language model. By further training the model on a specific data set composed of these training samples, it can be better adapted to the target task. The goal of training is to enable the basic large language model to reflect a specific personality style while maintaining general language understanding capabilities.
[0221] Step S6300: Generate multiple rounds of dialogue data in the test phase using the fine-tuned basic large language model and obtain corresponding scoring information;
[0222] In order to evaluate whether the basic large language model is suitable for serving as a professional chat model, the fine-tuned basic large language model is used to generate multi-round dialogue data in the test phase. By providing the basic large language model with corresponding character labels and data type labels, the generated test dialogues will cover a variety of scenarios and topics.
[0223] After the conversation is generated, it will enter the scoring stage. The scoring process can be done manually or through an automated scoring system. The scoring criteria usually include the naturalness, fluency, accuracy, relevance of the conversation, and whether it conforms to the preset personality style. In addition, the scoring of conversation security and compliance can be added according to business needs. Finally, the scoring information corresponding to each round of conversation data is obtained. The scoring information can be quantified into a single value.
[0224] Step S6400, iteratively train the basic large language model according to the scoring information, so that the basic large language model can achieve model optimization according to the evaluation information, and obtain a chat expert model, which is suitable for generating intention task feedback text of corresponding style according to the model input prompt text embedded with the user's preset personality label.
[0225] Based on the data of each multi-round dialogue and its scoring information, the basic large language model can be iteratively trained. Through iterative training, the parameters of the model can be adjusted to improve its poor performance in the test. For example, if the model scores low when handling complex dialogue scenarios, more similar dialogue samples can be added to the training sample set, or the model's learning rate and optimization algorithm can be adjusted to improve its ability to handle complexity.
[0226] During the iterative training process, the performance of the model can be continuously monitored to ensure that it can achieve the expected results in various conversation scenarios. The number of iterations can be multiple, and a new round of testing and scoring will be carried out after each iteration until the model reaches a satisfactory level in all key indicators. Ultimately, the chat expert model obtained through this process will be able to generate consistent and high-quality conversation responses based on the user's preset personality labels.
[0227] In addition, in order to ensure the practicality and security of the chat expert model, a series of compliance tests can be conducted on the model, including but not limited to preventing the generation of inappropriate content and protecting user privacy. These tests will be used as part of iterative training to ensure that the model can comply with relevant laws, regulations and ethical standards in actual applications.
[0228] Through the above iterative training process, the chat expert model will be able to understand and respond to user needs more accurately, providing a more natural, smooth and personalized conversation experience. This process not only improves the performance of the model, but also enhances its adaptability and reliability in a variety of chat scenarios.
[0229] This embodiment automatically generates multiple rounds of dialogue data by using preset personality labels and data type labels, which not only improves the efficiency of data preparation, but also ensures the diversity and style consistency of training samples. The combination of fine-tuning training and iterative training enables the model to accurately adapt to specific chat scenarios and personality styles, and generate natural, smooth and expected dialogue responses. In addition, through continuous testing and scoring, the model is continuously optimized on key performance indicators to ensure its efficiency and accuracy in practical applications. Ultimately, the chat expert model obtained in this embodiment shows obvious advantages in providing high-quality user interaction experience, and also shows excellent capabilities in handling complex conversations and maintaining conversation security, all of which greatly enhance the application potential and user satisfaction of chatbots in diverse chat scenarios.
[0230] On the basis of any embodiment of the method of the present application, the domain professional model includes a customer service professional model, which can be used to provide customer service related to the application itself or the products or services provided by the application, such as answering questions about the products on sale for the anchor user in the live broadcast application, or answering questions about the use of the chat robot in the chat companion, etc. The customer service professional model can retrieve and expand more background knowledge based on the preset knowledge base, thereby enriching the model input prompt text generated by the intention reasoning model. For example, when the intention reasoning model generates the model input prompt text "How to maintain this dress daily" corresponding to the customer service professional model, each keyword can be identified, and based on the semantic vectors corresponding to these keywords, vector similarity matching is performed with the semantic vectors of each preset background knowledge in the preset knowledge base to obtain background knowledge matching the model input prompt text, and then these background knowledge are merged into the model input prompt text and input into the customer service professional model to obtain the corresponding intention task feedback text.
[0231] This embodiment significantly improves the application efficiency of chatbots in the field of customer service by integrating a professional customer service model and utilizing the rich background knowledge of a preset knowledge base. Compared with other embodiments, it can not only accurately identify and respond to users' service needs, but also extract and integrate relevant background knowledge from the knowledge base through keyword matching and semantic vector similarity retrieval, thereby generating more comprehensive and in-depth responses. This strategy, which combines intention reasoning and knowledge base expansion, not only improves the accuracy and amount of information in responses, but also makes chatbots more adept at handling complex customer inquiries, providing users with a richer and more personalized service experience. In addition, through continuous interaction and learning, the professional customer service model can be continuously optimized to better adapt to changing user needs and business scenarios, demonstrating its unique technical advantages in improving customer service quality and efficiency.
[0232] Based on any embodiment of the method of the present application, the final response text can also be post-processed to further improve the quality of the response text and improve the accuracy, fluency and user satisfaction of the reply finally pushed to the user. Accordingly, any one or more of the following steps can be used for corresponding processing as needed:
[0233] Language correction step: The response text is processed through the language correction step to automatically correct any grammatical errors, spelling errors or incorrect punctuation to ensure the professionalism and readability of the response.
[0234] Style optimization step: To maintain consistency with the chatbot’s persona, a further check is performed to ensure that the style and tone of the text matches the persona or image that the user expects.
[0235] Information accuracy verification step: used to verify the factual information in the response and ensure that the data provided to the user is accurate.
[0236] Sensitive content filtering step: used to screen the response text to ensure that the response does not contain any inappropriate, offensive or illegal information.
[0237] Length optimization step: Adjust the length of your response based on the complexity of the user's question to ensure that the response is neither too short nor too long.
[0238] Keyword and phrase highlighting step: used to increase the user's attention to important information. To this end, the keywords in the response text are identified and highlighted so that the response text can display the corresponding keywords with brightness in the user-side terminal device.
[0239] Security review steps: Before the text is output, the response text is checked for compliance to ensure that the response content complies with laws, regulations and platform policies.
[0240] It can be seen that through these post-processing steps, the response text generated by the chatbot can be fully optimized before being provided to the user, ensuring the quality of the response, improving the user experience, and enhancing the reliability and effectiveness of the chatbot.
[0241] See also Figure 3According to one aspect of the present application, a user question answering device is provided, comprising a question preparation module 3100, an analysis and coordination module 3200, a domain generation module 3300, and a fusion optimization module 3400, wherein the question preparation module 3100 is configured to obtain user question information generated by a conversation between a user and a chat robot, and insert the user question information into a preset intention reasoning prompt template to obtain an intention reasoning prompt text; the analysis and coordination module 3200 is configured to call a preset intention reasoning model, and generate answer strategy information based on the intention reasoning prompt text, wherein the answer strategy information includes a fusion strategy prompt template, a target intention contained in the user question information, and a corresponding model input prompt text; the domain generation module 3300 is configured to call a domain professional model corresponding to each target intention, so that each domain professional model generates a corresponding intention task feedback text according to the model input prompt text corresponding to its target intention, and inserts each intention task feedback text into the fusion strategy prompt template to obtain a fusion strategy prompt text; the fusion optimization module 3400 is configured to call the answer fusion model, and generate an answer text corresponding to the user question information based on the fusion strategy prompt text.
[0242] Based on any embodiment of the device of the present application, the intention reasoning model includes: an associated task decomposition module, which is configured to decompose the complex requirements contained in the user question information into multiple tasks with logical associations according to the logical reasoning control instructions in the intention reasoning prompt text; a task intention determination module, which is configured to determine the target intention corresponding to each task based on the deep semantics of the user question information according to the task intention identification instructions in the intention reasoning prompt text; a task prompt generation module, which is configured to generate a model input prompt text corresponding to each task according to the task prompt generation instructions in the intention reasoning prompt text; a fusion template generation module, which is configured to generate a fusion strategy prompt template according to the fusion strategy generation instructions in the intention reasoning prompt text, and the fusion strategy prompt template is used to guide the response fusion model to correspond to the complex requirements, and fuse the intention task feedback texts generated by the domain professional models corresponding to each task into a response text, and the intention task feedback text is generated by the domain professional model based on the model input prompt text of the corresponding task.
[0243] Based on any embodiment of the device of the present application, the response fusion model includes: a text quality optimization module, which is configured to optimize the text quality of each intention task feedback text according to the text optimization strategy in the fusion strategy prompt text, and obtain each optimized feedback text accordingly; a feedback text fusion module, which is configured to semantically fuse each optimized feedback text according to the logical association relationship between each target intention identified by the intention reasoning model according to the text fusion strategy in the fusion strategy prompt text, and obtain a fused feedback text; a context adjustment optimization module, which is configured to adjust the text expression in the fused feedback text according to the context adjustment strategy in the fusion strategy prompt text to obtain a response text, so that the response text is coordinated with the event logic and emotional color in the context information provided by the user question information.
[0244] Based on any embodiment of the device of the present application, the question preparation module 3100 includes: a historical data calling module, which is configured to respond to a user question event, and obtain the historical chat records generated by the question and answer between the chat robot and the user according to a preset conversation cycle, wherein the historical chat records include multiple rounds of dialogues, and each round of dialogue includes a question text submitted by the user and a corresponding answer text output by the chat robot; a question information construction module, which is configured to splice the question text carried in the user question event with the historical chat record to form user question information; and an inference prompt construction module, which is configured to call an intention inference prompt template, and replace the preset label in the intention inference prompt model with the user question information to obtain the intention inference prompt text.
[0245] Based on any embodiment of the device of the present application, the domain generation module 3300 includes: a domain model determination module, which is configured to determine the domain professional model corresponding to each target intent from the preset domain professional model list information; an exception model determination module, which is configured to call the preset general model as the domain professional model corresponding to the target intent when there is a target intent for which the corresponding domain professional model cannot be determined from the domain professional model list information; a domain model execution module, which is configured to input the model input prompt text corresponding to each target intent into the domain professional model corresponding to the target intent, so as to obtain the corresponding intent task feedback text.
[0246] Based on any embodiment of the device of the present application, the domain generation module 3300 includes: a real-time information determination module, which is configured to determine a time professional model as the corresponding domain professional model when the target intention is a time-related intention, and replace the time information dynamic label carried by the model input prompt text corresponding to the target intention with real-time time information; an operation plug-in matching module, which is configured to determine a target time operation plug-in that matches the time task information based on the time task information derived from the user question information in the model input prompt text carrying real-time time information; a time information operation module, which is configured to call the target time operation plug-in to calculate the time result information based on the specific time information in the time task information, and add it to the time task information in the model input prompt text; a time model execution module, which is configured to generate a corresponding intention task feedback text by the time professional model according to the model input prompt text containing the time result information.
[0247] On the basis of any embodiment of the device of the present application, in the domain generation module 3300, when the target intent is a chat intent, a chat expert model is called as the corresponding domain professional model, wherein the training module of the chat expert model includes: a training data determination module, configured to call an external large language model, generate multiple rounds of dialogue data according to preset personality labels and data type labels, and obtain tuned dialogue data generated after the multiple rounds of dialogue data are corrected for personality style; a model training execution module, configured to use the tuned dialogue data to perform fine-tuning training on the pre-trained basic large language model; a scoring information acquisition module, configured to use the basic large language model after fine-tuning training to generate multiple rounds of dialogue data in the test phase, and obtain its corresponding scoring information; a chat model determination module, configured to perform iterative training on the basic large language model according to the scoring information, so that the basic large language model realizes model optimization according to the evaluation information, and obtains a chat expert model, which is suitable for generating an intention task feedback text of a corresponding style according to the model input prompt text embedded with the user's preset personality label.
[0248] Another embodiment of the present application also provides a user question answering device. Figure 4 As shown, a schematic diagram of the internal structure of a user question answering device. The user question answering device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable non-volatile storage medium of the user question answering device stores an operating system, a database, and computer-readable instructions. The database may store an information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a user question answering method.
[0249] The processor of the user question answering device is used to provide computing and control capabilities to support the operation of the entire user question answering device. The memory of the user question answering device may store computer-readable instructions, which, when executed by the processor, may enable the processor to execute the user question answering method of the present application. The network interface of the user question answering device is used to connect and communicate with a terminal.
[0250] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation on the user question answering device to which the present application scheme is applied. The specific user question answering device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0251] In this embodiment, the processor is used to execute Figure 3 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to realize data transmission between user terminals or servers. The non-volatile readable storage medium in this embodiment stores the program code and data required to execute all modules in the user question answering device of this application, and the server can call the program code and data of the server to execute the functions of all modules.
[0252] The present application also provides a non-volatile readable storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the user question answering method of any embodiment of the present application.
[0253] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.
[0254] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0255] In summary, the chatbot technology of this application significantly improves the ability to handle complex user questions by integrating advanced intent reasoning and multi-domain expert models. Using the intent reasoning model, it is possible to accurately identify and respond to multiple user intentions, ensuring the accuracy and relevance of the response. At the same time, by integrating strategic and emotional factors, the naturalness and empathy of the conversation are enhanced, improving the user experience. In addition, the optimized response generation process improves efficiency, allowing the chatbot to quickly provide high-quality interactions, representing a significant advancement in artificial intelligence dialogue system technology.
Claims
1. A method for answering user questions, characterized in that: include: Obtaining user question information generated by the conversation between the user and the chat robot, inserting the user question information into a preset intention reasoning prompt template, and obtaining an intention reasoning prompt text; Calling a preset intention inference model, generating response strategy information based on the intention inference prompt text, wherein the response strategy information includes a fusion strategy prompt template, the target intention contained in the user question information and its corresponding model input prompt text; Calling the domain professional models corresponding to each target intent, making each domain professional model input prompt text according to the model corresponding to its target intent, generating the corresponding intent task feedback text, and inserting each intent task feedback text into the fusion strategy prompt template to obtain the fusion strategy prompt text; The answer fusion model is called to generate an answer text corresponding to the user question information based on the fusion strategy prompt text.
2. The user question answering method according to claim 1, characterized in that: Calling a preset intention inference model to generate response strategy information based on the intention inference prompt text includes executing the following steps by the intention inference model: According to the logical reasoning control instructions in the intention reasoning prompt text, the complex requirements contained in the user's question information are decomposed into multiple tasks with logical associations; According to the task intention recognition instruction in the intention reasoning prompt text, the target intention corresponding to each task is determined based on the deep semantics of the user question information; Generate a model input prompt text corresponding to each task according to the task prompt generation instruction in the intention reasoning prompt text; According to the fusion strategy generation instructions in the intention reasoning prompt text, a fusion strategy prompt template is generated. The fusion strategy prompt template is used to guide the response fusion model to respond to the complex requirements, and fuse the intention task feedback texts generated by the domain professional models corresponding to each task into a response text. The intention task feedback text is generated by the domain professional model based on the model input prompt text of the corresponding task.
3. The user question answering method according to claim 1, characterized in that: Calling the answer fusion model to generate answer reply information corresponding to the user question information based on the fusion strategy prompt text, including the answer fusion model performing the following steps: According to the text optimization strategy in the fusion strategy prompt text, the text quality of each intention task feedback text is optimized to obtain each optimized feedback text accordingly; According to the text fusion strategy in the fusion strategy prompt text, semantically fuse each optimized feedback text according to the logical association relationship between each target intention identified by the intention reasoning model to obtain a fused feedback text; According to the context adjustment strategy in the fusion strategy prompt text, the text expression in the fusion feedback text is adjusted to obtain a response text, so that the response text is coordinated with the event logic and emotional color in the context information provided by the user question information.
4. The user question answering method according to claim 1, characterized in that: Obtain user question information generated by the conversation between the user and the chat robot, and insert the user question information into a preset intention reasoning prompt template to obtain the intention reasoning prompt text, including: In response to a user question event, historical chat records generated by questions and answers between the chat robot and the user are obtained according to a preset conversation cycle, wherein the historical chat records include multiple rounds of conversations, each round of conversation includes a question text submitted by the user and a corresponding answer text output by the chat robot; splicing the question text carried in the user question event with the historical chat record to form user question information; The intention reasoning prompt template is called, and the preset label in the intention reasoning prompt model is replaced by the user question information to obtain the intention reasoning prompt text.
5. The user question answering method according to claim 1, characterized in that: Call the domain professional models corresponding to each target intent, so that each domain professional model can input the prompt text according to the model corresponding to its target intent and generate the corresponding intent task feedback text, including: Determine the domain professional model corresponding to each target intent from the preset domain professional model list information; When there is a target intent for which the corresponding domain professional model cannot be determined from the domain professional model list information, a preset general model is called as the domain professional model corresponding to the target intent; The model input prompt text corresponding to each target intent is input into the domain professional model corresponding to the target intent to obtain the corresponding intent task feedback text.
6. The user question answering method according to any one of claims 1 to 4, characterized in that: Call the domain professional models corresponding to each target intent, so that each domain professional model can input the prompt text according to the model corresponding to its target intent and generate the corresponding intent task feedback text, including: When the target intent is a time-related intent, a time professional model is determined as the corresponding domain professional model, and the time information dynamic label carried by the model input prompt text corresponding to the target intent is replaced with real-time time information; Determine a target time calculation plug-in matching the time task information according to the time task information derived from the user's question information in the model input prompt text carrying the real-time time information; Calling the target time calculation plug-in to calculate the time result information based on the specific time information in the time task information, and adding it to the time task information in the model input prompt text; The time professional model generates corresponding intention task feedback text according to the model input prompt text containing the time result information.
7. The user question answering method according to any one of claims 1 to 5, characterized in that: In the step of calling the domain professional models corresponding to each target intent, making each domain professional model input a prompt text according to the model corresponding to its target intent, and generating the corresponding intent task feedback text, when the target intent is a chat intent, calling the chat expert model as the corresponding domain professional model, wherein the training process of the chat expert model includes: Calling an external large language model, generating multiple rounds of dialogue data according to preset character setting labels and data type labels, and obtaining optimized dialogue data generated by correcting the character setting style of the multiple rounds of dialogue data; Using the tuned dialogue data, fine-tune the pre-trained basic large language model; Use the fine-tuned basic large language model to generate multi-round dialogue data in the test phase and obtain its corresponding score information; The basic large language model is iteratively trained according to the scoring information, so that the basic large language model can achieve model optimization according to the evaluation information to obtain a chat expert model, which is suitable for generating intention task feedback text of corresponding style according to the model input prompt text embedded with the user's preset personality label.
8. A user question answering device, characterized in that: include: A question preparation module is configured to obtain user question information generated by a conversation between a user and a chat robot, and insert the user question information into a preset intention reasoning prompt template to obtain an intention reasoning prompt text; an analysis and coordination module, configured to call a preset intention inference model, and generate response strategy information based on the intention inference prompt text, wherein the response strategy information includes a fusion strategy prompt template, a target intention contained in the user question information, and a corresponding model input prompt text; A domain generation module is configured to call domain professional models corresponding to each target intent, so that each domain professional model generates corresponding intent task feedback text according to the model input prompt text corresponding to its target intent, and inserts each intent task feedback text into the fusion strategy prompt template to obtain the fusion strategy prompt text; The fusion optimization module is configured to call the answer fusion model and generate an answer text corresponding to the user question information based on the fusion strategy prompt text.
9. A user question answering device, comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.
10. A non-volatile readable storage medium, characterized in that: It stores a computer program implemented according to the method described in any one of claims 1 to 7 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
Citation Information
Cited By
Q-Bench large model assisted perception infrared visible image fusion method
CN119648547A
Control method and device for multi-vertical-domain knowledge questions and answers and medium
CN119861995A
Interaction method and device based on large model, intelligent agent and storage medium
CN120706575A
Large model-based interaction method and device, intelligent agent and storage medium
CN120706575B
Training data generation method, equipment and program product
CN120849580A