Adversarial training introduced model training method, question answering method and equipment

By introducing adversarial training in semantic recognition model training, the adversarial sample feature vector is generated, the problem of inaccurate user intention recognition is solved, and accurate reply is achieved when there are slight differences in user statements is achieved, which improves the anti-interference and adaptability of the model.

CN120471065APending Publication Date: 2025-08-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510573021.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In the prior art, when there are subtle deviations in user input voice and database problems, artificial intelligence systems cannot accurately identify user intentions, resulting in the inability to provide reasonable responses and require manual intervention.

Method used

By obtaining the semantic eigenvectors of the preset problem set, generating adversarial sample eigenvectors, and training the semantic recognition model to obtain the target semantic recognition model to accurately identify user intentions and provide replies when there are slight differences in user statements.

Benefits of technology

It improves the anti-interference and adaptability of the model, and can accurately identify user intentions when there are slight differences in user statements, provide accurate replies, and reduce manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471065A_ABST
    Figure CN120471065A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of artificial intelligence, and discloses a model training method with adversarial training introduced, and a question answering method and device. The method comprises the steps that a preset question set is acquired, and semantic feature vectors of all user questions in the preset question set are extracted; generating an adversarial sample feature vector associated with the semantic feature vector according to the semantic feature vector; and according to the semantic feature vector and the adversarial sample feature vector, performing semantic recognition model training to obtain a target semantic recognition model, and performing question answering through the target semantic recognition model. By introducing adversarial training into semantic recognition model training, the anti-interference performance of the model can be improved, the adaptive capacity of the model can be improved, and when user statements have small differences, the user intention can still be accurately recognized, and accurate reply can be conducted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology and can be applied to the field of financial technology. In particular, it relates to a model training method, question answering method and device that introduce adversarial training. Background Art

[0002] With the development of artificial intelligence technology, in order to meet the explosive demand for user services, artificial intelligence solutions are provided when providing services to users.

[0003] Existing technologies typically use artificial intelligence (AI) to identify the intent of user questions, match them with questions in a database, and generate corresponding responses. However, current AI-based solutions typically require that the user's input be identical to the database question before providing the corresponding response. Existing AI solutions fail to provide a reasonable response if there are even slight discrepancies between the user's input and the database question, requiring manual intervention.

[0004] Therefore, it is urgent to provide a new question answering method to improve the accuracy and reliability of user intent recognition. Summary of the Invention

[0005] The present invention provides a model training method, question answering method and device that introduce adversarial training to improve the model's anti-interference and adaptability, accurately identify user intentions, and provide precise answers.

[0006] According to one aspect of the present invention, a method for training a semantic recognition model by introducing adversarial training is provided, the method comprising:

[0007] Obtaining a preset question set and extracting the semantic feature vector of each user question in the preset question set;

[0008] Generating, based on the semantic feature vector, an adversarial sample feature vector associated with the semantic feature vector;

[0009] According to the semantic feature vector and the adversarial sample feature vector, a semantic recognition model is trained to obtain a target semantic recognition model, so as to answer questions through the target semantic recognition model.

[0010] According to one aspect of the present invention, a question answering method introducing adversarial training is provided, the method comprising:

[0011] Collect target user questions raised by users during voice calls;

[0012] Using a target semantic recognition model obtained by the semantic recognition model training method using adversarial training as provided in any embodiment of the present invention, semantic recognition is performed on the target user question to obtain a target matching result;

[0013] During the voice call, the target reply content corresponding to the target matching result is replied to the user.

[0014] According to another aspect of the present invention, a semantic recognition model training device introducing adversarial training is provided, the device comprising:

[0015] A semantic feature vector extraction module is used to obtain a preset question set and extract the semantic feature vector of each user question in the preset question set;

[0016] An adversarial sample feature vector generation module, configured to generate an adversarial sample feature vector associated with the semantic feature vector based on the semantic feature vector;

[0017] The target semantic recognition model determination module is used to perform semantic recognition model training based on the semantic feature vector and the adversarial sample feature vector to obtain a target semantic recognition model, so as to answer questions through the target semantic recognition model.

[0018] According to another aspect of the present invention, a question answering device that introduces adversarial training is provided, the device comprising:

