Robustness analysis method and apparatus for dialog understanding model, and computer device

By testing the original and adversarial sample sets of the dialogue understanding model and comparing changes in its evaluation data, the problem of inaccurate robustness evaluation in traditional technology is solved and more accurate robustness analysis is achieved.

WO2025016077A1PCT designated stage expired Publication Date: 2025-01-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/096632
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-14
Filing Date
2024-05-31
Publication Date
2025-01-23

AI Technical Summary

Technical Problem

There is an inaccurate problem in the assessment of robustness of dialogue understanding models in traditional techniques, mainly due to the excessive differences between different test samples before and after deformation.

Method used

By obtaining the original dialogue sample set, reconstruct the speaking turns of each sample to generate an adversarial sample set, and test the dialogue understanding model with the original sample set and the adversarial sample set respectively, and compare the changes in the original evaluation data and the adversarial evaluation data. situation to determine the robustness analysis results of the model.

Benefits of technology

This method can more accurately evaluate the robustness of the dialogue and understanding model, reduce the error caused by sample differences, and provide more reliable robust analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024096632_23012025_PF_FP_ABST
    Figure CN2024096632_23012025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a robustness analysis method and apparatus for a dialog understanding model, and a computer device, a storage medium and a computer program product. The method comprises: acquiring a raw sample set (S202), wherein the raw sample set comprises a plurality of raw dialog samples, and each round of dialog in each raw dialog sample comprises at least two speaking rounds in which speaking parties are different; for at least part of each speaking round, reconstructing each raw dialog sample, so as to obtain an adversarial sample set matching the raw sample set (S204); performing a test by taking the raw sample set as a test set, so as obtain raw evaluation data of a dialog understanding model (S206); performing a test by taking the adversarial sample set as a test set, so as to obtain adversarial evaluation data of the dialog understanding model (S208); and determining a robustness analysis result of the dialog understanding model according to the change situation of the adversarial evaluation data relative to the raw evaluation data (S210). By using the method, the difference of different samples before and after reconstruction can be reduced, and the robustness of a model under a plurality of sample adversarial tests is combined, thereby facilitating an improvement in the accuracy of a robustness analysis result.
Need to check novelty before this filing date? Find Prior Art

Description

Robustness analysis method, device and computer equipment for dialogue understanding model

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on July 14, 2023, with application number 202310863300.1 and application name “Robustness Analysis Method, Apparatus and Computer Equipment for Dialogue Understanding Model”, all contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for robustness analysis of a dialogue understanding model. Background Art

[0004] With the development of computer technology, natural language processing (NLP) has emerged, which uses computer technology to analyze, understand, and process natural language. Applying NLP technology to dialogue understanding tasks can generate dialogue understanding models through machine learning.

[0005] Traditionally, the robustness of a conversation understanding model is assessed by randomly deforming test samples and then comparing the model's understanding accuracy using the pre-deformed test samples with the post-deformed test samples. This approach can result in significant differences in the accuracy of different test samples before and after deformation, leading to inaccurate robustness assessments.

[0006] Summary of the Invention

[0007] According to various embodiments of the present application, a method, apparatus, computer device, computer-readable storage medium, and computer program product for robustness analysis of a dialogue understanding model are provided.

[0008] In a first aspect, the present application provides a method for analyzing the robustness of a conversation understanding model, performed by a computer device. The method comprises:

[0009] Acquire an original sample set; the original sample set includes a plurality of original conversation samples; each round of conversation in each of the original conversation samples includes at least two speaking rounds with different speakers;

[0010] Reconstructing each of the original dialogue samples for at least a portion of each of the speech turns to obtain an adversarial sample set that matches the original sample set;

[0011] Using the original sample set as a test set, testing to obtain original evaluation data of the dialogue understanding model;

[0012] Using the adversarial sample set as a test set, testing to obtain adversarial evaluation data of the dialogue understanding model; and

[0013] A robustness analysis result of the dialogue understanding model is determined based on a change in the adversarial evaluation data relative to the original evaluation data.

[0014] On the other hand, the present application also provides a robustness analysis device for a dialogue understanding model. The device includes:

[0015] An acquisition module is configured to acquire an original sample set, wherein the original sample set includes a plurality of original conversation samples, and each conversation round in each original conversation sample includes at least two speech rounds with different speakers;

[0016] a reconstruction module, configured to reconstruct each of the original dialogue samples for at least a portion of each of the speech turns, to obtain an adversarial sample set that matches the original sample set;

[0017] An original test module, configured to use the original sample set as a test set to obtain original evaluation data of the dialogue understanding model;

[0018] an adversarial testing module, configured to use the adversarial sample set as a test set to obtain adversarial evaluation data of the dialogue understanding model; and

[0019] A robustness analysis result determination module is used to determine the robustness analysis result of the dialogue understanding model based on the change of the adversarial evaluation data relative to the original evaluation data.

[0020] In another aspect, the present application further provides a computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors execute the steps of the method embodiments of the present application when executing the computer-readable instructions.

[0021] In another aspect, the present application further provides a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by one or more processors, perform the steps of the method embodiments of the present application.

[0022] In another aspect, the present application further provides a computer program product, comprising computer-readable instructions, which, when executed by one or more processors, perform the steps of the method embodiments of the present application.

[0023] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.

[0025] FIG1 is a diagram illustrating an application environment of a method for robustness analysis of a dialogue understanding model in one embodiment;

[0026] FIG2 is a schematic diagram of the online process of a dialogue understanding model in one embodiment;

[0027] FIG3 is a schematic diagram of a robustness analysis process of a dialogue understanding model in one embodiment;

[0028] FIG4 is a flowchart of a method for analyzing the robustness of a dialogue understanding model in one embodiment;

[0029] FIG5 is a schematic diagram of a robustness analysis process of a dialogue understanding model in another embodiment;

[0030] FIG6 is a flowchart of a method for analyzing the robustness of a dialogue understanding model in another embodiment;

[0031] FIG7 is a schematic diagram of robustness analysis results using a robustness indicator system array in one embodiment;

[0032] FIG8 is a schematic diagram of robustness analysis results of application model accuracy in one embodiment;

[0033] FIG9 is a schematic diagram of robustness analysis results obtained in an ablation experiment scenario in one embodiment;

[0034] FIG10 is a block diagram of a robustness analysis device for a dialogue understanding model according to one embodiment;

[0035] FIG11 is a diagram showing the internal structure of a computer device according to one embodiment;

[0036] FIG12 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0038] The robustness analysis method of the dialogue understanding model provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. The terminal 102 communicates with the server 104 through a network. The communication network can be a wired network or a wireless network. Therefore, the terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication. For example, the terminal 102 can be indirectly connected to the server 104 through a wireless access point, or the terminal 102 can be directly connected to the server 104 through the Internet. This application does not limit this. The terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The data storage system can store data that server 104 needs to process. The data storage system can be set up separately, integrated on server 104, or placed in the cloud or on other servers.

[0039] It should be noted that the robustness analysis method for the dialogue understanding model in the embodiments of the present application can be performed solely by server 104 or jointly by terminal 102 and server 104. If the data processing capabilities of terminal 102 meet the robustness analysis requirements, terminal 102 can also perform the robustness analysis alone. Taking the case of server 104 performing the analysis alone as an example, during the robustness analysis of the dialogue understanding model, server 104 first obtains an original sample set comprising multiple original dialogue samples. Each dialogue turn in each original dialogue sample includes at least two speech turns with different speakers. Then, for at least a portion of each speech turn, each original dialogue sample is reconstructed to obtain an adversarial sample set that matches the original sample set. Next, the original sample set is used as a test set to obtain original evaluation data for the dialogue understanding model; and the adversarial sample set is used as a test set to obtain adversarial evaluation data for the dialogue understanding model. Finally, based on the changes in the adversarial evaluation data relative to the original evaluation data, the robustness analysis results of the dialogue understanding model are determined.

[0040] In one embodiment, the robustness analysis method for a conversation understanding model provided herein can be applied to pre-launch robustness assessment scenarios. Specifically, as shown in Figure 2, after the server trains the conversation understanding model, it needs to perform an accuracy and robustness assessment on the model to ensure that it meets application requirements before launching it. During the pre-launch robustness analysis of the conversation understanding model, as shown in Figure 3, the server can obtain an original sample set comprising multiple original conversation samples and use this original sample set as a test set to obtain raw evaluation data for the conversation understanding model. Each conversation turn in each original conversation sample includes at least two speaking turns with different speakers. The server then reconstructs each original conversation sample for at least a portion of each speaking turn, obtaining a reconstructed conversation sample that matches each original conversation sample. For example, in Figure 3, reconstructed conversation sample 1 matches original conversation sample 1, and reconstructed conversation sample 2 matches original conversation sample 2. It can be understood that each reconstructed conversation sample constitutes an adversarial sample set that matches the original sample set. The server then uses this adversarial sample set as a test set to obtain adversarial evaluation data for the conversation understanding model. Finally, the server determines the robustness analysis results of the dialogue understanding model based on the changes in the adversarial evaluation data relative to the original evaluation data. If the robustness analysis results indicate that the dialogue understanding model's robustness meets the requirements for online applications, the model is launched online.

[0041] In one embodiment, the robustness analysis method of the dialogue understanding model provided in this application can also be applied to the robustness evaluation application scenario for the updated model. Specifically, during the model application process, it is usually necessary to perform update iterations to improve accuracy. Then, the server can perform a robustness analysis on the dialogue understanding model obtained after the update. The specific analysis process is described above and will not be repeated here. It can be understood that if the robustness analysis result indicates that the robustness of the updated dialogue understanding model is better than the dialogue understanding model before the update, the updated dialogue understanding model can be replaced by the updated dialogue understanding model; conversely, if the robustness analysis result indicates that the robustness of the updated dialogue understanding model is worse than the dialogue understanding model before the update, it is necessary to further evaluate whether it is necessary to perform this model update in combination with other indicators. Other indicators may include, for example, work efficiency, accuracy, model size, etc.

[0042] In one embodiment, as shown in FIG4 , a method for robustness analysis of a dialogue understanding model is provided. The method may be executed by a computer device, which may be the terminal or server shown in FIG1 . In this embodiment, the method is described by applying it to the server shown in FIG1 , and includes the following steps:

[0043] Step S402: Obtain the original sample set.

[0044] The original sample set includes multiple original conversation samples. A conversation refers to a language communication process involving at least two speakers. An original conversation sample refers to a text used to record the conversation process. The language type used by the original conversation sample is not unique, for example, it may include Chinese, English, German, etc., which is not limited here. The original sample set refers to a sample set including multiple original conversation samples. Each original conversation sample includes at least one round of conversation, and each round of conversation includes at least two speaking rounds with different speakers. Furthermore, the original conversation sample includes speaker information and speech information. Exemplarily, the original conversation sample 1 can be:

