Dialogue processing method and device, electronic equipment, storage medium and program product
By combining scene recognition models and intent recognition models, the RPA process is dynamically invoked, solving the problem of changing user intent in dynamic dialogues in RPA systems. This achieves efficient automated processing and accurate scene recognition, reducing manual intervention.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE ONLINE SERVICES CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-06-16
AI Technical Summary
Existing RPA systems struggle to adapt to changing user intent during dynamic, multi-turn dialogues, resulting in rigid rules, fixed processes, frequent manual intervention, low response efficiency, and a disconnect between intent and execution.
By combining scene recognition and intent recognition models, the routing module distributes user statements to multiple expert groups for scene recognition. Combined with the group-MOE architecture, the processing flow in the process library is dynamically invoked to form a closed loop between the scene and intent recognition results and the RPA process.
It improves the response efficiency and automation level of RPA processes, reduces manual operations, and enhances the accuracy of scene recognition and RPA process invocation.
Smart Images

Figure CN122221850A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a dialogue processing method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] Robotic Process Automation (RPA) technology has been widely used in business areas such as customer service, automating repetitive tasks such as work order entry and information retrieval through preset rules. Currently, most RPA systems rely on pre-programmed rules in the background to identify and match logic, then execute corresponding static processing flows based on the identification results. However, this approach suffers from rigid rules and fixed processes, making it difficult to adapt to dynamic and multi-turn changes in user intent during conversations. Furthermore, it requires frequent human intervention, leading to low response efficiency during conversations. Summary of the Invention
[0003] The purpose of this application is to provide a dialogue processing method, apparatus, electronic device, storage medium, and program product that can dynamically invoke RPA processes based on real-time dialogue scenarios and user intentions, thereby reducing manual intervention and improving response efficiency and automation levels.
[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions: In a first aspect, embodiments of this application provide a dialogue processing method, including: In response to receiving a user statement, a first scenario of the user statement is identified through a scenario recognition model; the scenario recognition model includes a routing module and multiple expert groups, the routing module assigns the user statement to at least one expert group for scenario recognition, and the first scenario is determined based on the scenario recognition results of the at least one expert group. The first intent of the user's statement is identified using the intent recognition model corresponding to the first scenario. Based on the first scenario and the first intent, a first processing flow is determined from the process library and executed.
[0005] Secondly, embodiments of this application provide a dialogue processing apparatus, including: A first identification module is configured to, in response to receiving a user statement, identify a first scenario of the user statement through a scenario identification model; the scenario identification model includes a routing module and multiple expert groups, the routing module assigns the user statement to at least one expert group for scenario identification, and the first scenario is determined based on the scenario identification results of the at least one expert group. The second recognition module is used to recognize the first intent of the user's statement through the intent recognition model corresponding to the first scenario; The processing module is used to determine a first processing flow from the process library and execute the first processing flow based on the first scenario and the first intent.
[0006] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the dialogue processing steps as provided in the first aspect.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the dialogue processing method as provided in the first aspect.
[0008] Fifthly, embodiments of this application provide a computer program product, the computer program product including a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform the dialogue processing method as provided in the first aspect.
[0009] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: By pre-configuring multiple processing flows in the process library, user statements are identified using scene recognition and intent recognition models during the dialogue process. The identified scene and intent are then combined to automatically invoke the matching processing flow from the library. This creates a closed loop between the scene and intent recognition results and the RPA process, enabling adaptive triggering of corresponding operations during the dialogue, thereby reducing manual intervention and improving response efficiency and automation. Furthermore, a group-MOE (Mixture of Experts) architecture is employed for scene recognition. The routing module assigns at least one appropriate expert group to each user statement for scene recognition, and the scene recognition models of these expert groups are combined to determine the scene of the user statement. This fully leverages the recognition capabilities of different expert groups, improving scene recognition accuracy and thus enhancing the accuracy of RPA process invocation. Attached Figure Description
[0010] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a dialogue processing method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a scene recognition model provided in an embodiment of this application; Figure 3 A flowchart illustrating a method for adjusting a first weight and a second weight, provided for an embodiment of this application; Figure 4 A flowchart illustrating a method for acquiring first training data provided in an embodiment of this application; Figure 5 A flowchart illustrating a training method for a first domain expert group provided in an embodiment of this application; Figure 6 A flowchart illustrating a training method for a third-domain expert group and a routing module provided in an embodiment of this application; Figure 7 A flowchart illustrating a training method for an intent recognition model provided in an embodiment of this application; Figure 8 A flowchart illustrating another dialogue processing method provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a dialogue processing device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] The term "comprising" and its variations as used in this document are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. The term "in response to" indicates that the performed operation depends on a condition or state. When the dependent condition or state is met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which multiple operations are performed.
[0013] It should be noted that the concepts of "first" and "second" mentioned in this document are used only to distinguish different devices, modules or units, and are not used to restrict the order of functions performed by these devices, modules or units or their interdependencies.
[0014] It should be noted that the terms "one" and "more" used in this document are illustrative rather than restrictive, and those skilled in the art should understand that, unless explicitly stated otherwise in the context, they should be understood as "one or more".
[0015] The names of messages or information exchanged between multiple devices in the embodiments of this document are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0016] As mentioned earlier, most RPA systems currently operate based on the following two modes: Pre-programmed / recorded mode: Developers use the PRA designer to build automated processes by recording user actions or by dragging and dropping predefined activity components. These processes are compiled into fixed scripts or flowcharts, which are then strictly executed step-by-step by the RPA system.
[0017] Rule-triggered mode: The execution of an RPA process is triggered by specific, structured rules or events.
[0018] The above two models have the following drawbacks: First, the rules are rigid. Relying on preset rules makes it difficult to adapt to changes in user intent during dynamic, multi-turn dialogues.
[0019] Second, the process is fixed. The RPA process is statically configured and cannot be dynamically adjusted according to real-time intentions.
[0020] Third, frequent human intervention is required. In complex scenarios, human intervention is necessary, which affects processing efficiency and user experience.
[0021] Fourth, intent and execution are disconnected. The intent recognition result does not form a closed loop with the RPA process, and the corresponding operation cannot be automatically triggered.
[0022] Therefore, this application aims to provide a dialogue processing method that combines intent recognition with RPA to invoke processing flows, thereby dynamically invoking RPA flows based on the scenario and intent of real-time user statements, reducing manual operations, and improving response efficiency and automation levels.
[0023] The dialogue processing method provided in this application can be executed by an electronic device. The electronic device referred to herein may include terminals, such as, but not limited to, mobile phones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances, smart wearable devices, vehicle terminals, and aircraft; or, the electronic device may also include a server, such as a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0024] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0025] Please refer to Figure 1 The above is a flowchart illustrating a dialogue processing method provided in an embodiment of this application. The method may include the following steps: S102, in response to receiving a user statement, identify the first scenario of the user statement through a scene recognition model.
[0026] The scene recognition model includes a routing module and multiple expert groups. Each expert group has a different area of expertise; for example, some expert groups may be good at handling input data from a general domain, while others may be good at handling input data from a preset business domain. These preset business domains can be set according to the actual application scenario, and this embodiment does not limit this. For example, if the scene recognition model is applied to the customer service domain of mobile communications, then the preset business domain may include the customer service domain of mobile communications.
[0027] The routing module assigns user statements to at least one expert group for scenario identification. In this case, the first scenario is determined based on the scenario identification results of at least one expert group. The scenario identification results of the expert groups may include the scenario identified for the user statement and the probability of that scenario. Alternatively, the scenario identification results of the expert groups may also include the probability that the user statement belongs to multiple preset scenario tags. These multiple scenario tags can be set according to actual needs, such as scenario tags for real-name authentication, reporting lost or stolen devices, and service suspension.
[0028] In this embodiment, user statements can be understood as real-time statements from the user during a dialogue. If the user engages in dialogue via voice, the user statements are statements transcribed from the user's real-time voice.
[0029] In S102 above, the user's statement can be directly input into the scene recognition model to obtain the first scene of the user's statement.
[0030] Alternatively, a summary of the user's statement can be extracted. For example, a Large Language Model (LLM) can be used to provide a summary of the user's statement, which can then be input into a scene recognition model to obtain the first scene of the user's statement.
[0031] For example, inputting prompts into an LLM can include task descriptions, user statements, and task examples. The task examples can include sample corpora and their summaries. One type of prompt is as follows: {"Sentences": "{User Statements}", "Text_Summary":["{ }"], "Prompt": "Referring to the Text_Summary example above, generate a short dialogue summary of the Texti conversation." Where Texti represents the i-th sample corpus, Texti={Si1,Si2,...,Sij,...,Sin}, where Sij represents the j-th sentence of the i-th sample corpus, and Simi represents the summary of the i-th sample corpus. The sample corpus can be historical call text after removing redundant information.
[0032] S104, using the intent recognition model corresponding to the first scenario, identify the first intent of the user's statement.
[0033] In this embodiment, multiple intent recognition models corresponding to scene labels are pre-deployed. The intent recognition model corresponding to a scene label is trained based on the sample statements corresponding to that scene label. The intent recognition model can adopt various architectures, such as large language models, etc., and this embodiment does not limit it.
[0034] Accordingly, in S104 above, the intent recognition model corresponding to the scene label representing the first scene can be determined as the intent recognition model corresponding to the first scene, and then the user's statement can be input into the intent recognition model to obtain the first intent of the user's statement.
[0035] S106, based on the first scenario and the first intention, determine the first processing flow from the process library and execute the first processing flow.
[0036] The process library stores multiple processing flows, each corresponding to a different scenario and intent. For example, in mobile communication customer service, the process library stores a facial recognition process, which corresponds to the scenarios "real-name authentication," "phone loss reporting and suspension," and the intent "facial recognition is allowed." If the first scenario is identified as "real-name authentication" and the first intent is "facial recognition is allowed," then the facial recognition process is determined as the first processing flow, and the facial recognition process is initiated.
[0037] The dialogue processing method provided in this application pre-configures multiple processing flows in a flow library. During the dialogue, a scene recognition model and an intent recognition model are used to identify the scene and intent of user statements respectively. The identified scene and intent are then combined to automatically call the matching processing flow in the flow library. This achieves a closed loop between the scene and intent recognition results and the RPA flow, enabling adaptive triggering of corresponding operations during the dialogue, thereby reducing manual operations and improving response efficiency and automation levels. Furthermore, in the scene recognition process, a group-MOE (Mixture of Experts) architecture scene recognition model is adopted. The routing module assigns at least one appropriate expert group to the user statement for scene recognition, and the scene recognition models of these expert groups are combined to determine the scene of the user statement. This fully leverages the recognition capabilities of different expert groups, improving scene recognition accuracy and thus enhancing the accuracy of RPA flow invocation.
[0038] In some embodiments, such as Figure 2 As shown, the multiple expert groups in the scene recognition model can include shared expert groups and domain expert groups. Shared expert groups correspond to a general domain, meaning they are adept at handling input data from a general domain. Domain expert groups correspond to a preset business domain, meaning they are adept at handling input data from a preset business domain. Each expert group can include at least one expert network, such as... Figure 2 As shown, the shared expert group includes expert networks 11-1S, and the domain expert group includes expert networks 21-2m.
[0039] Optionally, given the high level of expertise required for scene recognition of input data within a predefined business domain, the domain expert group may include a first domain expert group and a second domain expert group, with the first domain expert group being larger than the second domain expert group. For example, the number of expert networks in the first domain expert group may be greater than the number of expert networks in the second domain expert group, or the number of parameters in the expert networks within the first domain expert group may be greater than the number of parameters in the expert networks within the second domain expert group.
[0040] Therefore, for input data within a preset business domain, the routing module can assign the input data to a first domain expert group and a second domain expert group for scene identification. The identification results from both groups are then combined to determine the scene of the input data. This improves the accuracy of scene identification for input data within the preset business domain.
[0041] Optionally, the number of routing modules can be multiple. For example... Figure 2As shown, the routing module includes routing module 1 and routing module 2. Routing module 1 is responsible for allocating the input data to at least one expert group for scene recognition, and routing module 2 is responsible for assigning a corresponding activation probability to each expert network within the at least one expert group. Therefore, the scene recognition result of the input data is determined by a weighted sum of the scene recognition results and their activation probabilities of all expert networks within the at least one expert group.
[0042] Under the above architecture, S102 may include: Step A1: Identify the domain to which the user statement belongs through the routing module. Based on the domain to which the user statement belongs, determine the first target expert group applicable to the user statement from multiple expert groups, and determine the activation probability of each expert network within the first target expert group.
[0043] In some examples, the routing module may employ a gated network that uses a softmax function to determine the domain to which the user statement belongs, and based on this, determines which expert groups to activate and the activation probability of each expert network in the activated expert groups, and then identifies the activated expert groups as the first target expert groups.
[0044] For example, if the user statement belongs to a general domain, the shared expert group will be designated as the first target expert group; if the user statement belongs to a preset business domain, the domain expert group will be designated as the first target expert group.
[0045] Step A2: Perform scene recognition on the user's statement through each expert network in the first target expert network to obtain the scene recognition result of each expert network.
[0046] Step A3: Determine the first scene based on the scene recognition results and activation probabilities of each expert network within the first target expert group.
[0047] For example, in the first target expert group, the scene recognition results of each expert network include the probability of the user's statement corresponding to 5 scene labels respectively; for each scene label, the probability predicted by all expert networks for that scene label is weighted and summed based on the activation probability of each expert network to obtain the weighted probability of the user's statement for that scene label; finally, the scene label with the highest weighted probability is selected from the 5 scene labels, and the scene represented by the selected scene label is determined as the first scene.
[0048] When the domain expert group includes a first domain expert group and a second domain expert group, in response to the first target expert group being the domain expert group, the first scenario identification result of the user statement is determined based on the scenario identification result and activation probability of each expert network in the first domain expert group; the second scenario identification result of the user statement is determined based on the scenario identification result and activation probability of each expert network in the second domain expert group; and the first scenario identification result and the second scenario identification result of the user statement are weighted and summed based on the first weight of the first domain expert group and the second weight of the second domain expert group to obtain the first scenario.
[0049] Through the above embodiments, the domain expert group can automatically adapt to the complexity of the scene: a smaller second domain expert group is used to speed up the process in simple scenes, while a larger first domain expert group is used to ensure accuracy in complex scenes, ultimately achieving accurate and efficient scene recognition.
[0050] It should be noted that the first weight and the second weight can be preset based on human experience, or can be adjusted based on collaborative training. This application does not limit this.
[0051] In one implementation, such as Figure 3 As shown, the first and second weights are determined as follows: S302, Obtain the first training data.
[0052] The first training data includes: multiple scenario labels under a preset business domain and the first sample statement for each scenario label. For example, the preset business domain is customer service in mobile communications, and the multiple scenario labels may include, but are not limited to, real-name authentication, reporting lost or disconnected service, changing service plans, checking call charges, investigating abnormal data usage, and unsubscribing from value-added services. The first sample statement can be a user statement from historical dialogue text.
[0053] S304, the first domain expert group performs scene recognition on each first sample statement in the first training data to obtain the first scene recognition result for each first sample statement.
[0054] For each first sample statement, scene identification can be performed on the first sample statement by each expert network within the first domain expert group, and the activation probability of each expert network within the first domain expert group can be determined by the routing module. Then, the scene identification results and activation probabilities of each expert network are weighted and summed to obtain the first scene identification result of the first sample statement. This first scene identification result may include the first probability that the first sample statement corresponds to each of the aforementioned multiple scene labels.
[0055] S306, the second domain expert group performs scene recognition on each first sample statement to obtain the second scene recognition result for each first sample statement.
[0056] For each first sample statement, scene identification can be performed on the first sample statement by each expert network within the second domain expert group, and the activation probability of each expert network within the second domain expert group can be determined by the routing module. Then, the scene identification results and activation probabilities of each expert network are weighted and summed to obtain the second scene identification result of the first sample statement. The second scene identification result may include the second probability of the first sample statement corresponding to the aforementioned multiple scene labels.
[0057] S308, based on the first initial weight and the second initial weight, the first scene recognition result and the second scene recognition result of each first sample statement are weighted and summed to obtain the second scene of each first sample statement.
[0058] The second initial weight is determined based on the first initial weight. For example, the weights of the first domain expert group are randomly initialized, and these weights are the first initial weights, denoted as... The second initial weight is .
[0059] The first scene recognition result of the first sample statement is: The second scene recognition result is The second scenario is .
[0060] S310, based on the second scenario and scenario label of each first sample statement, adjust the first initial weight to obtain the first weight, and determine the second weight based on the first weight.
[0061] As an example, a first loss is determined based on the difference between the second scene and the scene label for each first sample statement; a first initial weight is obtained by adjusting the first weight based on the first loss using the gradient descent method; and a second weight is determined based on the first weight.
[0062] For example, the weight gradient is determined by the following formulas (1) to (2), and the weight gradient is reduced based on the first initial weight.
[0063] (1) (2) in, Indicates the first loss. This represents the second scenario of the i-th statement in the first sample. This represents the scene label of the i-th first sample statement. This indicates the number of statements in the first sample. Represents the weight gradient. This represents the gradient of the first loss with respect to the first initial weights. This indicates the preset learning rate.
[0064] This is only a single adjustment process. In practical applications, multiple adjustments can be made based on the initial weight. After each weight adjustment, the first loss is re-determined based on the adjusted weight. This process is repeated multiple times until a preset stopping condition is met, and the weight after the last adjustment is determined as the first weight. The preset stopping condition can be set according to actual needs, such as the first loss converging or the first loss being less than a preset threshold. This embodiment does not limit this.
[0065] As another example, the difference between the second scene and the scene label of each first sample statement is determined; in response to the difference being within a preset range, a first loss is determined based on the difference, and the gradient of the first loss with respect to a first initial weight is determined, and the first initial weight is adjusted based on the gradient to obtain a first weight; in response to the difference being outside the preset range, the KL divergence is determined based on the difference, and a first operation is performed on the first initial weight and the KL divergence to obtain a first weight.
[0066] More specifically, the gradient of the first loss with respect to the first initial weights can be determined by the following formula (3): (3) in, This represents the gradient of the first loss with respect to the first initial weights. This represents the first scene recognition result of the first sample statement. This represents the second scene recognition result of the first sample statement. This represents the second scenario of the first sample statement. This represents the scene label of the first sample.
[0067] Adjusting the first initial weight based on the gradient can include: performing a weighted summation of the gradient and the historical momentum accumulation value to obtain the current momentum accumulation value; and performing a second operation on the first initial weight and the current momentum accumulation value to obtain the first weight.
[0068] For example, the current momentum accumulation value can be determined by the following formula (4), and the second operation is shown in the following formula (5).
[0069] (4) (5) in, This represents the current accumulated momentum value. This represents the cumulative value of historical momentum. This represents the momentum coefficient (usually taken as 0.9). This represents the gradient of the first loss with respect to the first initial weights. Indicates the learning rate. This refers to the time step or the number of iterations.
[0070] The first operation is shown in the following formula (6).
[0071] (6) Wherein, KL divergence is represented. This represents the first scene recognition result of the first sample statement. This represents the second scene recognition result of the first sample statement. This is a hyperparameter used to control the magnitude of weight updates based on KL divergence, measuring the degree of influence of KL divergence on weight updates. Its value is typically around 10. -5 Between ~1.
[0072] As can be seen, by incorporating historical gradient information and employing momentum weighting to adjust the initial weights, oscillations can be prevented. Simultaneously, an uncertainty verification mechanism is introduced: when there is a significant difference in predictions between the first and second domain expert groups, the weight of the first domain expert group is automatically increased.
[0073] The first training data used in S302 above can be obtained in various ways, and this application embodiment does not limit this.
[0074] In one implementation, the first sample statement and its corresponding scene label can be extracted manually from the historical dialogue text.
[0075] In another implementation, such as Figure 4 As shown, the first training data was obtained in the following way: S402, Obtain the first candidate data.
[0076] The first candidate data includes multiple candidate statements and a scenario label for each candidate statement. The first candidate data can be obtained by business experts by extracting and annotating user statements from historical call texts.
[0077] The first candidate data is ,in, , This represents the j-th first sample statement belonging to the i-th scene label. This represents the i-th scene label.
[0078] S404: The first candidate data is optimized using a labeling model to obtain the second candidate data.
[0079] The second candidate data includes multiple scene labels and at least one candidate statement corresponding to each scene label.
[0080] The annotation model can employ an LLM (Limited Least Meaning) approach. Hints can be input into the annotation model to obtain second candidate data. These hints can include a task description, a task example, and the first candidate data. The task description instructs the first candidate data to be optimized by referring to the task example, such as expanding the scene labels and / or the first sample statements corresponding to the scene labels.
[0081] One possible message is as follows: [{"Question":" ","Answer":" "}, {"Question":" ","Answer":" "} ...... {"Question":" ","Answer":" "}] in, This represents the i-th scene label in the first candidate data. This represents the first sample statement corresponding to the i-th scene label in the first candidate data.
[0082] The second candidate data obtained from this is:
[0083] in, This represents the i-th scene label. This represents the first sample statement corresponding to the i-th scene label. .
[0084] S406, The second candidate data is verified using multiple verification models to obtain the verification result of each verification model.
[0085] The validation results of the validation model include the first probability distribution predicted by the validation model for each candidate statement in the second candidate data. The first probability distribution includes the probability of the candidate statement corresponding to multiple scene labels.
[0086] For example, firstly, the dialogue text of a preset business domain is collected and cleaned to construct high-quality instruction fine-tuning data. The dataset format is as follows: { Instruction: Analyze the following user call text scenario and extract key parameters. Output format: {Scenario: , Confidence:} "input": "A user called and said: 'My phone has been forcibly suspended, please help me unblock it'", "output": { Scenario: "System downtime" Confidence level: 0.95 }} Then, based on the open-source large model and pre-set business domain data, LoRA fine-tuning technology is used to fine-tune the model on the instruction dataset to obtain multiple validation models, enabling them to learn domain tasks and knowledge.
[0087] Next, the second candidate data is validated based on the fine-tuned validation model to obtain the validation results of each validation model.
[0088] S408: Based on the verification results of each verification model, obtain multiple scene labels and sample statements for each scene label from the second candidate data to obtain the first training data.
[0089] Specifically, for each candidate statement in the second candidate data, based on the first probability distribution predicted by each verification model for the candidate statement, the uncertainty of the second probability distribution of the candidate statement is determined; the first candidate statement in the second candidate data is determined as a sample statement, and the scene label of the first candidate statement is determined based on the second probability distribution of the first candidate statement, wherein the uncertainty of the second probability distribution of the first candidate statement is less than a preset threshold; after correcting the second probability distribution of the second candidate statement in the second candidate data, the second candidate statement is determined as a sample statement, and the scene label of the second candidate statement is determined based on the corrected second probability distribution of the second candidate statement, wherein the uncertainty of the second probability distribution of the second candidate statement is greater than or equal to the preset threshold.
[0090] For example, suppose the above verification models include verification model A, verification model B, and verification model C, and the verification results of each verification model are as follows: CorpusDS={(CandiS1,DST1),(CandiS2,DST2),...(CandiSn,DSTn)} CorpusQW={(CandiS1,QWT1),(CandiS2,QWT2),...(CandiSn,QWTn)} CorpusLLMa={(CandiS1,LLMaT1),(CandiS2,LLMaT2),...(CandiSn,LLMaTn)}.
[0091] Then, the results from CorpusDS, CorpusQW, and CorpusLLMa are input into the designed dynamic voting network module based on adversarial consensus verification. Model probabilities are introduced as weights, and the output results of verification model A, verification model B, and verification model C for the candidate statements are respectively... , , The formulas for calculating the dynamic weighted voting entropy are shown in Formulas 1-3, where... Represents the model probability weights, and I is the indicator function, where PAi represents the first probability distribution judged by validation model A, and PAi represents the probability that validation model A judges the i-th scene label. Let PBi represent the first probability distribution judged by the validation model B, and let PBi represent the probability that the validation model B judges the i-th scene label. PCi represents the first probability distribution judged by the validation model C, and PCi represents the probability of the i-th scene label judged by the validation model C; the value is 1 when model m predicts the i-th scene label with the maximum probability. , This represents the weighted voting probability of the i-th scene label in category m. Wherein, the weights of model m, ... The uncertainty of the second probability distribution is determined by the following formulas (7) to (9): (7) (8) (9) in, The weights of model m are represented. This represents the maximum probability in the first probability distribution output by model m. Let represent the entropy of the second probability distribution, which represents the uncertainty of the second probability distribution.
[0092] Through a two-layer decision-making mechanism, highly deterministic first candidate statements and their scene labels are output, forming the dataset HighModelTag: HighModelTag={(CandiS1,HMT1),(CandiS2,HMT2),...(CandiSn,HMTn)} At the same time, it also outputs a second candidate statement with low determinism and its scene label, forming the dataset LowModelTag: LowModelTag=CandiIntentCorpus-HighModelTag.
[0093] Furthermore, after submitting the LowModelTag dataset to the annotation experts for review, the result set ExpertTag={(RC1,T1),(RC2,T2),...(RCn,Tn)} is output, where RCI is the sample statement of the i-th scene label after being reviewed and confirmed by the annotation experts, and Ti represents the i-th scene label.
[0094] Furthermore, the dataset LowModelTag and the manually reviewed dataset ExpertTag are merged to form the dataset Corpus_Review=HighModelTag∪ExpertTag.
[0095] Finally, the Corpus_Review dataset is merged with the first candidate dataset IntentSample to obtain the first training data FinalCorpus=Corpus_Review∪IntentSample.
[0096] As can be seen, the above method for obtaining the first training data involves fine-tuning a general-purpose model based on preset business domains. Multiple domain-tuned validation models are used to annotate candidate data expanded from a small seed corpus in parallel. A dynamic weighted voting entropy mechanism is used to perform adversarial consistency checks on the validation results of multiple validation models, automatically selecting high-determinism corpora for direct storage, while only low-determinism corpora are submitted for manual review. This achieves semi-automatic generation and quality verification of the first training data, significantly reducing the cost of manual annotation and the workload of random sampling, thereby improving the quality and scale of training data for scene recognition models from the source.
[0097] In other embodiments, the domain expert group may also include a third domain expert.
[0098] In this situation, such as Figure 5 As shown, the first domain expert is trained in the following way: S502, obtain the second training data.
[0099] The second training data includes multiple scenario labels from a preset business domain and a second sample statement corresponding to each scenario label. The multiple scenario labels include first-class scenario labels and second-class scenario labels. The third domain expert group is trained based on the second sample statements corresponding to the second-class scenario labels.
[0100] The first category of scenario tags can be understood as scenario tags that are not commonly found in the preset business domain, such as, but not limited to, real-name authentication, reporting lost or disconnected services, etc. The second category of scenario tags can be understood as scenario tags that are common in the preset business domain, such as, but not limited to, changes to service plans, balance inquiries, troubleshooting abnormal data usage, and unsubscribing from value-added services, etc.
[0101] S504, for each second sample statement in the second training data, based on the selector parameters, determine the second target expert group applicable to the second sample statement from the first domain expert group and the third domain expert group, and identify the third scenario of the second sample statement through the second target expert group.
[0102] Specifically, the weights of the third-domain expert group can be determined based on the selector parameters, i.e. ,in, This represents the sigmoid function. This represents the selector parameter, and this represents the feature vector of the second sample statement. If this weight is close to 1, the third domain expert group is determined as the second target expert group; if this weight is close to 0, the first domain expert group is determined as the second target expert group.
[0103] The routing module determines the corresponding activation probability for each expert network within the second target expert group, and determines the third scenario of the second sample statement based on the activation probability of each expert network and the scene recognition results.
[0104] The third scenario of the second sample statement is determined by the following formula (10): (10) in, This represents the third scenario of the second sample statement. This indicates the number of expert networks within the third domain expert group. This represents the scene recognition result of the i-th expert network within the third domain expert group. This represents the activation probability of the i-th expert network. This indicates the number of expert networks within the first domain expert group. Let represent the scene recognition result of the j-th expert network within the first domain expert group. Let represent the activation probability of the j-th expert network.
[0105] The scene recognition results of each expert network within the first domain expert group are as follows: ,in, This represents the gating weight of each expert network within the first domain expert group.
[0106] S506, based on the third scenario and scenario label of each second sample statement, adjust the selector parameters and the parameters of the first domain expert group.
[0107] During training, the parameters of the third domain expert group are frozen, keeping the relevant knowledge of the second type of scenario label unchanged.
[0108] As an example, a second loss can be determined based on the differences between the third scenario and scenario labels of the second sample statement, and the selector parameters and the parameters of the first domain expert group can be adjusted based on the second loss.
[0109] As another example, a second loss is determined based on the difference between the third scenario of each second sample statement and the scenario label of each second sample statement; a third loss is determined based on the amount of second sample statements processed by each expert network in the first domain expert group and the amount of second sample statements processed by each expert network in the third domain expert group; a fourth loss is determined based on the parameters of the first domain expert group and the selector parameters; and the selector parameters and the parameters of the first domain expert group are adjusted based on the second, third, and fourth losses.
[0110] The second loss can be the cross-entropy loss.
[0111] The third loss can be determined as follows: based on the amount of data of the second sample statements processed by each expert network in the first domain expert group, determine the first load and first load balancing information of the first domain expert group; based on the amount of data of the second sample statements processed by each expert network in the third domain expert group, determine the second load and second load balancing information of the third domain expert group; and based on the first load balancing information, the second load balancing information, and the difference between the first load and the second load, determine the third loss.
[0112] Specifically, the first load balancing information includes the load variance of each expert network within the first domain expert group, and the second load balancing information includes the load variance of each expert network within the third domain expert group; the load variance of the expert network represents the degree of difference in the load of the expert network in each round of training.
[0113] Accordingly, the third loss is determined as follows: the first group equilibrium loss is determined based on the sum of the load variances of each expert network in the first domain expert group; the second group equilibrium loss is determined based on the sum of the load variances of each expert network in the third domain expert group; the inter-group equilibrium loss is determined based on the difference between the first load and the second load; and the third loss is obtained by weighted summation of the first group equilibrium loss, the second group equilibrium loss, and the inter-group equilibrium loss.
[0114] Therefore, the third loss reflects the differences between expert groups in different fields, which can prevent the aggregation of expert groups from lacking diversity.
[0115] For example, the third loss can be determined by the following formula (11): (11) in, Indicates the third loss. This represents the equilibrium loss within the second group. This represents the equilibrium loss within the first group. This represents the inter-group equilibrium loss. This represents the load variance of each expert network within the third domain expert group. This represents the number of tokens processed by the e-th expert network. This represents the load variance of each expert network within the first domain expert group. This indicates the second load. Indicates the first load amount. This represents the total number of tokens contained in the second training data. β represents the preset load ratio, with a default of β=1, which can be adjusted during training. λ1 and λ2 constrain the balanced utilization of expert networks within the first domain expert group and the uniform utilization of expert networks within the third domain expert group, ensuring the balance of expert networks within each group (avoiding overload or idleness of some expert networks); λ3 forces the total load ratio of the two domain expert groups to be close to β, ensuring the balance of expert networks between groups (preventing insufficient training of the first domain expert group).
[0116] Furthermore, the weighted sum of the second, third, and fourth losses can be determined, i.e. This is based on a weighted and adjusted selector parameter and the parameters of the first domain expert group. Among them, This indicates the second loss. Indicates the third loss. This represents the fourth loss; β represents the weight of the equilibrium loss, usually set to 0.01 (small weights avoid dominating task loss); γ represents the regularization coefficient, usually 10. -5 (Suppress overfitting of new parameters); Denotes the L2 norm of the new parameter, for the new parameter ( , , The size of the constraint.
[0117] This ensures the effectiveness of the first and third domain expert groups, and enhances the professionalism and versatility of the scene recognition model.
[0118] As can be seen, the above-described method for training the first domain expert group, based on group-MOE, constructs the first domain expert group corresponding to the first type of scene label under the preset business domain by incorporating a dual equilibrium constraint loss method during training. This method can adjust the third domain expert group to be suitable for recognizing both the first and second type of scene labels, improving the efficiency of activation computation; it can also solve the problems of insufficient generalization of knowledge in the preset business domain and imbalance in the expert network within the group in general large models.
[0119] In some embodiments, prior to S102 described above, the shared expert group and routing module can be trained using general data and preset domain data. When the input data is business domain data, the shared expert group may not be the primary active expert group, and therefore its updates may be limited. To ensure that the shared expert group does not forget general domain knowledge, it still needs to learn all domain data to ensure that different data can be routed to the appropriate expert group.
[0120] In addition, a third-domain expert group and a routing module are trained using pre-defined business domain data. For the third-domain expert group, it is generally desirable that it primarily handles the pre-defined domain data. Therefore, the following two methods can be used: The first approach is to update only the third-domain expert group and the routing module when encountering predefined domain data during training, without updating the shared expert group (or updating the shared expert group with a smaller learning rate).
[0121] The second approach is to design an additional loss function for the third domain expert group, which is calculated only based on preset domain data and is used only to update the third domain expert group.
[0122] Finally, the shared expert group, the third-domain expert group, and the routing module are trained alternately. The key to training the third-domain expert group is to focus it on the preset business domain through data selection and loss function design, while simultaneously adjusting the routing module to correctly route the preset business domain to the third-domain expert group. This may require some targeted training strategies, such as oversampling the preset business domain data during training, or using a multi-task learning framework, treating the preset business domain as a separate task and assigning a third-domain expert group to this task. During training, for the preset business domain task, the third-domain expert group is used, and the routing module selects it. Simultaneously, the domain characteristics of the third-domain expert group can be strengthened by controlling data flow and gradient updates.
[0123] In one implementation, the training of the third-domain expert group includes the following stages: First, adaptive pre-training for the preset business domain is performed based on the training data. Based on the training data, a combination of Masked Language Modeling (MLM) and term prediction is used to perform adaptive pre-training for the preset business domain. The MLM implementation process is as follows: Given an input sentence sequence, the content of some positions is randomly selected for masking, and the third domain expert group predicts the masked content based on the minimization formula. The optimization objective function is as follows, and its calculation process is shown in the following formulas (12) to (14): (12) (13) (14) Where x represents the input token sequence Randomly select some locations The mask is [MASK]. The model predicts the original token that is masked. xm represents the original token ID at the masked position m. x\M represents the context sequence after the masked position M. E(xm) represents the embedding vector representation of the input token xm. hm represents the model's context encoding output for position m. It is a key term in the preset business domain of input x. It is a domain term for prediction loss function. Control the weights of MLM and term prediction (usually set to a fixed value).
[0124] Next, supervised fine-tuning is performed on the pre-trained third-domain expert group. The parameters of the third-domain expert group are updated by minimizing the cross-entropy loss between the model prediction and the scene label. The supervised fine-tuning is shown in formula (15): (15) Where CE is the cross-entropy loss function. These are weight parameters that control the distillation weights when an expert model (or other existing models) exists, where D represents the training data for the preset business domain, and xi is the input text. These are scene labels; the ultimate goal is to learn a classifier. , KL divergence is the objective function of the classifier that the expert model ultimately learns. It is an asymmetric index that measures the difference between two probability distributions. The smaller the KL divergence, the better the model performance.
[0125] Finally, reinforcement learning alignment is performed on the supervised fine-tuned third-domain expert group. A proximal policy optimization algorithm is employed, achieving stable training through policy gradient optimization and trust region constraints to optimize the third-domain expert group, making it conform to domain rules and expert preferences. The objective function for optimization is... See formula (16): (16) in Indicates the current policy generates a response. The probability of, where This indicates that the old strategy generates the response. The probability, It is the value function, which refers to the advantage function of the expected cumulative return for predicting state x. It is a clipping function (when When the clipping function value is ,when When the clipping function value is Otherwise, the clipping function value equals ), This represents the pruning threshold (typically between 0.1 and 0.3), and the dominance function. , It is a reward function (1 if the classification is correct, 0 if the classification is incorrect), with the constraint that the classification label must appear in the scene labels included in the training data and that no non-compliant words can appear.
[0126] In another implementation, such as Figure 6 As shown, the third-domain expert group and the routing module are trained in the following way: S602, obtain the third training data.
[0127] The third training data includes: the third sample statements corresponding to the second type of scene labels.
[0128] S604, for each third sample statement in the third training data, the routing module identifies the domain to which the third sample statement belongs, and based on the domain to which the third sample statement belongs, determines the third target expert group applicable to the third sample statement from the shared expert group and the third domain expert group.
[0129] The specific implementation of S604 is similar to the specific implementation of the expert group for determining the second objective mentioned above, and will not be repeated here.
[0130] S606, the third target expert group performs scene recognition on the third sample statement to obtain the fourth scene of the third sample statement.
[0131] The specific implementation of S606 is similar to that of the first scenario for determining user statements, and will not be described in detail here.
[0132] S608 adjusts the parameters of the third domain expert group and the routing module based on the fourth scenario and second-class scenario labels of each third sample statement in the third training data.
[0133] As an example, a fifth loss can be determined based on the fourth scenario and the second scenario label of each third sample statement in the third training data; the gradient descent algorithm is then used to adjust the parameters of the third expert group and the routing module based on the fifth loss. The fifth loss can be the cross-entropy loss.
[0134] As another example, the third training data also includes the domain labels of the third sample statements. In this case, a fifth loss is determined based on the difference between the fourth scenario and the second scenario label for each third sample statement in the third training data; a sixth loss is determined based on the domain predicted by the routing module for each third sample statement and the domain label for each third sample statement; and the parameters of the third domain expert group and the routing module are adjusted based on the fifth and sixth losses.
[0135] This ensures that different data can be routed to the appropriate expert group and improves the scene recognition capabilities of the third-domain expert group.
[0136] In some embodiments, prior to S102 described above, the second domain expert group can be trained using the first training data. During the training process, the loss of the second domain expert group is obtained. Initialize its hyperparameter set ( The parameters include the learning rate, the number of training samples per iteration, etc. In each iteration, the gradient is calculated based on the loss, and the hyperparameter set of the second domain expert group is updated using the optimization algorithm Stochastic Gradient Descent (SGD) or Adaptive Moment Estimation (Adam).
[0137] Next, the performance of the second domain expert group is evaluated and adjusted. For example, the scene recognition effect of each round is obtained through the learned hyperparameter set, its performance is evaluated on the validation set, and the best hyperparameter set is selected based on the effect.
[0138] Iterative optimization of the second domain expert group: Repeat the above process until the second domain expert group gradually converges to the point where the accuracy and other metrics on the validation set no longer improve and the loss function... It tends to stabilize and gets infinitely close to 0.
[0139] In other embodiments, the intent recognition model may be trained prior to S104 described above. Specifically, such as Figure 7 As shown, the intent recognition model is trained in the following way: S702, obtain the fourth training data.
[0140] The fourth training data includes the fourth sample statement representing the first scenario and the intent label of the fourth sample statement.
[0141] In one implementation, the fourth training data can be obtained by business experts annotating the fourth sample statement of the first scenario.
[0142] In another implementation, it can also be obtained by LLM by expanding and optimizing the annotation results of business experts.
[0143] In another implementation, fifth training data is obtained, which includes: multiple scene labels, scene recognition rules corresponding to each scene label, and multiple fifth sample statements; using a scene recognition model, based on the scene recognition rules corresponding to multiple scene labels, the scene label of each fifth sample statement is determined from the multiple scene labels; the fifth sample statement corresponding to the scene label representing the first scene is determined as the fourth sample statement.
[0144] The scene recognition rules corresponding to each scene label help the scene recognition model more accurately identify the scene of each fifth sample statement. The scene recognition rules corresponding to the various scene labels mentioned above can be obtained as follows: First, multiple scene labels and scene recognition rules manually compiled for each scene label are obtained to obtain a candidate rule set, where IntentRule={(T1,RL1),(T2,RL2),...(Tn,RLn)}, where RLi represents the scene recognition rule corresponding to the i-th scene label, and T represents the scene label, such as reporting a lost phone or suspending service.
[0145] Then, based on the self-developed syntax symbols "&, |, !(), {}, []", a scene recognition rule set IntentRule was written. In it, & indicates that two keywords appear at the same time, | indicates that multiple rules are separated by a vertical bar, !() indicates that keywords are excluded, {N} indicates that the maximum number of characters between keywords is N, and [] indicates that the configuration rule is limited to matching the role information. That is, when the rule is matched, it is limited to matching only what the agent said or what the customer said. [k:rule] means that the rule only matches what the customer said, and [z:rule] means that the rule only matches what the agent said. Then, IntentRule and Prompt are combined into JSON format to construct a JSON-formatted QA pair.
[0146] { "Tag": "{T1,T2,...Tn}", "IntentRule": ["{(T1,RL1),(T2,RL2),...(Tn,RLn)}"], "Prompt": "Based on the above rule samples, generate a more complete set of scene recognition rules, with the scene label being "loss reported and service suspended", and the rule example samples being: loss reported & service suspended. The requirement is to expand to at least 10 scene recognition rules."
[0147] Next, the designed custom syntax symbols and the above JSON format data are input into the rule-assisted generation module built on LLM, which automatically outputs the rule candidate set Relu_Generate={(GT1,GL1),(GT2,GL2),...(GTn,GLn)}, where GTi is the scene label after optimization by a large model (which may be the same as or more accurate than the original Ti), and GLi is the generated new scene recognition rule set.
[0148] Furthermore, the generated rule candidate set Relu_Generat is submitted to business experts for review, and the final scene recognition rule Relu_Review={(RT1,RR1),(RT2,RR2),...(RTn,RRn)} is output, where RTi is the scene label confirmed by the business experts, and RRi is the scene recognition rule set confirmed by the business experts.
[0149] Finally, the scene recognition rule corresponding to various scene tags is FinalTag=IntentRule∪Relu_Review.
[0150] S704 identifies the first intent of the fourth sample statement through an intent recognition model.
[0151] S706, based on the first intent and intent label of the fourth sample statement, adjust the parameters of the intent recognition model.
[0152] The loss of the intent recognition model can be determined based on the difference between the first intent and the intent label; the gradient descent algorithm is then used to adjust the parameters of the intent recognition model based on this loss.
[0153] The training method described above enables the intent recognition model to more accurately identify user intent in the first scenario, thereby improving the accuracy of dialogue response.
[0154] The dialogue processing model provided in this application can be applied to various business fields. The following explanation uses the mobile communication customer service field as an example.
[0155] like Figure 8 As shown, in the training phase: First, historical dialogue text is acquired, and user statements, scene tags, intent tags, scene recognition rules, etc. in the historical dialogue text are manually sorted out, and the sorted user statements are used as sample statements.
[0156] Then, an auxiliary annotation module integrating LLM was used to expand the sample sentences and their scene labels and intent labels to obtain scene training data for training the scene recognition model and intent training data for training the intent recognition model. In addition, an auxiliary rule generation model integrating LLM was used to expand the scene recognition rules corresponding to each scene label in the scene training data to obtain an expanded set of scene recognition rules.
[0157] Furthermore, the scene recognition model is trained using scene training data and scene recognition rule sets, and the intent recognition model is trained using intent training data.
[0158] In the application phase: User voice is received in real time and transcribed to obtain user statements. Then, an LLM (Local Language Management) is called to generate a summary of the user statements. Based on the summary, a scene recognition model is used to identify the first scene of the user statements.
[0159] In response to the first scenario being a preset scenario (such as reporting a lost phone or suspending service), the intent recognition model identifies the first intent of the user's statement based on the summary.
[0160] In response to the initial intent that facial recognition can be performed, the facial recognition process is automatically initiated from the process library.
[0161] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0162] Based on the same inventive concept, embodiments of this application also provide a dialogue processing device. Please refer to... Figure 9 This is a schematic diagram of the structure of a dialogue processing device 900 provided in an embodiment of this application. The device 900 includes: a first identification module 910, a second identification module 920, and a processing module 930.
[0163] The first identification module 910 is used to identify a first scenario of the user statement in response to receiving the user statement through a scenario identification model; the scenario identification model includes a routing module and multiple expert groups, the routing module assigns the user statement to at least one expert group for scenario identification, and the first scenario is determined based on the scenario identification results of the at least one expert group.
[0164] The second recognition module 920 is used to recognize the first intent of the user's statement through the intent recognition model corresponding to the first scenario.
[0165] The processing module 930 is used to determine a first processing flow from the process library and execute the first processing flow based on the first scenario and the first intent.
[0166] Obviously, the dialogue processing device provided in the embodiments of this application can be used as described above. Figure 1 The entity executing the dialogue processing method shown can therefore realize the dialogue processing device in Figure 1 The functions implemented are the same, so they will not be described in detail here.
[0167] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to it. Figure 10 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0168] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 10 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0169] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0170] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a dialog processing device at the logical level. The processor executes the program stored in memory and specifically performs the following operations: In response to receiving a user statement, a first scenario of the user statement is identified through a scenario recognition model; the scenario recognition model includes a routing module and multiple expert groups, the routing module assigns the user statement to at least one expert group for scenario recognition, and the first scenario is determined based on the scenario recognition results of the at least one expert group. The first intent of the user's statement is identified using the intent recognition model corresponding to the first scenario. Based on the first scenario and the first intent, a first processing flow is determined from the process library and executed.
[0171] The above is as stated in this application. Figure 1 The methods executed by the dialogue processing apparatus disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0172] The electronic device can also perform Figure 1 The method, and implement the dialogue processing device in Figure 1 The functions of the embodiments shown are not described in detail here.
[0173] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0174] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The method of the illustrated embodiment is specifically used to perform the following operations: In response to receiving a user statement, a first scenario of the user statement is identified through a scenario recognition model; the scenario recognition model includes a routing module and multiple expert groups, the routing module assigns the user statement to at least one expert group for scenario recognition, and the first scenario is determined based on the scenario recognition results of the at least one expert group. The first intent of the user's statement is identified using the intent recognition model corresponding to the first scenario. Based on the first scenario and the first intent, a first processing flow is determined from the process library and executed.
[0175] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
[0176] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0177] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0178] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0179] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A dialogue processing method, characterized in that, include: In response to receiving a user statement, the first scenario of the user statement is identified through a scenario recognition model; The scene recognition model includes a routing module and multiple expert groups. The routing module assigns the user statement to at least one expert group for scene recognition. The first scene is determined based on the scene recognition results of the at least one expert group. The first intent of the user's statement is identified using the intent recognition model corresponding to the first scenario. Based on the first scenario and the first intent, a first processing flow is determined from the process library and executed.
2. The method according to claim 1, characterized in that, Each expert group includes at least one expert network, and the multiple expert groups include a shared expert group and a domain expert group. The shared expert group corresponds to a general domain, and the domain expert group corresponds to a preset business domain. The first scenario for identifying the user's statement through a scenario recognition model includes: The routing module identifies the domain to which the user statement belongs, and based on the domain to which the user statement belongs, determines a first target expert group applicable to the user statement from the plurality of expert groups, and determines the activation probability of each expert network within the first target expert group. The user's statement is scene-identified by each expert network within the first target expert group, and the scene identification result of each expert network is obtained. The first scene is determined based on the scene recognition results and activation probabilities of each expert network.
3. The method according to claim 2, characterized in that, The domain expert group includes a first domain expert group and a second domain expert group, with the first domain expert group being larger than the second domain expert group. Determining the first scene based on the scene recognition results and activation probabilities of each expert network includes: In response to the first target expert group being the domain expert group, the first scene recognition result of the user statement is determined based on the scene recognition result and activation probability of each expert network within the first domain expert group; Based on the scene recognition results and activation probabilities of each expert network within the second domain expert group, the second scene recognition result of the user statement is determined; Based on the first weight of the first domain expert group and the second weight of the second domain expert group, the first scene recognition result and the second scene recognition result of the user statement are weighted and summed to obtain the first scene.
4. The method according to claim 3, characterized in that, The first weight and the second weight are determined in the following manner: Acquire first training data, which includes: multiple scene tags under the preset business domain and a first sample statement for each scene tag; The first domain expert group performs scene recognition on each first sample statement in the first training data to obtain the first scene recognition result of each first sample statement. The second domain expert group performs scene recognition on each of the first sample statements to obtain the second scene recognition result of each of the first sample statements. Based on the first initial weight and the second initial weight, the first scene recognition result and the second scene recognition result of each first sample statement are weighted and summed to obtain the second scene of each first sample statement; the second initial weight is determined based on the first initial weight. Based on the second scenario and scenario label of each first sample statement, the first initial weight is adjusted to obtain the first weight, and the second weight is determined based on the first weight.
5. The method according to claim 4, characterized in that, The step of adjusting the first initial weight based on the second scenario and scenario label of each first sample statement to obtain the first weight includes: Determine the differences between the second scenario and the scenario label for each first sample statement; In response to the difference being within a preset range, a first loss is determined based on the difference, and the gradient of the first loss with respect to the first initial weight is determined, and the first initial weight is adjusted based on the gradient to obtain the first weight; In response to the difference exceeding the preset range, the KL divergence is determined based on the difference, and a first operation is performed on the first initial weight and the KL divergence to obtain the first weight.
6. The method according to claim 5, characterized in that, The step of adjusting the first initial weight based on the gradient to obtain the first weight includes: The current momentum accumulation value is obtained by weighted summing of the gradient and the historical momentum accumulation value. A second operation is performed on the first initial weight and the current momentum accumulation value to obtain the first weight.
7. The method according to claim 4, characterized in that, The first training data was obtained in the following way: Obtain first candidate data, which includes multiple candidate statements and scene tags for each candidate statement; The first candidate data is optimized by the annotation model to obtain the second candidate data, which includes the plurality of scene labels and at least one candidate statement corresponding to each scene label. The second candidate data is validated using multiple validation models, and the validation result of each validation model is obtained. The verification result of the verification model includes a first probability distribution predicted by the verification model for each candidate statement in the second candidate data, and the first probability distribution includes the probability of the candidate statement corresponding to the multiple scene labels; Based on the verification results of each verification model, the multiple scene labels and sample statements of each scene label are obtained from the second candidate data to obtain the first training data.
8. The method according to claim 7, characterized in that, The step of obtaining the multiple scene tags and sample statements for each scene tag from the second candidate data based on the verification results of each verification model includes: For each candidate statement in the second candidate data, based on the first probability distribution predicted by each verification model for the candidate statement, the second probability distribution of the candidate statement and the uncertainty of the second probability distribution are determined; The first candidate statement in the second candidate data is determined as the sample statement, and the scene label of the first candidate statement is determined based on the second probability distribution of the first candidate statement, wherein the uncertainty of the second probability distribution of the first candidate statement is less than a preset threshold. After correcting the second probability distribution of the second candidate statement in the second candidate data, the second candidate statement is determined as a sample statement, and the scene label of the second candidate statement is determined based on the corrected second probability distribution of the second candidate statement. The uncertainty of the second probability distribution of the second candidate statement is greater than or equal to the preset threshold.
9. The method according to claim 3, characterized in that, The domain expert group also includes a third domain expert group; The first domain expert group was trained in the following way: Acquire second training data, which includes multiple scene labels of the preset business domain and a second sample statement corresponding to each scene label. The multiple scene labels include a first type of scene label and a second type of scene label. The third domain expert group is trained based on the second sample statement corresponding to the second type of scene label. For each second sample statement in the second training data, based on the selector parameters, a second target expert group suitable for the second sample statement is determined from the first domain expert group and the third domain expert group, and a third scenario of the second sample statement is identified through the second target expert group; Based on the third scenario and scenario label of each second sample statement, adjust the selector parameters and the parameters of the first domain expert group.
10. The method according to claim 9, characterized in that, The adjustment of the selector parameters and the parameters of the first domain expert group based on the third scenario and scenario label of each second sample statement includes: The second loss is determined based on the difference between the third scenario of each second sample statement and the scenario label of each second sample statement; The third loss is determined based on the amount of data of the second sample statements processed by each expert network in the first domain expert group and the amount of data of the second sample statements processed by each expert network in the third domain expert group; Based on the parameters of the first domain expert group and the selector parameters, a fourth loss is determined; Based on the second loss, the third loss, and the fourth loss, the selector parameters and the parameters of the first domain expert group are adjusted.
11. The method according to claim 10, characterized in that, The determination of the third loss based on the amount of data of the second sample statements processed by each expert network in the first domain expert group and the amount of data of the second sample statements processed by each expert network in the third domain expert group includes: Based on the amount of data of the second sample statements processed by each expert network in the first domain expert group, the first load and first load balancing information of the first domain expert group are determined. Based on the amount of data of the second sample statements processed by each expert network in the third domain expert group, the second load and second load balancing information of the third domain expert group are determined. The third loss is determined based on the first load balancing information, the second load balancing information, and the difference between the first load and the second load.
12. The method according to claim 11, characterized in that, The first load balancing information includes the load variance of each expert network within the first domain expert group, and the second load balancing information includes the load variance of each expert network within the third domain expert group; the load variance of the expert network represents the degree of difference in the load of the expert network in each round of training. The determination of the third loss based on the first load balancing information, the second load balancing information, and the difference between the first load and the second load includes: The equilibrium loss within the first group is determined based on the sum of the load variances of each expert network within the first domain expert group. The equilibrium loss within the second group is determined based on the sum of the load variances of each expert network within the third domain expert group. Based on the difference between the first load and the second load, determine the inter-group balancing loss; The third loss is obtained by weighted summation of the equilibrium loss within the first group, the equilibrium loss within the second group, and the equilibrium loss between groups.
13. The method according to claim 9, characterized in that, The third domain expert group and the routing module are trained in the following manner: Obtain third training data, which includes: third sample statements corresponding to the second type of scene labels; For each third sample statement in the third training data, the routing module identifies the domain to which the third sample statement belongs, and based on the domain to which the third sample statement belongs, a third target expert group suitable for the third sample statement is determined from the shared expert group and the third domain expert group; The third target expert group performs scene recognition on the third sample statement to obtain the fourth scene of the third sample statement; Based on the fourth scenario and second scenario label of each third sample statement in the third training data, the parameters of the third domain expert group and the parameters of the routing module are adjusted.
14. The method according to claim 13, characterized in that, The third training data also includes the domain labels of the third sample statements; The adjustment of the parameters of the third domain expert group and the routing module based on the fourth scenario and second scenario label of each third sample statement in the third training data includes: Based on the differences between the fourth scenario and the second scenario label of each third sample statement in the third training data, the fifth loss is determined. The sixth loss is determined based on the domain predicted by the routing module for each third sample statement and the domain label of each third sample statement; Based on the fifth loss and the sixth loss, the parameters of the third domain expert group and the parameters of the routing module are adjusted.
15. The method according to claim 1, characterized in that, Before identifying the first intent of the user's statement using the intent recognition model corresponding to the first scenario, the method further includes: Obtain fourth training data, which includes a fourth sample statement representing the first scenario and an intent label for the fourth sample statement; The intent recognition model is used to identify the first intent of the fourth sample statement; Based on the first intent and intent label of the fourth sample statement, the parameters of the intent recognition model are adjusted.
16. The method according to claim 15, characterized in that, The fourth sample statement was obtained in the following way: Acquire the fifth training data, which includes: multiple scene labels, scene recognition rules corresponding to each scene label, and multiple fifth sample statements; Using the scene recognition model, and based on the scene recognition rules corresponding to the multiple scene tags, the scene tag for each fifth sample statement is determined from the multiple scene tags; The fifth sample statement corresponding to the scene label representing the first scene is determined as the fourth sample statement.
17. A dialogue processing apparatus, characterized in that, include: The first recognition module is used to recognize the first scenario of the user statement through a scene recognition model in response to receiving the user statement. The scene recognition model includes a routing module and multiple expert groups. The routing module assigns the user statement to at least one expert group for scene recognition. The first scene is determined based on the scene recognition results of the at least one expert group. The second recognition module is used to recognize the first intent of the user's statement through the intent recognition model corresponding to the first scenario; The processing module is used to determine a first processing flow from the process library and execute the first processing flow based on the first scenario and the first intent.
18. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of dialogue processing as described in any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the dialogue processing method as described in any one of claims 1 to 16.
20. A computer program product, characterized in that, The computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform the dialogue processing method as described in any one of claims 1 to 16.