[0019] Target user question collection module, used to collect target user questions raised by users during voice calls;

[0020] A semantic recognition module, configured to perform semantic recognition on the target user question using a target semantic recognition model obtained by the semantic recognition model training method using adversarial training as provided in any embodiment of the present invention, to obtain a target matching result;

[0021] The question reply module is used to reply the target reply content corresponding to the target matching result to the user during a voice call.

[0022] According to another aspect of the present invention, an electronic device is provided, comprising:

[0023] at least one processor; and

[0024] a memory communicatively connected to the at least one processor; wherein,

[0025] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the semantic recognition model training method introducing adversarial training or the question answering method introducing adversarial training described in any embodiment of the present invention.

[0026] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a processor to implement the semantic recognition model training method introducing adversarial training or the question answering method introducing adversarial training described in any embodiment of the present invention when executed.

[0027] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the semantic recognition model training method introducing adversarial training, or the question answering method introducing adversarial training, as described in any embodiment of the present invention.

[0028] The technical solution of the embodiment of the present invention obtains a preset question set and extracts the semantic feature vector of each user question in the preset question set; generates an adversarial sample feature vector associated with the semantic feature vector based on the semantic feature vector; and trains a semantic recognition model based on the semantic feature vector and the adversarial sample feature vector to obtain a target semantic recognition model, so as to answer questions through the target semantic recognition model, thereby solving the problem of inaccurate intention recognition in user questions and answers. By introducing adversarial training in the semantic recognition model training, the model's anti-interference ability and adaptability can be improved. When there are slight differences in user sentences, the user's intention can still be accurately identified and accurate answers can be given.

[0029] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0031] Figure 1a This is a flowchart of a semantic recognition model training method that introduces adversarial training according to the first embodiment of the present invention;

[0032] Figure 1bThis is a flowchart of another method for training a semantic recognition model by introducing adversarial training according to the first embodiment of the present invention;

[0033] Figure 2a is a flowchart of a semantic recognition model training method introducing adversarial training according to the second embodiment of the present invention;

[0034] Figure 2b 2. This is a schematic diagram comparing the application effects of a target semantic recognition model provided by the second embodiment of the present invention;

[0035] Figure 3a 2 is a flow chart of a question answering method introducing adversarial training according to the third embodiment of the present invention;

[0036] Figure 3b 2 is a schematic diagram of an application of a question answering method introducing adversarial training according to the second embodiment of the present invention;

[0037] Figure 4 2 is a schematic diagram of the structure of a semantic recognition model training device that introduces adversarial training according to a fourth embodiment of the present invention;

[0038] Figure 5 2 is a schematic diagram of the structure of a question answering device introducing adversarial training according to a fifth embodiment of the present invention;

[0039] Figure 6 It is a schematic diagram of the structure of an electronic device for implementing the method of the embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0041] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0042] Example 1

[0043] Figure 1a This is a flowchart of a semantic recognition model training method that introduces adversarial training according to the first embodiment of the present invention. This embodiment can be applied to intelligent question and answer, such as providing intelligent responses to user voice questions in intelligent outbound call scenarios. The method can be executed by a semantic recognition model training device that introduces adversarial training. The semantic recognition model training device that introduces adversarial training can be implemented in the form of hardware and / or software. The semantic recognition model training device that introduces adversarial training can be configured in an electronic device. The electronic device can be a mobile device such as a mobile phone, a tablet computer (PAD), a wearable device, or a personal computer (PC, Personal Computer), etc. Figure 1a As shown, the method includes:

[0044] Step 110: Obtain a preset question set and extract the semantic feature vector of each user question in the preset question set.

[0045] The preset question set can be a collection of user questions generated by collecting call data between users and intelligent customer service representatives. Call data between users and intelligent customer service representatives is obtained only after user authorization, and the acquisition method is reasonable and legal. The preset question set can also be a set of user questions manually set. Responses can be set for user questions in the preset question set, forming sentence pairs. During a call between a user and intelligent customer service representative, call data can be collected and matched with user questions in the preset question set. Responses corresponding to successfully matched user questions are then provided to the user to guide them in resolving their problem.

