User play and response method, device and product
By constructing a large language model and vector database, the problems of interactive flexibility and realism in traditional sales role-playing systems are solved, achieving efficient business simulation and low-cost maintenance, and improving the realism and adaptability of sales training.
Patent Information
- Application Number
- CN202511754492.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-13
AI Technical Summary
Traditional sales role-playing systems suffer from poor interactive flexibility, weak sense of role realism, and high costs of iteration and maintenance, making it difficult to adapt to rapidly changing business needs.
By constructing a large language model, combining multi-dimensional role feature parameters and emotional states, dynamically adjusting the number of training rounds and parameters, highly realistic user feedback dialogue is generated, and the knowledge base is updated using a vector database to adapt to business changes.
It enables flexible simulation of potential user behavior, enhances the realism and randomness of the roles, reduces system maintenance costs, and improves the model's generalization ability and training stability.
Smart Images

Figure CN121525879A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information technology, and in particular to a user role playing and responding method, device and product. BACKGROUND
[0002] In the sales scenarios of finance, insurance and the like, the communication skills of sales personnel directly affect the business conversion rate, and therefore the "role playing" mode is usually adopted for simulated practice. The industry usually adopts a traditional small model combined with engineering means to realize sales dialogue practice. The core logic of this scheme is "rule preset + limited interaction", that is, a fixed dialogue framework is built by engineering means, and a simple language task within the framework is processed by using a small model. However, this traditional implementation scheme is essentially "simulation" rather than truly "playing" the potential user, and has significant limitations in role implementation path and ability boundary, resulting in many technical defects in actual application.
[0003] Firstly, the interaction flexibility of the traditional scheme is poor, and the role authenticity is weak. Since the system highly depends on the preset script library and keyword matching mechanism for response, once the sales personnel mentions the content not recorded in the rule library in the practice, for example, suddenly mentions the competitor information, involves the non-pre-set customer pain points, or uses non-standard dialogue to introduce the product, the system often cannot correctly process, resulting in "stuttering" of the role, invalid content (such as "I don't know", "change the topic") or even direct interruption of the interaction, and it is completely impossible to simulate the dialogue flow direction full of variables and "uncontrollable" in real communication. At the same time, the role controlled by the traditional small model is very single in emotion expression and decision logic, and often shows the binary state of either all the time questioning or all the time cooperating, which cannot simulate the "hesitation" (such as expressing the need to consult with family members) or "emotional fluctuation" (such as worry due to past experience) of real potential users in the decision-making process; in addition, its response lacks randomness, and after repeated practice, the sales personnel will find that the questioning way and questioning points of the role are highly similar, which is easily recognized as a "scripted" program, and it is difficult to achieve the training effect close to the real user communication environment.
[0004] Secondly, the intention understanding ability of the traditional scheme is weak, and it is easy to cause the dialogue to be disconnected due to "expression deviation". Since the small model mainly relies on the basic keyword matching technology, it cannot deeply understand the deep intention behind "synonymous different expressions". If a certain keyword is not recorded in the rule library, the system cannot match the corresponding response script, resulting in the scene that should respond to the penalty related problem, but the role replies irrelevant content, which seriously damages the coherence of the interaction.
[0005] Finally, traditional systems suffer from high iteration costs and struggle to adapt to rapidly changing business needs. Maintenance of traditional solutions relies heavily on manual operations. When business needs change (e.g., interest rate adjustments, new product launches) or user pain points shift (e.g., from interest rate concerns to data security concerns), developers must manually modify the rule base and update numerous response scripts. As business complexity and user pain points increase, the maintenance cost of the rule base rises exponentially, and its iteration efficiency lags far behind the pace of change in the real market.
[0006] Therefore, in response to the above problems, there is an urgent need for a professional training method that can deeply understand semantics, flexibly respond to unpredictable scenarios, have high realism, and is easy to maintain. Summary of the Invention
[0007] One objective of this application is to provide a user role-playing and response method, device, and product that at least addresses the problems of poor interactive flexibility, weak role realism, and high system iteration and maintenance costs in existing business development exercises.
[0008] To achieve the above objectives, some embodiments of this application provide the following aspects:
[0009] This application provides a user role-playing and response method, the method comprising:
[0010] Acquire historical business dialogue data, and construct dialogue samples for training a large model based on the historical business dialogue data. Preprocess the dialogue samples to obtain preprocessed training samples divided by business scenario.
[0011] The first language model is fine-tuned based on the preprocessed training samples. The fine-tuning training includes calculating the sample sparsity based on the sample size of the preprocessed training samples corresponding to the business scenario, and dynamically adjusting the number of training rounds and / or training parameters based on the sample sparsity.
[0012] Use the finely tuned large model to build a large role model with user role-playing capabilities;
[0013] Set user role characteristic parameters and / or exercise scenario parameters according to business exercise requirements;
[0014] Receive input information from the trainees, and input the input information, the role feature parameters and / or the training scenario parameters into the role model, so that the role model generates user feedback dialogue;
[0015] The user feedback script is returned to the trainees to enable user role-playing business practice.
[0016] Secondly, some embodiments of this application also provide an electronic device, the electronic device comprising: one or more processors; and a memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method described above.
[0017] Thirdly, some embodiments of this application also provide a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described above.
[0018] Compared with related technologies, the solution provided in this application, through a finely tuned role model combined with multi-dimensional role characteristic parameters (including decision-making tendency, emotional state, purchasing power, etc.), achieves dynamic reasoning and complex simulation of potential user behavior. Compared with traditional solutions that rely solely on preset scripts and keyword matching, this solution can flexibly handle "out-of-rule scenarios" and non-standard scripts raised by sales personnel in sales drills, effectively solving the problems of traditional systems easily "lagging" or providing invalid responses. Simultaneously, by simulating users' real and varied psychological states such as "hesitation" and "emotional fluctuations," the realism and randomness of the practice roles are greatly enhanced, avoiding the shortcomings of traditional solutions where practice roles are easily identified as "scripted," making the drill effect closer to real business communication. This solution, through an innovative adaptive optimization training mechanism, solves the problem of training imbalance caused by large differences in sample size between business scenarios. By calculating the "sample sparsity coefficient" for each business scenario and dynamically adjusting the number of training rounds and weight decay coefficient based on this, the number of training rounds is automatically increased for sparse sample scenarios to avoid underfitting. At the same time, by monitoring the perplexity and overfitting risk coefficient in real time, the training parameters are dynamically adjusted to ensure that each business scenario is in the "optimal fit state", thereby effectively improving the overall generalization ability and training stability of the model. Attached Figure Description
[0019] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with 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.
[0020] Figure 1 A flowchart illustrating a user role-playing and response method provided as an exemplary embodiment of this disclosure;
[0021] Figure 2 A flowchart of another user role-playing and response method provided as an exemplary embodiment of this disclosure;
[0022] Figure 3 A flowchart of yet another user role-playing and response method provided as an exemplary embodiment of this disclosure;
[0023] Figure 4 A flowchart of a knowledge base recall method provided as an exemplary embodiment of this disclosure;
[0024] Figure 5 A flowchart of a speech processing method provided as an exemplary embodiment of this disclosure;
[0025] Figure 6 An exemplary structural diagram of the electronic device provided for some embodiments of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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, 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.
[0027] Figure 1 A flowchart of a user role-playing and response method provided as an exemplary embodiment of this disclosure, the method comprising:
[0028] S101. Obtain historical business dialogue data, and construct dialogue samples for training a large model based on the historical business dialogue data. Preprocess the dialogue samples to obtain preprocessed training samples divided according to business scenarios.
[0029] Specifically, this step aims to construct a high-quality, structured training dataset. First, raw historical business dialogue data is collected, such as transcripts of sales recordings from top-performing sales staff and question-and-answer logs. Then, this data undergoes preprocessing based on business scenarios, generating a structured training sample set to provide input for subsequent adaptive training. For example, sales recordings from designated top-performing sales staff (historical top 10 performers) are extracted (using software or models for transcribing speech), categorized by user type, and converted into sales-user dialogue samples, constructing an input (sales script) - output (user script) dataset. 70% of this data is used as the training set, 20% as the test set, and the remaining 10% as the validation set.
[0030] S102. Fine-tuning training of the first language model based on the preprocessed training samples, wherein the fine-tuning training includes calculating sample sparsity based on the sample size of the preprocessed training samples corresponding to each business scenario, and dynamically adjusting the number of training rounds and / or training parameters based on the sample sparsity.
[0031] Specifically, this step aims to address the underfitting or overfitting issues caused by significant differences in training sample sizes across different business scenarios. In existing business scenarios, the training sample sizes vary greatly (e.g., 1000 samples for "regular interest rate consultation" versus only 50 samples for "special overdue processing"). Existing technologies use a fixed number of training rounds (e.g., 3 rounds), leading to underfitting in scenarios with fewer samples (the model hasn't learned the core logic) and overfitting in scenarios with more samples (the model remembers redundant data). Therefore, during fine-tuning, the sparsity coefficient of each business scenario is first calculated. The initial number of training rounds for each business scenario is dynamically determined based on the sparsity coefficient; for example, a higher number of training rounds is set for scenarios with sparse samples to ensure sufficient learning. Simultaneously, the perplexity of the validation set for each scenario is monitored in real-time during training. If the perplexity of a scenario increases continuously for several rounds, its training rounds are automatically reduced to quickly suppress overfitting.
[0032] S103. Construct a large role model with user role-playing capabilities using the finely tuned large model.
[0033] Specifically, after adaptive optimization and fine-tuning training in step S102, the first large language model learns the semantic logic of the business scenario, user psychological characteristics, and complex decision-making tendencies, thus possessing the ability to simulate complex user behavior in business dialogues. This model is then constructed as the role model.
[0034] S104. Set user role characteristic parameters and / or exercise scenario parameters according to business exercise requirements.
[0035] Specifically, before each business drill begins, the large role model is initialized based on the training objectives of the drill participants. This initialization includes:
[0036] User role characteristic parameters include setting multi-dimensional attributes of the user in this exercise, such as the user's decision-making tendency (hesitation, decisiveness), emotional state (anxiety, calmness, resistance), purchasing power, resistance points, industry background and other key parameters.
[0037] The scenario parameters for the exercise include setting the specific environment and background in which the dialogue takes place, such as information about the product to be promoted, characteristics of the target customer group, current market environment information, and / or the set dialogue objectives.
[0038] Furthermore, user role profiles (including industry attributes, personality traits, and pain points), dialogue styles (professional or casual), and scenario rules (such as objection preferences) can be entered into the role configuration backend through a visual interface, thereby generating user role characteristic parameters and exercise scenario parameters.
[0039] S105. Receive input information from the trainees and input the input information and / or the role characteristic parameters and the training scenario parameters into the role model, so that the role model generates user feedback dialogue.
[0040] Specifically, after the exercise begins, real-time dialogue input (text or voice) is received from the trainees (sales personnel). The role model receives this input information and, in conjunction with the current dialogue history, the role characteristic parameters set in step S104, and the exercise scenario parameters, performs dynamic multi-factor reasoning. The reasoning process includes: assessing the impact of the trainees' rhetoric on the user's psychological state (such as emotional changes), dialogue logic, and product acceptance. Based on this dynamic reasoning result, the model generates highly human-like user feedback rhetoric (i.e., user-side responses) that conform to the current scenario and role settings.
[0041] S106. Return the user feedback script to the trainees to achieve user role-playing business practice.
[0042] Specifically, the user feedback script (which can be converted into speech via speech synthesis) is returned to the trainees. After receiving the feedback, the trainees respond again, repeating steps S105 to S106, thus forming a highly realistic cyclical dialogue practice until the preset end conditions are met (e.g., successfully completing a sales pitch, the user explicitly rejecting the pitch, or reaching a preset duration). After the practice ends, the system will also objectively evaluate the trainees' business performance based on the dialogue history (e.g., dialogue fluency, objection handling ability, etc.) and generate targeted guidance feedback.
[0043] In this embodiment, a finely tuned role model, combined with multi-dimensional role characteristic parameters (including decision-making tendency, emotional state, purchasing power, etc.), enables dynamic reasoning and complex simulation of potential user behavior. Compared to traditional solutions that rely solely on preset scripts and keyword matching, this solution can flexibly handle "out-of-rule scenarios" and non-standard scripts raised by sales personnel during drills, effectively solving the problems of traditional systems easily "lagging" or providing invalid responses. Simultaneously, by simulating users' real and varied psychological states such as "hesitation" and "emotional fluctuations," the realism and randomness of the practice roles are greatly enhanced, avoiding the weakness of traditional solutions where practice roles are easily identified as "scripted," making the drills more closely resemble real business communication. Furthermore, an innovative adaptive optimization training mechanism solves the problem of training imbalance caused by large differences in sample size between business scenarios. By calculating the "sample sparsity coefficient" for each business scenario and dynamically adjusting the number of training rounds and weight decay coefficient based on this, the number of training rounds is automatically increased for sparse sample scenarios to avoid underfitting. At the same time, by monitoring the perplexity and overfitting risk coefficient in real time, the training parameters are dynamically adjusted to ensure that each business scenario is in the "optimal fit state", thereby effectively improving the overall generalization ability and training stability of the model.
[0044] Furthermore, in one embodiment, the "sparseness coefficient" of each business scenario sample before training can be determined by the following formula: Sparsity = 1 - (sample size_i / maximum sample size). Wherein, sample size_i is the number of samples in the i-th business scenario, and maximum sample size is the maximum sample size among all scenarios.
[0045] Furthermore, in one embodiment, the number of training epochs is dynamically adjusted based on the sparsity coefficient.
[0046] Specifically, after calculating the "sparseness coefficient" of samples for each business scenario, if the sample is sparse (Sparsity > 0.7), the number of training epochs is automatically set to 5, and if the sample is sufficient (Sparsity < 0.3), it is set to 2. At the same time, the "perplexity" of the validation set of each scenario is monitored in real time. If the perplexity of a certain scenario increases for two consecutive epochs (indicating overfitting), one epoch is automatically reduced to ensure that each business scenario is in the "optimal fit state".
[0047] In the above embodiments, the above mechanism reduces the perplexity of the model in sparse sample scenarios from 8.5 to 5.2 (close to the perplexity of 5.0 in sufficient sample scenarios) in practical applications, and improves the overall generalization ability of the model by 28% compared with the existing fixed epoch method.
[0048] Figure 2A flowchart illustrating another user role-playing and response method provided in an exemplary embodiment of this disclosure, the user role-playing and response method further comprising:
[0049] S107. Construct training samples for assisting responses based on the historical business dialogue data.
[0050] Specifically, this step aims to provide role-reversed training data for the auxiliary response model. Using the historical business dialogue data (i.e., dialogue records between users and sales personnel) acquired and preprocessed in step S101, the roles of input and output for each dialogue round are reversed. For example, the "user's script" in the original data is used as input (Prompt), and the "salesperson's script" is used as the expected output (Completion), thus constructing a training sample set in the format of "user script - sales script". This sample set is used to train the model, enabling it to learn and master the professional and efficient response styles and script logic of sales personnel in different scenarios.
[0051] S108. Fine-tune the second large language model based on the training samples of the auxiliary response to obtain the large auxiliary response model.
[0052] Specifically, this step uses the role-inverted auxiliary response training samples constructed in S107 to fine-tune the second major language model (e.g., an open-source major model, such as QwQ-32B, that is the same as the base model used to build the major role model in S102). This ensures that the second major language model not only has good response fluency but also accurately grasps and outputs key business information. After training, an auxiliary response major model with sales auxiliary response capabilities is obtained.
[0053] S109. Based on the user feedback script and the response request from the trainees, the auxiliary response big model generates response scripts through model understanding combined with a knowledge base recall mechanism.
[0054] Specifically, the core difference between the auxiliary response model and the role model lies in the fact that user role profiles (such as customer identity, needs, communication preferences, etc.) are relatively stable and do not require frequent adjustments; however, the response content needs to be dynamically adapted to product iterations (such as feature upgrades, policy changes, and rights updates). Figure 3During business practice among trainees, or in real business communication scenarios, the system receives response requests from trainees and obtains the user feedback script for the current dialogue round. The auxiliary response model does not directly generate responses; instead, it uses a collaborative model combining "model understanding and knowledge base retrieval" to generate response scripts. The model first performs semantic understanding of the user feedback script, identifying the core intents such as the product, needs, or objections mentioned by the user, and triggers a knowledge base retrieval mechanism based on these intents. The retrieval mechanism retrieves the latest and most accurate target knowledge fragments (such as the latest product interest rates, policy changes, etc.) from an external vector database. Finally, the auxiliary response model integrates the understanding results and the retrieved knowledge fragments to generate and output response scripts that conform to communication logic and strictly match the latest business information for trainees' reference or use.
[0055] In this embodiment, the constructed auxiliary response model ensures that, based on understanding the user's intent, the model retrieves and embeds the latest key business information, such as product policies, interest rate changes, and rights updates, from an external vector database in real time. This fundamentally solves the problem of erroneous information in sales-side responses due to outdated knowledge base updates in traditional solutions, ensuring that the response scripts provided to trainees (or actual sales personnel) strictly match the latest business status, effectively avoiding business risks caused by outdated or incorrect information.
[0056] Secondly, it reduces system maintenance costs and iteration cycles. In traditional sales support systems, whenever business rules or product information change, a large number of preset scripts and rule bases need to be manually modified, resulting in high iteration costs and long update cycles. In this embodiment, since the latest business information is stored in an easily maintainable and updatable knowledge base (vector database), when business changes occur, only the content and vectors of the knowledge base need to be updated, without requiring a complete retraining of the large language model or manual rule reconstruction. This mechanism shifts the complexity and maintenance costs from the model and scripts to the data layer, enabling the system to dynamically adapt to business changes and significantly improving the system's operational efficiency and response speed.
[0057] Finally, the auxiliary response model is fine-tuned based on historical dialogue samples to make its response style more professional and coherent. By learning the response scripts of high-quality salespeople, the model can generate response content that is both logically sound and demonstrates professional sales skills. At the same time, relying on the semantic understanding capabilities of the large model, it can flexibly respond to non-standard and complex response requests from users, overcoming the shortcomings of traditional systems that cannot accurately match responses due to "expression bias".
[0058] In one embodiment, the preprocessing of the dialogue sample includes:
[0059] Based on preset business keywords, key information is extracted and / or redundant content is filtered from the historical business dialogue data.
[0060] Specifically, the preprocessing includes key information extraction and redundant content filtering. This step analyzes historical business dialogue data and, based on preset business keywords (e.g., core elements such as product access conditions and interest rate rules), automatically identifies and anchors key information in the dialogue using a rule engine. Simultaneously, it filters out verbose and redundant dialogue content that lacks business value, thereby significantly increasing the key information density of the dialogue samples and providing more focused, higher-quality data for model training.
[0061] In one embodiment, the preprocessing of the dialogue samples further includes generating adversarial samples of synonyms based on the historical business dialogue data to expand the dialogue samples.
[0062] Specifically, using Prompt Engineering, an open-source large language model is guided to rewrite the original language statements, generating adversarial examples with the same semantics but different expressions (e.g., rewriting "interest rate" as "how is interest calculated"). These adversarial examples are added to the training set to improve the large model's ability to understand the deep intent of "synonymous but different expressions," thereby enhancing its flexibility and robustness in dealing with non-standardized language statements.
[0063] In one embodiment, the preprocessing of the dialogue samples further includes adding business scenario labels and role labels to the dialogue samples to form a hierarchically labeled dataset.
[0064] Specifically, each dialogue is clearly labeled with its associated business scenario (e.g., business loan demand mining) and corresponding user role characteristic tags (e.g., hesitant customer). Through this hierarchical labeling, subsequent fine-tuning training can achieve grouped training by tags, thereby ensuring that the large model can accurately match specific business scenarios and user role styles, improving the realism of role-playing and the relevance of responses.
[0065] In the above embodiments, by extracting key information and filtering redundant content from historical business dialogue data based on preset business keywords, this embodiment can significantly improve data quality and key information density. This process effectively eliminates colloquial, repetitive, or irrelevant redundant information from the dialogue, making the data relied upon for model training more refined and efficient. This processing ensures that the model can learn core business logic and key dialogue elements more effectively, thereby avoiding low model learning efficiency or deviation from core business objectives due to data noise, and thus effectively improving the model's accuracy in understanding business knowledge.
[0066] Furthermore, this embodiment significantly enhances the model's ability to understand and robust to interactions with "synonymous but different expressions" by generating adversarial samples with synonymous expressions and expanding the dialogue dataset. This strategy effectively solves the problem of weak intent understanding caused by the limitations of "keyword matching" in traditional models. Even if the participants use non-standard or diverse expressions (e.g., expressing "no penalty for early settlement" as "borrow and repay at any time"), the large model can accurately identify their deep semantic intent. This enables role-playing and assisted responses to maintain a high degree of interactive coherence and accuracy in complex and varied real-world dialogue scenarios, avoiding dialogue "stuttering" or interruptions due to expression deviations, and greatly improving the user experience.
[0067] Furthermore, adding business scenario and role labels to dialogue samples to create a hierarchically labeled dataset significantly improves the model's scenario matching accuracy and the realism of role-playing. Through this detailed annotation, the large model can specifically learn the unique dialogue styles and decision-making logic of different business scenarios and specific user roles during fine-tuning training. For example, for "individual merchants" set as "hesitant customers" or "concerned about cash flow flexibility," the model can generate more empathetic emotions of hesitation, questions, or concerns, thereby greatly enhancing the realism of role-playing, avoiding the stiffness of "scripted" performance, providing sales personnel with a training experience closer to real communication, and ultimately optimizing their professional skills.
[0068] In one embodiment, the fine-tuning training further includes:
[0069] Calculate an overfitting risk coefficient based on the training set loss and / or validation set loss, and adjust the weight decay coefficient and / or learning rate according to the risk coefficient.
[0070] Specifically, during this fine-tuning training phase, the changing trends of the training loss and validation loss are monitored and recorded in real time for each training iteration. Based on this, a dynamic "overfitting risk coefficient" is calculated by analyzing the relative difference and slope of change between the two. When the training loss continues to decrease while the validation loss begins to stabilize or show an upward trend, this usually indicates that the model is at risk of overfitting, and the calculated risk coefficient will increase accordingly. To address this risk, key hyperparameters in the fine-tuning process—weight decay coefficient and / or learning rate—can be intelligently adjusted according to the magnitude of the overfitting risk coefficient. For example, when the risk coefficient reaches a preset threshold, the weight decay coefficient is automatically increased to enhance the model's regularization ability, penalize excessively large model weights, and thus suppress the model's overfitting to noise in the training data; simultaneously, or separately, the learning rate is appropriately reduced to update model parameters with finer step sizes, avoiding excessive fluctuations near local optima. This dynamic adjustment strategy based on real-time risk assessment enables the fine-tuning process to proactively adapt to the model's learning state, effectively preventing the problem of a model performing well on a specific training set but lacking generalization ability. Ultimately, it ensures that the fine-tuned model can maintain a high level of accuracy and robustness when facing new and unseen data.
[0071] Furthermore, in one embodiment, the overfitting risk coefficient Risk is determined by the following formula:
[0072]
[0073] Wherein, TrainLoss is the training set loss and Val Loss is the validation set loss;
[0074] When Risk < 0.1: there is no risk of overfitting (Train Loss is close to Val Loss).
[0075] When 0.1≤Risk≤0.3: low risk of overfitting (Train Loss decreases faster than Val Loss);
[0076] When Risk > 0.3: High risk of overfitting (Train Loss is much lower than Val Loss, the model remembers the training data).
[0077] Furthermore, in one embodiment, adjusting the weight decay coefficient based on the overfitting risk coefficient specifically includes:
[0078] When Risk < 0.1: weight_decay = 0.005 (reduce weight decay and avoid underfitting)
[0079] When 0.1≤Risk≤0.3: weight_decay=0.01 (normal decay, balanced fitting and generalization)
[0080] When Risk > 0.3: weight_decay = 0.02, and trigger "learning rate decay" (reducing learning_rate from 2e-5 to 1e-5), quickly suppressing overfitting;
[0081] Furthermore, in one embodiment, after each training round, Risk is automatically calculated and weight_decay is updated without manual intervention.
[0082] In the above embodiments, this mechanism reduces the "overfitting rate" of the model during training from 35% to 8% under the existing fixed weight_decay, and stabilizes the validation set perplexity at 5.0±0.2, thereby improving the model training stability and generalization ability compared to existing technologies.
[0083] In the above embodiment, by monitoring the changes in training set loss and validation set loss in real time and calculating the "overfitting risk coefficient Risk" based on a specific formula, this embodiment can perform a refined evaluation of the model's current learning state. This hierarchical and targeted parameter adjustment strategy enables the model to self-optimize according to the actual training situation, effectively avoiding training oscillations or overfitting that may be caused by traditional fixed hyperparameters. Furthermore, after each round of training, the system automatically calculates the overfitting risk coefficient and updates the weight decay coefficient accordingly, eliminating the need for tedious manual parameter trial and error and intervention. This automation not only greatly reduces the workload of algorithm engineers and improves R&D efficiency, but also ensures the timeliness and accuracy of parameter adjustments, avoiding errors that may be caused by human judgment, thus making the entire training process smoother and more efficient.
[0084] Furthermore, in one embodiment, after configuring the training parameters, the Trainer is used to initialize and start two-stage training.
[0085] Specifically, the first stage (unsupervised): rewrite the publicly available financial business documents (product manuals, compliance guidelines) into simulated dialogue samples, and perform unsupervised pre-training on QwQ-32B (only updating 10% of the parameters) to master the basic business logic.
[0086] The second stage (supervised): Fine-tuning was performed using the refined business recording data to optimize the character's response style and dialogue coherence. During training, the real-time curve was monitored using Wandb. The training set loss steadily decreased, the validation set perplexity stabilized at around 5, and the BLEU (Machine Translation Evaluation Metric) score reached 0.82 (a 17% improvement from the original 0.7). This indicates that the model did not overfit and could accurately extract key information.
[0087] In one embodiment, during the fine-tuning training process, text segments containing key business information are assigned higher weight coefficients than ordinary segments, and the large model is trained based on a weighted cross-entropy loss function.
[0088] Specifically, during the fine-tuning training process, semantic analysis or predefined rules and label recognition are used to accurately identify text fragments containing key business information from the input training data. This key business information includes at least one of product interest rates, penalty policies, and product eligibility criteria. For example, this key information may include product names, customer needs, specific terminology, core facts, or instructions that require high attention from the model. Once these key fragments are identified, the system assigns them a higher weight than ordinary text fragments. Conversely, ordinary fragments with relatively low background, auxiliary, or importance are assigned a normal or lower weight. This differential setting of weights aims to guide the model to allocate more attention, computational resources, and error correction priority to these information points that are crucial to business decisions or the model's core functions during the learning process. For example, a weight coefficient (default 1.5) is assigned to "key business information fragments" in the training samples (such as "annualized interest rate of 4.8%-5.5%, no penalty after 6 months of repayment"), while the weight coefficient for ordinary dialogue fragments is set to 1.0.
[0089] Subsequently, the training process will be based on a weighted cross-entropy loss function to train the large model. In this loss function, the loss contribution of each predicted token is no longer equal, but multiplied by the weight coefficient set for its corresponding text segment. This means that prediction errors on key business information segments will result in larger loss values, thus prompting the optimizer to more aggressively adjust the model parameters to correct these errors.
[0090] Through the above methods, this embodiment can significantly improve the large model's ability to understand, memorize, and generate core business knowledge, effectively reduce deviations or errors in the processing of key information, and ultimately enable the fine-tuned large model to exhibit higher accuracy, reliability, and practical value in specific application scenarios.
[0091] Furthermore, when calculating the loss, the cross-entropy loss value is dynamically adjusted according to the segment weights, as shown in the following formula:
[0092]
[0093] Where ω_i is the weight coefficient of the i-th segment (1.0 or 1.5), and CE Loss_i is the cross-entropy loss of the i-th segment;
[0094] During training, the accuracy rate of "key business information generation" in the test set is statistically analyzed in real time. If the accuracy rate is lower than 90%, the weight coefficient is automatically increased to 1.8 to ensure that the model learns and outputs core business information first.
[0095] In the above embodiments, by designing a "dynamic weight loss function for business information", the characteristic that "key business information is more important than ordinary dialogue content" in the business development scenario is guaranteed, thus avoiding the occurrence of prioritizing the fluency of the dialogue while losing core business information.
[0096] In one embodiment, the knowledge base recall mechanism specifically includes:
[0097] The knowledge fragments obtained from parsing product knowledge documents are vectorized using an embedded model and stored in a vector database;
[0098] Vector retrieval is performed on the user feedback statements based on cosine similarity, and target knowledge fragments are determined by filtering based on similarity thresholds and / or topic consistency.
[0099] The target knowledge fragment and the user feedback script are input together into the auxiliary response model to generate the response script.
[0100] Specifically, such as Figure 4 First, the massive amount of product knowledge documents undergoes meticulous pre-processing. These documents may contain various information such as product specifications, features, frequently asked questions, sales highlights, and policy terms. The original text content is parsed and segmented into a series of independent knowledge fragments. These fragments are then fed into a specialized embedding model, which maps high-dimensional text information into low-dimensional vector representations—a process known as "vectorization." Each knowledge fragment corresponds to a unique vector. These vectorized knowledge fragments are then stored in a high-performance vector database for fast and efficient retrieval.
[0101] Secondly, when user feedback (i.e., user questions or input) is received, it is not directly submitted to the large model to generate a response. Instead, the user feedback is first vectorized by the same embedding model to obtain its corresponding vector representation. Then, based on this vector, an efficient retrieval is performed in a pre-built vector database. The core mechanism of this retrieval is cosine similarity, which calculates the similarity between the user feedback vector and all knowledge fragment vectors in the database to identify the semantically most relevant knowledge fragments. To further improve the accuracy and targeting of the retrieval, a dual filtering mechanism is applied: on the one hand, filtering is performed based on a similarity threshold, retaining only knowledge fragments with a similarity higher than a preset threshold; on the other hand, topic consistency filtering is performed, automatically labeling with keywords using a preset business topic tag library or automatically identifying topics using a classification model, ensuring that the selected knowledge fragments are not only similar but also highly consistent with the core topic of the user's question. After these two layers of filtering, a set of highly relevant and accurate target knowledge fragments is finally determined.
[0102] Finally, after obtaining these filtered target knowledge fragments that are closely related to user questions, they are submitted together with the original user feedback script as input to the auxiliary response model.
[0103] In the above embodiments, when generating response scripts, the large model no longer relies entirely on the general knowledge stored in its internal parameters, but can directly refer to and integrate the latest and most authoritative specific product knowledge from external sources. This greatly enriches the contextual information of the model's generated response scripts, enabling it to generate more accurate, professional, detailed, and highly product-matched sales-side response scripts. This effectively avoids model illusions and significantly improves the efficiency and quality of sales communication.
[0104] Furthermore, in one embodiment, the process of vectorizing the knowledge fragments obtained from parsing the product knowledge document using an embedding model and storing them in a vector database specifically includes: preprocessing user questions and unified vector representation.
[0105] Specifically, problem preprocessing involves cleaning up user questions (such as removing interjections like "ah" and "ne", and correcting typos). For example, a user asking "What is the interest rate for applying for a business loan now?" is cleaned to "What is the interest rate for applying for a business loan?"
[0106] Unified Vector Representation: Input the cleaned question text into the same Sentence-BERT model (all-MiniLM-L6-v2) used in the knowledge base transformation to generate a 384-dimensional question vector, ensuring that the question and the knowledge base text are in the same vector space and avoiding similarity calculation deviations caused by model differences.
[0107] Furthermore, in one embodiment, the user feedback statements are retrieved based on cosine similarity.
[0108] Specifically, a search request is sent to the Qdrant vector database, specifying "sorted by cosine similarity", and the similarity value between the question vector and all paragraph vectors in the target set (such as the "business loan" set) is calculated (range 0-1, the higher the value, the more similar the semantics).
[0109] Furthermore, in one embodiment, the specific steps for determining the target knowledge fragment based on similarity threshold filtering and / or topic consistency filtering include:
[0110] Specifically, the system first performs a similarity threshold filter: the default threshold is 0.8 (this can be adjusted according to business needs, such as setting it to 0.85 for high precision and 0.75 for high recall), automatically removing paragraphs with a similarity < 0.8 to avoid interference from low-relevance knowledge (e.g., if a user asks about "interest rates," paragraphs related to "material requirements" are filtered out). Next, a topic consistency filter is performed; combining the "knowledge topic" in the paragraph metadata, results matching the question topic are further filtered (e.g., if a user asks about "interest rates," only paragraphs whose "knowledge topic contains 'interest rates'" are retained). This dual filtering mechanism ensures double the accuracy of the recall.
[0111] Furthermore, in one embodiment, the knowledge base recall can also be configured to return a specific number of results and sort the results.
[0112] Specifically, based on business scenario requirements, the system supports configuring the number of results retrieved in the backend (e.g., returning the Top 3 results for sales assistance to ensure information focus; returning the Top 5 results for self-service queries to provide more references). The Top N retrieved results can be sorted in descending order of similarity, while also displaying the "original paragraph text, document source, and upload time," facilitating quick assessment of knowledge validity by sales staff. To view the complete context, users can click "View Original Text" to jump to the specific location in the corresponding document, improving the efficiency of knowledge utilization.
[0113] Furthermore, in one embodiment, the vector retrieval of the knowledge base further includes: converting the knowledge text into a vector representation, storing the vector representation, and then constructing an index.
[0114] Specifically, the paragraph text vector is first converted: Sentence-BERT (all-MiniLM-L6-v2 model) is selected as the embedding model. Its advantage lies in balancing semantic representation accuracy and computational efficiency. It can convert text into 384-dimensional fixed-length vectors and supports batch processing.
[0115] The preprocessed paragraph texts are then input into the Sentence-BERT model in batches. The model uses its pre-trained semantic understanding capabilities to capture key information such as "product name-attribute-value-time" (e.g., "business loan-interest rate-4.5%-2024.05") and outputs the corresponding 384-dimensional vector.
[0116] Then, metadata is bound to each paragraph vector, including "paragraph ID, document name, upload time, knowledge topic, and original text", which facilitates quick location of knowledge source and context during subsequent retrieval, and also supports filtering the latest knowledge by "upload time".
[0117] Finally, the generated paragraph vectors and metadata are written to a vector database (such as Qdrant).
[0118] Furthermore, in one embodiment, constructing the index specifically includes:
[0119] Create custom collections: Create different collections by "product type" (such as "business loan" and "consumer loan") to avoid retrieval interference caused by mixed storage of cross-product knowledge; if there are many product types, you can achieve categorized retrieval within the same collection through "tag field" (such as product_type: business loan).
[0120] Build an IVF_FLAT (inverted index): For small to medium-sized knowledge bases (such as texts with less than 100,000 segments), use an IVF_FLAT index to keep the retrieval time within 100ms while ensuring retrieval accuracy. If the knowledge base exceeds 1 million segments, it can be upgraded to an HNSW (hierarchical navigable small-world index), which sacrifices a small amount of accuracy (<5%) to improve retrieval efficiency (retrieval time <50ms).
[0121] Furthermore, in one embodiment, a vector expiration mechanism is provided.
[0122] Specifically, add a "knowledge validity period" field (e.g., "2024.05.01-2025.04.30") to the metadata, and trigger Qdrant's filtering query periodically (e.g., daily) to automatically mark expired vectors. During subsequent retrieval, expired knowledge can be excluded by filtering conditions (expire_date>current date) to ensure the timeliness of knowledge.
[0123] In one embodiment, the product knowledge document parsing includes:
[0124] Responding to tabular documents, the basic text is obtained by splitting the document according to its row and column structure;
[0125] Responding to document-type files, the topic text is obtained by splitting the file according to the directory hierarchy;
[0126] The resulting text is then subjected to semantic segmentation and / or length control and / or invalid content filtering to form knowledge fragments for vectorization.
[0127] Specifically, firstly, for tabular documents, such as product parameter tables, price lists, or feature comparison matrices, the system intelligently identifies and parses their row and column structures. Traditional text extraction might only extract cell content, but this embodiment goes further, performing structured combination based on the row header, column header, and content of the cell. For example, the entry for "Product A" with "8GB" memory can be parsed into a basic text fragment like "Product A has 8GB of memory," ensuring data integrity and readability, thereby avoiding the loss of important related information.
[0128] Secondly, for document-type files, such as product manuals, technical white papers, frequently asked questions, or policy guidelines, the focus is on parsing their table of contents hierarchy and chapter logic. By identifying elements such as titles, subheadings, and chapter numbers, the document is broken down into text blocks with clearly defined themes. Each resulting text block typically corresponds to a specific topic or subtopic, forming a thematic text fragment with contextual integrity. This avoids information fragmentation and ensures that each fragment independently conveys a complete concept.
[0129] After the initial segmentation for different document types, a series of standardization and optimization processes are performed on all obtained text (whether basic or topical) to ultimately form high-quality knowledge fragments. This includes semantic segmentation: ensuring each fragment is semantically complete and independent, for example, avoiding truncation in the middle of a sentence or forcibly merging unrelated sentences. Next, length control is applied: limiting the number of characters or tokens in a fragment. Excessively long fragments may reduce the effectiveness of the embedding model and retrieval efficiency, while excessively short fragments may lack sufficient contextual information. The system will perform truncation or merging operations based on preset thresholds. Finally, invalid content filtering automatically identifies and removes headers and footers, advertising information, legal disclaimers, repetitive text, or noisy data unrelated to core knowledge, ensuring the purity and high value of the knowledge fragments.
[0130] Through these meticulous analysis and processing steps, this embodiment can efficiently and accurately transform the original product knowledge document into a series of high-quality knowledge fragments that are clearly structured, semantically complete, and free of redundancy. This lays a solid foundation for subsequent vectorized embedding and efficient knowledge retrieval, thereby greatly improving the knowledge utilization efficiency and accuracy of the entire intelligent response system.
[0131] Furthermore, in one embodiment, it supports uploading product documents in both structured and semi-structured formats, and processes data of different formats through hierarchical parsing logic.
[0132] Specifically, structured formats (Excel / CSV) prioritize reading the relationship between the table header and content. For example, in tables like "Product Name-Interest Rate-Term-Eligibility Criteria", the data is automatically split into "rows (single product information) + columns (knowledge dimensions)" to avoid confusion of information across columns.
[0133] Semi-structured format (Word / PDF): Extract text content using tools such as PyPDF2 and Python-Docx, while recognizing the document's table of contents (e.g., "1. Overview of Business Loan Products → 1.1 Interest Rate Policy"). Using the table of contents nodes as semantic boundaries, the document is broken down into thematic segments such as "Product Overview", "Interest Rate Policy", and "Repayment Rules".
[0134] After format parsing, the output is uniformly structured data in the format of "Paragraph ID-Document Source-Paragraph Text-Knowledge Topic (automatically labeled, such as "Business Loan-Interest Rate")", laying the foundation for subsequent vectorization. For the parsed text, the segmentation quality is further optimized through "Topic Focus Filtering".
[0135] Further filtering of invalid paragraphs: Automatically remove meaningless content such as headers, footers, blank lines, and duplicate declarations (e.g., "The final interpretation right of this manual belongs to XX") from the document; and control paragraph length: Set a threshold for the number of words in a single paragraph (e.g., 100-300 words, configurable). Paragraphs that are too long (e.g., more than 300 words) are split into two parts by punctuation marks such as "comma / semicolon", and paragraphs that are too short (e.g., less than 50 words) are merged with paragraphs with the same topic in the context, ensuring that each paragraph focuses on a single knowledge point (e.g., "Annualized interest rate of business loan is 4.5%, updated in May 2024, applicable to individual merchants"), and avoid "multiple topics in one paragraph" which leads to fuzzy vector representation.
[0136] In one embodiment, the method further includes:
[0137] The system receives voice input from trainees and converts the voice input into text information using a voice recognition model, which is then used as the input information for the trainees.
[0138] In one embodiment, the method further includes:
[0139] The user feedback script is converted into speech using a speech synthesis model and then transmitted back to the trainees.
[0140] Specifically, such as Figure 5On the front-end interface, users can select the user roles they wish to practice with. A long-lived connection is established with the server via WebSocket, and the server retrieves the corresponding role configurations based on the practice needs. On the front-end interface, direct dialogue is possible, with the audio stream transmitted to the server in real-time via WebSocket. The server converts the audio stream into text using the ASR model (Whisper-Large-V3), and then inputs the converted text along with the corresponding role's preset prompts into a finely tuned role-playing model. The model generates matching response scripts for the role and returns them to the server. The server then calls the TTS model (ChatTTS) to convert the script into an audio stream, which is finally transmitted back to the front-end interface via WebSocket, achieving a real-time dialogue effect.
[0141] Furthermore, some embodiments of this application also provide an electronic device. The electronic device can be various forms of digital computer, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.
[0142] The electronic device includes: one or more processors; and a memory storing computer program instructions that, when executed, cause the processor to perform the steps of the methods provided in any one or more of the above embodiments. Figure 6 An exemplary structural diagram of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations. The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0143] The electronic device may further include an input device 1103 and an output device 1104. The processor 1101, memory 1102, input device 1103 and output device 1104 may be connected by a bus or other means, as shown in the figure, which is connected by a bus.
[0144] Input device 1103 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 1104 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display, a light-emitting diode display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0145] To provide interaction with the user, the electronic device can be a computer. The computer has: a display device (e.g., a cathode ray tube or LCD monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback); and input from the user can be received in any form (e.g., voice input or tactile input).
[0146] In this embodiment, a computer-readable medium stores a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in any one or more of the above embodiments. This computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into that device. The aforementioned computer-readable medium carries one or more computer-readable instructions.
[0147] The memory 1102 can serve as a non-transitory computer-readable storage medium, used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 1102, thereby implementing the program instructions / modules corresponding to the methods provided in any one or more of the embodiments described above in this application.
[0148] The memory 1102 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 1102 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1102 may optionally include memory remotely located relative to the processor 1101, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0149] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0150] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, read-only optical discs, digital versatile optical discs or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0151] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including local area networks (LANs) or wide area networks (WANs), or it can be connected to an external computer (e.g., via the Internet through an Internet service provider).
[0152] In the above embodiments, all or part of the implementation can be achieved through software, hardware, firmware, or any combination thereof. For example, it can be implemented using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the above steps or functions. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, and similar devices. In addition, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.
[0153] The computer program product provided in this application includes one or more computer programs / instructions. When executed by a processor, these computer programs / instructions generate, in whole or in part, the processes or functions described in this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0154] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0155] The scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to encompass all variations falling within the meaning and scope of equivalents of the claims. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device in software or hardware. Terms such as "first," "second," etc., are used only for distinguishing descriptions and do not indicate any particular order, nor should they be construed as indicating or implying relative importance.
[0156] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily made by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims, and the above embodiments should be regarded as exemplary and non-limiting.
Claims
1. A user role-playing and response method based on a large model, characterized in that, The method includes: Acquire historical business dialogue data, and construct dialogue samples for training a large model based on the historical business dialogue data. Preprocess the dialogue samples to obtain preprocessed training samples divided by business scenario. The first language model is fine-tuned based on the preprocessed training samples. The fine-tuning training includes calculating the sample sparsity based on the sample size of the preprocessed training samples corresponding to the business scenario, and dynamically adjusting the number of training rounds and / or training parameters based on the sample sparsity. Use the finely tuned large model to build a large role model with user role-playing capabilities; Set user role characteristic parameters and / or exercise scenario parameters according to business exercise requirements; Receive input information from the trainees, and input the input information, the role feature parameters and / or the training scenario parameters into the role model, so that the role model generates user feedback dialogue; The user feedback script is returned to the trainees to enable user role-playing business practice.
2. The method according to claim 1, characterized in that, The method further includes: Training samples for assisting responses are constructed based on the aforementioned historical business dialogue data; The second large language model is fine-tuned and trained based on the training samples of the auxiliary response to obtain the large auxiliary response model; Based on the user feedback script and the response requests from the trainees, the auxiliary response model generates response scripts through model understanding combined with a knowledge base recall mechanism.
3. The method according to claim 1, characterized in that, The preprocessing of the dialogue samples includes: Based on preset business keywords, key information is extracted and / or redundant content is filtered from the historical business dialogue data. And / or generate adversarial samples of synonymous expressions based on the historical business dialogue data to expand the dialogue samples; And / or add business scenario tags and / or role tags to the dialogue samples to form a hierarchically labeled dataset.
4. The method according to claim 1, characterized in that, The fine-tuning training also includes: Calculate an overfitting risk coefficient based on the training set loss and / or validation set loss, and adjust the weight decay coefficient and / or learning rate according to the risk coefficient.
5. The method according to claim 1, characterized in that, During the fine-tuning training process, text segments containing key business information are assigned higher weight coefficients than ordinary segments, and the large model is trained based on the weighted cross-entropy loss function.
6. The method according to claim 2, characterized in that, The knowledge base recall mechanism specifically includes: The knowledge fragments obtained from parsing product knowledge documents are vectorized using an embedded model and stored in a vector database; Vector retrieval is performed on the user feedback statements based on cosine similarity, and target knowledge fragments are determined by filtering based on similarity thresholds and / or topic consistency. The target knowledge fragment and the user feedback script are input together into the auxiliary response model to generate the response script.
7. The method according to claim 6, characterized in that, The product knowledge document parsing includes: Responding to tabular documents, the basic text is obtained by splitting the document according to its row and column structure; Responding to document-type files, the topic text is obtained by splitting the file according to the directory hierarchy; The resulting text is then subjected to semantic segmentation and / or length control and / or invalid content filtering to form knowledge fragments for vectorization.
8. The method according to claim 1, characterized in that, The method further includes: The system receives voice input from trainees and converts the voice input into text information using a voice recognition model, which is then used as the input information for the trainees. And / or convert the user feedback into speech using a speech synthesis model and send it back to the trainees.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as described in any one of claims 1 to 8.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 8.