[0045] “(Speaking Round 1) Speaker A: I ate a mango today.

[0046] (Speaking Round 2) Speaker B: It is difficult to buy mangoes in this season.

[0047] (Speaking Round 3) Speaker A: How about I give you a box? I have a lot.

[0048] (Speaking Round 4) Speaker B: Great!

[0049] It can be understood that the "Speaker A" and "Speaker B" recorded in the above original conversation sample 1 are speaker information, "I ate a mango today", "It's hard to buy mangoes in this season", "How about I give you a box? I have a lot", and "That's great" are speech information, and the original conversation sample 1 includes a total of two rounds of conversation, and each round of conversation includes two speech rounds participated by speaker A and speaker B. In other words, speech round 1 and speech round 2 constitute a round of conversation, and speech round 3 and speech round 4 constitute a round of conversation. It should be noted that each round of conversation in the original conversation sample can include various dialogue forms such as declarative dialogue or question-and-answer dialogue, which is not limited here. For example, in the above original conversation sample 1, speech round 1 and speech round 2 constitute a round of declarative dialogue, and speech rounds 3 and 4 constitute a round of question-and-answer dialogue.

[0050] Specifically, the server can obtain a raw sample set including multiple raw conversation samples. The server can obtain the raw sample set by either active acquisition or passive reception. For example, a user can input conversation information into a terminal. The specific form of the conversation information can include, for example, voice, text, etc. The server then obtains raw conversation samples based on the conversation record composed of each conversation information, thereby obtaining the raw sample set including multiple raw conversation samples. The server can also obtain the raw conversation sample set via a network.

[0051] Step S404 : reconstructing each original dialogue sample for at least a portion of each speech round to obtain an adversarial sample set that matches the original sample set.

[0052] Robustness can be understood as a model's tolerance to data variations. If a small deviation in sample data or a small perturbation within the model only slightly impacts the model output and still produces correct results, the model is considered robust and has withstood the attack. Based on this, dialogue understanding models can be tested for robustness and flaws by reconstructing dialogue samples with imperceptible perturbations. The imperceptibility of perturbations during the reconstruction process can be understood as the relatively small impact of the added perturbations on the sample semantics.

[0053] Specifically, as described above, each conversation round in each original conversation sample includes at least two speech rounds with different speakers. In other words, the original conversation sample is essentially composed of multiple speech rounds. Based on this, the server can perform information transformation on at least a portion of each speech round in each original conversation sample to obtain reconstructed conversation samples that match each original conversation sample, thereby obtaining a set of adversarial samples that match the original sample set.

[0054] Furthermore, the process of transforming speech information can include information transformation at multiple levels, such as character level, word level, and sentence level. Character-level transformation, also known as word-granularity attack, specifically corresponds to English letters or Chinese characters. Perturbations can be added at the letter or word level by replacing similar or homophone characters, and adding, deleting, or modifying word-granularity to generate reconstructed dialogue samples. Word-level transformation, also known as word-granularity attack, specifically corresponds to English words or Chinese phrases. Perturbations can be added at the word or phrase level by replacing synonyms, and adding, deleting, or modifying word-granularity to generate reconstructed dialogue samples. Sentence-level transformation, also known as sentence-granularity attack, specifically corresponds to English sentences or Chinese sentences. Perturbations are performed at the sentence level to generate reconstructed dialogue samples.

[0055] In one embodiment, the server may reconstruct each original dialogue sample for each target speech turn that meets a set condition in each speech turn.

[0056] The set conditions can be represented, for example, by at least one of a reconstructed turn condition, a reconstructed turn number condition, and a turn information quantity condition. The reconstructed turn condition represents the condition that the target speech turn must meet in its turn order within the original conversation sample; the reconstructed turn number condition represents the condition that the target number of speech turns within an original conversation sample must meet; and the turn information quantity condition represents the condition that the amount of information contained in the speech information corresponding to the target speech turn must meet. The turn order can include, for example, odd and even turns, and can also include the current turn and previous turns. The current turn refers to the last speech turn in the original conversation sample, such as speech turn 4 in the original conversation sample 1 described above. The amount of information contained in a speech turn can be represented by the total number of characters or word slots contained in the speech information of that speech turn. It is understood that the number of target speech turns in an original conversation sample can be one or more.

[0057] In one possible implementation, the server may transform the information of a target speech turn that meets a turn information quantity condition in each speech turn to reconstruct the original conversation sample. The turn information quantity condition may, for example, be that the total number of characters contained in the speech information of the target speech turn is greater than a set number of characters, or that the total number of characters is greater than or equal to the set number of characters.

[0058] In one possible implementation, the server may perform information transformation on the last speech turn in each original conversation sample, may perform information transformation on the first speech turn in each original conversation sample, and may further perform information transformation on at least a portion of the historical speech turns in each original conversation sample other than the last speech turn, to reconstruct the original conversation sample. For example, the reconstructed conversation samples matching the above-mentioned original conversation sample 1 may include reconstructed conversation sample 1-1, in which information transformation is performed on all speech turns, reconstructed conversation sample 1-2, in which information transformation is performed only on the last speech turn, and reconstructed conversation sample 1-3, in which information transformation is performed only on historical speech turns.

[0059] The reconstructed dialogue sample 1-1 may be:

[0060] “(Speaking Round 1) Speaker A: I ate a mango today.

[0061] (Speaking Round 2) Speaker B: It is [really] difficult to buy mangoes this season.

[0062] (Speaking Round 3) Speaker A: How about I give you a box? I have a lot.

[0063] (Speaking Round 4) Speaker B: That’s great!

[0064] The reconstructed dialogue sample 1-1 undergoes the following information transformations based on the original dialogue sample 1: deleting the quantifier "one" in speech round 1; adding the degree adverb "really" in speech round 2; replacing the verb "give" in speech round 3 with "send"; and replacing the adjective "good" in speech round 4 with "good".

[0065] Reconstructing the dialogue sample 1-2 can be:

[0066] “(Speaking Round 1) Speaker A: I ate a mango today.

[0067] (Speaking Round 2) Speaker B: It is difficult to buy mangoes in this season.

[0068] (Speaking Round 3) Speaker A: How about I give you a box? I have a lot.

[0069] (Speaking Round 4) Speaker B: That’s great!

[0070] The reconstructed dialogue sample 1-2 undergoes the following information transformation based on the original dialogue sample 1: the word "good" in speech turn 4 is replaced with "excellent".

[0071] Reconstructed dialogue samples 1-3 can be:

[0072] “(Speaking Round 1) Speaker A: I ate a mango today.

[0073] (Speaking Round 2) Speaker B: It is [really] difficult to buy mangoes this season.

[0074] (Speaking Round 3) Speaker A: How about I give you a box? I have a lot.

[0075] (Speaking Round 4) Speaker B: Great!

[0076] The reconstructed dialogue sample 1-3 undergoes the following information transformation based on the original dialogue sample 1: deleting "one" in speech round 1; adding "really" in speech round 2; and replacing "give" in speech round 3 with "send".

[0077] Step S406: Using the original sample set as a test set, the original evaluation data of the dialogue understanding model is obtained through testing.

[0078] The conversation understanding model refers to a machine learning model used to implement the conversation understanding task. Specifically, in this application, the conversation understanding model is the subject of robustness analysis. The conversation understanding task may, for example, include at least one of the following tasks: conversation intent understanding or conversation emotion understanding. Conversation intent refers to the content information that the speaker wants to express through the conversation, thereby conveying a specific task requirement. Such task requirements may include, for example, movie ticket booking, flight booking, music playback, etc. Conversation emotion refers to the emotional information expressed by the speaker during the conversation. Such conversation emotions may include, for example, happiness, neutrality, sadness, etc. Furthermore, the conversation understanding model may, for example, be a neural network model or a decision tree model. The specific type of neural network model is not unique and may include, for example, convolutional neural network (CNN), recurrent neural network (RNN) model, or generative adversarial network (GAN) model, etc., without limitation herein.

[0079] In practical applications, for a particular model, the robustness analysis can be conducted on the model itself or on an adjusted model obtained after processing the model. This adjusted model can be, for example, an updated model obtained through incremental training or an ablation model obtained by removing some components from the model. For example, in an ablation experiment, the impact of different components in the dialogue understanding model on the robustness results can be analyzed. In this scenario, the complete dialogue understanding model and the ablated dialogue understanding model with the target component removed can be used as robustness analysis objects. By comparing the robustness analysis results of the complete dialogue understanding model and the ablated dialogue understanding model under the same original sample set and adversarial sample set, the impact of the target component on the model robustness can be determined. For example, the impact of adding or not adding different components (R1-R3) to model M1 on the final robustness can be verified through multiple data sets. That is, in this case, the robustness analysis objects include the complete dialogue understanding model M1, the dialogue understanding model M1-R1 after removing component R1, the dialogue understanding model M1-R2 after removing component R2, and the dialogue understanding model M1-R3 after removing component R3.

[0080] Raw evaluation data refers to model evaluation data obtained by testing the original sample set as the test set. In practical applications, the test set can be used to test the dialogue understanding model and obtain corresponding model evaluation data. This model evaluation data may include, for example, confusion matrix, AUC (area under curve), ROC (receiver operating characteristic curve), error rate, accuracy, and loss statistics. Loss statistics may include, for example, loss mean, standard deviation, and standard score.

[0081] Specifically, the server can use the original sample set as a test set to test the dialogue understanding model and obtain raw evaluation data for the dialogue understanding model. For example, if the raw evaluation data is accuracy, the server can input each original dialogue sample into the dialogue understanding model, obtain the model output corresponding to each original dialogue sample, and compare each model output with the corresponding label. The server then calculates the percentage of samples where the model output matches the label, thereby determining the accuracy of the dialogue understanding model.

[0082] In step S408, the adversarial sample set is used as a test set to obtain adversarial evaluation data of the dialogue understanding model.

[0083] Specifically, after obtaining the adversarial sample set, the server can test the dialogue understanding model using it as a test set, obtaining adversarial evaluation data for the dialogue understanding model. For example, if the adversarial evaluation data is accuracy, the server can input each reconstructed dialogue sample into the dialogue understanding model, obtain the model output corresponding to each reconstructed dialogue sample, and compare each model output with the corresponding label. The server then calculates the percentage of samples where the model output matches the label, thereby determining the accuracy of the dialogue understanding model under the adversarial sample set. The label corresponding to the reconstructed dialogue sample is the label of the original dialogue sample that matched the reconstructed dialogue sample.