[0046] In order to avoid the situation where the user intention cannot be accurately identified when there is a deviation between the call data and the user questions in the preset question set, resulting in the intelligent customer service failing to meet the user's expectations, adversarial training is introduced in the embodiment of the present invention to train the semantic recognition model.

[0047] When introducing adversarial training, semantic feature vectors can be first extracted from each user question in a preset question set. There are various ways to extract semantic feature vectors. Extracting semantic feature vectors allows computers to recognize processed information. For example, semantic feature vectors can be extracted using word embedding models, embedded language models, or bidirectional pre-trained encoders.

[0048] In this embodiment of the present invention, the closer the semantic feature vectors are to the textual semantics, the better the downstream task completion results. To ensure that the extracted semantic feature vectors fully understand complex data and contextual information, improving the model's recognition capabilities, a variant model robustly optimized for a bidirectional pre-trained encoder can be used to extract semantic feature vectors for user questions. This variant model can learn richer linguistic knowledge, achieve better data capture of call data, and facilitate improved accuracy in responses to user questions.

[0049] The structure of the variant model can be formally expressed as: and Among them, h 0 The input representation is composed of word embedding, position embedding and segment embedding, L is the function of the normalization layer, F is the function of the linear projection layer, activation layer and linear projection layer, l is the depth of the Transformer layer, and M is the multi-head self-attention function. The normalization function L can be obtained by the variance of the data sample. and the expected E[x] are calculated to The activation function used by the variant model can be GELU, The multi-head self-attention function in the variant model can be expressed as M=MultiHead(Q, K, V)=Concat(head1,…,head n )·W o , where W is the weight matrix of M, head i =Attention(QW i Q , KW i K , VW i V ), Q, K, and V are all encoded model input data. The dot-product scaled attention function, Attention, is calculated using the softmax function. Combining the results of each head's calculations yields a multi-head self-attention function, M. This multi-head self-attention function enables the variant model to capture more comprehensive and effective text information, improving the accuracy of user intent recognition.

[0050] Step 120: Generate an adversarial sample feature vector associated with the semantic feature vector based on the semantic feature vector.

[0051] The adversarial feature vector is generated by adding a perturbation factor to the semantic feature vector. There are various ways to generate an adversarial feature vector. For example, a perturbation radius can be added to the gradient of the semantic feature vector to generate a perturbation factor. Alternatively, the data in the semantic feature vector can be masked, and the semantic recognition model can be used to determine the impact of the feature value on the recognition result. For feature values that have a greater impact on the recognition result, a smaller perturbation factor can be used; for feature values that have a smaller impact on the recognition result, a larger perturbation factor can be used. By adding a perturbation factor to the semantic feature vector, an adversarial feature vector is generated.

[0052] Optionally, based on the semantic feature vector, an adversarial sample feature vector associated with the semantic feature vector is generated, including: performing forward propagation calculation of semantic recognition based on the semantic feature vector to obtain a first forward loss function, and obtaining a first gradient of the first forward loss function through back propagation; determining a perturbation factor based on the first gradient and the perturbation radius; and generating an adversarial sample feature vector based on the perturbation factor and the semantic feature vector.

[0053] Among them, the prediction result of the i-th semantic feature vector is y i , p i is the probability of predicting the positive class, S is the number of samples of the semantic feature vector, then the first forward loss function can be obtained by the formula The first gradient of the semantic feature vector x can be determined by the formula Sure.

[0054] Optionally, the perturbation factor can be given by the formula Determine. The adversarial feature vector corresponding to the semantic feature vector x can be a=x+r. Where ε is the perturbation radius. Exemplarily, the perturbation radius is 1.

[0055] By considering the loss function of the semantic feature vector in semantic recognition and determining the perturbation factor with the gradient, the rationality of the perturbation can be ensured. This allows the model to accurately identify user intent when there are slight changes in the user's words, while ensuring that the perturbation is not too large, causing the model training to deviate from the actual situation.

[0056] Step 130: Perform semantic recognition model training based on the semantic feature vector and the adversarial sample feature vector to obtain a target semantic recognition model, so as to answer questions through the target semantic recognition model.

