Virtual seat construction method and virtual seat interaction system and method

By using real conversation data and features to supplement the training of the virtual agent model, the problem of insufficient understanding ability of virtual agents in multi-turn conversations was solved, resulting in more professional and stable responses and improving user experience and service quality.

CN121880914APending Publication Date: 2026-04-17GUANGZHOU SHIYUAN ELECTRONICS CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU SHIYUAN ELECTRONICS CO LTD
Filing Date
2024-10-15
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing virtual agents have a low ability to understand user questions in multi-round conversations, their responses lack specificity, they cannot provide professional and stable solutions, and the maintenance cost of the FAQ knowledge base is high.

Method used

By acquiring real conversation data, pre-training with a large language model, and combining scene features, product features, Bayesian fault networks, and demand features for model training, the model's ability to understand long contexts is optimized. Furthermore, the model parameters are iteratively optimized through loss values ​​to generate more human-like and professional responses.

Benefits of technology

It improves the virtual agent's understanding and response accuracy in multi-turn conversations, reduces the awkwardness of dialogue, enhances user experience and service quality, and the model can continuously improve itself with data accumulation and technological advancements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880914A_ABST
    Figure CN121880914A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of man-machine interaction, in particular to a virtual seat construction method and a virtual seat interaction system and method. According to the virtual seat construction method, a real session is used as training data, so that a trained model can better fit a real scene when replying to a user; according to the method, the sessions are spliced into the text for pre-training, and the session features of the real sessions are supplemented to perform two-stage training, so that the model has the long text understanding ability, the accuracy of positioning user questions by the model is improved, and the model is assisted to generate more professional and stable replies. And in combination with an iterative optimization mode based on a loss value, it is ensured that the virtual seat model can be continuously improved by itself along with data accumulation and technology progress, the service quality and efficiency are improved, and a better reply is given to a problem proposed by a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of human-computer interaction technology, specifically to a method for constructing virtual agents, a virtual agent interaction system, and a method thereof. Background Technology

[0002] In recent years, with the rapid development of technology, human agents (also known as virtual agents) have accounted for a significant portion of company operations costs. How to automate the deployment of virtual agents to assist them, streamlining and standardizing certain operational processes, and indirectly reducing labor costs, is a common industry solution. This involves using FAQs or task-based question-and-answer robots to respond to simple user inquiries. However, current FAQ-based solutions tend to produce relatively rigid responses, failing to provide a good user experience. They are also limited to handling simple questions and lack generalization capabilities, and the corresponding FAQ knowledge base requires substantial manpower for maintenance. Furthermore, most common large-scale question-and-answer models only address single-round questions and cannot help users troubleshoot and locate problems in multiple steps, or flexibly ask follow-up questions, relying heavily on knowledge organization. Summary of the Invention

[0003] The main technical problem addressed by the implementation method of this application is that existing virtual agents have a low ability to understand user conversations, especially in multi-turn conversation scenarios, and it is not easy to provide targeted agent responses.

[0004] To address the aforementioned technical problems, one technical solution adopted in this application is: providing a virtual agent construction method, comprising: acquiring multiple real conversations from a training dataset, wherein the real conversations include interaction records between users and agents; concatenating the real conversations into a complete text, and further pre-training the text using the prediction pattern of the next sub-word to obtain an initial agent model; supplementing the real conversations with conversation features based on the conversation information of the real conversations; training the initial agent model for agent response prediction based on the real conversations with supplemented conversation features, and calculating the loss on the prediction results to iteratively optimize the model parameters based on the loss value, so as to output a trained virtual agent model.

[0005] The virtual agent construction method provided in this application uses real conversations as training data, enabling the trained model to respond to users in a more realistic way, using more human-like responses, reducing the stiffness of the dialogue, and optimizing the user experience. Training is performed through conversation splicing, and then supplemented with conversation features from real conversations, giving the model the ability to understand long contexts, improving the accuracy of the model in locating user questions, and assisting the model in generating more professional and stable responses. A two-stage training method, which trains the initial agent model and then further trains it using conversation features, allows the model to learn the complete flow logic of a conversation and acquire professional knowledge for handling different problems from a large number of conversations. Combined with an iterative optimization method based on loss values, this ensures that the virtual agent model can continuously improve itself with the accumulation of data and technological advancements, improving service quality and efficiency, and providing better responses to user questions.

[0006] In some embodiments, the conversation features include scenario features and product features. Supplementing the conversation features of the real conversation based on the conversation information of the real conversation includes: obtaining the source information of the real conversation and determining scenario features based on the source information; marking the scenario features at the end of the first round of dialogue in the real conversation; obtaining product features based on the conversation content of the real conversation; and marking the product features at the end of each round of dialogue in the user's conversation. This solution accurately supplements the corresponding real conversations with scenario features and product features, enabling the virtual agent model to understand the context of the dialogue more deeply and learn to provide more suitable solutions for the faults of different products in different scenarios. This not only improves the model's ability to understand the scenario of the conversation content but also enhances the relevance and effectiveness of the model's responses.