[0084] It should be noted that the data type of adversarial evaluation data is consistent with that of the original evaluation data. For example, if the original evaluation data includes accuracy, the adversarial evaluation data also includes accuracy; if the original evaluation data includes loss statistics, the adversarial evaluation data also includes loss statistics, and so on.

[0085] Step S410: Determine the robustness analysis result of the dialogue understanding model based on the change of the adversarial evaluation data relative to the original evaluation data.

[0086] The change in the adversarial evaluation data relative to the original evaluation data can be represented by a difference, a ratio, etc. Specifically, the server can determine the robustness analysis results of the dialogue understanding model based on the change in the same type of adversarial evaluation data relative to the original evaluation data.

[0087] In one embodiment, the original evaluation data includes the original accuracy rate, and the adversarial evaluation data includes the adversarial accuracy rate. In this embodiment, step S410 includes: determining accuracy change data of the adversarial accuracy rate relative to the original accuracy rate; and determining robustness analysis results of the dialogue understanding model based on the accuracy change data.

[0088] The original accuracy refers to the model accuracy determined using the original sample set as the test set. Correspondingly, the adversarial accuracy refers to the model accuracy determined using the adversarial sample set as the test set. This model accuracy may include at least one of the accuracy of understanding conversation intent or the accuracy of understanding conversation emotion. Specifically, the server may determine the accuracy change data of the adversarial accuracy relative to the original accuracy, and based on this accuracy change data, determine the robustness analysis results of the conversation understanding model. This accuracy change data may include the accuracy change amount, the accuracy change rate, and so on.

[0089] For example, consider the case where the model accuracy is the conversation emotion understanding accuracy. The server can determine the number of correct emotion understanding samples in the original sample set whose conversation emotion understanding results match the conversation emotion labels, and use the proportion of these correct emotion understanding samples in the original sample set as the original accuracy. It can also determine the number of correct emotion understanding samples in the adversarial sample set whose conversation emotion understanding results match the conversation emotion labels, and use the proportion of these correct emotion understanding samples in the adversarial sample set as the adversarial accuracy. The robustness analysis results of the conversation understanding model are then determined based on the difference between the adversarial accuracy and the original accuracy. If the adversarial accuracy varies little relative to the original accuracy, this indicates that the evaluated conversation understanding model has strong anti-attack capabilities and exhibits strong robustness.

[0090] In this embodiment, determining the robustness analysis results of the dialogue understanding model based on the accuracy change data can intuitively reflect the model performance and help improve the reliability of the robustness analysis results.

[0091] In one embodiment, the original evaluation data includes original loss statistics, and the adversarial evaluation data includes adversarial loss statistics. In this embodiment, step S408 includes: determining loss change data of the adversarial loss statistics relative to the original loss statistics; and determining robustness analysis results of the dialogue understanding model based on the loss change data.

[0092] The original loss statistic refers to the model loss statistic determined using the original sample set as the test set. Correspondingly, the adversarial loss statistic refers to the model loss statistic determined using the adversarial sample set as the test set. The model loss statistic may include at least one of the loss mean, loss average, standard deviation, and standard score. Specifically, the server may determine the loss change data of the adversarial loss statistic relative to the original loss statistic, and determine the robustness analysis results of the dialogue understanding model based on the loss change data. The loss change data may include the loss change amount, loss change rate, and the like.

[0093] For example, consider the case where the model loss statistics are calculated as the mean loss. The server can perform statistical calculations on the loss values ​​of each original conversation sample to obtain the mean original loss value of the conversation understanding model for the original sample set. Furthermore, the server can perform statistical calculations on the loss values ​​of each original conversation sample to obtain the mean adversarial loss value of the conversation understanding model for the original sample set. The robustness analysis results of the conversation understanding model are then determined based on the difference between the mean adversarial loss value and the mean original loss value. If the mean adversarial loss value varies little relative to the mean original loss value, the evaluated conversation understanding model demonstrates strong anti-attack capabilities and robustness.

[0094] In this embodiment, the robustness analysis results of the dialogue understanding model are determined based on the loss change data. The algorithm is simple and is conducive to improving the processing efficiency of the robustness analysis process.

[0095] In one embodiment, the original evaluation data includes the original accuracy and the original loss statistics, and the adversarial evaluation data includes the adversarial accuracy and the adversarial loss statistics. In this embodiment, step S408 includes: determining accuracy change data of the adversarial accuracy relative to the original accuracy, and loss change data of the adversarial loss statistics relative to the original loss statistics; and determining robustness analysis results of the dialogue understanding model based on the accuracy change data and the loss change data.

[0096] The specific definitions of the original accuracy, original loss statistics, adversarial accuracy, and adversarial loss statistics are described above and will not be repeated here. Specifically, on one hand, the server can use the adversarial sample set as the test set to determine the adversarial accuracy of the dialogue understanding model; use the original sample set as the test set to determine the original accuracy of the dialogue understanding model; and obtain accuracy change data based on the change in the adversarial accuracy relative to the original accuracy. On the other hand, the server can also use the adversarial sample set as the test set to determine the adversarial loss statistics of the dialogue understanding model; use the original sample set as the test set to determine the original loss statistics of the dialogue understanding model; and obtain loss change data based on the change in the adversarial loss statistics relative to the original loss statistics. The server can then determine the accuracy change data and the loss change data as the robustness analysis results of the dialogue understanding model, or further process the accuracy change data and the loss change data to obtain the robustness analysis results of the dialogue understanding model. For example, the server can normalize the accuracy change data and the loss change data and then perform a weighted summation to obtain the robustness analysis results. The weight of the accuracy change data is greater than the weight of the loss change data.

[0097] In this embodiment, combining the accuracy change data and the loss change data to determine the robustness analysis results of the dialogue understanding model is conducive to further improving the accuracy of the robustness analysis results.

[0098] The above-mentioned robustness analysis method of the dialogue understanding model uses an original sample set including multiple original dialogue samples as a test set to test and obtain original evaluation data of the dialogue understanding model; each round of dialogue in each original dialogue sample includes at least two speech rounds with different speakers; for at least a portion of each speech round, each original dialogue sample is reconstructed separately to obtain an adversarial sample set that matches the original sample set; using the adversarial sample set as a test set, testing and obtaining adversarial evaluation data of the dialogue understanding model; and determining the robustness analysis results of the dialogue understanding model based on the changes in the adversarial evaluation data relative to the original evaluation data. During the above processing, on the one hand, in the robustness analysis of the dialogue understanding model, based on the unique property that each original dialogue sample includes multiple speech turns, each original dialogue sample is reconstructed for a part of the speech turns. This can reduce the differences between different samples before and after reconstruction to a certain extent, making the final robustness analysis results more credible, which is conducive to improving the accuracy of the robustness analysis results; on the other hand, the original sample set containing multiple original dialogue samples and the adversarial sample set matching the original sample set are used as test sets, and the robustness analysis results are determined according to the changes in the model evaluation data of the dialogue understanding model under different test sets. This is equivalent to combining the robustness of the model under multiple sample adversarial tests, and can also improve the accuracy of the robustness analysis results.

[0099] In one embodiment, the number of adversarial example sets is at least two. In this embodiment, step S406 includes: using each adversarial example set as a test set, testing to obtain adversarial evaluation data of the dialogue understanding model corresponding to each adversarial example set. Step S410 includes: determining the robustness analysis results of the dialogue understanding model based on the change in each adversarial evaluation data relative to the original evaluation data.

[0100] Among them, the reconstruction parameters of different adversarial sample sets are different. The reconstruction parameters may include reconstruction round parameters, reconstruction granularity parameters, and information transformation methods, etc. The reconstruction round parameters are used to characterize the parameter conditions that need to be met for the speech rounds that perform information transformation during the reconstruction process. The reconstruction granularity parameters are used to characterize the information transformation level, and may include granularity such as characters, words, and sentences. The information transformation methods may include deletion, replacement, and addition, etc. Replacement may be a replacement with similar pronunciation, similar glyphs, or similar semantics, etc. The reconstruction parameters of different adversarial sample sets are different, which may mean that at least a part of the parameters such as the reconstruction round parameters, reconstruction granularity parameters, or information transformation methods corresponding to different adversarial sample sets are different. For example, the reconstruction round parameters of adversarial sample set A and adversarial sample set B are different, the reconstruction granularity parameters of adversarial sample set B and adversarial sample set C are different, and so on.

[0101] Specifically, the server can combine parameters such as the reconstruction round parameter, reconstruction granularity parameter, and information transformation method to derive multiple reconstruction parameters. The server then reconstructs the original sample set according to each reconstruction parameter, obtaining adversarial sample sets corresponding to each reconstruction parameter. The server then uses each adversarial sample set as a test set to obtain adversarial evaluation data for the dialogue understanding model corresponding to each adversarial sample set. The robustness analysis results of the dialogue understanding model are determined based on the changes in each adversarial evaluation data relative to the original evaluation data.

[0102] For example, as shown in Figure 5, the server can combine the various parameter information to obtain reconstruction parameters 1, 2, and 3. In one possible implementation, reconstruction parameter 1 can, for example, replace synonyms at the word level for the last speaking turn; reconstruction parameter 2 can, for example, replace homophones at the character level for each historical speaking turn; and reconstruction parameter 3 can, for example, delete modal particles from each speaking turn. The server then reconstructs the original sample set according to reconstruction parameter 1 to obtain adversarial sample set 1; reconstructs the original sample set according to reconstruction parameter 2 to obtain adversarial sample set 2; and reconstructs the original sample set according to reconstruction parameter 3 to obtain adversarial sample set 3. The server then uses adversarial sample set 1 as the test set to obtain adversarial evaluation data 1 for the dialogue understanding model corresponding to adversarial sample set 1; uses adversarial sample set 2 as the test set to obtain adversarial evaluation data 2 for the dialogue understanding model corresponding to adversarial sample set 2; and uses adversarial sample set 3 as the test set to obtain adversarial evaluation data 3 for the dialogue understanding model corresponding to adversarial sample set 3. Finally, the server determines the robustness analysis results of the dialogue understanding model based on the changes in each adversarial evaluation data relative to the original evaluation data obtained by testing with the original sample set as the test set.