[0057] During the semantic recognition model training process, both semantic feature vectors and adversarial sample feature vectors can be used as training samples for model training. When the iteration termination condition is met, the target semantic recognition model is obtained. This target semantic recognition model can then be applied to intelligent outbound calling scenarios. In-call call data is obtained and matched with user questions in a preset question set to obtain a target matching result. The target response content corresponding to the target matching result is then sent back to the user to guide the user in resolving the problem.

[0058] Optionally, a semantic recognition model is trained based on the semantic feature vector and the adversarial sample feature vector to obtain a target semantic recognition model, including: performing forward propagation calculation of semantic recognition based on the adversarial sample feature vector to obtain a second forward loss function, and obtaining a second gradient of the second forward loss function through back propagation; accumulating the first gradient and the second gradient, updating the model parameters of the semantic recognition model, and obtaining the target semantic recognition model.

[0059] The calculation formula for the second forward loss function is the same as the first forward loss function, differing only in the sample data. The calculation formula for the second gradient is the same as the first gradient. Updating the model parameters of the semantic recognition model using the accumulated gradient values can improve the recognition accuracy of the target semantic recognition model.

[0060] For example, Figure 1b This is a flowchart of another method for training a semantic recognition model by introducing adversarial training according to the first embodiment of the present invention. Figure 1b As shown, for the text data of each user question in the preset question set, the variant model can be used to extract features to obtain semantic feature vectors; for each semantic feature vector, a perturbation factor can be added, and the adversarial sample feature vector and the semantic feature vector obtained after adding the perturbation factor are input into the semantic recognition model for question-answer matching to obtain the output result. Figure 1b The process shown reaches iteration termination and obtains the target semantic recognition model, so as to answer questions through the target semantic recognition model and improve the recognition accuracy of the model.

[0061] The technical solution of this embodiment obtains a preset question set and extracts the semantic feature vector of each user question in the preset question set; generates an adversarial sample feature vector associated with the semantic feature vector based on the semantic feature vector; and trains a semantic recognition model based on the semantic feature vector and the adversarial sample feature vector to obtain a target semantic recognition model, so as to answer questions through the target semantic recognition model, thereby solving the problem of inaccurate intention recognition in user questions and answers. By introducing adversarial training in the semantic recognition model training, the model's anti-interference ability and adaptability can be improved. When there are slight differences in user sentences, the model can still accurately identify user intentions and give precise answers.

[0062] Example 2

[0063] Figure 2a This is a flowchart of a semantic recognition model training method that introduces adversarial training according to the second embodiment of the present invention. This embodiment is a further refinement of the above technical solution. The technical solution in this embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 2a As shown, the method includes:

[0064] Step 210: Obtain a preset question set, and perform text normalization and data enhancement processing on each user question in the preset question set to obtain sample enhanced data.

[0065] Text normalization can be to clean up formatting issues in user questions. For example, remove extra spaces, special symbols, errors caused by accents, etc. Another example is to remove non-alphanumeric characters and correct spelling errors. Exemplarily, the text of each user question in the preset question set can be normalized by regular rules. For example, the regular rule can be r"[^A-Za-z0-9\s,.?!\(\)'\":\u4e00-\u9fff]+", which means matching any sequence of characters that are neither letters (case insensitive), numbers, nor common punctuation marks (including but not limited to commas, periods, question marks, exclamation marks, brackets, quotation marks and colons), nor blank characters or Chinese characters (according to Unicode definition). Regular rules can be used to filter out non-standard characters in the text and only retain normal characters.

[0066] Data augmentation can help the pre-set question set cover more contexts with similar semantics. Data augmentation can be performed by expanding the data sample based on the original pre-set question set. For example, data augmentation can be performed on the original pre-set question set through synonym replacement and / or back translation.

[0067] Optionally, text normalization and data enhancement processing are performed on each user question in the preset question set to obtain sample enhanced data, including: text normalization of each user question in the preset question set to obtain sample normalized data; synonym replacement of the sample normalized data to obtain first enhanced data; translation of the sample normalized data from the original language to the target language data, and translation of the target language data to the original language to obtain second enhanced data; and use the sample normalized data, the first enhanced data, and the second enhanced data as sample enhanced data.