[0007] In some embodiments, the session features include Bayesian features, and supplementing the session features of the real session based on the session information of the real session includes: collecting fault phenomena and processing behaviors in the real session, and establishing a Bayesian fault network based on the fault phenomena and the processing behaviors; and labeling the Bayesian features of the real session based on the Bayesian fault network. This solution, by using a Bayesian fault network, models the causal relationship between complex fault phenomena and processing behaviors, endowing the virtual agent model with powerful fault reasoning capabilities. Based on Bayesian features, it can not only capture the conditional probability of fault occurrence but also analyze potential fault paths through the dependency relationships between nodes, enabling the model to more accurately identify the root cause of the problem when handling user inquiries and provide more scientific and reasonable solutions, thus improving the professionalism of fault handling. Furthermore, the flexibility of the Bayesian network allows the model to continuously update and adjust the network structure with the addition of new data, thereby adapting to constantly changing fault modes and user needs, enabling the model to support continuous learning and optimization, and providing more professional and practical responses.

[0008] In some embodiments, establishing a Bayesian fault network based on the fault phenomenon and the processing behavior includes: determining Bayesian node names based on the fault phenomenon and the processing behavior; representing the Bayesian node names and their corresponding standard descriptions as a first vector; representing the agent responses in the real conversation as a second vector using semantic vectors; performing semantic matching between the first vector and the second vector; filtering agent responses with a similarity greater than a preset similarity threshold based on the matching results; performing cluster analysis on the filtered agent responses to obtain the standard scripts corresponding to the Bayesian nodes; and generating a set of mapping relationships between Bayesian nodes and agent response scripts to obtain the Bayesian fault network, wherein each Bayesian node corresponds to a set of standard scripts. This solution provides the specific logic for establishing a Bayesian fault network. By performing refined semantic vector representation and matching of fault phenomena, processing behaviors, and agent responses, it can accurately filter out standard scripts highly related to specific fault nodes, providing clear guidance for virtual agents when dealing with similar problems, and making the model's responses more professional and standardized.

[0009] In some embodiments, labeling the Bayesian features of the real session according to the Bayesian fault network includes: matching the agent's response in the real session with the standard dialogue corresponding to the Bayesian node according to the mapping relationship set; when a match is successful, labeling the corresponding Bayesian node at the end of the previous user dialogue sentence of the agent's response as a Bayesian feature. This solution, by matching the agent's response in the real session with the standard dialogue in the Bayesian fault network, and labeling the corresponding Bayesian node as a feature after a successful match, tightly integrates complex fault handling logic with the dialogue flow, improves the accuracy of dialogue processing, and enables virtual agents to respond more accurately and efficiently in subsequent dialogues based on these features.

[0010] In some embodiments, the conversation features include request features, and supplementing the conversation features of the real conversation based on the conversation information of the real conversation includes: analyzing the core user requests of the real dialogue using a large model; training a feature extraction small model using the real dialogue and the core user requests as training data; generating user core requests as request features using the feature extraction small model based on the conversation content; and marking the request features at the end of the user dialogue in the real dialogue. This solution uses a large model to analyze real dialogue to identify the user's core requests, and trains a feature extraction small model based on these core requests to ensure the accurate identification of request features (i.e., user core requests); directly marking the request features at the end of the user dialogue not only enables the model to quickly capture and remember this key information, but also helps to always respond around the user's core questions during the conversation, ensuring the consistency and coherence of the conversation content, and effectively avoiding the phenomenon of the conversation deviating from the topic or repeating replies.

[0011] In some embodiments, the method further includes preprocessing multiple real conversations in the training dataset, specifically including: identifying and deleting worthless replies from agents; identifying and deleting non-textual replies from agents; identifying multiple conversations of the same role within a consecutive time period and merging them into a single conversation; detecting sensitive information in the conversation content and deleting or equivalently replacing the sensitive information. This solution effectively removes noise and redundant information from the training data through preprocessing. Simultaneously, by detecting and processing sensitive information in the conversation content, it avoids the model learning inappropriate replies, reduces the likelihood of the model generating useless or harmful replies, and improves the reliability of the model in practical applications.

[0012] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a virtual agent interaction system, the system comprising: a session acquisition module for acquiring user sessions; a feature supplementation module for supplementing session features of the user session based on session information, the session features including at least one of scenario features, product features, Bayesian features, and request features; a Bayesian fault network including Bayesian node names and a set of mapping relationships between Bayesian nodes and agent response scripts, wherein each Bayesian node corresponds to a set of standard scripts; a feature extraction mini-model for generating core user requests as request features based on session content; an FAQ question-and-answer module for combining an FAQ knowledge base and outputting agent responses based on the user session; and a virtual agent model constructed by the aforementioned virtual agent construction method, used to combine the session features and output agent responses based on the user session.

[0013] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a virtual agent interaction method applied to the virtual agent interaction system described above. The method includes: acquiring a question or reply input by a user; when the current session round is less than a first preset threshold, invoking an FAQ module to match the question or reply with a high-scoring result, and outputting an agent reply based on the high-scoring result when a match is successful; when the current session round is not less than the first preset threshold, or when the current session round is less than the first preset threshold and a match fails, acquiring and marking the session features of the current session based on the current session content, the session features including at least one of scenario features, product features, Bayesian features, and request features; and invoking the virtual agent model to output an agent reply to the question or reply until the user stops replying.