[0103] Furthermore, the server can determine the change in each adversarial evaluation data relative to the original evaluation data as the robustness analysis result of the dialogue understanding model. Under this premise, the obtained robustness analysis result can be used to characterize the robustness of the dialogue understanding model under adversarial attack scenarios corresponding to different reconstruction parameters. The server can also determine the robustness analysis result of the dialogue understanding model by performing statistical calculations on the change in each adversarial evaluation data relative to the original evaluation data. Under this premise, the obtained robustness analysis result can be used to characterize the overall anti-attack performance of the dialogue understanding model, that is, the comprehensive robustness of the dialogue understanding model. The specific algorithm for statistical calculation can include at least one of addition, multiplication, etc.

[0104] In this embodiment, performing robustness analysis on each adversarial sample set is equivalent to comprehensively considering the robustness of the dialogue understanding model under different adversarial attack scenarios, which is conducive to further improving the accuracy of the robustness analysis results.

[0105] In one embodiment, step S404 includes: determining an expected reconstruction round in the sample reconstruction process; for each original dialogue sample, determining a sample reconstruction round that matches the expected reconstruction round from each speech round of the original dialogue sample; and reconstructing each original dialogue sample according to its own sample reconstruction round to obtain an adversarial sample set that matches the original sample set.

[0106] The expected reconstruction round represents the speaking round in which information transformation is expected. The expected reconstruction round can be determined in various ways. For example, the expected reconstruction round can be determined based on the turn order. For example, the expected reconstruction round can include the current round and historical rounds, or it can include the target round, the round before the target round, and the round after the target round. The current round refers to the last speaking round in the conversation sample, the historical round refers to the speaking round before the last speaking round, and the round before the target round refers to the speaking round before the target round, and the round after the target round refers to the speaking round after the target round. In specific applications, the expected reconstruction round can also be determined based on the amount of turn information. The amount of information in a speaking round can be characterized by the total number of characters, the number of word slots, etc. contained in the speech information of the speaking round. For example, the server can determine the speaking round as the expected reconstruction round if the total number of characters contained in the speech information is greater than a set number of characters, or if the total number of characters is greater than or equal to the set number of characters.

[0107] Specifically, the number of speaking turns contained in each original conversation sample may vary, and the speech information contained in each speaking turn may also be different. Based on this, the server can determine the expected reconstruction round during the sample reconstruction process. This expected reconstruction round can be directly set by the developer based on robustness analysis requirements, such as setting it to historical rounds or the current round; it can also be determined by the server based on the reconstruction round conditions set by the developer. This reconstruction round condition can be characterized by the amount of turn information, the order of the turns, etc.

[0108] Then, for each original conversation sample, the server determines the sample reconstruction round that matches the desired reconstruction round from each speech round in the original conversation sample. The sample reconstruction round refers to the speech round in the original conversation sample that matches the desired reconstruction round. Taking the case where the desired reconstruction round is the current round as an example, for an original conversation sample containing four speech rounds, the sample reconstruction round of the original conversation sample is "speech round 4"; for an original conversation sample containing five speech rounds, the sample reconstruction round of the original conversation sample is "speech round 5". Next, the server performs information transformation on the speech information in each sample reconstruction round according to the sample reconstruction round of each original conversation sample, achieving sample reconstruction for each original conversation sample, obtaining adversarial conversation samples that match each original conversation sample, and then obtaining an adversarial sample set that matches the original sample set.

[0109] In this embodiment, the expected reconstruction round in the sample reconstruction process is first determined, and then sample reconstruction is performed for the sample reconstruction round that matches the expected reconstruction round in each original conversation sample. This can further reduce the differences between different samples before and after reconstruction, thereby further improving the accuracy of the robustness analysis results.

[0110] In one embodiment, a sample reconstruction round that matches the expected reconstruction round is determined from each speech round of the original conversation sample, including: when the expected reconstruction round includes the current round, the last speech round of the original conversation sample is determined as the sample reconstruction round that matches the expected reconstruction round; when the expected reconstruction round includes historical rounds, at least a part of the historical speech rounds of the original conversation sample are determined as the sample reconstruction round that matches the expected reconstruction round.

[0111] In practical applications, for dialogue understanding models, what is usually of interest is the performance of the model for the current round and the performance of the model for historical rounds. Based on this, the expected reconstruction round can include at least one of the current round or the historical round. That is, sample reconstruction can be performed only for the current round, or only for historical rounds, or for both the current round and historical rounds. Specifically, when the expected reconstruction round includes the current round, the last speech round of the original dialogue sample is determined as the sample reconstruction round that matches the expected reconstruction round; when the expected reconstruction round includes historical rounds, at least a portion of the historical speech rounds of the original dialogue sample are determined as the sample reconstruction round that matches the expected reconstruction round. The historical speech round refers to the speech round before the last speech round.

[0112] For example, taking original conversation sample 1 as an example, if the desired reconstructed turn is a historical turn, sample reconstruction can be performed on at least a portion of speech turns 1 to 3. In this case, the reconstructed conversation samples matching original conversation sample 1 may include reconstructed conversation samples 1-3, obtained by performing information transformation on all historical speech turns. The reconstructed conversation samples matching original conversation sample 1 may also include reconstructed conversation samples 1-4 and reconstructed conversation samples 1-5, obtained by performing information transformation on a portion of each historical speech turn.

[0113] Among them, the reconstructed dialogue samples 1-4 can be:

[0114] “(Speaking Round 1) Speaker A: I ate a mango today.

[0115] (Speaking Round 2) Speaker B: It is [really] difficult to buy mangoes this season.

[0116] (Speaking Round 3) Speaker A: How about I give you a box? I have a lot.

[0117] (Speaking Round 4) Speaker B: Great!

[0118] The reconstructed dialogue sample 1-4 undergoes the following information transformation based on the original dialogue sample 1: deleting "one" in speech round 1; and adding "really" in speech round 2.

[0119] Reconstructed dialogue samples 1-5 can be:

[0120] “(Speaking Round 1) Speaker A: I ate a mango today.

[0121] (Speaking Round 2) Speaker B: It is difficult to buy mangoes in this season.

[0122] (Speaking Round 3) Speaker A: How about I give you a box? I have a lot.

[0123] (Speaking Round 4) Speaker B: Great!

[0124] The reconstructed dialogue sample 1-5 undergoes the following information transformation based on the original dialogue sample 1: the “one” in speech turn 1 is deleted.

[0125] In the above embodiment, for the attack on the current round, the attack area is the current speaking round of the original sample; for the attack on historical rounds, the attack area is at least a part of the historical speaking rounds, which can ensure that the sample reconstruction process matches the characteristics of the dialogue understanding model, and thus ensure the practicality of the robustness analysis results.

[0126] In one embodiment, the robustness analysis method for a dialogue understanding model further includes determining an expected number of reconstruction rounds in a sample reconstruction process. In this embodiment, when the expected reconstruction rounds include historical rounds, determining at least a portion of the historical speech rounds of the original dialogue sample as sample reconstruction rounds that match the expected reconstruction rounds includes: when the expected reconstruction rounds include historical rounds, determining, according to the expected number of reconstruction rounds, sample reconstruction rounds that match the expected reconstruction rounds from the historical speech rounds of the original dialogue sample.

[0127] Among them, the expected number of reconstruction rounds is used to represent the number of speech rounds that need to undergo information transformation in an original conversation sample, that is, the number of sample reconstruction rounds in an original conversation sample. Specifically, in the case where the expected reconstruction rounds include historical rounds, since the number of historical speech rounds contained in each original conversation sample is different, in order to further reduce the differences between different samples before and after reconstruction, the parameter of the expected number of reconstruction rounds can be introduced. The expected number of reconstruction rounds can be directly set by the developer according to the robustness analysis requirements, or it can be determined by the server according to the reconstruction round number conditions set by the developer. The reconstruction round number condition can refer to the number of sample reconstruction rounds in an original conversation sample being a set value, or it can refer to the number of sample reconstruction rounds in an original conversation sample being within a set range and the ratio of the number of sample reconstruction rounds to the total number of speech rounds being within a set range, which is not limited here.

[0128] Furthermore, the server can determine the sample reconstruction round that matches the expected reconstruction round from the historical speech rounds of the original dialogue sample according to the expected reconstruction round number. For example, if the expected reconstruction round number is 2, the server can select two historical speech rounds from the respective historical speech rounds in the original dialogue sample for each original dialogue sample as the sample reconstruction rounds in the original dialogue sample that match the expected reconstruction round. In practical applications, the sample reconstruction round can also be determined in combination with the amount of round information, round order conditions, etc., to further reduce the differences between different samples before and after reconstruction. For example, the sample reconstruction round can be determined from the odd-numbered speech rounds in each historical speech round when the expected reconstruction round number is met; for example, the historical speech round with a higher order can be determined as the sample reconstruction round when the expected reconstruction round number is met.

[0129] In the above embodiment, when the expected reconstruction round includes historical rounds, determining the sample reconstruction round in combination with the expected number of reconstruction rounds can further reduce the differences between different samples before and after reconstruction and improve the accuracy of the robustness analysis results.

[0130] In one embodiment, sample reconstruction is performed on each original dialogue sample according to its respective sample reconstruction round to obtain an adversarial sample set that matches the original sample set, including: determining the speech information to be reconstructed for each original dialogue sample according to its respective sample reconstruction round; performing information transformation on each speech information to be reconstructed to obtain reconstructed speech information that matches each speech information to be reconstructed; and performing sample reconstruction on each original dialogue sample based on its respective reconstructed speech information to obtain an adversarial sample set that matches the original sample set.

[0131] The utterance information to be reconstructed refers to the utterance information from the sample reconstruction round in the original conversation sample. Specifically, if the sample's semantics undergoes significant changes during the reconstruction process, this will inevitably cause changes in the output of the conversation understanding model. If this change is used to evaluate the robustness of the conversation understanding model, there may be deviations in the robustness analysis results due to the influence of semantic changes. Based on this, the server can determine the utterance information to be reconstructed for each original conversation sample based on the sample reconstruction round. Then, it performs information transformation on each utterance to be reconstructed to obtain reconstructed utterance information that matches each utterance to be reconstructed. The semantic similarity between the matching utterance information to be reconstructed and the reconstructed utterance information satisfies a similarity condition. This similarity condition can be, for example, a semantic similarity greater than a similarity threshold or a semantic similarity greater than or equal to a similarity threshold. Finally, based on the reconstructed utterance information of each original conversation sample, the server reconstructs each original conversation sample to obtain a set of adversarial samples that matches the original sample set.

[0132] In this embodiment, sample reconstruction is performed based on the reconstructed speech information that matches the speech information to be reconstructed. Since the semantic similarity between the matching speech information to be reconstructed and the reconstructed speech information meets the similarity condition, the semantic similarity between the original dialogue sample and the reconstructed dialogue sample can be maintained during the sample reconstruction process, thereby avoiding the impact of sample semantic differences on model evaluation data and ensuring the accuracy of the robustness analysis results.