[0068] For example, a synonym for "unable to log in" could be "login problem." Back-translation—translating sample standard data from the original language into the target language and then back into the original language—enriches the user questions in the pre-set question set and expands the ways in which user questions can be expressed.

[0069] Through data augmentation processing, a piece of text data can be expanded to obtain multiple pieces of data represented by different texts, providing reorganized training data and improving the recognition accuracy of the semantic recognition model in real call scenarios.

[0070] Step 220: Extract the semantic feature vector of the sample enhanced data.

[0071] Step 230: Perform forward propagation calculation of semantic recognition based on the semantic feature vector to obtain a first forward loss function, and obtain a first gradient of the first forward loss function through back propagation.

[0072] Step 240: Determine a perturbation factor based on the first gradient and the perturbation radius; and generate an adversarial sample feature vector based on the perturbation factor and the semantic feature vector.

[0073] Optionally, a perturbation factor is determined based on the first gradient and the perturbation radius; and an adversarial sample feature vector is generated based on the perturbation factor and the semantic feature vector, including: taking the product of the normalized value of the first gradient and the perturbation radius as the initial perturbation factor; adding the initial perturbation factor to the semantic feature vector to obtain an initial anti-sample feature vector; calculating the semantic similarity between the initial anti-sample feature vector and the semantic feature vector, and adjusting the initial perturbation factor based on the semantic similarity to obtain a target perturbation factor; adding the target perturbation factor to the semantic feature vector to obtain an adversarial sample feature vector.

[0074] By formula The initial perturbation factor can be obtained. The initial anti-sample feature vector can be obtained by the formula a=x+r. The semantic similarity between the anti-sample feature vector and the semantic feature vector can be obtained by similarity calculation methods such as cosine similarity. When the semantic similarity is greater than or equal to the first preset similarity, the initial perturbation factor can be used as the target perturbation factor, and the target perturbation factor can be added to the semantic feature vector to obtain the adversarial sample feature vector. When the semantic similarity is greater than the second preset similarity and less than or equal to the second preset similarity, the ratio of the second preset similarity to the first preset similarity can be used as the introduction weight of the initial perturbation factor, and the product of the initial perturbation factor and the introduction weight can be used as the target perturbation factor. Add the target perturbation factor to the semantic feature vector to obtain the adversarial sample feature vector. When the semantic similarity is less than the second preset similarity, the initial perturbation factor and the corresponding initial anti-sample feature vector are discarded.

[0075] The first preset similarity is greater than the second preset similarity. For example, the first preset similarity is 80% and the second preset similarity is 50%. By introducing semantic similarity with the semantic feature vector when generating the adversarial sample feature vector, inaccurate semantic recognition caused by excessive adversarial perturbation can be avoided, ensuring the reliability of semantic recognition.

[0076] Step 250: Perform forward propagation calculation of semantic recognition based on the adversarial sample feature vector to obtain a second forward loss function, and obtain a second gradient of the second forward loss function through back propagation.

[0077] Step 260: Accumulate the first gradient and the second gradient, update the model parameters of the semantic recognition model, and obtain a target semantic recognition model to answer the question through the target semantic recognition model.

[0078] The technical solution of the embodiment of the present invention obtains sample enhanced data by obtaining a preset question set and performing text normalization and data enhancement processing on each user question in the preset question set; extracts the semantic feature vector of the sample enhanced data; performs forward propagation calculation of semantic recognition based on the semantic feature vector to obtain a first forward loss function, and obtains the first gradient of the first forward loss function through back propagation; determines the disturbance factor based on the first gradient and the disturbance radius; and generates an adversarial sample feature vector based on the disturbance factor and the semantic feature vector; performs forward propagation calculation of semantic recognition based on the adversarial sample feature vector to obtain a second forward loss function, and obtains the second gradient of the second forward loss function through back propagation; accumulates the first gradient and the second gradient, updates the model parameters of the semantic recognition model, and obtains the target semantic recognition model, so as to answer questions through the target semantic recognition model, thereby solving the problem of inaccurate intention recognition in user questions and answers, and performing adversarial training by adding a reasonably disturbed disturbance factor to the semantic recognition model training, thereby improving the model's anti-interference ability and the model's adaptability, and improving the accuracy and reliability of identifying user intentions, so as to accurately answer user questions.