[0014] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is: to provide an electronic device, including: at least one processor and a memory; the memory is coupled to the processor, and the memory is used to store instructions or programs, which, when executed by the at least one processor, cause the at least one processor to execute the virtual agent construction method as described above, or to execute the virtual agent interaction method as described above.

[0015] Unlike related technologies, this application provides a virtual agent construction method, a virtual agent interaction system, and a method. This virtual agent construction method acquires multiple real conversations from a training dataset, concatenates these real conversations into a complete text, and continues pre-training based on the predicted pattern of the next sub-word. Then, it supplements the real conversation's conversation features based on the conversation information and further iteratively trains the initial agent model accordingly, outputting a trained virtual agent model. This solution trains by concatenating conversations and supplements them with real conversation features, enabling the model to understand long contexts, improving the accuracy of locating user questions, and helping the model generate more professional and stable responses. The two-stage training approach—training the initial agent model and further training it using conversation features—allows the model to learn the complete flow logic of a conversation and acquire professional knowledge for handling different questions from a large number of conversations. Combined with an iterative optimization method based on loss values, this ensures that the virtual agent model can continuously improve itself with data accumulation and technological advancements, enhancing service quality and efficiency, and providing better responses to user questions. Attached Figure Description

[0016] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0017] Figure 1 This is a flowchart illustrating a virtual agent construction method provided in an embodiment of this application;

[0018] Figure 2 This is a schematic diagram illustrating the splicing of text and the continuation of pre-training provided in the embodiments of this application;

[0019] Figure 3 This is a text diagram with supplementary session features provided in the embodiments of this application;

[0020] Figure 4 This is the model training method provided in the embodiments of this application after supplementing conversation features;

[0021] Figure 5 This is a schematic diagram illustrating the supplementary scenario features and product features provided in the embodiments of this application;

[0022] Figure 6 This is an example diagram of a Bayesian fault network provided in an embodiment of this application;

[0023] Figure 7 This is a schematic diagram of the supplementary Bayesian features provided in the embodiments of this application;

[0024] Figure 8 This is a schematic diagram of the training feature extraction mini-model provided in the embodiments of this application;

[0025] Figure 9 This is a schematic diagram illustrating the supplementary claim features provided in the embodiments of this application;

[0026] Figure 10 This is a schematic diagram of the structure of the virtual seat creation device provided in the embodiments of this application;

[0027] Figure 11 This is a flowchart illustrating the virtual agent interaction method provided in an embodiment of this application;

[0028] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. It should be noted that, unless otherwise specified, the various features in the embodiments of this application can be combined with each other, all within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed with a different module division or order than that shown in the device schematic diagram or the flowchart.

[0030] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.

[0031] As e-commerce expands, companies tend to deploy virtual agents to assist in handling user inquiries and indirectly reduce labor costs in order to alleviate the cost pressure of human agents. The industry widely adopts FAQ-based solutions or task-oriented question-and-answer robots to respond to simple user inquiries. However, current FAQ-based solutions have limited understanding of user conversations, resulting in relatively stiff responses that fail to provide a good interactive experience, especially in multi-turn conversations. They can only handle simple questions and answers and are not adept at providing real-person responses tailored to user issues. Furthermore, the corresponding FAQ knowledge base requires significant manpower for maintenance.

[0032] To address the aforementioned issues, this solution proposes an innovative method for constructing virtual agent models. It utilizes real-world conversations as training data to enhance the naturalness and accuracy of dialogue interaction. Training is conducted through conversation splicing, and further supplemented with conversational features from real conversations to optimize the model's ability to understand long contexts, assisting the model in generating more professional and stable responses. Through a two-stage training approach, the model learns professional knowledge for handling different problems, troubleshooting logic, and a patient, human-like response style based on the dialogue corpus. Furthermore, combined with an iterative optimization method based on loss values, the virtual agent model can continuously improve itself with data accumulation and technological advancements, providing more efficient and high-quality agent responses to customer inquiries.

[0033] Based on this, the embodiments of this application will be further described in conjunction with specific scenarios:

[0034] Figure 1 This is a flowchart illustrating a virtual agent construction method provided in an embodiment of this application, such as... Figure 1As shown, the method for constructing a virtual seat includes:

[0035] S11. Obtain multiple real conversations in the training dataset, where the real conversations contain the interaction records between the user and the seat. It can be understood that here, a real conversation represents a complete conversation between the seat and the user, and this conversation can include multiple user conversations and multiple seat conversations (which are also the seat responses in the embodiments of this application). In this solution, a large amount of real conversation data between artificial seats and users can be collected. These real conversation data can be historical conversations saved in the server. Taking these real conversation data as the training dataset, and then training the model based on the multiple real conversations included, so that the virtual seat can learn to generate anthropomorphic responses, thereby generating more natural, fluent and seat-style responses. As much as possible, the responses output by the virtual seat model during interaction are not rigid, so as to optimize the user experience.