[0133] Furthermore, there is no unique method for reconstructing each original conversation sample based on its reconstructed speech information to obtain an adversarial sample set that matches the original sample set. For example, the server may extract the original speech information from each original conversation sample, excluding the speech information to be reconstructed, and then combine the original speech information with the reconstructed speech information to obtain an adversarial conversation sample that matches the original conversation sample, thereby determining an adversarial sample set that includes the adversarial conversation samples corresponding to each original conversation sample.

[0134] In one embodiment, based on the reconstructed speech information of each original dialogue sample, each original dialogue sample is reconstructed to obtain an adversarial sample set that matches the original sample set, including: for each original dialogue sample, replacing the speech information to be reconstructed of the original dialogue sample with the reconstructed speech information that matches the speech information to be reconstructed, to obtain an adversarial dialogue sample that matches the original dialogue sample; and determining an adversarial sample set that includes the adversarial dialogue samples corresponding to each original dialogue sample.

[0135] Specifically, based on the original sample set, the server replaces the speech information to be reconstructed of each original dialogue sample with the reconstructed speech information that matches the speech information to be reconstructed, thereby obtaining an adversarial dialogue sample that matches the original dialogue sample, and further obtaining an adversarial sample set containing the adversarial dialogue samples corresponding to each original dialogue sample. For example, taking original dialogue sample 1 as an example, if the speech information to be reconstructed is "great", the server can perform information transformation on the speech information to be reconstructed to obtain the reconstructed speech information "great" that matches the speech information to be reconstructed. Then, the "great" in original dialogue sample 1 is replaced with "great", resulting in reconstructed dialogue sample 1-2.

[0136] In this embodiment, sample reconstruction is achieved by replacing speech information, which is beneficial to simplifying the sample reconstruction process and improving the working efficiency of the robustness analysis process.

[0137] In one embodiment, the robustness analysis method for a dialogue understanding model further includes determining a desired reconstruction granularity during sample reconstruction. In this embodiment, performing information transformation on each utterance to be reconstructed to obtain reconstructed utterance information that matches each utterance to be reconstructed includes performing information transformation on each utterance to be reconstructed according to an information transformation method that matches the desired reconstruction granularity to obtain reconstructed utterance information that matches each utterance to be reconstructed.

[0138] Among them, the expected reconstruction granularity is used to characterize the information transformation level in the information transformation process, and may include granularities such as characters, words, and sentences. It can be understood that the corresponding information transformation methods are different under different reconstruction granularities. Exemplarily, the information transformation method of character granularity may include algorithms such as TextBugger and TextFooler, and the information transformation method of word granularity may include PWWS (Probability Weighted Word Saliency, a greedy algorithm based on probability weighted word saliency) and the like. Similar to the expected reconstruction rounds and the expected number of reconstruction rounds, the expected reconstruction granularity can also be directly set by the developer according to the robustness analysis requirements, for example, it can be set to character granularity or word granularity; it can also be determined by the server according to the reconstruction granularity conditions set by the developer. The reconstruction granularity condition can, for example, be that the reconstruction granularity is greater than the character granularity, or that the reconstruction granularity is less than or equal to the word granularity.

[0139] Specifically, the server can determine the expected reconstruction granularity in the sample reconstruction process, and perform information transformation on each speech information to be reconstructed according to the information transformation method that matches the expected reconstruction granularity, thereby obtaining reconstructed speech information that matches each speech information to be reconstructed. It should be noted that for the same original dialogue sample, when there are multiple sample reconstruction rounds, the reconstruction granularity of each sample reconstruction round can be the same or different. Taking the case where the reconstruction granularity is less than or equal to the word granularity as an example, the server can combine the principle of semantic similarity and select an appropriate reconstruction granularity from the word granularity and the character granularity for information transformation for each sample reconstruction round. For example, for original dialogue sample 1, if the word granularity can maintain semantic similarity after transformation, the word granularity can be used as the reconstruction granularity for information transformation; for original dialogue sample 2, if the word granularity cannot maintain semantic similarity after transformation, the character granularity can be used as the reconstruction granularity for information transformation.

[0140] In this embodiment, information transformation is performed on each speech information to be reconstructed according to an information transformation method that matches the desired reconstruction granularity, and reconstructed speech information that matches each speech information to be reconstructed is obtained. This can ensure that the reconstruction granularity in the reconstruction process of different original dialogue samples is correlated, thereby further reducing the differences before and after reconstruction of different samples and improving the accuracy of the robustness analysis results.

[0141] In one embodiment, information transformation is performed on each speech information to be reconstructed according to an information transformation method that matches the desired reconstruction granularity to obtain reconstructed speech information that matches each speech information to be reconstructed, including: for each speech information to be reconstructed, at least two candidate information transformation methods that match the desired reconstruction granularity are determined; information transformation is performed on the speech information to be reconstructed based on each candidate information transformation method to obtain candidate reconstructed speech information corresponding to each candidate information transformation method; from each candidate reconstructed speech information, the reconstructed speech information whose semantic similarity with the speech information to be reconstructed meets the similarity condition and whose semantic difference is the largest is determined.

[0142] In practical applications, during the robustness analysis process, on the one hand, it is expected that the semantic similarity of the samples before and after reconstruction can be maintained to ensure that the robustness analysis results are less affected by semantic changes; on the other hand, it is necessary to ensure that the semantic difference between the reconstructed sample set and the original sample set is large enough to ensure that the analysis process can show the robustness of the worst case. Based on this, the server can determine at least two candidate information transformation methods that match the desired reconstruction granularity for each speech information to be reconstructed. Then, based on each candidate information transformation method, the information to be reconstructed is transformed to obtain the candidate reconstructed speech information corresponding to each candidate information transformation method, and through semantic analysis, the semantic similarity of each candidate speech information with the speech information to be reconstructed is determined. Finally, from each candidate reconstructed speech information, the reconstructed speech information is determined whose semantic similarity with the speech information to be reconstructed meets the similarity condition and has the largest semantic difference.

[0143] In this embodiment, from multiple candidate reconstructed speech information obtained based on different information transformation methods, the reconstructed speech information whose semantic similarity with the speech information to be reconstructed meets the similarity conditions and has the largest semantic difference is determined. This can ensure that the information transformation process maintains semantic similarity while generating the greatest possible disturbance to the sample, which is conducive to improving the credibility of the robustness analysis results.

[0144] In one embodiment, as shown in FIG6 , a method for robustness analysis of a dialogue understanding model is provided. The method may be executed by a computer device, which may be the terminal or server shown in FIG1 . For example, taking the computer device as a server, in this embodiment, the method includes the following steps:

[0145] Step S601: Obtain a dialogue understanding model, an original sample set for the dialogue understanding model, and at least two sample reconstruction parameters.

[0146] The original sample set includes multiple original conversation samples, and each round of conversation in each original conversation sample includes at least two speaking rounds with different speakers. The sample reconstruction parameters may include reconstruction round parameters, reconstruction granularity parameters, and information transformation methods, etc. The reconstruction round parameters are used to characterize the parameter conditions that need to be met in the speech rounds that require information transformation during the reconstruction process. The reconstruction granularity parameters are used to characterize the information transformation level and may include granularity such as characters, words, and sentences. The information transformation methods may include deletion, replacement, and addition, etc. The replacement may be a replacement with similar pronunciation, similar glyphs, or similar semantics, etc.

[0147] In step S602, the original sample set is used as a test set to obtain the original accuracy and original loss mean of the dialogue understanding model.

[0148] Step S603 : corresponding to each sample reconstruction parameter, determining an expected reconstruction round and an expected reconstruction granularity that match the sample reconstruction parameter.

[0149] The expected reconstruction rounds may include the current round and the historical rounds, and the expected reconstruction granularity may include the character, word, and sentence granularity.

[0150] Step S604 : for each original dialogue sample, determine a sample reconstruction round that matches the expected reconstruction round from each speech round of the original dialogue sample.

[0151] Step S605 : determining the speech information to be reconstructed for each original dialogue sample according to the sample reconstruction round of each original dialogue sample.

[0152] Step S606: for each speech information to be reconstructed, determine at least two candidate information transformation modes that match the desired reconstruction granularity.

[0153] Step S607 : performing information transformation on the utterance information to be reconstructed based on each candidate information transformation mode, and obtaining candidate reconstructed utterance information corresponding to each candidate information transformation mode.

[0154] Step S608 : Determine, from among the candidate reconstructed speech information, the reconstructed speech information whose semantic similarity with the speech information to be reconstructed satisfies the similarity condition and whose semantic difference is the greatest.

[0155] Step S609 : For each original dialogue sample, the speech information to be reconstructed of the original dialogue sample is replaced with the reconstructed speech information that matches the speech information to be reconstructed, thereby obtaining an adversarial dialogue sample that matches the original dialogue sample.

[0156] Step S610 , corresponding to each sample reconstruction parameter, determining an adversarial sample set including adversarial dialogue samples corresponding to each original dialogue sample.

[0157] In step S611, each adversarial sample set is used as a test set to obtain the adversarial accuracy and adversarial loss mean of the dialogue understanding model corresponding to the reconstruction parameters of each sample.

[0158] Step S612: Determine the accuracy change data of the adversarial accuracy relative to the original accuracy, and the loss change data of the adversarial loss mean relative to the original loss mean.

[0159] Step S613: Determine the robustness analysis result of the dialogue understanding model based on the accuracy change data and loss change data corresponding to each sample reconstruction parameter.

[0160] The above-mentioned robustness analysis method of the dialogue understanding model, on the one hand, during the robustness analysis process of the dialogue understanding model, based on the unique property that each original dialogue sample includes multiple speech turns, the expected speech turns are transformed based on the expected reconstruction granularity to complete the reconstruction of the original dialogue sample. This can reduce the differences between different samples before and after reconstruction to a certain extent, making the final robustness analysis results more credible, which is conducive to improving the accuracy of the robustness analysis results; on the other hand, the original sample set containing multiple original dialogue samples and multiple adversarial sample sets matching the original sample set are used as test sets. The robustness analysis results are determined based on the changes in the accuracy and loss mean of the dialogue understanding model under different test sets. This is equivalent to combining the robustness of the model under various attack scenarios, which can also improve the accuracy of the robustness analysis results.

[0161] The robustness analysis method of the dialogue understanding model in this application is described in detail below with reference to Figures 7 to 9.