[0079] Figure 2b : is a schematic diagram comparing the application effects of a target semantic recognition model provided by the second embodiment of the present invention. Figure 2b As shown, the model performance measurement indicators are used under different sample numbers to compare the semantic recognition models before and after the introduction of adversarial training. It is found that the method provided by the embodiment of the present invention is effective in improving the sentence matching accuracy in the intelligent outbound call scenario.

[0080] Among them, the model performance measurement index can take into account the performance of the model in terms of precision and recall, and more intuitively and comprehensively reflect the performance of the model in sentence pair matching. The calculation method of the model performance measurement index is P is the precision rate R is the recall rate Among them, Ni is the number of sentence pairs under label i, TP means that both the actual label and the predicted label are positive; FP means that the actual label is negative, but the predicted label is positive; TN means that both the actual label and the predicted label are negative; FN means that the actual label is positive, but the predicted label is negative.

[0081] The technical solution of the embodiment of the present invention can solve the problem of matching failures often occurring in actual conversation scenarios due to individual text differences. The present invention effectively solves this problem to a certain extent by introducing adversarial training, more accurately identifying the customer's true intentions and giving reasonable responses. In actual applications, as the user group of subsequent intelligent outbound call scenarios continues to expand, the sentence pair data in actual conversations is also increasing. With more comprehensive and sufficient training corpus, the model proposed in the embodiment of the present invention can be re-trained and parameter fine-tuned. The accuracy of the model will be further improved, giving users more accurate responses, thereby better improving the user experience.

[0082] Example 3

[0083] Figure 3a This is a flowchart of a question answering method that introduces adversarial training according to the third embodiment of the present invention. This embodiment is applicable to intelligent question answering, such as providing intelligent answers to users' voice questions in intelligent outbound call scenarios. The method can be executed by a question answering device that introduces adversarial training. The question answering device that introduces adversarial training can be implemented in the form of hardware and / or software. The question answering device that introduces adversarial training can be configured in an electronic device. The electronic device can be a mobile device such as a mobile phone, a tablet computer (PAD), a wearable device, or a personal computer (PC, Personal Computer), etc. Figure 3a As shown, the method includes:

[0084] Step 310: Collect the target user questions raised by the user during the voice call.

[0085] The collection of target user questions is conducted with user authorization and is legal and compliant. Voice calls can be made during smart outbound calls made by the bank.

[0086] Step 320: Use the target semantic recognition model obtained by the semantic recognition model training method introducing adversarial training as provided in any embodiment of the present invention to perform semantic recognition on the target user question to obtain a target matching result.

[0087] By performing semantic recognition on the target user questions under the target semantic recognition model, the preset questions in the remaining preset question sets can be matched to obtain target matching results.

[0088] Step 330: During the voice call, the target reply content corresponding to the target matching result is replied to the user.

[0089] In a pre-set question set, user questions and responses form sentence pairs. When a target matching result is found, the target response corresponding to the target matching result in the sentence pair can be provided to the user to help them resolve their technical issues.

[0090] Figure 3b : is a schematic diagram of an application of a question answering method that introduces adversarial training according to the second embodiment of the present invention. Figure 3b As shown, in the intelligent outbound call scenario, questions can be asked to the user to determine the target user question the user is asking. The target user question is matched and identified using the target semantic recognition model introduced with adversarial training to obtain the target matching result, and then the target reply content corresponding to the target matching result is replied to the user.

[0091] The technical solution of the embodiment of the present invention is to collect target user questions raised by users during voice calls; use a target semantic recognition model obtained by a semantic recognition model training method that introduces adversarial training as provided in any embodiment of the present invention to perform semantic recognition on the target user questions and obtain a target matching result; in the voice call, the target reply content corresponding to the target matching result is replied to the user, thereby solving the problem of inaccurate intention recognition in user questions and answers. By using the semantic recognition model obtained by adding adversarial training for semantic recognition, it is possible to accurately recognize the user's intention and give a precise reply even when there are slight differences in the user's sentences.

[0092] Example 4