[0036] S12. Concatenate the real conversations into a complete text, and continue to pre-train the text in the mode of next sub-word prediction to obtain an initial seat model. In this solution, the LLM (Large Language Model) can be used to convert all real conversations into training data for pre-training. It can be understood that when training a model, usually a large pre-trained model, that is, the base model, is required to provide a starting point and support for the subsequent training of a specific model. In this solution, please refer to Figure 2 , and the relatively mature Qwen series models or chatGLM dialogue language models can be selected as the base model. Specifically, first concatenate each real conversation in the training dataset into a complete text. Taking the Figure 2 example shown, a certain training dataset contains n real conversations. Select the 1st, the kth (k < n), and the nth conversations as sample 1, sample 2, and sample 3 respectively. Figure 2The diagram illustrates an example of the concatenated text, where "user" represents user dialogue and "assistant" represents agent dialogue / response. Different dialogues in the text are distinguished by "#". The concatenated text is then used as training data to input into the base model for further pre-training in the next token predict mode. The core idea of ​​next token predict is that, given a series of texts (usually parts or complete sentences, in this case, concatenated text), the model is trained to predict the next word or token in the sequence. Through training in this mode, the model can predict and generate the most likely next word or token based on a given text sequence, improving the model's ability to understand natural language and generate text. Based on this stage of model training, the initial agent model is obtained.

[0037] S13. Supplement the conversation features of the real conversation based on the conversation information of the real conversation. Please refer to... Figure 3 Using the first four sentences of the dialogue from Sample 1 above as training samples, the feature-rich dialogue data after supplementing with dialogue features is as follows: Figure 3 As shown, "[Scenario: XX Brand]", "[Product: Learning Machine-W2-Under Warranty]", "[Request: User's screen is black]", and "[bys: Restart]" are all conversation features. In this embodiment, by supplementing the end sentences of real conversations with conversation features, the model can be trained in conjunction with these features, helping the model better understand the user's question and thus provide a more reasonable response.

[0038] S14. Based on the real conversation supplemented with conversation features, train the initial agent model to predict agent responses, and calculate the loss on the prediction results to iteratively optimize the model parameters based on the loss value, so as to output the trained virtual agent model. Please refer to... Figure 4 Taking the training sample above as an example, the user dialogue with features is "user: My all-in-one machine screen is black [Scenario: XX brand][Product: Learning machine-W2-under warranty][Request: User's screen is black]". The model predicts the agent's response, and then calculates the loss based on the actual agent's response "assistant: power indicator color", and optimizes the model parameters based on the loss value. Then, the next user dialogue with features is added, and the above training steps are repeated. The iterative optimization method based on the loss value allows the model to continuously improve itself with the accumulation of data and the advancement of technology, and finally outputs a trained virtual agent model.

[0039] This solution utilizes real-world conversations as training data, enabling the trained model to respond to users in a more realistic and human-like manner, reducing the stiffness of the dialogue and optimizing the user experience. Training through conversation concatenation, supplemented with real-world conversation features, gives the model the ability to understand long contexts, improving the accuracy of identifying user questions and helping the model generate more professional and stable responses. A two-stage training approach—training an initial agent model and then further training it using conversation features—allows the model to learn the complete flow logic of a conversation and acquire professional knowledge for handling different issues from a large number of conversations. Combined with iterative optimization based on loss values, this ensures that the virtual agent model can continuously improve itself with data accumulation and technological advancements, enhancing service quality and efficiency, and providing better responses to user questions.

[0040] To enable the model to provide specific and professional responses to user questions based on different scenarios or products, the model needs to learn that even for the same fault, different products offer different solutions in different scenarios. For example, the black screen solution for product A should differ from that for product B. This application further proposes a specific method for supplementing session features. Specifically, the session features include scenario features and product features. Step S13, supplementing the session features of the real session based on the session information of the real session, includes:

[0041] Obtain the source information of the real conversation and determine the scene characteristics based on the source information; mark the scene characteristics at the end of the first round of dialogue in the real conversation. The source information includes the user's consultation entry channel, such as a public account or web page, and the consultation scenario channel, such as a pre-sales consultation scenario or an after-sales consultation scenario; determine the scene characteristics based on the source information, for example, the channel name can be used as the scene characteristic, and mark the scene characteristics at the end of the first round of user dialogue.

[0042] Product features are obtained based on the content of the actual conversation; these product features are then marked at the end of each sentence in the user's dialogue. Product features are primarily determined automatically based on product information mentioned by the user in the conversation, such as products mentioned in the user's dialogue or product serial numbers provided by the user; product features can include product name, product model, and whether it is within the warranty period, etc.

[0043] Please combine Figure 5 In the image, the left side shows a window without labeled conversation features (scenario features and product features), while the right side shows a window with labeled conversation features. The left side of the window represents user conversations, and the right side represents agent conversations / agent responses. Figure 5The example of "[Scenario: XX Brand]" is an example of a scenario feature, indicating that the conversation was entered from the XX Brand's official WeChat account or website; "[Product: Learning Machine - W2 - Under Warranty]" is an example of a product feature, indicating that the conversation mainly revolves around the W2 model learning machine. This solution accurately supplements the corresponding real conversations with scenario and product features, enabling the virtual agent model to more deeply understand the context of the dialogue and learn to provide more suitable solutions for different product malfunctions in different scenarios. This not only improves the model's ability to understand the context of the conversation content but also enhances the relevance and effectiveness of the model's responses.