[0162] Specifically, for tasks in the context of natural language processing, after training on a training set, the model can better fit the training set and achieve good results on the test set. However, if the accuracy of the prediction results cannot be guaranteed when perturbations are added to the test set samples, it means that the robustness of the model is poor. Therefore, attention should be paid to the issue of model robustness. In the task of dialogue understanding, there is no standard evaluation system for the robustness of the model. Based on this, this application proposes an evaluation system to evaluate the robustness of the model from three perspectives: the above information, the current turn, and the entire dialogue. The above information includes at least a portion of each historical speech turn of the dialogue sample. At the same time, this application also proposes two criteria for evaluating the robustness of dialogue: Criterion 1 proposes three indicators, "AAA(C)", "AAA(U)" and "AAA(U+C)", which respectively reflect the robustness of the dialogue understanding model to "previous information", "current dialogue" and "complete dialogue process"; Criterion 2 proposes three indicators, "MLG(C)", "MLG(U)" and "MLG(U+C)", which respectively assist in reflecting the robustness of the dialogue understanding model to "previous information", "current dialogue" and "complete dialogue" processes by calculating the degree of change in the value of the loss function before and after the attack. Among them, "C" represents that the perturbation attack area is the previous information, that is, the historical round, "U" represents that the perturbation attack area is the current round, and "U+C" represents that the perturbation attack area includes historical rounds and the current round; "AAA" represents the model accuracy, and "MLG" represents the mean value of the loss function change.

[0163] The modeling formula for the robustness analysis process of the dialogue understanding model is as follows:

[0164] Here, x represents the original conversation sample, which contains the text information of previous rounds (Context, denoted by C below) and the text information of the current round (Utterance, denoted by U below). y is the label carried by the original conversation sample x, that is, the correct answer label. D represents the original sample set, (x, y) is one of the samples belonging to the original sample set D, and δ is the perturbation information. The goal of robustness analysis is to maximize the loss function after the perturbation information δ is added to sample x (that is, maximize the distance between the probability of the predicted result and the correct answer brought about by a small amount of perturbation). L is the loss function used to measure the distance between the predicted result and the correct answer after the perturbation is added. θ is a parameter of the conversation understanding model, which is used by the conversation understanding model to infer the predicted probability of the output of sample x after the perturbation δ is added.

[0165] The loss function of the model before the perturbation information attack is: L(θ, x, y)

[0166] After the attack (adding perturbation δ), the loss function is: L(θ, x+δ, y)

[0167] The loss function is defined as: L(θ, x, y) = L(Y, P(Y|X)) = -logP(Y|X)

[0168] The change in the loss function value before and after the attack (adding perturbation δ) is: L(θ, x+δ, y)-L(θ, x, y)

[0169] Based on the above modeling method, the evaluation system obtains two criteria:

[0170] Criterion 1: If the original conversation sample x is added with the perturbation δ to reconstruct the conversation sample x+δ, causing the result y output by the conversation understanding model to change, it means that the model has not resisted this attack and is not robust to this attack.

[0171] Criterion 2: The greater the change in the loss function value before and after the attack (adding perturbation δ), the less robust the dialogue understanding model. Conversely, the smaller the change in the loss function value, the more robust the dialogue understanding model.

[0172] Furthermore, text attacks are a robustness test. The change in the loss function before and after the attack is compared; the greater the change, the less robust the model. For example, in the case of emotion understanding in a conversation comprehension task, the candidate emotion labels are happy, sad, and neutral. For the original conversation sample 1 above, the model outputs the following probabilities for each candidate emotion label: happy 54%, neutral 23%, and sad 23%. Since the highest probability is "happy," the correct label "happy" is hit.

[0173] For the reconstructed conversation sample 1-1 of the original conversation sample 1, the attack area is "U+C," meaning that both the current round and the previous rounds are attacked. The model outputs the following probabilities for the candidate emotion labels: happy 34%, neutral 30%, and sad 36%. Since the highest probability result is "sad," the correct label is not hit.

[0174] For the reconstructed conversation sample 1-2 of the original conversation sample 1, the attack area is "U," meaning it only attacks the current turn. The model outputs the following probabilities for each candidate emotion label: happy 50%, neutral 31%, and sad 19%. Since the result with the highest probability is "happy," the correct label is hit.

[0175] For the reconstructed conversation samples 1-3 of the original conversation sample 1, the attack area is "C," meaning only the historical turns are targeted. The model outputs the following probabilities for the candidate emotion labels: happy 30%, neutral 44%, and sad 26%. Since the highest probability result is "neutral," the correct label is not hit.

[0176] Based on the above criterion 1, we propose the Accuracy After Attack (AAA) metric. This metric can be calculated in three ways, corresponding to the three attack areas mentioned above:

[0177] AAA(U+C) refers to the accuracy of the dialogue understanding model when tested against an adversarial sample set covering both the current and previous rounds. Reconstructed dialogue sample 1-1 shows the result of a sample subjected to the U+C attack. The prediction for this sample was incorrect, so the number of correctly predicted samples is counted as 0. AAA(U+C) ranges from [0 to 1]. A larger AAA(U+C) value indicates a more robust dialogue understanding model against the attacks in the previous context and the current round (stronger attack resistance), meaning it demonstrates robustness throughout the entire conversation.

[0178] AAA(U) refers to the accuracy of the dialogue understanding model when tested against an adversarial sample set whose attack domain only includes the current round. Reconstructed dialogue sample 1-2 shows the result of a sample after the U attack. The prediction result of this sample after the attack is correct, so the number of correct predictions is counted as 1. Similarly, the value of AAA(U) ranges from [0 to 1]. A larger value of AAA(U) indicates that the evaluated dialogue understanding model is more robust to the attack in the current round (stronger its anti-attack capability), indicating that its understanding of the current round of dialogue is highly robust.

[0179] AAA(C) refers to the accuracy of a dialogue understanding model when tested on an adversarial sample set where the attack domain only includes historical rounds. Reconstructed dialogue samples 1-3 show the results of a sample after the C attack. The prediction for this sample was incorrect, so the number of correctly predicted samples is counted as 0. Similarly, the value of AAA(C) ranges from [0 to 1]. A larger value of AAA(C) indicates that the evaluated dialogue understanding model is more robust to attacks on historical rounds (stronger anti-attack capabilities), indicating strong robustness in understanding the context of the conversation.

[0180] It should be noted that, in this embodiment, the original accuracy of the default dialogue understanding model in the original dialogue sample set is 1. Therefore, the above AAA indicator can reflect the change in the accuracy of the dialogue understanding model before and after the attack.

[0181] Based on the above criterion 2, we propose to evaluate the robustness of the dialogue understanding model by using the mean change in the loss function before and after the attack (MLG, Mean Loss Gradient). There are also three calculation methods:

[0182] MLG(U+C) refers to the mean change in the dialogue understanding model's loss when tested on a set of adversarial examples covering both the current and past rounds. n represents the total number of test samples. A larger MLG(U+C) value indicates a greater change in the model's understanding after the attack, and a less robust model's understanding performance throughout the entire conversation. Conversely, a smaller MLG(U+C) value indicates a smaller change in the model's understanding after the attack, and a more robust model's understanding performance throughout the entire conversation. Taking reconstructed dialogue sample 1-1 as an example, after the U+C attack, the post-attack loss is: L(θ,x+δ,y) = -logP(y = happy|x+δ) = -log0.34.

[0183] The loss value before the attack is: L(θ,x,y)=-logP(y=happy|x)=-log0.54.

[0184] The mean loss change is: MLG(U+C)=L(θ,x+δ,y)-L(θ,x,y)=-log0.34-(-log0.54)=0.2009.

[0185] MLG(U) refers to the mean change in the loss of the dialogue understanding model when tested on an adversarial sample set whose attack domain only includes the current round. n is the total number of test samples. A larger MLG(U) value indicates a greater change in the model's understanding after the attack, and a less robust performance in the current round. Conversely, a smaller MLG(U) value indicates a smaller change in the model's understanding after the attack, and a more robust performance in the current round. Taking the reconstructed dialogue sample 1-2 as an example, after the U attack, the loss after the attack is: L(θ,x+δ,y) = -logP(y = happy|x+δ) = -log0.5.

[0186] The loss value before the attack is -log0.54. The mean change in loss is: MLG(U) = L(θ,x+δ,y) - L(θ,x,y) = -log0.5 - (-log0.54) = 0.0334.

[0187] MLG(C) refers to the mean change in the loss of the dialogue understanding model when tested on an adversarial sample set where the attack domain only includes historical rounds. n is the total number of test samples. A larger MLG(C) value indicates a greater change in the model's understanding after the attack, indicating that the model's understanding performance in historical rounds is less robust. Conversely, a smaller MLG(C) value indicates a smaller change in the model's understanding after the attack, indicating that the model's understanding performance in the current round is more robust. Taking reconstructed dialogue samples 1-3 as an example, after the C attack, the loss value of the sample after the attack is: L(θ,x+δ,y) = -logP(y = happiness|x+δ) = -log0.3.

[0188] The loss value before the attack is -log0.54. The mean change in loss is: MLG(C) = L(θ,x+δ,y) - L(θ,x,y) = -log0.3 - (-log0.54) = 0.2552.

[0189] In the above reconstructed sample test (one sample, n=1), MLG(U)<MLG(U+C)<MLG(C). The dialogue understanding model's robustness on this sample is as follows: it performs well on the current turn (U) and least robust on the historical turn (C). Due to interference with the entire dialogue information, it also performs less robustly.

[0190] As shown in Figure 7, the robustness analysis results of four models (M1-M4) under two attack methods (AM1 and AM2) are evaluated on a specific dataset D using the proposed dialogue understanding model robustness indicator system. The indicator AAA_Score (attack method, dialogue understanding model, attack area) corresponds to the robustness results of the three indicators for each model under the attack methods (AM1-AM2). The value range of AAA_Score is [0, 1]. For example, AAA(AM1, U+C, M1, U+C, D) represents the accuracy of model M1 when dataset D is the original sample set, the attack area is U+C, and the attack algorithm is AM1. Furthermore, different attack algorithms at different granularities (character granularity, word granularity, or sentence granularity) can be used. For example, character-level attack algorithms include TextBugger / TextFooler, and word-level attack algorithms include PWWS. These can all serve as practical attack algorithms (AM). The dialogue understanding model being evaluated can include four models, M1-M4. The attack region, the area within which robustness is assessed, can include the current turn, previous turns, and the complete conversation (i.e., both the current and previous turns). Specifically, U corresponds to the formula AAA(U) / MLG(U), evaluating the model's robustness to the current turn; C corresponds to the formula AAA(C) / MLG(C), evaluating the model's robustness to the preceding context; and U+C corresponds to AAA(U+C) / MLG(U+C), evaluating the model's robustness to the complete input conversation. Based on the array of indicators in Figure 7, the model's robustness can be comprehensively evaluated from three perspectives: the current turn (U), the preceding context (U), and the complete conversation (U+C).