[0093] Figure 4 Schematic diagram of a semantic recognition model training device that introduces adversarial training according to the fourth embodiment of the present invention. Figure 4 As shown, the device includes: a semantic feature vector extraction module 410, an adversarial sample feature vector generation module 420 and a target semantic recognition model determination module 430.

[0094] in:

[0095] Semantic feature vector extraction module 410, used to obtain a preset question set and extract the semantic feature vector of each user question in the preset question set;

[0096] An adversarial sample feature vector generation module 420 is configured to generate an adversarial sample feature vector associated with the semantic feature vector based on the semantic feature vector;

[0097] The target semantic recognition model determination module 430 is used to perform semantic recognition model training based on the semantic feature vector and the adversarial sample feature vector to obtain a target semantic recognition model, so as to answer questions through the target semantic recognition model.

[0098] Optionally, the adversarial sample feature vector generation module 420 includes:

[0099] A first gradient determination unit is configured to perform forward propagation calculation of semantic recognition according to the semantic feature vector to obtain a first forward loss function, and obtain a first gradient of the first forward loss function through backpropagation;

[0100] The adversarial sample feature vector generating unit is used to determine the perturbation factor according to the first gradient and the perturbation radius; and generate the adversarial sample feature vector according to the perturbation factor and the semantic feature vector.

[0101] Optional adversarial sample feature vector generation unit, specifically used to:

[0102] The product of the normalized value of the first gradient and the perturbation radius is used as the initial perturbation factor;

[0103] Add the initial perturbation factor to the semantic feature vector to obtain the initial anti-sample feature vector;

[0104] Calculate the semantic similarity between the initial anti-sample feature vector and the semantic feature vector, and adjust the initial perturbation factor according to the semantic similarity to obtain the target perturbation factor;

[0105] Add the target perturbation factor to the semantic feature vector to obtain the adversarial sample feature vector.

[0106] Optionally, the target semantic recognition model determination module 430 includes:

[0107] A second gradient determination unit is configured to perform forward propagation calculation of semantic recognition based on the adversarial sample feature vector to obtain a second forward loss function, and obtain a second gradient of the second forward loss function through backpropagation;

[0108] The target semantic recognition model determination unit is used to accumulate the first gradient and the second gradient, update the model parameters of the semantic recognition model, and obtain the target semantic recognition model.

[0109] Optionally, the semantic feature vector extraction module 410 includes:

[0110] A data enhancement processing unit is used to perform text normalization and data enhancement processing on each user question in the preset question set to obtain sample enhanced data;

[0111] The semantic feature vector extraction unit is used to extract the semantic feature vector of the sample enhanced data.

[0112] Optional data enhancement processing unit, specifically used for:

[0113] Normalize the text of each user question in the preset question set to obtain sample normative data;

[0114] Perform synonym replacement on the sample standard data to obtain first enhanced data;

[0115] Translating the sample standard data from the original language into the target language data, and then translating the target language data into the original language to obtain second enhanced data;

[0116] The sample specification data, the first enhanced data, and the second enhanced data are used as sample enhanced data.

[0117] The semantic recognition model training device introducing adversarial training provided in an embodiment of the present invention can execute the semantic recognition model training method introducing adversarial training provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0118] Example 5

[0119] Figure 5 Schematic diagram of a question answering device that introduces adversarial training according to the fifth embodiment of the present invention. Figure 5 As shown, the device includes: a target user question collection module 510, a semantic recognition module 520 and a question answering module 530. Among them:

[0120] Target user question collection module 510, used to collect target user questions raised by users during voice calls;

[0121] Semantic recognition module 520, configured to perform semantic recognition on a target user question using a target semantic recognition model obtained by a semantic recognition model training method using adversarial training as provided in any embodiment of the present invention, and obtain a target matching result;

[0122] The question reply module 530 is used to reply the target reply content corresponding to the target matching result to the user during the voice call.

[0123] The question answering device introducing adversarial training provided in an embodiment of the present invention can execute the question answering method introducing adversarial training provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0124] In the technical solutions of the embodiments of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of user personal information (such as question sets, user questions and answer content, etc.) are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0125] The information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0126] Example 6