[0044] Considering the complexity of business processing logic, user inquiries involve a large number of different fault types. Further analysis revealed that these fault types exhibit a long-tail distribution, which may lead to a certain bias in the training of the analysis model. To minimize this problem, this application embodiment further proposes another specific method for supplementing session features. Specifically, the aforementioned session features include Bayesian features. Step S13, supplementing the session features of the real session based on the session information of the real session, includes:

[0045] This approach collects fault phenomena and corresponding handling behaviors from real-world sessions, and establishes a Bayesian fault network based on these phenomena and behaviors. The Bayesian features of the real-world sessions are then labeled using this network. By utilizing a Bayesian fault network, this solution models the causal relationships between complex fault phenomena and handling behaviors, endowing the virtual agent model with fault reasoning capabilities. Based on the characteristics of Bayesian networks, it not only captures the conditional probability of fault phenomena but also analyzes potential fault paths through dependencies between nodes. This allows the model to more accurately identify the root cause of problems when handling user inquiries and provide more scientific and reasonable solutions, improving the professionalism of fault handling. Furthermore, the flexibility of Bayesian networks allows the model to continuously update and adjust its network structure with the addition of new data, adapting to constantly changing fault modes and user needs. This enables the model to support continuous learning and optimization, providing more professional and practical responses.

[0046] The step of establishing a Bayesian fault network based on the fault phenomenon and the processing behavior includes: determining the Bayesian node name based on the fault phenomenon and the processing behavior; representing the Bayesian node name and its corresponding standard description as a first vector, for example, denoted as vector A; and representing the agent responses in the real conversation as a second vector, for example, denoted as vector B. The vectorization of the node name and agent responses can be achieved using natural language processing techniques, such as word embedding or sentence embedding models, facilitating subsequent semantic matching. Then, the first and second vectors are semantically matched, and agent responses with a similarity greater than a preset similarity threshold are selected based on the matching results. That is, vector A and vector B are semantically matched, and their similarity score is calculated, typically within the range of (0,1). Agent responses with a similarity score greater than the preset similarity threshold are then selected, for example, those with a score greater than 0.8. These selected agent responses are considered to have a high semantic relevance to the corresponding Bayesian node, facilitating subsequent mapping relationship summarization. Cluster analysis is performed on the selected agent responses to extract the most representative responses from a large number of relevant responses, thus obtaining the standard scripts corresponding to the Bayesian nodes. Through the above steps, a mapping set of Bayesian nodes and agent response scripts is generated to obtain the Bayesian fault network, where each Bayesian node corresponds to a set of standard scripts.

[0047] The established Bayesian fault network records the troubleshooting process. Based on the current fault phenomena, this network can be used to deduce the next fault node to be investigated or the necessary actions to be taken. Please combine this with... Figure 6 , Figure 6 This is an example of a Bayesian fault network, as shown in the figure. The elliptical nodes correspond to fault phenomena in a user session, and the square nodes correspond to the agent's response processing behavior. p represents the jump probability. The sum of all p values ​​derived from each node is 1. For example, in the Bayesian fault network shown in the figure, the node "no touch" leads to three possible responses: restart, clean dust, or warranty service, with corresponding jump probabilities p1, p2, and p10, respectively. Therefore, p1 + p2 + p10 = 1. This solution provides the specific logic for building the Bayesian fault network. By performing refined semantic vector representation and matching of fault phenomena, processing behaviors, and agent responses, it can accurately filter out standard dialogues highly relevant to specific fault nodes, providing clear guidance for virtual agents when dealing with similar problems, making the model's responses more professional and standardized.

[0048] The step of labeling the Bayesian features of the real session based on the Bayesian fault network includes: matching the agent's response in the real session with the standard dialogue corresponding to the Bayesian node based on the mapping relationship set obtained above; when a match is successful, marking the corresponding Bayesian node at the end of the previous sentence of the user dialogue in the agent's response as a Bayesian feature. Please refer to... Figure 7 , Figure 7 This is an example diagram of labeled Bayesian nodes. As shown in the figure, after receiving the user dialogue in the third line (before adding Bayesian features), the model combines the Bayesian fault network to match the agent's response to that dialogue. For example, if the agent's response is "Please turn off the power and restart," and it matches the standard script corresponding to the "restart" node in the Bayesian fault network, then Bayesian node information will be added to the previous line of the user dialogue for that agent's response. Figure 7 The Bayesian feature in the example is: [bys: restart]. It should be noted that the representation of the Bayesian fault network described above is not limited to this. Figure 6 The network graph form in the diagram can also be other forms of mapping relationships, such as... Figure 7 The Bayesian node mapping table mentioned earlier. This solution matches agent responses in real conversations with standard dialogue in a Bayesian fault network, and labels the corresponding Bayesian node as a feature upon successful matching. This tightly integrates complex fault handling logic with the dialogue flow, improving the accuracy of dialogue processing and enabling virtual agents to respond more accurately and efficiently in subsequent conversations based on these features.

[0049] To enhance the model's ability to understand and follow context, and to enable it to remember contextual features to ensure consistency in the conversation, this application further proposes another method for supplementing conversation features. Specifically, the conversation features include appeal features. Step S13, supplementing the conversation features of the real conversation based on the conversation information of the real conversation, includes:

[0050] A large model is used to analyze the core user requests in the real dialogue; the real dialogue and the core user requests are used as training data to train a small feature extraction model; the small feature extraction model generates the core user requests as request features based on the conversation content; and the request features are labeled at the end of the user dialogue in the real dialogue. Generally, large models such as GPT3.5 or GPT4 have a massive number of parameters, enabling them to exhibit extremely high accuracy and generalization ability in natural language tasks, but they also require high computational costs and long inference times. Please combine this with... Figure 8This application embodiment utilizes a large model, such as GPT3.5 or GPT4, to analyze a large number of conversations, identifying the core user needs for each conversation. Based on this analysis, a small feature extraction model, such as GPT2, is then trained. This facilitates the rapid acquisition of core user needs for new conversations in subsequent iterations. During training, the large model refines the original conversation data, removing noise and irrelevant information, leaving only data closely related to the core user needs to train the small feature extraction model. The small model focuses on learning the specific task of extracting core user features from conversations, unlike the large model which needs to handle a wide variety of natural language tasks. This results in a relatively simple feature extraction model with fewer parameters. The simpler model structure means less computational requirements, leading to faster inference speeds and lower costs for the small feature extraction model.

[0051] Please combine Figure 9 The feature extraction mini-model generates the user's core needs as feature characteristics based on the conversation content, for example... Figure 9 The request ["Request: Resolve the black screen issue of the all-in-one machine"] is marked with the request feature at the end of the user's actual dialogue. It is understood that analyzing a user's core request requires a certain number of rounds of dialogue in the actual conversation for convenient analysis. For example, in this embodiment, the core user request analysis can be based on actual conversations with three or more rounds of dialogue. The analysis corpus can also utilize only the first three rounds of dialogue in each actual conversation. The feature extraction model trained in this way will, due to this training method, be able to analyze the user's core request through the first three rounds of dialogue in a new conversation when the number of dialogue rounds reaches three or more. It is understood that the above example of using the first three rounds of dialogue to analyze the user's core request is merely for ease of explanation and is not a limitation. In some embodiments, different requirements such as two or four rounds can also be set. This solution utilizes a large model to analyze real-world dialogues to identify users' core needs, and then trains a small model based on these core needs to extract features, ensuring accurate identification of the needs / user's core needs. By directly marking the needs features at the end of the user's dialogue, the model can quickly capture and remember this key information, assisting in consistently responding to the user's core questions throughout the conversation, ensuring the consistency and coherence of the conversation content, and effectively avoiding the phenomenon of the dialogue deviating from the topic or repeating responses.

[0052] In some embodiments, the virtual agent construction method described above further includes preprocessing multiple real conversations in the training dataset. Since a large amount of real dialogue data between former human agents and users is used, it is best to preprocess this data to remove noise or useless responses when training the model. Specifically, this preprocessing method includes:

[0053] a. Identify and delete worthless responses from the agent. In the real conversation between the agent and the user, there are some worthless responses in the agent's replies, including soothing words to relieve the user's queuing anxiety, such as "Okay, received", "Wait a moment", "Let me check", etc. Deleting these worthless responses through preprocessing can make the responses generated by the trained model more direct and useful. b. Identify and delete non-text responses from the agent. The virtual agent construction method provided in the embodiments of this application mainly focuses on text-modal agent responses. Therefore, the conversations containing non-text content in the real conversation can be deleted through preprocessing, such as conversations containing pictures, videos or audio. c. Identify multiple conversations of the same role within a continuous time period and merge them into a single conversation. In an actual conversation, if a role has two or more consecutive responses, these two or more responses will be merged into one conversation. d. Detect sensitive information in the conversation content and delete or equivalently replace the sensitive information. In an actual conversation, if there is sensitive information that needs to be avoided as much as possible, such as phone numbers or important product parameters, it needs to be desensitized, such as directly deleting it or replacing the words, so as to ensure that the trained model will not generate sensitive information as much as possible. This solution effectively eliminates noise and redundant information in the training data through preprocessing. At the same time, it detects and processes sensitive information in the conversation content, avoids the model learning inappropriate responses, reduces the situation where the model generates useless or harmful responses, and improves the reliability of the model in actual applications.

[0054] It can be understood that the above four methods a-d are only preferred examples of the preprocessing methods given in the embodiments of this solution, and do not represent limitations on it. In the actual use process, preprocessing methods different from the above examples can also be selected to achieve the effect of eliminating noise and redundant information in the training data. For example, it can also include deleting special characters in the text (such as HTML tags, URL links, emojis, etc., which usually do not help substantially in model training); deleting extra spaces, line breaks and repeated characters (reducing the text size and lowering the storage and calculation overhead); removing common meaningless words in the text (such as "of", "is", "and", etc., reducing the size of the vocabulary and lowering the computational complexity of the model), and other suitable preprocessing methods.

[0055] The virtual agent construction method provided in this application uses real conversations as training data, enabling the trained model to respond to users in a more realistic way, using more human-like responses, reducing the stiffness of the dialogue, and optimizing the user experience. Training is performed through conversation splicing, and then supplemented with conversation features from real conversations, giving the model the ability to understand long contexts, improving the accuracy of the model in locating user questions, and assisting the model in generating more professional and stable responses. A two-stage training method, which trains the initial agent model and then further trains it using conversation features, allows the model to learn the complete flow logic of a conversation and acquire professional knowledge for handling different problems from a large number of conversations. Combined with an iterative optimization method based on loss values, this ensures that the virtual agent model can continuously improve itself with the accumulation of data and technological advancements, improving service quality and efficiency, and providing better responses to user questions.