[0191] In actual application, the robustness of some indicators of the dialogue understanding model can be partially selected for targeted evaluation. For example, as shown in Figure 8, taking the evaluation of the robustness of different dialogue understanding models (Models) as an example, in order to evaluate the robustness of the current round (U) and the complete dialogue (U+C) of the dialogue understanding model. In the specific experiment, three different attack methods (AM1-AM3) were specifically applied, corresponding to the attack algorithms PWWS, TextFooler and TextBugger, respectively. Under these three attack methods, the evaluation index AAA(U+C) / AAA(U) proposed in this application was applied to perform robustness evaluation, and the anti-interference ability (i.e. robustness) of the current round (U) of different dialogue understanding models and the anti-interference ability (i.e. robustness) of the complete dialogue (U+C) were evaluated.

[0192] In the ablation experiment scenario, it is necessary to analyze the impact of different components in the dialogue understanding model on the robustness results. As shown in Figure 9, the specific application of the robustness index evaluation system proposed in this patent is demonstrated, and the specific method is applied in the ablation experiment. The experiment can verify the impact of adding different components (R1-R3) in the evaluated model M1 through multiple data sets (D1-D2). The impact on the final robustness results, including positive and negative impacts and the degree of impact, can be comprehensively evaluated and verified through the AAA(U+C) / AAA(U) / AAA(C) and MLG(U+C) / MLG(U) / MLG(C) indicator systems.

[0193] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0194] Based on the same inventive concept, embodiments of the present application also provide a robustness analysis device for implementing the aforementioned method for robustness analysis of a dialogue understanding model. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of the embodiments of one or more robustness analysis devices for dialogue understanding models provided below can be found in the limitations of the robustness analysis method for dialogue understanding models above and will not be further elaborated here.

[0195] In one embodiment, as shown in FIG10 , a robustness analysis device 1000 for a dialogue understanding model is provided, comprising: an acquisition module 1002 , a reconstruction module 1004 , an original test module 1006 , an adversarial test module 1008 , and a robustness analysis result determination module 1010 , wherein:

[0196] An acquisition module 1002 is configured to acquire an original sample set, wherein the original sample set includes a plurality of original conversation samples; each conversation round in each original conversation sample includes at least two speech rounds with different speakers;

[0197] A reconstruction module 1004 is configured to reconstruct each original dialogue sample for at least a portion of each speech turn to obtain an adversarial sample set that matches the original sample set;

[0198] The original test module 1006 is used to test the original sample set as the test set to obtain the original evaluation data of the dialogue understanding model;

[0199] An adversarial testing module 1008 is configured to use the adversarial sample set as a test set to obtain adversarial evaluation data of the dialogue understanding model; and

[0200] The robustness analysis result determination module 1010 is used to determine the robustness analysis result of the dialogue understanding model based on the changes in the adversarial evaluation data relative to the original evaluation data.

[0201] In one embodiment, the reconstruction module 1004 includes: an expected reconstruction round determination submodule, which is used to determine the expected reconstruction round in the sample reconstruction process; a sample reconstruction round determination submodule, which is used to determine, for each original dialogue sample, a sample reconstruction round that matches the expected reconstruction round from each speech round of the original dialogue sample; and a reconstruction submodule, which is used to perform sample reconstruction on each original dialogue sample according to its own sample reconstruction round to obtain an adversarial sample set that matches the original sample set.

[0202] In one embodiment, the sample reconstruction round determination submodule is specifically configured to: when the expected reconstruction round includes the current round, determine the last speaking round of the original conversation sample as the sample reconstruction round that matches the expected reconstruction round; when the expected reconstruction round includes historical speaking rounds, determine at least a portion of the historical speaking rounds of the original conversation sample as the sample reconstruction round that matches the expected reconstruction round. The historical speaking rounds refer to the speaking rounds before the last speaking round.

[0203] In one embodiment, the robustness analysis device for a dialogue understanding model further includes an expected reconstruction round number determination module configured to determine an expected number of reconstruction rounds during the sample reconstruction process. In this embodiment, the sample reconstruction round determination submodule is further configured to, if the expected reconstruction rounds include historical rounds, determine a sample reconstruction round that matches the expected reconstruction round from the historical speech rounds of the original dialogue sample according to the expected reconstruction round number.

[0204] In one embodiment, the reconstruction submodule includes: a unit for determining speech information to be reconstructed, configured to determine the speech information to be reconstructed for each original conversation sample based on the sample reconstruction round of each original conversation sample; an information transformation unit for performing information transformation on each piece of speech information to be reconstructed, thereby obtaining reconstructed speech information that matches each piece of speech information to be reconstructed; and a reconstruction unit for performing sample reconstruction on each original conversation sample based on the reconstructed speech information of each original conversation sample, thereby obtaining a set of adversarial samples that match the original sample set. The semantic similarity between the matching speech information to be reconstructed and the reconstructed speech information satisfies a similarity condition.

[0205] In one embodiment, the robustness analysis device for a dialogue understanding model further includes a desired reconstruction granularity determination module configured to determine the desired reconstruction granularity during sample reconstruction. In this embodiment, the information transformation unit is specifically configured to perform information transformation on each utterance to be reconstructed according to an information transformation method that matches the desired reconstruction granularity, thereby obtaining reconstructed utterance information that matches each utterance to be reconstructed.

[0206] In one embodiment, the information transformation unit is specifically used to: determine at least two candidate information transformation methods that match the expected reconstruction granularity for each speech information to be reconstructed; perform information transformation on the speech information to be reconstructed based on each candidate information transformation method, and obtain candidate reconstructed speech information corresponding to each candidate information transformation method; and determine, from each candidate reconstructed speech information, the reconstructed speech information whose semantic similarity with the speech information to be reconstructed meets the similarity condition and has the largest semantic difference.

[0207] In one embodiment, the reconstruction unit is specifically used to: for each original dialogue sample, replace the speech information to be reconstructed of the original dialogue sample with reconstructed speech information that matches the speech information to be reconstructed, to obtain an adversarial dialogue sample that matches the original dialogue sample; and determine an adversarial sample set that includes the adversarial dialogue samples corresponding to each original dialogue sample.

[0208] In one embodiment, the original evaluation data includes the original accuracy rate, and the adversarial evaluation data includes the adversarial accuracy rate. In this embodiment, the robustness analysis result determination module 1010 is specifically configured to: determine accuracy change data of the adversarial accuracy rate relative to the original accuracy rate; and determine the robustness analysis result of the dialogue understanding model based on the accuracy change data.

[0209] In one embodiment, the original evaluation data includes original loss statistics, and the adversarial evaluation data includes adversarial loss statistics. In this embodiment, the robustness analysis result determination module 1010 is specifically configured to: determine loss change data of the adversarial loss statistics relative to the original loss statistics; and determine a robustness analysis result of the dialogue understanding model based on the loss change data.

[0210] In one embodiment, the number of adversarial example sets is at least two. In this embodiment, adversarial testing module 1008 is specifically configured to use each adversarial example set as a test set to obtain adversarial evaluation data of the dialogue understanding model corresponding to each adversarial example set. Robustness analysis result determination module 1010 is specifically configured to determine the robustness analysis result of the dialogue understanding model based on the change in each adversarial evaluation data relative to the original evaluation data.

[0211] Each module in the robustness analysis device for a conversational understanding model can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.

[0212] In one embodiment, a computer device is provided. The computer device may be a server or a terminal, and its internal structure diagram may be shown in FIG11 . The computer device includes one or more processors, memory, an input / output (I / O) interface, and a communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The database of the computer device is used to store data required or generated during the robustness analysis of a dialogue understanding model, such as original sample sets, adversarial sample sets, original evaluation data, adversarial evaluation data, robustness analysis results, and so on. The I / O interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via a network connection. When executed by one or more processors, the computer-readable instructions implement a robustness analysis method for a dialogue understanding model.

[0213] In one embodiment, a computer device is provided, which may be a terminal. Its internal structure diagram may be as shown in Figure 12. The computer device includes one or more processors, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless communication. The wireless communication may be achieved via Wi-Fi, a mobile cellular network, NFC (near-field communication), or other technologies. When executed by one or more processors, the computer-readable instructions implement a robustness analysis method for a dialogue understanding model. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0214] Those skilled in the art will understand that the structure shown in Figure 11 or Figure 12 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0215] In one embodiment, a computer device is provided, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors implement the steps of the above-mentioned method embodiments when executing the computer-readable instructions.

[0216] In one embodiment, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the steps in the above-mentioned method embodiments are implemented.

[0217] In one embodiment, a computer program product is provided, comprising computer-readable instructions, which implement the steps of the above-mentioned method embodiments when executed by one or more processors.

[0218] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant regions and areas. In addition, users can choose not to authorize user information and related data, or refuse or conveniently refuse to push information, etc.

[0219] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0220] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0221] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A robustness analysis method for a dialogue understanding model, characterized in that: Executed by a computer device, the method includes: Acquire an original sample set; the original sample set includes a plurality of original dialogue samples; each dialogue round in each of the original dialogue samples includes at least two speech rounds with different speakers; Reconstructing the original dialogue samples for at least a portion of each of the speech rounds to obtain an adversarial sample set matching the original sample set; Using the original sample set as a test set, testing to obtain original evaluation data of the dialogue understanding model; Using the adversarial sample set as a test set, testing to obtain adversarial evaluation data of the dialogue understanding model; and A robustness analysis result of the dialogue understanding model is determined according to a change in the adversarial evaluation data relative to the original evaluation data.

2. The method according to claim 1, characterized in that The reconstructing the original dialogue samples for at least a part of each speech round to obtain an adversarial sample set matching the original sample set includes: Determine the expected number of reconstruction rounds in the sample reconstruction process; For each of the original dialogue samples, determining a sample reconstruction round that matches the expected reconstruction round from each speech round of the original dialogue sample; and According to the sample reconstruction round of each of the original dialogue samples, sample reconstruction is performed on each of the original dialogue samples to obtain an adversarial sample set that matches the original sample set.

3. The method according to claim 2, characterized in that The step of determining, from the speech turns of the original dialogue sample, a sample reconstruction round that matches the expected reconstruction round comprises: In the case where the expected reconstruction round includes the current round, determining the last speech round of the original dialogue sample as the sample reconstruction round matching the expected reconstruction round; and In the case where the expected reconstruction round includes historical rounds, at least a portion of the historical speech rounds of the original dialogue sample are determined as sample reconstruction rounds that match the expected reconstruction round; the historical speech rounds refer to the speech rounds before the last speech round.