[0127] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0128] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0129] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0130] The processor 11 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the semantic recognition model training method that introduces adversarial training, or the question answering method that introduces adversarial training as described in claim 7.

[0131] In some embodiments, the semantic recognition model training method that introduces adversarial training, or the question answering method that introduces adversarial training of claim 7 can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the semantic recognition model training method that introduces adversarial training, or the question answering method that introduces adversarial training described above, can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the semantic recognition model training method that introduces adversarial training, or the question answering method that introduces adversarial training of claim 7, by any other appropriate means (for example, by means of firmware).

[0132] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0133] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0134] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0135] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0136] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0137] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0138] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0139] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A semantic recognition model training method that introduces adversarial training, characterized in that: include: Obtaining a preset question set and extracting the semantic feature vector of each user question in the preset question set; Generating, based on the semantic feature vector, an adversarial sample feature vector associated with the semantic feature vector; According to the semantic feature vector and the adversarial sample feature vector, a semantic recognition model is trained to obtain a target semantic recognition model, so as to answer questions through the target semantic recognition model.

2. The method according to claim 1, characterized in that Generating, according to the semantic feature vector, an adversarial sample feature vector associated with the semantic feature vector, comprising: Performing forward propagation calculation of semantic recognition according to the semantic feature vector to obtain a first forward loss function, and obtaining a first gradient of the first forward loss function through back propagation; A perturbation factor is determined according to the first gradient and the perturbation radius; and an adversarial sample feature vector is generated according to the perturbation factor and the semantic feature vector.

3. The method according to claim 2, characterized in that Determining a perturbation factor according to the first gradient and the perturbation radius; and generating an adversarial sample feature vector according to the perturbation factor and the semantic feature vector, including: taking the product of the normalized value of the first gradient and the perturbation radius as an initial perturbation factor; Adding the initial perturbation factor to the semantic feature vector to obtain an initial anti-sample feature vector; Calculating the semantic similarity between the initial anti-sample feature vector and the semantic feature vector, and adjusting the initial perturbation factor according to the semantic similarity to obtain a target perturbation factor; The target perturbation factor is added to the semantic feature vector to obtain an adversarial sample feature vector.

4. The method according to claim 2, characterized in that Performing semantic recognition model training based on the semantic feature vector and the adversarial sample feature vector to obtain a target semantic recognition model includes: Performing forward propagation calculation of semantic recognition according to the adversarial sample feature vector to obtain a second forward loss function, and obtaining a second gradient of the second forward loss function through backpropagation; The first gradient and the second gradient are accumulated, and model parameters of the semantic recognition model are updated to obtain a target semantic recognition model.

5. The method according to claim 1, wherein Extracting the semantic feature vector of each user question in the preset question set includes: Performing text normalization and data enhancement processing on each user question in the preset question set to obtain sample enhanced data; Extracting semantic feature vectors of the sample enhanced data.

6. The method according to claim 5, characterized in that Perform text normalization and data augmentation on each user question in the preset question set to obtain sample augmented data, including: Normalizing the text of each user question in the preset question set to obtain sample normative data; Performing synonym replacement on the sample specification data to obtain first enhanced data; translating the sample standard data from an original language into target language data, and translating the target language data into the original language to obtain second enhanced data; The sample specification data, the first enhanced data, and the second enhanced data are used as sample enhanced data.

7. A question answering method that introduces adversarial training, characterized in that include: Collect target user questions raised by users during voice calls; Using the target semantic recognition model obtained by the semantic recognition model training method introducing adversarial training as described in any one of claims 1 to 6, semantic recognition is performed on the target user question to obtain a target matching result; During the voice call, the target reply content corresponding to the target matching result is replied to the user.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the semantic recognition model training method introducing adversarial training as described in any one of claims 1 to 6, or the question answering method introducing adversarial training as described in claim 7.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the semantic recognition model training method introducing adversarial training as described in any one of claims 1 to 6, or the question answering method introducing adversarial training as described in claim 7 when executed.

10. A computer program product, comprising a computer program, which, when executed by a processor, implements the semantic recognition model training method introducing adversarial training described in any one of claims 1 to 6, or the question answering method introducing adversarial training described in claim 7.