[0056] This application provides a virtual agent creation device. Please refer to the embodiments thereof. Figure 10 The virtual agent construction device 200 includes: a training data acquisition module 201, an initial model training module 202, a conversation feature supplementation module 203, and a virtual agent generation module 204. Specifically, the training data acquisition module 201 can acquire multiple real conversations in the training dataset, wherein the real conversations include interaction records between users and agents; the initial model training module 202 can concatenate the real conversations into a complete text and continue pre-training the text using the next sub-word prediction pattern to obtain an initial agent model; the conversation feature supplementation module 203 can supplement the conversation features of the real conversations based on the conversation information of the real conversations; the virtual agent generation module 204 can train the initial agent model to predict agent responses based on the real conversations with supplemented conversation features, and perform loss calculation on the prediction results to iteratively optimize the model parameters based on the loss value to output a trained virtual agent model.

[0057] It should be noted that the aforementioned virtual seat construction device can execute the virtual seat construction method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the embodiments of the virtual seat construction device can be found in the virtual seat construction method provided in the embodiments of this application.

[0058] This application provides a virtual agent interaction method, applied to a virtual agent interaction system. The virtual agent interaction system includes: a session acquisition module for acquiring user sessions; a feature supplementation module for supplementing session features of the user session based on session information, the session features including at least one of scenario features, product features, Bayesian features, and request features; a Bayesian fault network including Bayesian node names and a set of mapping relationships between Bayesian nodes and agent response scripts, wherein each Bayesian node corresponds to a set of standard scripts; a feature extraction mini-model for generating core user requests as request features based on session content; an FAQ question-and-answer module for combining an FAQ knowledge base and outputting agent responses based on the user session; and a virtual agent model constructed as described in the above virtual agent construction method embodiment, used to combine the session features and output agent responses based on the user session. Please refer to... Figure 11 The process of this virtual agent interaction method can be as follows:

[0059] Get the user's input questions or responses.

[0060] The system determines whether the current session round is less than a first preset threshold. If the current session round is less than the first preset threshold, it calls the FAQ module to match the question or answer with a high-scoring result. If a match is successful, it outputs an agent's response based on the high-scoring result. In other words, if a match is successful, it means a high-scoring match exists, and an agent's response can be directly output based on that high-scoring match. If a match fails, it means no high-scoring match exists.

[0061] When the current session round is not less than a first preset threshold, or when the current session round is less than the first preset threshold and matching fails in the step of calling the FAQ question-and-answer module, the user dialogue is marked with session features. In the embodiments of this application, marking session features includes... Figure 11 The process involves acquiring and labeling scenario features, product features, Bayesian features, and demand features. For example, ... Figure 11 As shown, after a session begins, the system can acquire and label the scenario features of the current session. For example, it can acquire the source information of the user session and determine the scenario features based on this source information. Specifically, the methods for labeling scenario features, product features, Bayesian features, and appeal features can be found in the above method embodiments. Step S13 in the context of session features including scenario features, product features, Bayesian features, or appeal features will not be elaborated here.

[0062] After the session features are labeled, the trained virtual agent model is invoked to output agent responses to the questions or replies until the user stops responding.

[0063] In this embodiment, the first preset threshold can be 3 rounds. Based on the above interaction method, if the current session is in the 1st or 2nd round, the FAQ module will be called to output a response from an agent. Specifically, this includes calling the FAQ module, matching the question or response with a high-scoring result, and outputting a response from an agent based on the high-scoring result when a match is successful. If the current session proceeds to the 3rd round, or if the FAQ module cannot output a response from an agent in the first 2 rounds, a trained virtual agent model will be used to output a response from an agent. It is understood that the above 3 rounds are only an example of the first preset threshold and not a limitation thereof. Different first preset thresholds can be set in different application scenarios. It is understood that the model parameters of the virtual agent model in this embodiment depend entirely on its training method, i.e., the virtual model construction method described above. Therefore, the virtual agent model in this embodiment has the beneficial effects corresponding to its training method. For technical details not described in detail in the virtual agent interaction method embodiment, please refer to the virtual agent construction method provided in this embodiment.

[0064] Please combine Figure 12 This application provides an electronic device 300, which includes at least one processor 301 and a memory 302. Figure 12 The example uses a processor 301 and a memory 302.

[0065] Processor 301 and memory 302 can be connected via a bus or other means. Figure 12 Taking the example of a connection between China and Israel via a bus.

[0066] The memory 302, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the virtual agent construction method or virtual agent interaction method in the embodiments of the present invention. The processor 301 executes various functional applications and data processing of the solid-state drive by running the non-volatile software programs, instructions, and modules stored in the memory 302, thereby implementing the virtual agent construction method or virtual agent interaction method in the above method embodiments.

[0067] The memory 302 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and application programs required for at least one function. Furthermore, the memory 302 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 non-volatile solid-state storage device. In some embodiments, the memory 302 may optionally include memory remotely located relative to the processor 301.

