Neural network model training method and device for intention recognition
By adding professional field corpus and expanding the training data set to the neural network model training for intent recognition, the problem of insufficient robustness of the model when identifying intent in highly professional fields is solved, and the processing capability and robustness of the model are improved. sex.
Patent Information
- Application Number
- CN202410839095.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-24
AI Technical Summary
Existing neural network models for intent recognition have insufficient performance and poor robustness in identifying highly professional conversational intentions, mainly due to the lack of professional domain content covered by the training data set.
By obtaining and collecting professional field corpus, adding professional field corpus to the initial training data set, performing data augmentation, and expanding the training data set by inserting modal particles, deleting characters, adding specific scene dialogue, and replacing synonyms, etc., to improve the model's accuracy in professional fields. Processing capabilities in areas with strong sexual characteristics.
It has significantly improved the neural network model's processing ability and robustness for texts in highly specialized fields, enhanced the model's ability to understand non-standard sentences and culturally related expressions, and improved its generalization ability in complex scenarios.
Smart Images

Figure CN118690813A
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language processing technology, and in particular to a training method and device for a neural network model for intent recognition. Background Art
[0002] Intent recognition is an important task in natural language processing, which aims to determine the intention or purpose expressed in the sentence input by the user. Simply put, intent recognition is to understand the semantics of the user's words in order to better answer the user's questions or provide related services.
[0003] Currently, neural network models for intent recognition are usually trained using limited data sets, which are usually composed of conversations in daily scenarios. Although the neural network models trained with these data sets perform well in recognizing the intent of conversations in daily scenarios, they perform poorly in recognizing the intent of conversations with strong professional characteristics. Therefore, the robustness of the neural network models currently used for intent recognition is poor.
[0004] Therefore, how to improve the robustness of the neural network model for intent recognition becomes an urgent problem to be solved. Summary of the invention
[0005] The present application provides a method and device for training a neural network model for intent recognition, which can improve the robustness of the neural network model for intent recognition.
[0006] In a first aspect, a training method for a neural network model for intent recognition is provided, comprising:
[0007] Obtain data sources containing professional domain corpora;
[0008] Use data sources to collect professional domain corpus;
[0009] Add professional domain corpus to the initial training dataset to obtain the target training dataset. The initial training dataset includes multiple dialogues and the intent label corresponding to each dialogue.
[0010] Use intent labels to label the dialogues to be labeled in the target training dataset;
[0011] Use the labeled target training dataset to fine-tune the base neural network model for intent recognition to obtain the target neural network model.
[0012] In a feasible design, before annotating the to-be-annotated dialogues in the target training dataset using the intent labels, the method further includes:
[0013] Determine the dialogue scene to be added;
[0014] Collect real conversations that match the conversation scenario to be added;
[0015] Execute the simulated dialogue script to obtain a virtual dialogue that meets the dialogue scenario to be added;
[0016] Annotate real and virtual conversations using intent labels;
[0017] Add annotated real and virtual conversations to the target training dataset.
[0018] In a feasible design, before annotating the to-be-annotated dialogues in the target training dataset using the intent labels, the method further includes:
[0019] Determine a sentence to be modified from the target training data set, where the number of characters included in the sentence to be modified is greater than a first preset number;
[0020] Determine the deletion rule, which is used to specify that characters containing professional information should not be deleted in the sentence to be modified;
[0021] Determine the words to be modified of the sentence to be modified according to the deletion rule;
[0022] Randomly deleting a second preset number of characters in the word to be modified;
[0023] If the intention of the deleted sentence to be modified does not change, add the deleted sentence to be modified to the target training data set.
[0024] In a feasible design, before annotating the to-be-annotated dialogues in the target training dataset using the intent labels, the method further includes:
[0025] Determine the words to be replaced in the corpus of the target training data set using a first vocabulary, wherein the first vocabulary is used to store a plurality of words with the same or similar semantics and a corresponding relationship between the plurality of words;
[0026] Determining a target word corresponding to the word to be replaced from the first word library;
[0027] Use the target word to replace the word to be replaced to obtain a new corpus;
[0028] Add new corpus to the target training dataset.
[0029] In a feasible design, before annotating the to-be-annotated dialogues in the target training dataset using the intent labels, the method further includes:
[0030] Determine the content of the modal particles based on the intent type of the conversation in the target training dataset;
[0031] Determine a target position for inserting modal particles in a dialogue of a target training dataset;
[0032] Insert modal particles at the target position.
[0033] In a feasible design, before annotating the real dialogue and the virtual dialogue with the intent label, the method further includes:
[0034] Determine personal privacy information in real conversations;
[0035] Delete personal privacy information in real conversations, or replace personal privacy information in real conversations with preset content.
[0036] In a feasible design, before adding the annotated real dialogues and virtual dialogues to the target training dataset, the method further includes:
[0037] Annotate real and virtual conversations with key information labels.
[0038] In a feasible design, before adding the annotated real dialogues and virtual dialogues to the target training dataset, the method further includes:
[0039] The rating of the virtual conversations was determined using an evaluation script, which was used to check the quality of the conversations;
[0040] Delete the conversations whose scores are less than the preset scores in the virtual conversations.
[0041] In a feasible design, before annotating the real dialogue and the virtual dialogue with the intent label, the method further includes:
[0042] Generate new dialogues by changing the tense or voice of sentences in real and virtual dialogues;
[0043] Add new dialogues to real and virtual conversations.
[0044] In a second aspect, a training device for a neural network model for intent recognition is provided, comprising:
[0045] A professional domain corpus adding module is used to obtain data sources containing professional domain corpus;
[0046] The professional field corpus adding module is also used to collect professional field corpus using data sources;
[0047] The professional domain corpus adding module is also used to add professional domain corpus to the initial training data set to obtain the target training data set. The initial training data set includes multiple dialogues and the intent label corresponding to each dialogue;
[0048] The intent labeling module is used to label the dialogues to be labeled in the target training dataset using intent labels;
[0049] The model fine-tuning module is used to fine-tune the base neural network model for intent recognition using the labeled target training data set to obtain the target neural network model.
[0050] After obtaining a data source containing professional domain corpus, the embodiment of the present application can use the data source to accurately and effectively collect professional domain corpus. The present application achieves data augmentation and improves the professionalism of the training data set by adding professional domain corpus to the initial training data set. Fine-tuning the base neural network model using the target training data set after data augmentation can improve the neural network model's ability to process text in highly professional fields and improve the robustness of the neural network model. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0052] Figure 1 is a schematic flow chart of a training method of a neural network model for intent recognition provided by an exemplary embodiment of the present application;
[0053] Figure 2 It is a schematic diagram of a training device for a neural network model for intent recognition provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] At present, the neural network models used for intent recognition rely on limited data sets for training, and these data sets lack the content in professional fields. As a result, the trained neural network models have insufficient performance and poor robustness in recognizing the intent of highly professional conversations.
[0056] In order to improve the robustness of the neural network model used for intent recognition, such as Figure 1 As shown, the present application provides a training method for a neural network model for intent recognition, comprising:
[0057] S110, obtaining a data source containing professional domain corpus.
[0058] It should be noted that the corpus in this application includes various forms of text such as dialogues, professional terms, sentences and paragraphs.
[0059] Among them, professional fields include medical, legal, financial and other highly professional fields. Professional field corpus includes industry terms, professional expressions or sentences in specific business contexts.
[0060] Exemplarily, data sources include professional literature, industry reports, professional forum posts, expert interview recordings, etc.
[0061] S120, collecting professional domain corpus using data sources.
[0062] Specifically, scripts are used to extract relevant texts from data sources such as professional literature, industry reports or professional forums. Furthermore, the accuracy of the collected professional field corpus and the relevance of the corresponding professional field can also be ensured by cooperating with field experts. After ensuring that the collected professional field corpus covers the main topics and concepts in the field, the common professional terms, sentence expressions and typical application scenarios in the professional field are determined based on the collected professional field corpus, and then the collected professional field corpus, as well as the common professional terms, sentence expressions and typical application scenarios in the professional field determined above are placed in the corpus.
[0063] S130, adding professional domain corpus to the initial training data set to obtain a target training data set.
[0064] The initial training data set includes multiple conversations and the intent label corresponding to each conversation.
[0065] The initial training dataset is an open source training dataset, which usually consists of commonly used expressions with standard sentence structures or conversations in daily scenarios.
[0066] Specifically, the corpus corresponding to the professional field in the corpus is added to the initial training data set to obtain the target training data set.
[0067] The present application also considers that the current neural network models used for intent recognition rely on limited data sets for training, and these data sets cover fewer forms of language expression. As a result, the trained neural network models perform well in recognizing commonly used expressions with standard sentence structures, but are insufficient in recognizing the intent of uncommon expressions (including non-standard terms, such as sentences containing puns) or culturally related expressions (such as sentences containing dialects).
[0068] In order to solve the above problem, in a feasible design, the present application also provides a method for expanding the training data set by adding modal particles, including the following steps:
[0069] Determine the content of the modal particle according to the intention type of the conversation in the target training dataset;
[0070] Determine the target position in the conversation of the target training dataset for inserting the modal particle;
[0071] Insert the modal particle at the target position.
[0072] Among them, the modal particle is an empty word indicating mood, commonly used at the end of a sentence or at the pause in the middle of a sentence to indicate various moods. Common modal particles are: de, le, me, ne, ba, a.
[0073] The intention types include types such as indicating confirmation, indicating doubt, indicating request, indicating instruction, etc. The content of the modal particle to be inserted corresponding to different intention types is different. For example, the modal particle corresponding to the confirmation type is "en", the modal particle corresponding to the doubt type is "ne", and the modal particle corresponding to the instruction type is "a".
[0074] Exemplarily, determine the target position for inserting the modal particle according to the intention type of the conversation.
[0075] For example, the intention type of the conversation "Yes" is to indicate confirmation, and its target position is the position before the first character of the statement. Insert the modal particle "en" at the target position, and the generated conversation is "En, yes". To make the conversation more natural, in this case, after inserting the modal particle at the target position, insert a punctuation mark after the modal particle. The conversation with the inserted punctuation mark is "En, yes".
[0076] Another example is that the intention type of the conversation "When can I receive the goods" is to indicate doubt, and its target position is the position after the last character of the statement. Insert the modal particle "ne" at the target position, and the generated conversation is "When can I receive the goods ne". If the last character of the statement is a punctuation mark, then the target position is the position before the last character.
[0077] Another example is that the intention type of the conversation "Please wait a moment, I'll check your order" is to indicate a request, and its target position is the position before the first punctuation mark after the character indicating the request. Insert the modal particle "a" at the target position, and the generated conversation is "Please wait a moment, a, I'll check your order".
[0078] Exemplarily, determine the intention type of the conversation according to the keywords, key phrases and / or punctuation marks of the conversation. For example, if the conversation includes the keyword "Please", its intention type is to indicate a request; if the conversation includes the key phrase "Why", its intention type is to indicate doubt; if the conversation includes the key phrases "Yes" or "That's right", the intention type is to indicate confirmation.
[0079] The above-mentioned embodiment of inserting modal particles into the dialogue of the target training data set can be executed through a script.
[0080] For example, after inserting the modal particle at the target position, a manual or automated tool is used to check whether the use of the modal particle conforms to the context of natural language, so as to ensure that the addition of the modal particle follows the habits of natural language and ensure that they are placed in the appropriate position in the sentence.
[0081] The above example can accurately determine the content of the modal particle according to the intention type of the conversation in the target training data set. After determining the target position, the modal particle is inserted at the target position of the conversation, thereby realizing automatic insertion of the modal particle. Compared with manual insertion, the above example can save human resources and improve the efficiency of processing the training data set. In addition, by adding modal particles commonly used in spoken language to the conversation, the present application can make the conversation more natural and enrich the diversity of the target training data set. This method enables the neural network model to improve its ability to understand more colloquial conversations, and the output responses are more humane, further improving the robustness of the neural network model.
[0082] In a feasible design, the present application also provides a method for expanding the training data set by deleting characters in a sentence, comprising the following steps:
[0083] Determine a sentence to be modified from the target training data set, where the number of characters included in the sentence to be modified is greater than a first preset number;
[0084] Determine the deletion rule, which is used to specify that characters containing professional information should not be deleted in the sentence to be modified;
[0085] Determine the words to be modified of the sentence to be modified according to the deletion rule;
[0086] Randomly deleting a second preset number of characters in the word to be modified;
[0087] If the intention of the deleted sentence to be modified does not change, add the deleted sentence to be modified to the target training data set.
[0088] The first preset number can be set according to actual needs and can be set to 20.
[0089] The second preset number can be set according to actual needs, and can be set to 1 or 2.
[0090] For example, the characters containing professional information are proper nouns or professional technical terms. Since proper nouns and professional technical terms are highly professional, if they are deleted, it will affect the understanding of the professional information of the sentence. Therefore, setting the above deletion rule can ensure that the understanding of the professional information of the sentence to be modified after deletion is not affected.
[0091] The above embodiments are illustrated below by specific examples:
[0092] Select sentences with more than 20 characters from the target training dataset as the sentences to be modified. The sentence to be modified is "Welcome to use our online shopping platform. What can I do for you?";
[0093] Set a deletion rule, where the deletion rule is to avoid deleting characters of proper nouns and technical terms in the sentence;
[0094] According to the deletion rule, determine that the words to be modified in the sentence to be modified are words other than proper nouns and technical terms. Select "online shopping platform" in the sentence as the word to be modified for modification. This is a relatively long word, and even if 1 or 2 characters are missing, it does not affect the understanding of the sentence where it is located;
[0095] Use a script to randomly delete 1 character in "online shopping platform". This character is "ping", and it becomes "online shopping desk". The sentence after deletion is "Welcome to use our online shopping desk. What can I do for you?";
[0096] Since the semantics of the sentence to be modified after deletion do not affect understanding, the intention of the sentence to be modified after deletion remains unchanged. Add the sentence to be modified after deletion to the target training dataset.
[0097] This application takes into account sentences of moderate or long length, which can still maintain readability even after deleting characters. Therefore, sentences with the number of characters greater than the first preset number are used as the sentences to be modified. In addition, by setting the above deletion rule, this application can ensure that the understanding of the professional information of the sentence to be modified after deletion is not affected. By stipulating the length of the sentence to be modified and the deletion rule in the above example, it can be ensured as much as possible that the sentence is contextually understandable and the intention does not change after deleting the second preset number of characters, thereby simulating typing errors or omissions in spoken language in the real world. Adding the sentence to be modified after deletion to the target training dataset realizes data augmentation and can increase the diversity of data in the target training dataset. Fine-tuning the base neural network model using the target training dataset expanded in this way helps to improve the adaptability of the target neural network model to real scenarios and enhances the robustness of the neural network model.
[0098] In a feasible design, this application also provides a method for expanding the training dataset by adding conversations in a specific scenario (i.e., the conversation scenario to be added), including the following steps:
[0099] Determine the conversation scenario to be added;
[0100] Collect real conversations that meet the conversation scenario to be added;
[0101] Execute the simulated dialogue script to obtain a virtual dialogue that meets the dialogue scenario to be added;
[0102] Annotate real and virtual conversations using intent labels;
[0103] Add annotated real and virtual conversations to the target training dataset.
[0104] Exemplarily, the dialogue scenarios to be added include customer service scenarios, which specifically include order inquiry, product support, refund process and other scenarios.
[0105] Among them, the simulated conversation script can reflect the natural process of real communication, including common customer inquiry processes and possible service representative response processes.
[0106] Intent tags are used to mark the intent of a conversation, such as "query order status", "request a refund", etc.
[0107] Exemplarily, when the dialogue scenario to be added includes a customer service scenario, collecting real dialogues that match the dialogue scenario to be added includes:
[0108] Use customer service text extraction scripts to crawl conversation data in customer service records from chat logs, emails, recordings, and other sources. If the data contains personal privacy information, anonymize the data;
[0109] Alternatively, the conversation data is extracted from the backend of the customer service system, and the extracted conversation data is desensitized to remove the user's sensitive information.
[0110] The above examples collect real conversations from various sources so that the collected conversations can include different customer needs, questions, and feedback types, thereby covering various typical situations.
[0111] Exemplarily, real conversations include conversations with non-standard sentence structures, which are used to improve the processing capability of the neural network model for conversations with non-standard sentence structures.
[0112] This application expands the training data set by adding dialogues for specific scenarios, and performs targeted data augmentation on the training data set corresponding to specific scenarios. Considering that if there is not enough real dialogue data, virtual dialogues are obtained by further executing simulated dialogue scripts, thereby increasing the scale of dialogues in specific scenarios to ensure that there are enough samples to fine-tune the neural network model and improve the generalization ability of the neural network model. The above examples enable the neural network model to better adapt to the complexity and diversity of the real world, optimize its performance and ensure its effectiveness in complex or unseen situations, further improving the robustness of the neural network model.
[0113] In a feasible design, before annotating the real conversation and the virtual conversation with the intent label, the method further includes:
[0114] Determine personal privacy information in real conversations;
[0115] Delete personal privacy information in real conversations, or replace personal privacy information in real conversations with preset content.
[0116] Among them, the preset content can be set according to needs.
[0117] The above examples protect personal privacy by removing or replacing personal privacy information in the conversation.
[0118] In a feasible design, before adding the annotated real dialogues and virtual dialogues to the target training dataset, the method further includes:
[0119] Annotate real and virtual conversations with key information labels.
[0120] Among them, key information tags are used to mark the key content of the conversation, such as order number, amount, date, etc.
[0121] The above example uses key information tags to annotate real conversations and virtual conversations, so that the neural network model can also learn to identify key content in the conversation and use the key content in the conversation to determine the content of the reply to the user, thereby improving the interaction performance with the user.
[0122] In a feasible design, before adding the annotated real dialogues and virtual dialogues to the target training dataset, the method further includes:
[0123] The rating of the virtual conversations was determined using an evaluation script, which was used to check the quality of the conversations;
[0124] Delete the conversations whose scores are less than the preset scores in the virtual conversations.
[0125] Among them, the evaluation script can be scored by analyzing grammatical errors, typos and other information in the conversation.
[0126] The preset score can be set according to actual needs, and this application does not limit this.
[0127] The above example uses an evaluation script to automatically check the generated virtual dialogue to ensure it is natural, accurate, and realistic.
[0128] For example, the quality of the conversation can also be checked manually, such as by inviting domain experts or actual customer service representatives to conduct evaluation and feedback.
[0129] In a feasible design, before annotating the real conversation and the virtual conversation with the intent label, the method further includes:
[0130] Generate new dialogues by changing the tense or voice of sentences in real and virtual dialogues;
[0131] Add new dialogues to real and virtual conversations.
[0132] The above example generates a new dialogue by changing the tense or voice of the dialogue, further expanding the training data set to improve the neural network model's ability to process dialogues in various tenses or voices.
[0133] Further illustratively, by screening the real conversations and virtual conversations obtained from the above examples, it is ensured that the conversations in the specific scenarios added to the training dataset are consistent or similar in discourse style and structure to the conversations in the initial training dataset.
[0134] Further exemplary, the real conversation and the virtual conversation are formatted into a format suitable for neural network model input, for example, their storage type is converted into a specific file type or database structure.
[0135] In a feasible design, the present application further expands the training data set by replacing synonyms or near-synonyms, and the steps are as follows:
[0136] Determine the words to be replaced in the corpus of the target training data set using a first vocabulary, wherein the first vocabulary is used to store a plurality of words with the same or similar semantics and a corresponding relationship between the plurality of words;
[0137] Determining a target word corresponding to the word to be replaced from the first word library;
[0138] Use the target word to replace the word to be replaced to obtain a new corpus;
[0139] Add new corpus to the target training dataset.
[0140] Exemplarily, based on an existing word library for storing synonyms or near-synonyms, synonyms or near-synonyms related to professional fields and / or customer service scenarios are added to generate a first word library.
[0141] Exemplarily, the following method is used to determine the words to be replaced in the corpus of the target training data set using the first vocabulary:
[0142] By using a keyword matching method, a word in the corpus of the target training data set that is identical to a word in the first vocabulary is determined, and then the word is determined as a word to be replaced.
[0143] The above example uses the first thesaurus to perform synonym replacement or near-synonym replacement on the corpus of the target training dataset, and generates new sentence variants on the premise of ensuring that the sentences before and after replacement are semantically consistent, so as to further expand the training dataset.
[0144] Exemplarily, the corpus in the target training dataset is rewritten using dialects and / or slang on the premise of ensuring semantic consistency, new corpus is generated, and the new corpus is added to the target training dataset to further enhance the diversity of the target training dataset, thereby improving the processing ability of the neural network model for conversations containing dialects and / or slang, and thus improving the robustness of the neural network model.
[0145] S140, use intent labels to label the dialogues to be labeled in the target training dataset.
[0146] Exemplarily, before labeling the dialogues to be labeled in the target training dataset, in order to improve the quality of the corpus in the target training dataset, the data in the target training dataset is preprocessed, and the preprocessing includes one or more of the following methods:
[0147] (1) Data cleaning:
[0148] Remove the noise and irrelevant information in the data to reduce the interference to the neural network model. For example:
[0149] a: Remove useless characters, that is, check and remove the garbled characters or abnormal characters in the text, such as some non-standard encoded characters or symbols that should not appear in the text (such as control characters).
[0150] b: Correct spelling mistakes and typos, that is, use a spelling check tool or a custom script to check and correct spelling mistakes or typos.
[0151] c: Remove duplicate records, that is, check whether there are duplicate entries in the text data and remove redundant information.
[0152] d: Remove stop words, that is, remove the common but less important words for understanding the main intention of the text as needed, such as words like "and", "of", "is" that may not carry useful information in subsequent text analysis.
[0153] e: Clean Hyper Text Markup Language (HTML) tags and website addresses, that is, if the text is from a web page, remove HTML tags and website addresses, etc., and only retain the pure text content.
[0154] f: Remove or replace sensitive information, that is, to protect privacy, remove or replace personal information such as names, phone numbers, etc. with placeholders.
[0155] (2) Text normalization, for example:
[0156] a: Format unification, that is, ensure that all text data follows the same format, such as unifying the date format to "YYYY-MM-DD", unifying uppercase and lowercase, currency and numerical formats, etc.
[0157] b: Encoding conversion, unifying the encoding format of data from multiple sources, such as converting all text into a unified encoding format UTF-8.
[0158] c: Text standardization, which is to perform standardization processing on specific elements in the text, such as converting all uppercase letters to lowercase, or converting traditional Chinese characters to simplified Chinese.
[0159] (3) Word segmentation, which is to divide continuous text into words or phrases. Word segmentation tools suitable for professional fields can be considered to more accurately identify relevant terms in professional fields.
[0160] (4) Divide the text into paragraphs and sentences for more detailed processing and analysis.
[0161] Exemplarily, data backup is performed before data cleaning to prevent irreversible errors from occurring during the cleaning process.
[0162] Exemplarily, after data cleaning, the integrity of the data in terms of intended expression is verified to prevent accidental deletion of important information during the data cleaning process.
[0163] S150, fine-tuning the base neural network model for intent recognition using the labeled target training data set to obtain a target neural network model.
[0164] The base neural network model can parse the user input and extract the intent from it, and then respond according to the intent. This application does not limit the structure of the base neural network model.
[0165] After obtaining a data source containing professional domain corpus, the embodiment of the present application can use the data source to accurately and effectively collect professional domain corpus. The present application achieves data augmentation and improves the professionalism of the training data set by adding professional domain corpus to the initial training data set. Fine-tuning the base neural network model using the target training data set after data augmentation can improve the neural network model's ability to process text in highly professional fields and improve the robustness of the neural network model.
[0166] like Figure 2 As shown, the present application also provides a training device for a neural network model for intent recognition, comprising:
[0167] A professional domain corpus adding module is used to obtain data sources containing professional domain corpus;
[0168] The professional field corpus adding module is further used to collect the professional field corpus using the data source;
[0169] The professional domain corpus adding module is further used to add the professional domain corpus to an initial training data set to obtain a target training data set, wherein the initial training data set includes multiple dialogues and an intent label corresponding to each dialogue;
[0170] An intent labeling module, used to label the to-be-labeled dialogues in the target training data set using intent labels;
[0171] The model fine-tuning module is used to fine-tune the base neural network model for intent recognition using the labeled target training data set to obtain a target neural network model.
[0172] In a feasible design, a customer service scenario dialogue adding module is also included, and the dialogue adding module expands the target training data set in the following ways:
[0173] Determine the dialogue scene to be added;
[0174] Collect real conversations that match the conversation scenario to be added;
[0175] Execute the simulated dialogue script to obtain a virtual dialogue that meets the dialogue scenario to be added;
[0176] Annotate real and virtual conversations using intent labels;
[0177] Add annotated real and virtual conversations to the target training dataset.
[0178] In a feasible design, a character deletion module is also included, and the character deletion module expands the target training data set in the following manner:
[0179] Determine a sentence to be modified from the target training data set, where the number of characters included in the sentence to be modified is greater than a first preset number;
[0180] Determine the deletion rule, which is used to specify that characters containing professional information should not be deleted in the sentence to be modified;
[0181] Determine the words to be modified of the sentence to be modified according to the deletion rule;
[0182] Randomly deleting a second preset number of characters in the word to be modified;
[0183] If the intention of the deleted sentence to be modified does not change, add the deleted sentence to be modified to the target training data set.
[0184] In a feasible design, a word replacement module is also included to expand the target training data set in the following manner:
[0185] Determine the words to be replaced in the corpus of the target training data set using a first vocabulary, wherein the first vocabulary is used to store a plurality of words with the same or similar semantics and a corresponding relationship between the plurality of words;
[0186] Determining a target word corresponding to the word to be replaced from the first word library;
[0187] Use the target word to replace the word to be replaced to obtain a new corpus;
[0188] Add new corpus to the target training dataset.
[0189] In a feasible design, a modal particle insertion module is also included. The modal particle insertion module inserts modal particles into the dialogue of the target training dataset in the following manner:
[0190] Determine the content of the modal particles based on the intent type of the conversation in the target training dataset;
[0191] Determine a target position for inserting modal particles in a dialogue of a target training dataset;
[0192] Insert modal particles at the target position.
[0193] In a feasible design, the customer service scenario dialogue adding module is also used to determine personal privacy information in real conversations; the customer service scenario dialogue adding module is also used to delete personal privacy information in real conversations, or replace personal privacy information in real conversations with preset content.
[0194] In a feasible design, the customer service scenario dialogue adding module is also used to annotate real dialogues and virtual dialogues with key information tags.
[0195] In a feasible design, the customer service scenario dialogue adding module is also used to determine the score of the virtual dialogue using an evaluation script, and the evaluation script is used to check the quality of the dialogue; the customer service scenario dialogue adding module is also used to delete dialogues in the virtual dialogue whose scores are less than preset scores.
[0196] In a feasible design, the customer service scenario dialogue adding module is also used to generate new dialogues by changing the tense or voice of sentences in real dialogues and virtual dialogues; the customer service scenario dialogue adding module is also used to add new dialogues to real dialogues and virtual dialogues.
[0197] For other implementations and effects of the above-mentioned device, please refer to the description in the embodiment of the training method of the neural network model for intention recognition, which will not be repeated here.
[0198] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.
[0199] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by 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 they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0200] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the words "such as but not limited to", and can be used interchangeably with them.
[0201] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.
[0202] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0203] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A training method for a neural network model for intent recognition, characterized in that: include: Obtain data sources containing professional domain corpora; Using the data source to collect the professional field corpus; Adding the professional domain corpus to an initial training data set to obtain a target training data set, wherein the initial training data set includes multiple dialogues and an intent label corresponding to each dialogue; Using intent labels to label the dialogues to be labeled in the target training dataset; The labeled target training data set is used to fine-tune the base neural network model for intent recognition to obtain a target neural network model.
2. The method according to claim 1, characterized in that Before annotating the to-be-annotated dialogues in the target training data set using the intent labels, the method further includes: Determine the dialogue scene to be added; Collecting real dialogues that match the dialogue scenario to be added; Execute the simulated dialogue script to obtain a virtual dialogue that conforms to the dialogue scenario to be added; Annotating the real conversation and the virtual conversation using intent labels; The annotated real dialogue and the virtual dialogue are added to the target training data set.
3. The method according to claim 1 or 2, characterized in that: Before annotating the to-be-annotated dialogues in the target training data set using the intent labels, the method further includes: Determining a sentence to be modified from the target training data set, wherein the number of characters contained in the sentence to be modified is greater than a first preset number; Determine a deletion rule, wherein the deletion rule is used to specify that characters containing professional information should not be deleted from the sentence to be modified; Determining the words to be modified of the sentence to be modified according to the deletion rule; Randomly deleting a second preset number of characters in the word to be modified; If the intention of the deleted statement to be modified does not change, the deleted statement to be modified is added to the target training data set.
4. The method according to claim 1 or 2, characterized in that: Before annotating the to-be-annotated dialogues in the target training data set using the intent labels, the method further includes: Determining the words to be replaced in the corpus of the target training data set by using a first vocabulary, wherein the first vocabulary is used to store a plurality of words with the same or similar semantics and the corresponding relationship between the plurality of words; Determining a target word corresponding to the word to be replaced from the first word library; Using the target word to replace the word to be replaced to obtain a new corpus; Add the new corpus to the target training dataset.
5. The method according to claim 1 or 2, characterized in that: Before annotating the to-be-annotated dialogues in the target training data set using the intent labels, the method further includes: Determining the content of the modal particle according to the intent type of the dialogue in the target training data set; Determining a target position for inserting an interjection in the dialogue of the target training data set; The modal particle is inserted at the target position.
6. The method according to claim 2, characterized in that Before annotating the real dialogue and the virtual dialogue with the intention label, the method further includes: Determining personal privacy information in the real conversation; The personal privacy information in the real conversation is deleted, or the personal privacy information in the real conversation is replaced with preset content.
7. The method according to claim 2, characterized in that Before adding the annotated real dialogue and the virtual dialogue to the target training data set, the method further includes: The real dialogue and the virtual dialogue are annotated using key information tags.
8. The method according to claim 2, characterized in that: Before adding the annotated real dialogue and the virtual dialogue to the target training data set, the method further includes: determining a score for the virtual conversation using an evaluation script, the evaluation script being used to check the quality of the conversation; Delete the dialogues in the virtual dialogues whose scores are less than the preset scores.
9. The method according to claim 2, characterized in that: Before annotating the real dialogue and the virtual dialogue with the intention label, the method further includes: Generate a new dialogue by changing the tense or voice of sentences in the real dialogue and the virtual dialogue; The new dialogue is added to the real dialogue and the virtual dialogue.
10. A training device for a neural network model for intention recognition, characterized in that: include: A professional domain corpus adding module is used to obtain data sources containing professional domain corpus; The professional field corpus adding module is further used to collect the professional field corpus using the data source; The professional domain corpus adding module is further used to add the professional domain corpus to an initial training data set to obtain a target training data set, wherein the initial training data set includes multiple dialogues and an intent label corresponding to each dialogue; An intent labeling module, used to label the to-be-labeled dialogues in the target training data set using intent labels; The model fine-tuning module is used to fine-tune the base neural network model for intent recognition using the labeled target training data set to obtain a target neural network model.
Citation Information
Patent Citations
Real estate industry dialogue intention recognition method and device
CN116050422A
Intention recognition model training method, response processing method and related device
CN116127023A
Intention recognition method and target industry intention model training method
CN116303926A
Cited By
LLM-based multi-cloud storage heterogeneous user intention recognition method and device
CN119849504A
A multi-cloud storage heterogeneous user intent recognition method and device based on LLM
CN119849504B
