Answer generation method and device, equipment, medium and program product
By using multiple pre-trained language models in the customer service system to process user query requests, generate and display recommended answers, the problems of insufficient answer generation speed and accuracy are solved, the response speed and generation quality are improved, and customer service efficiency is enhanced.
Patent Information
- Application Number
- CN202411118613.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2026-03-03
AI Technical Summary
The existing customer service system is inadequate in terms of the speed and accuracy of answer generation, which affects user experience and customer service efficiency.
By acquiring the user's query request, multiple pre-trained language models are used to process the target query message, generate multiple recommended answers, and display them synchronously on the client and user sides. Finally, the target answer is selected and displayed.
It improved the speed and accuracy of answer generation, enhanced the efficiency of customer service personnel, and ensured that users received fast and accurate service.
Smart Images

Figure CN121597786A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, specifically to an answer generation method, apparatus, electronic device, computer storage medium, and computer program product. Background Technology
[0002] A customer service system (also known as a customer support system) is a socialized technology system that coordinates personnel, business processes, technology, and strategy. It provides appropriate channels for accessing organizational resources, creates customer and corporate value through interactive communication, and aims to improve service operation capabilities by providing services to meet customer needs and expectations through specific technologies or organizational network configurations.
[0003] In modern enterprise operations, especially in the customer service field, the application of AI (Artificial Intelligence) technology is becoming increasingly important. This is not only related to improving user experience, but also involves how to improve efficiency, reduce costs, and optimize data usage through technology. Summary of the Invention
[0004] This application provides an answer generation method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the speed and accuracy of answer generation.
[0005] A method for generating answers, comprising:
[0006] Obtain a query request sent by the user client, the query request including: a target query message;
[0007] The target query message is displayed synchronously on the client side, and the target query message is processed based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, resulting in multiple recommended answers;
[0008] Multiple recommended answers are displayed simultaneously on the client-side interface.
[0009] The client receives the target answer returned by the client based on multiple recommended answers, and displays the target answer synchronously on the client.
[0010] Accordingly, this application also provides an answer generation apparatus, including:
[0011] The first acquisition unit is used to acquire a query request sent by the user terminal, the query request including: a target query message;
[0012] The processing unit is used to synchronously display the target query message on the client side, and process the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, thereby obtaining multiple recommended answers;
[0013] The first synchronization unit displays multiple recommended answers simultaneously on the client side;
[0014] The second synchronization unit is used to receive the target answer returned by the client based on multiple recommended answers, and to synchronously display the target answer on the client.
[0015] Optionally, in some implementations, the query request further includes: a user identifier corresponding to the user terminal; when the target query message is synchronously displayed on the client terminal, the processing unit is used to:
[0016] Determine the customer service type corresponding to the target query message;
[0017] Assign a corresponding customer service identifier to the user identifier based on the customer service type;
[0018] The target message will be synchronously displayed on the corresponding customer service terminal based on the customer service identifier.
[0019] Optionally, in some embodiments, the apparatus further includes:
[0020] The second acquisition unit is used to acquire the corresponding current session message based on the user identifier and the customer service identifier after the target query message is synchronously displayed on the customer service terminal based on the user identifier and the customer service identifier, and before the target query message is processed based on multiple different pre-trained language models. The current session message includes the target query message and subsequent messages, and the display time of the subsequent messages on the customer service terminal is later than that of the target query message.
[0021] The detection unit is used to detect the integrity of the content of the current session message and obtain the detection result;
[0022] When processing the target query message based on multiple different pre-trained language models, the processing unit is further configured to: perform processing of the target query message based on multiple different pre-trained language models according to the detection results.
[0023] Optionally, in some implementations, when detecting the integrity of the content of the current session message and obtaining a detection result, the detection unit is specifically used for:
[0024] Get the number of question-and-answer message rounds in the current session message;
[0025] If the number of question-and-answer message rounds does not reach the preset number, the detection result is determined to be passed;
[0026] If the number of question-and-answer message rounds does not reach the preset number, the detection result is determined to be unsuccessful.
[0027] Optionally, in some implementations, when processing the target query message based on multiple different pre-trained language models according to the detection results, the processing unit is specifically used for:
[0028] If the detection result is passed, then consecutive messages of the same type in the current session message are merged to obtain the first merged message;
[0029] Based on the user identifier, determine the query message that is closest to the current time from the first merged message, as well as other messages besides the query message;
[0030] The query messages are identified as the target query question, and the other messages are identified as the historical context of the target query question, and then input into the multiple different pre-trained language models respectively.
[0031] Optionally, in some implementations, when processing the target query message based on multiple different pre-trained language models according to the detection results, the processing unit is specifically used for:
[0032] If the detection result is not passed, historical session messages within a preset time period are obtained based on the user identifier;
[0033] The historical session messages and the current session messages are merged to obtain a second merged message;
[0034] Based on the user identifier, determine the query message that is closest to the current time and other messages other than the query message from the second merged message;
[0035] The query messages are identified as the target query question, and the other messages are identified as the historical context of the target query question, and then input into the multiple different pre-trained language models respectively.
[0036] Optionally, in some implementations, when processing the target query message based on multiple different pre-trained language models, the processing unit is further configured to:
[0037] Construct an answer generation task, wherein the answer generation task indicates that the target query message is processed based on multiple different pre-trained language models;
[0038] The answer generation task is added to the corresponding asynchronous message queue for processing.
[0039] Optionally, in some embodiments, each pre-trained language model corresponds to a coroutine, and the pre-trained language model and the coroutine are in one-to-one correspondence; when processing the target query message based on multiple different pre-trained language models, the processing unit is further configured to:
[0040] Construct multiple coroutine tasks, wherein each coroutine task indicates that the target query message is processed based on the corresponding preset training language model invoked by the coroutine.
[0041] Multiple coroutine tasks are launched in parallel.
[0042] Optionally, in some implementations, when the multiple recommended answers are simultaneously displayed on the client side, the first synchronization unit is used to:
[0043] When the completion of any of the coroutine tasks is detected, the recommended answer output by the pre-trained language model corresponding to the coroutine task is obtained;
[0044] Based on the completion time of the coroutine task, the corresponding recommended answer will be displayed synchronously on the client side.
[0045] Optionally, in some implementations, the data structure corresponding to the recommended answer includes: answer status, source type, source type name, answer text, and source information.
[0046] Furthermore, embodiments of this application also provide an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the steps in the answer generation method provided in the embodiments of this application.
[0047] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in the answer generation method provided in embodiments of this application.
[0048] Furthermore, this application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the answer generation method provided in this application.
[0049] This application embodiment acquires a query request sent by a user client, synchronously displays the target query message in the query request on the client-side, and processes the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, resulting in multiple recommended answers; these multiple recommended answers are synchronously displayed on the client-side; the client-side receives the target answer returned based on the multiple recommended answers, and synchronously displays the target answer on the user client. This solution can improve response speed and the quality of generated answers, while also improving the work efficiency of customer service personnel, ensuring that users receive fast and accurate service. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a schematic diagram of a scenario illustrating the answer generation method provided in an embodiment of this application;
[0052] Figure 2 This is a flowchart illustrating the answer generation method provided in an embodiment of this application;
[0053] Figure 3 This is a schematic diagram of an interface of the answer generation method provided in an embodiment of this application;
[0054] Figure 4 This is a schematic diagram of an application scenario of the answer generation method provided in the embodiments of this application;
[0055] Figure 5 This is a schematic diagram illustrating another application scenario of the answer generation method provided in the embodiments of this application;
[0056] Figure 6 This is a schematic diagram of the signaling flow of a recommendation and response system based on message processing and large model fusion provided in an embodiment of this application;
[0057] Figure 7 This is a schematic diagram of an application scenario of the recommendation and reply method based on message processing and large model fusion provided in the embodiments of this application;
[0058] Figure 8 This is a schematic diagram illustrating another application scenario of the recommendation and response method based on message processing and large model fusion provided in this application embodiment;
[0059] Figure 9 This is a schematic diagram illustrating another application scenario of the recommendation and response method based on message processing and large model fusion provided in this application embodiment;
[0060] Figure 10 This is a schematic diagram of the structure of the answer generation device provided in the embodiments of this application;
[0061] Figure 11 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] This application provides an answer generation method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the speed and accuracy of answer generation. The answer generation apparatus can be integrated into an electronic device, which can be a server or a terminal, etc.
[0064] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services, and big data and artificial intelligence platforms. The terminal can be a mobile phone, computer, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0065] For example, see Figure 1 Taking the integration of an answer generation device into an electronic device as an example, the electronic device first obtains the query request sent by the user terminal, which includes the target query message; then, it synchronously displays the target query message on the client terminal and processes the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, resulting in multiple recommended answers; then, it synchronously displays the multiple recommended answers on the client terminal; finally, it receives the target answer returned by the client terminal based on the multiple recommended answers and synchronously displays the target answer on the user terminal.
[0066] It is understood that in the specific implementation of this application, related data such as attribute data, attribute sets and attribute subsets are involved. When the following embodiments of this application are applied to specific products or technologies, permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0067] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0068] This embodiment will describe the answer generation device from the perspective of the answer generation device. The answer generation device can be integrated into an electronic device, which can be a server or a terminal, etc. The terminal can be a mobile phone, computer, intelligent voice interaction device, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to these.
[0069] This application provides an answer generation method, comprising: obtaining a query request sent by a user terminal, the query request including a target query message; synchronously displaying the target query message on a client terminal, and processing the target query message based on multiple different pre-trained language models to obtain answers generated by each pre-trained language model, thereby obtaining multiple recommended answers; synchronously displaying the multiple recommended answers on the client terminal; receiving the target answer returned by the client terminal based on the multiple recommended answers, and synchronously displaying the target answer on the user terminal.
[0070] like Figure 2 As shown, the specific process of this answer generation method is as follows:
[0071] 101. Obtain the query request sent by the user client. The query request includes the target query message.
[0072] In this embodiment, the client is an application or interface in a customer service system that is directed to end users. Users can access the main functions of services or products through the client and communicate and interact with the customer service team. Specifically, the client can provide a Customer Service Interface (CSI), which is the front-end part for user interaction with the customer service team. The CSI may include the following features and components: an access point (such as a "Customer Service" or "Help" button on a website or application), a chat window (providing real-time chat functionality, supporting text communication between users and customer service representatives), a question submission form (a form supporting user submission of questions or requests), a service directory (listing frequently asked questions or service categories), a search function (supporting users to search the customer service knowledge base or previous question answers), account information (supporting the display of account information, such as order history, service records, etc.), interaction history (displaying previous communication records between the user and customer service), and multi-channel support (supporting users to contact customer service through multiple channels, such as telephone, email, and social media).
[0073] Specifically, when a user needs to consult, they can trigger a query request through the customer service interface provided on the user client. For example, the user can enter the target query message in the chat window of the customer service interface and click send to trigger the query request. It should be noted that in this embodiment, the target query message is a query-type message, such as "How to configure the check-in rules?" or "Why can't I set up group management?", etc.
[0074] 102. Display the target query message synchronously on the client side, and process the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, thus obtaining multiple recommended answers.
[0075] In this embodiment, the customer service client (also known as the customer service terminal) refers to a back-end system designed for customer service personnel, used to process user requests, manage user data, and view service records. Specifically, the customer service client provides a conversational interface (such as a dialog box) through which customer service representatives can communicate and interact with users.
[0076] In practical applications, the client and client sides can be implemented through different parts or modules of the same application. For example, an application with an administrator panel can allow users to switch to a client view. Because the client and client sides are usually designed for different use cases and user roles, they may have different interfaces and feature sets even within the same application.
[0077] Specifically, after receiving a query request from a user, the target query message carried in the query request will be synchronously displayed on the client-side. In practice, when a message is sent from the user to the system (i.e., the customer service system), it will be received by a central node. This central node will then forward queries and requests directly related to the customer service representative to the customer service system and display these messages on the client-side's chat interface for manual processing by the customer service representative.
[0078] Simultaneously, upon receiving a query request from a user, the central node forwards the target query message to the data mining service (wwdatamining_svr) for a deeper understanding of the message content. Subsequently, multiple pre-trained language models (such as ChatGLM, WELM, and WELM20B) are invoked to process the target query message, obtaining the corresponding answer generated by each pre-trained language model, resulting in multiple recommended answers. In the customer service system, these pre-trained language models provide more natural and accurate language understanding and generation capabilities, enabling more effective communication with users.
[0079] In one implementation, the query request may further include a user identifier corresponding to the user's client, such as a user ID. When synchronously displaying the target query message on the client side, the following process may be included:
[0080] Determine the customer service type corresponding to the target query message;
[0081] Assign a corresponding customer service identifier to the user identifier based on the customer service type;
[0082] Based on the customer service identifier, the target query message will be displayed synchronously on the corresponding customer service client.
[0083] In this embodiment, customer service types may include full-skill after-sales service, anti-spam after-sales service, pre-sales service, enterprise email processing, and test customer service, etc.
[0084] Specifically, after determining the customer service type corresponding to the target query message, the customer service system will assign a corresponding customer service identifier (such as a customer service ID) to the user identifier based on the customer service type. This will transfer the message from the current user's client to the client of the customer service representative who is specifically handling that type of customer service transaction, and simultaneously display the target query message on that client for the customer service representative to view.
[0085] For example, refer to Figure 3The system will send a prompt to the corresponding customer service representative's client, requesting the representative to confirm whether the current user belongs to a specific customer service type (such as pre-sales service). This allows the representative to verify if the current query falls within their scope of responsibility. If the representative clicks "Confirm," the message from the current user's client will be transferred to the customer service representative's client. If the representative clicks "Deny," the system will re-evaluate the customer service type corresponding to the target query, or the customer service representative can manually transfer the message from the current user's client to a customer service representative's client for a different customer service type.
[0086] In practical implementation, to improve the accuracy of the model's output, it is necessary to ensure a sufficient amount of messages for the pre-trained language model to process. Therefore, before calling the model to generate answers, it is necessary to perform content integrity checks on the messages input to the model. That is, in one embodiment, after the target query message is synchronously displayed on the customer service terminal based on the user identifier and the customer service identifier, and before processing the target query message based on multiple different pre-trained language models, the following process may also be included:
[0087] The current session message is obtained based on the user identifier and the customer service identifier. The current session message includes the target query message and subsequent messages. The subsequent messages are displayed on the customer service side later than the target query message.
[0088] The integrity of the content of the current session message is checked, and the check result is obtained.
[0089] Specifically, when using the model to generate answers, the current session message containing the target query message can be obtained, and the content integrity of the current session message can be checked.
[0090] In one implementation, when checking the integrity of the content of the current session message and obtaining the detection result, the number of question-and-answer message rounds in the current session message can be obtained. If the number of question-and-answer message rounds has not reached a preset number, the detection result is determined to be passed; if the number of question-and-answer message rounds has not reached a preset number, the detection result is determined to be failed. It should be noted that one question and one answer constitutes one round of messages.
[0091] When processing target query messages based on multiple different pre-trained language models, the specific processing can be performed based on the detection results.
[0092] In customer service systems, user-customer service messages may be in a question-and-answer format or involve multiple questions and answers. For cases where content integrity is not an issue, the user-customer service conversation records need to be properly organized to ensure accurate answer recommendations when incorporated into a large model. Specifically, in one implementation, when processing the target query message based on multiple different pre-trained language models according to the detection results, the following process may be included:
[0093] If the detection result is passed, then consecutive messages of the same type in the current session are merged to obtain the first merged message;
[0094] Based on the user identifier, identify the query message that is closest to the current time from the first merged message, as well as other messages besides the query message;
[0095] The query message is identified as the target query question, and other messages are identified as the historical context of the target query question. These are then input into multiple different pre-trained language models.
[0096] The message types can include query messages, answer messages, confirmation messages, notification messages, instruction messages, suggestion messages, greeting messages, reminder messages, and so on.
[0097] In practice, consecutive messages of the same type can be merged within the current session to obtain a first merged message, thereby reducing the total number of messages and simplifying subsequent processing. This merging process not only reduces data redundancy but also makes message processing more efficient. It should be noted that in this embodiment, a continuous interruption is determined when the message type changes or a single session ends.
[0098] Then, the latest query-type message (i.e., the most recent query-type message at the current time) is extracted from the first merged message and identified as the target query question. All other messages in the first merged message, excluding this latest query-type message, are identified as the historical context of the target query question. Finally, the identified target query question and historical context are used as model inputs and fed into multiple different pre-trained language models to obtain the corresponding answers generated by each pre-trained language model, resulting in multiple recommended answers.
[0099] In one embodiment, when processing the target query message based on multiple different pre-trained language models according to the detection results, the following process may be included:
[0100] If the detection result is not passed, historical session messages within a preset time period are obtained based on the user identifier;
[0101] Merge consecutive messages of the same type in historical session messages to obtain a second merged message;
[0102] Based on the user identifier, identify the query message that is closest to the current time from the first merged message, as well as other messages besides the query message;
[0103] The query messages are identified as the target query question, and the other messages and the first merged message are used to determine the historical context of the target query question. These are then input into multiple different pre-trained language models.
[0104] Specifically, if the detection result is unsuccessful, meaning there's a problem with the completeness of the current session message content, it's necessary to backtrack to previous historical session messages to complete the data. This ensures that the number of question-and-answer rounds in the completed session message meets the requirements (e.g., reaching a preset number). Furthermore, consecutive messages of the same type in historical session messages can be merged to obtain a second merged message, thereby reducing the total number of messages and simplifying subsequent processing. Similarly, when the message type changes or a single session ends, it's identified as a continuous interruption.
[0105] Then, the latest query-type message (i.e., the most recent query-type message at the current time) is extracted from the second merged message and identified as the target query question. The other messages in the second merged message, excluding this latest query-type message, are identified as the historical context of the target query question. Finally, the identified target query question and historical context are used as model inputs and fed into multiple different pre-trained language models to obtain the corresponding answers generated by each pre-trained language model, resulting in multiple recommended answers.
[0106] In practical applications, the interaction messages between the user end and the client end (such as the target query message, session message, historical session message, etc. mentioned above) can first undergo parameter validation and request pass-through processing to ensure that all data meets the processing standards.
[0107] In one implementation, the data structure corresponding to the required model output answer can be pre-constructed. That is, the data structure corresponding to the recommended answer may include: answer status, source type, source type name, answer text, and source information, etc. Figure 4 As shown, the data construction (i.e., Record construction) corresponding to the answer output by the model in this embodiment may include the machine answer, the answer status, and the information source; wherein, the machine answer may include the answer status ("1" indicates preparation, "2" indicates completion), the source type, the source type name, the answer text, and the source information (such as title, resource address URL, etc.).
[0108] 103. Display multiple recommended answers simultaneously on the client side.
[0109] Specifically, after obtaining multiple recommended answers, the recommended answers will be displayed simultaneously on the customer service client's chat interface (such as a dialog box) or its associated page for customer service personnel to select or refer to.
[0110] Continue to refer to Figure 3 The system can display a global customer service view on the associated page of the dialog box. This global view can display a smart recommendation page, on which the system can simultaneously display multiple recommended answers. Specifically, it can display the user's latest inquiry (e.g., user query message 1), recommended answers (e.g., answer A, answer B, answer C), the source of each answer, and related information.
[0111] In practice, multiple recommended answers can be intelligently sorted based on their relevance to the target query message or other indicators to help customer service personnel quickly locate the optimal answer.
[0112] 104. Receive the target answer returned by the client based on multiple recommended answers, and display the target answer synchronously on the user's end.
[0113] Specifically, customer service personnel can select from multiple recommended answers displayed on the client-side to use or modify these recommended answers in order to provide the user with the final response (i.e., the target answer). When the system receives the target answer returned by the client-side based on multiple recommended answers, it will send the target answer to the user's client so that the user's client can display the target answer synchronously.
[0114] For example, continue to refer to Figure 3 Customer service personnel can select one of the multiple recommended answers (e.g., double-click or drag) and the selected answer (e.g., answer B) will be displayed in the information editing area of the dialog box. Customer service personnel can edit the selected answer in this information editing area to obtain the target answer. After clicking "send", the system will display the final answer in the customer service interface on the user's end.
[0115] As can be seen from the above, the answer generation method provided in this application obtains a query request sent by the user terminal, synchronously displays the target query message in the query request on the client-side, processes the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, and obtains multiple recommended answers; synchronously displays the multiple recommended answers on the client-side; receives the target answer returned by the client-side based on the multiple recommended answers, and synchronously displays the target answer on the user terminal. This solution can improve response speed and the quality of generated answers, while also improving the work efficiency of customer service personnel, ensuring that users receive fast and accurate service.
[0116] In practical applications, to address the time consumption during answer generation, an asynchronous message processing mechanism can be introduced, generating recommended answers asynchronously through a message queue. That is, in one implementation, when processing target query messages based on multiple different pre-trained language models, the following process can be included:
[0117] Construct an answer generation task, which specifies that the target query message should be processed based on multiple different pre-trained language models.
[0118] Add the answer generation task to the corresponding asynchronous message queue for processing.
[0119] Specifically, an answer generation task can be constructed based on the query message to be processed and the information of the pre-trained language model to be invoked. Then, the generated answer generation task is submitted to an asynchronous message queue, awaiting dequeueing and consumption. Asynchronous processing allows the system to continue executing other tasks while waiting for certain operations (such as data read / write) to complete, thus greatly improving efficiency.
[0120] Specifically, in distributed systems, asynchronous message queues are a common design pattern used to handle the delivery of tasks and messages. Here, the Task ID is a unique identifier for each task; each task is assigned a unique Task ID when submitted to the message queue. The User Identification Number (UIN) identifies the initiator or related user of the message or task. The Command ID (CMDID) identifies the type of message or operation command in the message queue, helping the system recognize the intent of the message and trigger the corresponding business processing logic.
[0121] refer to Figure 5 In asynchronous message queues, messages undergo rigorous parameter validation to ensure the data processed is complete and valid, thus preventing errors in subsequent processing. Specifically, this can be achieved by validating the UIN (caller identifier) and CMDID (command identifier) passed from the calling service, using a consistent hashing service. Then, the UIN is routed to the corresponding distributed machine, and the CMDID is routed into the appropriate message queue for dequeueing and consumption.
[0122] In practical applications, to improve processing efficiency, coroutine technology can be used to process the answer generation task in parallel. Specifically, in one implementation, each pre-trained language model is configured with a corresponding coroutine, and there is a one-to-one correspondence between pre-trained language models and coroutines. When processing target query messages based on multiple different pre-trained language models, multiple coroutine tasks can be constructed. These coroutine tasks instruct the corresponding pre-trained language model to process the target query message; then, multiple coroutine tasks are started in parallel. In essence, by creating multiple coroutines, the system can process multiple tasks simultaneously, greatly improving processing efficiency.
[0123] In practical applications, whenever a task is completed, it is written to the database for storage, so that the relevant recommended answers can be promptly provided to customer service personnel. That is, in one implementation, when multiple recommended answers are simultaneously displayed on the customer service side, if the completion of any coroutine task is detected, the recommended answer output by the pre-trained language model corresponding to the coroutine task can be obtained, and the corresponding recommended answer can be simultaneously displayed on the customer service side according to the completion time of the coroutine task.
[0124] Based on the methods described in the above embodiments, the following will provide further detailed examples. In another embodiment of this application, a recommendation and response system based on message processing and large-scale model fusion is provided. (See reference...) Figure 6 , Figure 6 This is a schematic diagram of the signaling flow of a system for recommending responses based on message processing and large model fusion, provided in an embodiment of this application. Below, we will combine... Figure 6 The recommendation and response system based on message processing and large model fusion provided in this embodiment is described in detail below.
[0125] (1) User message reception
[0126] Specifically, the user sends a message to the central node; the central node forwards the message to the customer service system; the central node receives the message sent by the user and integrates the message, and then calls the data mining service (wwdatamining_svr) in the backend interface of the AI big model.
[0127] When a user sends a message through the client, the system first receives these messages at a central node. This node's function is to categorize and forward user messages. In practice, queries and requests directly related to customer service representatives need to be forwarded to the customer service system for manual processing. Additionally, all messages are simultaneously forwarded to a data mining service for more in-depth processing of the message content.
[0128] For example, when a user needs consultation, they click on the customer service interface (i.e., the Node.js client) and send a consultation request, such as "How do I configure the check-in rules?". After this consultation message is sent, it is first synchronized to the customer service system and displayed in the dialog box. Simultaneously, the message receiving interface is triggered, and the Node.js client integrates the following messages: uid (user ID), kf_vid (customer service representative ID), msgs (all session records in the current dialog box), and tokf_appinfo (authentication information). After message integration, wwdatamining_svr is called.
[0129] (2) Construction of Record for Message Completion and Fusion Scheme
[0130] Specifically, the message first undergoes parameter validation and request pass-through to ensure all data meets processing standards. Then, wwdatamining_svr requests the customer service account service (kf_account_svr) to determine which type of customer service representative should handle the message. Customer service types include full-skill after-sales, anti-spam after-sales, pre-sales service, enterprise email processing, and test customer service. Once the customer service type is determined, the data mining logic (wwdatamining_logic) checks the message content for completeness. For cases where the message rounds are insufficient (i.e., the content is incomplete), the system will supplement the message rounds using historical data from the message database (message_db). During the historical data supplementation process, recent conversation records need to be reviewed to supplement the context of the current dialogue.
[0131] Next, wwdatamining_logic will construct several possible answer fusion schemes, aiming to provide diverse answer options. (Reference) Figure 4 , Figure 4 The diagram shows the construction of the Record in this embodiment. Three different fusion models were mainly used when generating the answer: chatglm, welm, and welm20b.
[0132] (3) Storage and asynchronous processing of answers
[0133] Specifically, wwdatamining_logic calls the data access object layer (wwdatamining_dao) to write all generated fusion solutions into the database for storage. In addition, wwdatamining_logic submits a task to the asynchronous message queue system (wwdatamining_xmq) for further processing of these answers (such as...). Figure 5 (As shown).
[0134] In an asynchronous message queue system, messages undergo rigorous parameter validation to ensure the data processed is complete and valid, preventing errors in subsequent processing. If the message list is empty or a message of the user's query type is missing, the system will log the error, terminate processing, and return the corresponding error type. After parameter validation, the system will attempt to read the record associated with the current message ID from the database.
[0135] (4) Integrate specific queries (question queries) with history (historical context).
[0136] Specifically, in a messaging system, the message format between users and customer service representatives might be a question-and-answer session or multiple questions and multiple answers. Here, an algorithm (algorithm_lib) is needed to properly organize the user and customer service conversation records so that they can be incorporated into a larger model for accurate recommendations. The main purpose is to integrate consecutive messages of the same type and extract key user prompts, while retaining other information as historical context. The key features and steps of this algorithm are as follows:
[0137] Message merging: The algorithm reduces the total number of messages and simplifies subsequent processing by merging consecutive messages of the same type. This merging process not only reduces data redundancy but also makes message processing more efficient.
[0138] Type Differentiation: The algorithm distinguishes between different types of messages, especially user queries and other message types. This differentiation is the basis for extracting the most critical information (i.e., the user's last query-type message), ensuring that the system can accurately understand and respond to the user's current needs.
[0139] Historical context extraction: In addition to the user's latest query, the algorithm also retains all previous messages as historical context. This provides the system with a complete interaction history, helping to generate more accurate and personalized responses.
[0140] like Figure 7 As shown, the message interaction interface (i.e., the chat interface between the user and customer service) displays a screenshot, user query message 1, user query message 2, and customer service response A. After algorithm processing, the integrated message is a one-to-one dialogue format (e.g., Figure 7 (Message after integration on the right).
[0141] For example, user query message 1 reads, "Why can the same person set up group owners in some groups but not in others?" User query message 2 reads, "For example, the same account can be set as an administrator in group 1 but not in group 2. What's the logic behind this?" Customer service response A is, "Currently, only groups you created yourself can set any contact as the group owner and any contact as the group administrator." The combined messages would look like this:
[0142] User: Why can the same person set up admin privileges in some groups but not in others? For example, the same account can set up admin privileges in group 1 but not in group 2. What's the logic behind this?
[0143] ChatGLM-6B: Currently, only groups you created yourself can have any contact designated as the group owner and any contact designated as a group administrator.
[0144] In this embodiment, the message integration algorithm steps are as follows:
[0145] ① Initialization and message classification: At the beginning of the algorithm, a message vector vecMsg is initialized to store the sorted messages, and then the input message list req.msgs() is traversed.
[0146] ② Merging messages of the same type: For each message, the algorithm checks whether subsequent messages are of the same type as the current message. If they are the same, the contents of these messages are merged into the current message content, using a newline character as the separator.
[0147] ③ Construct new message items: Whenever a type change occurs or the message list ends, the currently accumulated message content is encapsulated into a new MsgItem object and added to vecMsg.
[0148] ④ Extract the latest user query: Iterate through vecMsg, find the last message of type user query, and set it as prompt.
[0149] ⑤ Extract historical messages: Except for the latest user query, save all other messages in vecMsg as historical context.
[0150] (5) The coroutine starts the task and pushes the card.
[0151] Specifically, once the message and historical data are ready, the system will use coroutine technology to process the answer generation task in parallel. By creating multiple coroutines to form a coroutine pool, the system can handle multiple tasks simultaneously, greatly improving processing efficiency. Each coroutine will invoke a configured machine learning model, passing in the user's latest query and historical context.
[0152] refer to Figure 8When a coroutine adds a task, each coroutine task is instructed to pass the compiled history and query to the large model invocation service (chat_python_svr) for invocation of the large model. For example, coroutine task _1 is configured to invoke chatglm, coroutine task _2 is configured to invoke welm, and coroutine task _3 is configured to invoke welm20b. Whenever a task completes its invocation, it is written to the database for storage. Here, id_1, id_2…id_x-1, id_x, etc., represent the task IDs of the corresponding coroutine tasks.
[0153] In this embodiment, the generated answer is stored back in the database and pushed to the user via the client interface. (Reference) Figure 9 When a user submits a question, the right-hand interface displays the user's latest question (i.e., "How to configure the check-in rules") and multiple recommended answers. The recommended answers are continuously updated based on the completion time of the coroutine task in the recommended answer column on the right. When answering a user's query, the recommended answers from different large models on the right can be referenced. Users can click to select the corresponding answer and add it to the message input area of the dialog box. Users can also choose to use or modify these suggested answers to provide the user with a final response.
[0154] In practical applications, to avoid negative feedback from the simultaneous launch of three integrated solutions, a gray-scale mechanism (or canary release) can be introduced. Initially, the integrated solution is only available to a portion (e.g., 10%) of customer service personnel. After confirming that there are no abnormal issues, it is then gradually rolled out to other customer service personnel in a tiered manner (e.g., 30%, 50%, etc.) until it is available to 100% of customer service personnel.
[0155] As can be seen, in this embodiment, after a user submits a question to the customer service system, different large model calls are made to generate different recommended answers for the customer service system to refer to. Meanwhile, when handling a large number of concurrent requests for large models, asynchronous processing mechanisms and the use of coroutines become key technologies for improving system responsiveness.
[0156] The recommendation and response system based on message processing and large-scale model fusion provided in this application integrates a large-scale model approach. It asynchronously generates recommended answers through message queues to address the time consumption during answer generation. Furthermore, the system extracts core queries and histories as prompts for the large-scale model using a message processing algorithm, resulting in more accurate answers. By using coroutine technology, the system can call multiple large-scale language models in parallel for rapid response, and a real-time write mechanism ensures timely storage of generated answers. These large-scale model bases can be quickly replaced according to configuration, demonstrating the system's flexibility and scalability. In addition, the system designs an efficient interaction mechanism between the C++ backend and the Python large-scale model, further improving processing speed. Finally, the large-scale model recommendation system pushes the answers to customer service representatives, who can choose to use or modify these suggested answers to provide the final response to the user. Therefore, this solution not only significantly improves response speed and quality but also enhances the work efficiency of customer service personnel, ensuring users receive fast and accurate service.
[0157] To better implement the above methods, this application also provides an answer generation device that can be integrated into an electronic device.
[0158] For example, such as Figure 10 As shown, the answer generation device may include: a first acquisition unit 301, a processing unit 302, a first synchronization unit 303, and a second synchronization unit 304, as follows:
[0159] The first acquisition unit 301 is used to acquire a query request sent by the user terminal, the query request including: a target query message;
[0160] The processing unit 302 is used to synchronously display the target query message on the client side and process the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model and obtain multiple recommended answers.
[0161] The first synchronization unit 303 displays multiple recommended answers simultaneously on the client side;
[0162] The second synchronization unit 304 is used to receive the target answer returned by the client based on multiple recommended answers, and to synchronously display the target answer on the client.
[0163] Optionally, in some implementations, the query request further includes: a user identifier corresponding to the user terminal; when the target query message is synchronously displayed on the client terminal, the processing unit 302 is used to:
[0164] Determine the customer service type corresponding to the target query message;
[0165] Assign a corresponding customer service identifier to the user identifier based on the customer service type;
[0166] Based on the customer service identifier, the target message will be displayed synchronously on the corresponding customer service client.
[0167] Optionally, in some embodiments, the device further includes:
[0168] The second acquisition unit is used to acquire the corresponding current session message based on the user identifier and the customer service identifier after the target query message is synchronously displayed on the customer service terminal based on the user identifier and the customer service identifier, and before the target query message is processed based on multiple different pre-trained language models. The current session message includes the target query message and subsequent messages, and the display time of the subsequent messages on the customer service terminal is later than that of the target query message.
[0169] The detection unit is used to detect the integrity of the content of the current session message and obtain the detection result;
[0170] When processing the target query message based on multiple different pre-trained language models, the processing unit 302 is further configured to: perform processing of the target query message based on multiple different pre-trained language models according to the detection result.
[0171] Optionally, in some implementations, when detecting the integrity of the content of the current session message and obtaining the detection result, the detection unit is specifically used for:
[0172] Get the number of question-and-answer message rounds in the current session message;
[0173] If the number of rounds of question and answer messages has not reached the preset number, the detection result is determined to be passed;
[0174] If the number of rounds of question and answer messages does not reach the preset number, the detection result is determined to be unsuccessful.
[0175] Optionally, in some implementations, when processing the target query message based on multiple different pre-trained language models according to the detection result, the processing unit 302 is specifically used for:
[0176] If the detection result is passed, then consecutive messages of the same type in the current session are merged to obtain the first merged message;
[0177] Based on the user identifier, determine the query message that is closest to the current time and other messages other than the query message from the first merged message;
[0178] The query message is identified as the target query question, and the other messages are identified as the historical context of the target query question. These are then input into the multiple different pre-trained language models.
[0179] Optionally, in some implementations, when processing the target query message based on multiple different pre-trained language models according to the detection result, the processing unit 302 is specifically used for:
[0180] If the detection result is not passed, historical session messages within a preset time period are obtained based on the user identifier;
[0181] Merge consecutive messages of the same type in historical and current sessions to obtain a second merged message;
[0182] Based on the user identifier, determine the most recent query message from the second merged message, as well as other messages besides the query message;
[0183] The query message is identified as the target query question, and the other messages are identified as the historical context of the target query question. These are then input into the multiple different pre-trained language models.
[0184] Optionally, in some implementations, when processing the target query message based on multiple different pre-trained language models, the processing unit 302 is further configured to:
[0185] Construct an answer generation task that indicates: process the target query message based on multiple different pre-trained language models;
[0186] Add the answer generation task to the corresponding asynchronous message queue for processing.
[0187] Optionally, in some implementations, each pre-trained language model is configured with a corresponding coroutine, and there is a one-to-one correspondence between the pre-trained language model and the coroutine; when processing the target query message based on multiple different pre-trained language models, the processing unit 302 is further configured to:
[0188] Construct multiple coroutine tasks, each coroutine task instructing the corresponding pre-trained language model to process the target query message based on that coroutine.
[0189] Multiple tasks of this coroutine can be started in parallel.
[0190] Optionally, in some implementations, when displaying multiple recommended answers simultaneously on the client, the first synchronization unit 303 may specifically be used for:
[0191] When any of the coroutine tasks is detected to be completed, the recommended answer output by the pre-trained language model corresponding to the coroutine task is obtained;
[0192] Based on the completion time of the coroutine task, the corresponding recommended answer will be displayed synchronously on the client.
[0193] Optionally, in some implementations, the data structure corresponding to the recommended answer includes: answer status, source type, source type name, answer text, and source information.
[0194] As can be seen from the above, the answer generation device provided in this application obtains a query request sent by the user terminal, synchronously displays the target query message in the query request on the client terminal, processes the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, and obtains multiple recommended answers; synchronously displays the multiple recommended answers on the client terminal; receives the target answer returned by the client terminal based on the multiple recommended answers, and synchronously displays the target answer on the user terminal. This solution can improve response speed and the quality of generated answers, while also improving the work efficiency of customer service personnel, ensuring that users receive fast and accurate service.
[0195] This application also provides an electronic device, such as... Figure 11 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically:
[0196] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0197] The processor 401 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and computer programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0198] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and generates answers by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0199] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0200] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0201] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. It should be noted that the electronic device in this embodiment can specifically be the first server, that is, the server where the SSO certification center is located. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 runs the computer programs stored in the memory 402 to achieve various functions, as follows:
[0202] Obtain the query request sent by the user, which includes: the target query message;
[0203] The target query message is displayed synchronously on the client side, and the target query message is processed based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, resulting in multiple recommended answers;
[0204] Multiple recommended answers will be displayed simultaneously on the client application.
[0205] Receive the target answer returned by the client based on multiple recommended answers, and display the target answer synchronously on the user's client.
[0206] In one embodiment, the query request further includes: a user identifier corresponding to the user terminal; when the target query message is synchronously displayed on the client terminal, the processor 401 is specifically used for:
[0207] Determine the customer service type corresponding to the target query message; assign a corresponding customer service identifier to the user identifier based on the customer service type; and synchronously display the target message on the corresponding customer service client based on the customer service identifier.
[0208] In one embodiment, after the target query message is synchronously displayed on the client based on the user identifier and the customer service identifier, and before processing the target query message based on multiple different pre-trained language models, the processor 401 may further be used to:
[0209] Based on the user identifier and the customer service identifier, the corresponding current session message is obtained. The current session message includes the target query message and subsequent messages. The subsequent messages are displayed later than the target query message on the customer service client. The integrity of the content of the current session message is checked to obtain the detection result.
[0210] Therefore, when processing the target query message based on multiple different pre-trained language models, processor 401 is specifically used for:
[0211] Based on the detection results, the target query message is processed using multiple different pre-trained language models.
[0212] In one embodiment, when detecting the integrity of the content of the current session message and obtaining the detection result, the processor 401 may specifically be used to:
[0213] Get the number of question-and-answer message rounds in the current session message; if the number of question-and-answer message rounds has not reached the preset number, the detection result is determined to be passed; if the number of question-and-answer message rounds has not reached the preset number, the detection result is determined to be failed.
[0214] In one embodiment, when processing the target query message based on multiple different pre-trained language models according to the detection result, the processor 401 may specifically be used to:
[0215] If the detection result is passed, the consecutive messages of the same type in the current session message are merged to obtain the first merged message; based on the user identifier, the query message closest to the current time and other messages other than the query message are determined from the first merged message; the query message is determined as the target query question, and the other messages are determined as the historical context of the target query question, and are respectively input into the multiple different pre-trained language models.
[0216] In one embodiment, when processing the target query message based on multiple different pre-trained language models according to the detection result, the processor 401 may specifically be used to:
[0217] If the detection result is not passed, historical session messages within a preset time period are obtained based on the user identifier; consecutive messages of the same type in the historical session messages and the current session messages are merged to obtain a second merged message; based on the user identifier, the most recent query message and other messages besides the query message are determined from the second merged message; the query message is determined as the target query question, and the other messages are determined as the historical context of the target query question, and are respectively input into the multiple different pre-trained language models.
[0218] In one embodiment, when processing the target query message based on multiple different pre-trained language models, the processor 401 may specifically be used to:
[0219] Construct an answer generation task that indicates: process the target query message based on multiple different pre-trained language models; add the answer generation task to the corresponding asynchronous message queue for processing.
[0220] In one embodiment, each pre-trained language model is configured with a corresponding coroutine, and there is a one-to-one correspondence between the pre-trained language model and the coroutine; when processing the target query message based on multiple different pre-trained language models, the processor 401 can specifically be used to:
[0221] Construct multiple coroutine tasks, each coroutine task instructing the following: based on the coroutine, call the corresponding preset trained language model to process the target query message; start multiple such coroutine tasks in parallel.
[0222] In one embodiment, when displaying multiple recommended answers simultaneously on the client, the processor 401 can specifically be used to:
[0223] When any of the coroutine tasks is detected to be completed, the recommended answer output by the pre-trained language model corresponding to the coroutine task is obtained; according to the completion time of the coroutine task, the corresponding recommended answer is displayed synchronously on the client.
[0224] In one embodiment, the data structure corresponding to the recommended answer includes: answer status, source type, source type name, answer text, and source information.
[0225] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0226] As described above, in this embodiment, the electronic device acquires a query request sent by the user terminal, synchronously displays the target query message in the query request on the client-side, processes the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, resulting in multiple recommended answers; synchronously displays the multiple recommended answers on the client-side; receives the target answer returned by the client-side based on the multiple recommended answers, and synchronously displays the target answer on the user terminal. This solution can improve response speed and the quality of generated answers, while also improving the work efficiency of customer service personnel, ensuring that users receive fast and accurate service.
[0227] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0228] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the answer generation methods provided in embodiments of this application. For example, the instructions can execute the following steps:
[0229] The system retrieves a query request sent by the user client, which includes a target query message. It then displays the target query message synchronously on the client client and processes it based on multiple pre-trained language models to obtain the corresponding answer generated by each pre-trained language model, resulting in multiple recommended answers. Finally, it displays these multiple recommended answers synchronously on the client client. The system also receives the target answer returned by the client client based on these multiple recommended answers and displays it synchronously on the user client.
[0230] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0231] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0232] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the answer generation methods provided in the embodiments of this application, the beneficial effects that any of the answer generation methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0233] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various alternative implementations of the above-described answer generation aspect.
[0234] The foregoing has provided a detailed description of an answer generation method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for generating answers, characterized in that, include: Obtain a query request sent by the user client, the query request including: a target query message; The target query message is displayed synchronously on the client side, and the target query message is processed based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, resulting in multiple recommended answers; Multiple recommended answers are displayed simultaneously on the client-side interface. The client receives the target answer returned by the client based on multiple recommended answers, and displays the target answer synchronously on the client.
2. The answer generation method according to claim 1, characterized in that, The query request also includes: the user identifier corresponding to the user terminal; the step of synchronously displaying the target query message on the client terminal includes: Determine the customer service type corresponding to the target query message; Assign a corresponding customer service identifier to the user identifier based on the customer service type; The target message will be synchronously displayed on the corresponding customer service terminal based on the customer service identifier.
3. The answer generation method according to claim 2, characterized in that, After the target query message is synchronously displayed on the customer service terminal based on the user identifier and the customer service identifier, and before processing the target query message based on multiple different pre-trained language models, the process further includes: Based on the user identifier and the customer service identifier, the corresponding current session message is obtained, wherein the current session message includes the target query message and subsequent messages, and the subsequent messages are displayed on the customer service terminal later than the target query message; The integrity of the content of the current session message is checked, and the check result is obtained; The processing of the target query message based on multiple different pre-trained language models includes: Based on the detection results, the target query message is processed using multiple different pre-trained language models.
4. The answer generation method according to claim 3, characterized in that, The step of detecting the integrity of the content of the current session message and obtaining the detection result includes: Get the number of question-and-answer message rounds in the current session message; If the number of question-and-answer message rounds does not reach the preset number, the detection result is determined to be passed; If the number of question-and-answer message rounds does not reach the preset number, the detection result is determined to be unsuccessful.
5. The answer generation method according to claim 3, characterized in that, The step of processing the target query message based on the detection results using multiple different pre-trained language models includes: If the detection result is passed, then consecutive messages of the same type in the current session message are merged to obtain the first merged message; Based on the user identifier, determine the query message that is closest to the current time from the first merged message, as well as other messages besides the query message; The query messages are identified as the target query question, and the other messages are identified as the historical context of the target query question, and then input into the multiple different pre-trained language models respectively.
6. The answer generation method according to claim 3, characterized in that, The step of processing the target query message based on the detection results using multiple different pre-trained language models includes: If the detection result is not passed, historical session messages within a preset time period are obtained based on the user identifier; The historical session messages and the current session messages are merged to obtain a second merged message; Based on the user identifier, determine the query message that is closest to the current time and other messages other than the query message from the second merged message; The query messages are identified as the target query question, and the other messages are identified as the historical context of the target query question, and then input into the multiple different pre-trained language models respectively.
7. The answer generation method according to claim 1, characterized in that, The processing of the target query message based on multiple different pre-trained language models includes: Construct an answer generation task, wherein the answer generation task indicates that the target query message is processed based on multiple different pre-trained language models; The answer generation task is added to the corresponding asynchronous message queue for processing.
8. The answer generation method according to any one of claims 1-7, characterized in that, Each pre-trained language model corresponds to a coroutine, and there is a one-to-one correspondence between the pre-trained language model and the coroutine; the processing of the target query message based on multiple different pre-trained language models includes: Construct multiple coroutine tasks, wherein each coroutine task indicates that the target query message is processed based on the corresponding preset training language model invoked by the coroutine. Multiple coroutine tasks are launched in parallel.
9. The answer generation method according to claim 8, characterized in that, The step of simultaneously displaying multiple recommended answers on the client side includes: When the completion of any of the coroutine tasks is detected, the recommended answer output by the pre-trained language model corresponding to the coroutine task is obtained; Based on the completion time of the coroutine task, the corresponding recommended answer will be displayed synchronously on the client side.
10. The answer generation method according to any one of claims 1-7, characterized in that, The data structure corresponding to the recommended answer includes: answer status, source type, source type name, answer text, and source information.
11. An answer generation device, characterized in that, include: The first acquisition unit is used to acquire a query request sent by the user terminal, the query request including: a target query message; The processing unit is used to synchronously display the target query message on the client side, and process the target query message based on multiple different pre-trained language models to obtain the answer generated by each pre-trained language model, thereby obtaining multiple recommended answers; The first synchronization unit displays multiple recommended answers simultaneously on the client side; The second synchronization unit is used to receive the target answer returned by the client based on multiple recommended answers, and to synchronously display the target answer on the client.
12. The answer generation device according to claim 11, characterized in that, Each pre-trained language model is configured with a corresponding coroutine, and there is a one-to-one correspondence between the pre-trained language model and the coroutine; the processing unit is used for: Construct multiple coroutine tasks, wherein each coroutine task indicates that the target query message is processed based on the corresponding preset training language model invoked by the coroutine. Multiple coroutine tasks are launched in parallel.
13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor running the computer program in the memory to perform the steps of the answer generation method according to any one of claims 1-10.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the answer generation method according to any one of claims 1-10.
15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the answer generation method according to any one of claims 1-10.