[0068] The one or more modules are stored in the memory 302, and when executed by the one or more processors 301, they execute the virtual agent construction method or the virtual agent interaction method in any of the above method embodiments.

[0069] The above-described product can execute the virtual agent construction method or virtual agent interaction method provided in the embodiments of the present invention, and has the corresponding functional modules for executing the method. Technical details not described in detail in this embodiment can be found in the virtual agent construction method or virtual agent interaction method provided in the embodiments of the present invention.

[0070] The device / system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0071] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for constructing virtual agent seats, characterized in that, include: Obtain multiple real conversations from the training dataset, wherein the real conversations include records of interactions between the user and the agent; The multiple real conversations are concatenated into a complete text, and the text is further pre-trained based on the pattern predicted by the next subword to obtain an initial agent model; The session characteristics of the real session are supplemented based on the session information of the real session; Based on the real conversation supplemented with conversation features, the initial agent model is trained to predict agent responses, and the prediction results are used to calculate loss. The model parameters are iteratively optimized based on the loss value to output a trained virtual agent model.

2. The method according to claim 1, characterized in that, The session features include scenario features and product features, and supplementing the session features of the real session based on the session information of the real session includes: Obtain the source information of the real session, and determine the scene characteristics based on the source information; The scene features are marked at the end of the first round of dialogue in the real conversation; Product features are obtained based on the content of the actual conversation; The product features are marked at the end of each sentence in the user's conversation.

3. The method according to claim 1, characterized in that, The session features include Bayesian features, and supplementing the session features of the real session based on the session information of the real session includes: Collect fault phenomena and processing behaviors in the real sessions, and establish a Bayesian fault network based on the fault phenomena and processing behaviors. The Bayesian features of the real session are labeled according to the Bayesian fault network.

4. The method according to claim 3, characterized in that, The step of establishing a Bayesian fault network based on the fault phenomenon and the processing behavior includes: The Bayesian node name is determined based on the fault phenomenon and the processing behavior, and the Bayesian node name and its corresponding standard description are represented as a first vector. The semantic vector representation of the agent's response in the real conversation is used as the second vector; The first vector and the second vector are semantically matched, and agent responses with similarity greater than a preset similarity threshold are selected based on the matching results. Cluster analysis is performed on the selected agent responses to obtain the standard scripts corresponding to the Bayesian nodes; Generate a set of mapping relationships between Bayesian nodes and agent response scripts to obtain a Bayesian fault network, where each Bayesian node corresponds to a set of standard scripts.

5. The method according to claim 4, characterized in that, The Bayesian features used to label the real session based on the Bayesian fault network include: Based on the mapping relationship set, the agent responses in the real conversation are matched with the standard scripts corresponding to the Bayesian nodes; When a match is successful, the corresponding Bayesian node is marked at the end of the previous sentence of the user dialogue in the agent's reply, and used as a Bayesian feature.

6. The method according to claim 1, characterized in that, The session features include request features, and supplementing the session features of the real session based on the session information of the real session includes: Utilize large-scale model analysis to identify the core user needs in the real-world dialogues; The real dialogues and the user's core demands are used as training data to train a small feature extraction model. The feature extraction mini-model is used to generate core user requests as request features based on the conversation content; The requested features are marked at the end of the user's dialogue in the actual conversation.

7. The method according to claim 1, characterized in that, The method also includes preprocessing multiple real sessions in the training dataset, specifically including: Identify and delete worthless replies from agents; Identify and delete non-text replies from agents; Identify multiple conversations of the same character within a consecutive time period and merge them into a single conversation; Detect sensitive information in the session content and delete or replace the sensitive information equivalently.

8. A virtual agent interaction system, characterized in that, The system includes: The session acquisition module is used to acquire user sessions; The feature supplementation module is used to supplement the session features of the user session based on the session information of the user session. The session features include at least one of scenario features, product features, Bayesian features, and appeal features. The Bayesian fault network includes the names of Bayesian nodes and a set of mapping relationships between Bayesian nodes and agent response scripts, where each Bayesian node corresponds to a set of standard scripts; A small feature extraction model is used to generate core user demands as demand features based on the conversation content. The FAQ (Frequency Question and Answer) module is used to combine the FAQ knowledge base to output agent responses based on the user's conversation; and... The virtual agent model constructed by the method of any one of claims 1-7 is used to combine the session features and output agent responses based on the user session.

9. A virtual agent interaction method, applied to the virtual agent interaction system as described in claim 8, the method comprising: Get the user's input question or response; When the current session round is less than a first preset threshold, the FAQ module is invoked to match the question or answer with a high-scoring result, and when the match is successful, the agent's reply is output based on the high-scoring result; When the current session round is not less than the first preset threshold, or when the current session round is less than the first preset threshold and matching fails, the session features of the current session are obtained and marked according to the current session content. The session features include at least one of scenario features, product features, Bayesian features and request features. The virtual agent model is then invoked to output agent responses to the question or reply until the user stops replying.

10. An electronic device, characterized in that, include: At least one processor and memory; The memory is coupled to the processor and is used to store instructions or programs that, when executed by the at least one processor, cause the at least one processor to perform the virtual agent construction method as described in any one of claims 1-7, or to perform the virtual agent interaction method as described in claim 9.