4. The method according to claim 3, characterized in that The method further comprises: Determine the expected number of reconstruction rounds in the sample reconstruction process; In the case where the expected reconstruction round includes historical rounds, determining at least a portion of the historical speech rounds of the original dialogue sample as sample reconstruction rounds matching the expected reconstruction rounds comprises: In the case where the expected reconstruction round includes historical rounds, a sample reconstruction round matching the expected reconstruction round is determined from the historical speech rounds of the original dialogue sample according to the expected reconstruction round number.

5. The method according to claim 2, characterized in that: The reconstructing each of the original dialogue samples according to the sample reconstruction round of each of the original dialogue samples to obtain an adversarial sample set matching the original sample set includes: Determining the speech information to be reconstructed for each of the original dialogue samples according to the sample reconstruction rounds of each of the original dialogue samples; Performing information transformation on each of the speech information to be reconstructed to obtain reconstructed speech information that matches each of the speech information to be reconstructed; the semantic similarity between the mutually matching speech information to be reconstructed and the reconstructed speech information satisfies a similarity condition; and Based on the reconstructed speech information of each of the original dialogue samples, sample reconstruction is performed on each of the original dialogue samples to obtain an adversarial sample set that matches the original sample set.

6. The method according to claim 5, characterized in that The method further comprises: Determine the desired reconstruction granularity during sample reconstruction; The step of performing information transformation on each of the speech information to be reconstructed to obtain reconstructed speech information that matches each of the speech information to be reconstructed includes: According to the information transformation mode matching the expected reconstruction granularity, each of the speech information to be reconstructed is respectively transformed to obtain the reconstructed speech information matching each of the speech information to be reconstructed.

7. The method according to claim 6, characterized in that The information transformation is performed on each of the speech information to be reconstructed according to the information transformation mode matching the expected reconstruction granularity to obtain the reconstructed speech information matching each of the speech information to be reconstructed, including: For each of the speech information to be reconstructed, determining at least two candidate information transformation modes that match the desired reconstruction granularity; Performing information transformation on the to-be-reconstructed speech information based on each of the candidate information transformation modes to obtain candidate reconstructed speech information corresponding to each of the candidate information transformation modes; and From each of the candidate reconstructed speech information, determine the speech information whose semantic similarity with the speech information to be reconstructed satisfies the similarity condition and Reconstruct the speech information with the greatest semantic difference.

8. The method according to claim 5, characterized in that The method of reconstructing each of the original dialogue samples based on the reconstructed speech information of each of the original dialogue samples to obtain an adversarial sample set matching the original sample set includes: For each of the original dialogue samples, the speech information to be reconstructed of the original dialogue sample is replaced with the reconstructed speech information matching the speech information to be reconstructed, so as to obtain an adversarial dialogue sample matching the original dialogue sample; and Determine an adversarial sample set including adversarial dialogue samples corresponding to each of the original dialogue samples.

9. The method according to any one of claims 1 to 8, characterized in that The original evaluation data includes the original accuracy rate, and the adversarial evaluation data includes the adversarial accuracy rate; Determining the robustness analysis result of the dialogue understanding model according to the change of the adversarial evaluation data relative to the original evaluation data includes: Determining accuracy change data of the adversarial accuracy relative to the original accuracy; and Based on the accuracy change data, a robustness analysis result of the dialogue understanding model is determined.

10. The method according to any one of claims 1 to 8, characterized in that The original evaluation data includes original loss statistics, and the adversarial evaluation data includes adversarial loss statistics; Determining the robustness analysis result of the dialogue understanding model according to the change of the adversarial evaluation data relative to the original evaluation data includes: Determine loss change data of the countermeasure loss statistic relative to the original loss statistic; and Based on the loss change data, a robustness analysis result of the dialogue understanding model is determined.

11. The method according to any one of claims 1 to 8, characterized in that The number of the adversarial sample sets is at least two; The step of using the adversarial sample set as a test set to test and obtain adversarial evaluation data of the dialogue understanding model includes: Using each of the adversarial sample sets as a test set, respectively, to obtain adversarial evaluation data of the dialogue understanding model corresponding to each of the adversarial sample sets; and Determining the robustness analysis result of the dialogue understanding model according to the change of the adversarial evaluation data relative to the original evaluation data includes: The robustness analysis result of the dialogue understanding model is determined according to the change of each of the adversarial evaluation data relative to the original evaluation data.

12. A robustness analysis device for a dialogue understanding model, characterized in that: The device comprises: An acquisition module, used for acquiring an original sample set; the original sample set includes a plurality of original dialogue samples; each dialogue round in each of the original dialogue samples includes at least two speech rounds with different speakers; A reconstruction module, configured to reconstruct each of the original dialogue samples for at least a portion of each of the speech rounds, to obtain an adversarial sample set matching the original sample set; An original test module, used to use the original sample set as a test set to test and obtain original evaluation data of the dialogue understanding model; an adversarial testing module, configured to use the adversarial sample set as a test set to obtain adversarial evaluation data of the dialogue understanding model; and The robustness analysis result determination module is used to determine the robustness analysis result of the dialogue understanding model according to the change of the adversarial evaluation data relative to the original evaluation data.

13. The device according to claim 12, characterized in that The reconstruction module includes: An expected reconstruction round determination submodule is used to determine the expected reconstruction rounds in the sample reconstruction process; a sample reconstruction round determination submodule, configured to determine, for each of the original dialogue samples, a sample reconstruction round that matches the expected reconstruction round from the speech rounds of the original dialogue sample; and The reconstruction submodule is used to reconstruct each of the original dialogue samples according to the sample reconstruction round of each of the original dialogue samples to obtain an adversarial sample set that matches the original sample set.

14. The device according to claim 13, characterized in that The sample reconstruction round determination submodule is specifically used for: In the case where the expected reconstruction round includes the current round, determining the last speech round of the original dialogue sample as the sample reconstruction round matching the expected reconstruction round; and In the case where the expected reconstruction round includes historical rounds, at least a portion of the historical speech rounds of the original dialogue sample are determined as sample reconstruction rounds that match the expected reconstruction round; the historical speech rounds refer to the speech rounds before the last speech round.

15. The device according to claim 14, characterized in that The device also includes: An expected reconstruction round number determination module is used to determine the expected reconstruction round number in the sample reconstruction process; The sample reconstruction round determination submodule is also used for: In the case where the expected reconstruction round includes historical rounds, a sample reconstruction round matching the expected reconstruction round is determined from the historical speech rounds of the original dialogue sample according to the expected reconstruction round number.

16. The device according to claim 13, characterized in that The reconstruction submodule includes: A unit for determining speech information to be reconstructed, used to determine the speech information to be reconstructed for each of the original dialogue samples according to the sample reconstruction round of each of the original dialogue samples; An information transformation unit is used to perform information transformation on each of the speech information to be reconstructed to obtain reconstructed speech information that matches each of the speech information to be reconstructed; the semantic similarity between the mutually matching speech information to be reconstructed and the reconstructed speech information satisfies a similarity condition; and The reconstruction unit is used to reconstruct each of the original dialogue samples based on the reconstructed speech information of each of the original dialogue samples to obtain an adversarial sample set that matches the original sample set.

17. The device according to claim 16, characterized in that The device also includes: An expected reconstruction granularity determination module is used to determine the expected reconstruction granularity during the sample reconstruction process; The information conversion unit is specifically used for: According to the information transformation mode matching the expected reconstruction granularity, each of the speech information to be reconstructed is respectively transformed to obtain the reconstructed speech information matching each of the speech information to be reconstructed.

18. The device according to claim 17, characterized in that The information conversion unit is specifically used for: For each of the speech information to be reconstructed, determining at least two candidate information transformation modes that match the desired reconstruction granularity; Performing information transformation on the speech information to be reconstructed based on each of the candidate information transformation modes to obtain candidate reconstructed speech information corresponding to each of the candidate information transformation modes; and From the candidate reconstructed utterance information, the reconstructed utterance information whose semantic similarity with the to-be-reconstructed utterance information satisfies the similarity condition and whose semantic difference is the greatest is determined.

19. The device according to claim 16, characterized in that The reconstruction unit is specifically used for: For each of the original dialogue samples, the speech information to be reconstructed of the original dialogue sample is replaced with the reconstructed speech information matching the speech information to be reconstructed, so as to obtain an adversarial dialogue sample matching the original dialogue sample; and Determine an adversarial sample set including adversarial dialogue samples corresponding to each of the original dialogue samples.

20. The device according to any one of claims 12 to 19, characterized in that The original evaluation data includes the original accuracy rate, and the adversarial evaluation data includes the adversarial accuracy rate; the robustness analysis result determination module is specifically used for: Determining accuracy change data of the adversarial accuracy relative to the original accuracy; and Based on the accuracy change data, a robustness analysis result of the dialogue understanding model is determined.

21. The device according to any one of claims 12 to 19, characterized in that The original evaluation data includes original loss statistics, and the adversarial evaluation data includes adversarial loss statistics; The robustness analysis result determination module is specifically used for: Determining loss change data of the countermeasure loss statistic relative to the original loss statistic; and Based on the loss change data, a robustness analysis result of the dialogue understanding model is determined.

22. The device according to any one of claims 12 to 19, characterized in that The number of the adversarial sample sets is at least two; The adversarial testing module is specifically used to: use each of the adversarial sample sets as a test set, and test and obtain adversarial evaluation data of the dialogue understanding model corresponding to each of the adversarial sample sets; and The robustness analysis result determination module is specifically used to determine the robustness analysis result of the dialogue understanding model according to the change of each of the adversarial evaluation data relative to the original evaluation data.

23. A computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors implement the steps of the method according to any one of claims 1 to 11 when executing the computer-readable instructions.

24. A computer-readable storage medium having computer-readable instructions stored thereon, characterized in that: When the computer readable instructions are executed by one or more processors, the steps of the method of any one of claims 1 to 11 are implemented.

25. A computer program product comprising computer readable instructions, characterized in that: When the computer readable instructions are executed by one or more processors, the steps of the method of any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Robustness evaluation method and device for semantic comprehension model and computer equipment

    CN114239589A

  • Small sample learning robustness improvement method based on comparative learning

    CN114781651A

  • Method and device for determining loss parameters of dialogue generation model

    CN115357684A

  • Robustness analysis method and device for dialogue understanding model and computer equipment

    CN116579350A

  • System and method for text-based conversation with a user, using machine learning

    US11275903B1