Data enhancement method and device, electronic equipment and storage medium

By preprocessing the training model and conducting vocabulary expansion training, and using the BERT model to generate extended sentences, the problem of difficult data labeling in deep learning is solved, and low-cost data expansion in data enhancement and emotional dialogue tasks is achieved.

CN114153984BActive Publication Date: 2025-10-10BEIJING XIAOMI MOBILE SOFTWARE CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111373575.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-10-10
Estimated Expiration
2041-11-19

Smart Images

  • Figure CN114153984B_ABST
    Figure CN114153984B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data enhancement method, device, electronic equipment and storage medium. The data enhancement method comprises: preprocessing a training model; inputting a training sentence with a training label and a mask to the training model; performing vocabulary expansion training on the training sentence based on the training label through the training model to obtain an expanded vocabulary; and outputting an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary. In this application, since the position of the expanded vocabulary is determined in advance by the mask, a large number of expanded vocabularies can be placed in the same position in the training sentence, thereby obtaining expanded sentences with the same sequence, which is beneficial to the extraction of vocabularies during subsequent data training, and thus data enhancement is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer application, and particularly relates to a data enhancement method and device, electronic equipment and storage medium. BACKGROUND

[0002] Deep learning is a new research direction in the field of machine learning, which is introduced into machine learning to make it closer to the original goal-artificial intelligence (AI). Deep learning is to learn the internal rules and representation levels of sample data, and the information obtained in the learning process is very helpful for the interpretation of data such as text, images and sounds. The ultimate goal is to enable machines to have analysis and learning ability like people, and to recognize text, images and sound data. In the era of deep learning, when training a model through data, the data directly determines the upper limit of the model capability. However, high-quality and large-scale labeled data are often difficult to obtain. SUMMARY

[0003] The present disclosure provides a data enhancement method, a data enhancement device, a terminal and a storage medium.

[0004] In a first aspect of the embodiments of the present disclosure, a data enhancement method is provided, comprising:

[0005] Preprocessing a training model;

[0006] Inputting a training sentence with a training label and a mask to the training model;

[0007] Performing vocabulary expansion training on the training sentence through the training model based on the training label to obtain an expanded vocabulary.

[0008] Outputting an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary.

[0009] In some embodiments, the performing vocabulary expansion training on the training sentence through the training model based on the training label to obtain an expanded vocabulary comprises:

[0010] Determining an association relationship between a to-be-expanded vocabulary and the training label;

[0011] Training the training sentence based on the training label and the determined association relationship to obtain the expanded vocabulary.

[0012] In some embodiments, the training label at least comprises an emotion label representing emotion.

[0013] The association relationship is that the extended vocabulary is used to represent the cause of the emotion in the emotion label.

[0014] The training of the training sentence based on the training label and the determined association relationship obtains the extended vocabulary, at least including:

[0015] Based on the emotion label and the association relationship, the extended vocabulary representing the cause of the emotion is trained.

[0016] In some embodiments, the extended vocabulary is obtained by training the training sentence based on the training label through the training model, including:

[0017] Determine the vocabulary length of the extended vocabulary that can be accommodated by the mask position;

[0018] Based on the training label, the extended vocabulary conforming to the vocabulary length is trained.

[0019] In some embodiments, before the training model is input with the training label and the training sentence with the mask, the method further comprises:

[0020] Obtain an initial sentence, wherein the initial sentence includes a user inquiry sentence;

[0021] The mask is used to shield the vocabulary associated with the training label in the initial sentence;

[0022] Determine the position of the shielded vocabulary as the position of the mask.

[0023] In some embodiments, the pre-processing of the training model at least includes:

[0024] Obtain a training vocabulary without the training label in a predetermined field, wherein the training vocabulary has language characteristics of the predetermined field;

[0025] Input the training vocabulary into the training model;

[0026] Train the training model based on the training vocabulary.

[0027] In some embodiments, the method further comprises:

[0028] In the emotional dialogue task, the training label is determined, wherein the training label is used to represent the emotion category involved in the emotional dialogue task;

[0029] Based on the training label representing the emotion category, the extended vocabulary is trained.

[0030] In a second aspect, the present disclosure provides a data enhancement device, the device comprising:

[0031] a first processing unit configured to preprocess a training model;

[0032] a second processing unit configured to input a training sentence with a training label and a mask to the training model;

[0033] a third processing unit configured to perform vocabulary expansion training on the training sentence based on the training label through the training model to obtain an expanded vocabulary;

[0034] a fourth processing unit configured to output an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary.

[0035] In a third aspect, the present disclosure provides a terminal, comprising a processor and a memory, wherein the memory stores a computer program capable of running on the processor, and the processor is configured to execute the steps of the method of the first aspect when running the computer program.

[0036] In a fourth aspect, the present disclosure provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of the method of the first aspect.

[0037] The technical solution provided by the embodiments of the present disclosure can have the following beneficial effects:

[0038] The data enhancement method in the embodiments of the present disclosure comprises preprocessing a training model, inputting a training sentence with a training label and a mask to the training model, performing vocabulary expansion training on the training sentence based on the training label through the training model to obtain an expanded vocabulary, and outputting an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary. In the present disclosure, when training the training sentence through the training model, the position of the training sentence where the expanded vocabulary is placed can be determined through the mask first, and then the training sentence with the mask is input to the training model. The training sentence is trained based on the training label to obtain an expanded vocabulary associated with the training label. Finally, the expanded sentence with the expanded vocabulary is obtained by replacing the position of the mask with the expanded vocabulary. Since the position of the expanded vocabulary is determined through the mask in advance, a large number of expanded vocabularies obtained can be placed in the same position in the training sentence, so that the expanded sentence with the same order can be obtained, which is beneficial to the extraction of the vocabulary during subsequent data training (the expanded sentence has the same order, and the expanded vocabulary is located in the same position), and thus data enhancement is achieved.

[0039] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure, in which, like reference numerals designate corresponding parts throughout the several views.

[0041] Figure 1 is a flow chart of a data enhancement method according to an exemplary embodiment of the present disclosure.

[0042] Figure 2 is an application schematic of a data enhancement method according to an exemplary embodiment of the present disclosure. Figure 1 .

[0043] Figure 3 is an application schematic of a data enhancement method according to an exemplary embodiment of the present disclosure. Figure 2 .

[0044] Figure 4 is a structure schematic of a data enhancement device according to an exemplary embodiment of the present disclosure.

[0045] Figure 5 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0046] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements in the several figures. The following detailed description is not representative of all embodiments consistent with the present disclosure. Rather, it is merely exemplary of devices consistent with some aspects of the present disclosure as detailed in the appended claims.

[0047] Deep learning is a new research direction in the field of machine learning, which is introduced into machine learning to make it closer to the original goal-artificial intelligence (AI). Deep learning is to learn the internal rules and representation levels of sample data, and the information obtained in the learning process is very helpful for the interpretation of data such as text, images and sound. Its ultimate goal is to enable machines to have analysis and learning ability like people, and to recognize text, images and sound data. In the era of deep learning, when training a model through data, data directly determines the upper limit of the model's ability. High-quality, large-scale labeled data is often difficult to obtain. Therefore, data enhancement is necessary.

[0048] An embodiment of the present disclosure provides a data enhancement method, which is applied to electronic devices. The electronic devices include mobile terminals, which may include smart phones, smart tablets, smart computers, smart speakers, smart wearable devices, etc.; the electronic devices may also be servers, including local servers, cloud servers, etc. Figure 1 FIG. 1 is a flow chart of a data enhancement method according to an exemplary embodiment. Figure 1 As shown, the data enhancement methods include:

[0049] Step 10: Preprocess the training model;

[0050] Step 11: inputting a training sentence with a training label and a mask into the training model;

[0051] Step 12: Based on the training labels, perform vocabulary expansion training on the training sentences using the training model to obtain expanded vocabulary;

[0052] Step 13: Output an extended sentence with the extended vocabulary, wherein the extended sentence is obtained by replacing the position of the mask with the extended vocabulary.

[0053] In the disclosed embodiments, the training model may utilize the BERT (Bidirectional Encoder Representation from Transformers) model. Before inputting training labels and training sentences into the training model, the model may be pre-trained to enable the training model to be trained on training sentences. The pre-trained model offers powerful performance and strong language understanding and representation capabilities. During sentence training, the training model is not restricted by sentence length and exhibits strong generalization capabilities.

[0054] In the disclosed embodiment, the position of the expanded vocabulary in the training sentence can be determined in advance using a mask. The position of the expanded vocabulary can include: the position in the sentence word order, such as the attributive position, the adverbial position, etc., and / or the byte position of the vocabulary in the sentence, such as the Nth byte position from left to right in the sentence.

[0055] In the embodiment of the present disclosure, a large number of expanded sentences with expanded words at the same position are obtained by replacing the positions of the mask with expanded words, so that the expanded sentences have the same word order.

[0056] Figure 2 This is a schematic diagram of an application of a data enhancement method according to an exemplary embodiment. Figure 1 .like Figure 2 As shown in the figure, the training label (sadness) and the training sentence (Alas, I am ##) are input into the BERT model, and the training is used to obtain the expanded vocabulary (divorce).

[0057] The data enhancement method of the present disclosure can be applied to the emotional dialogue language understanding task. With the popularity of voice assistants, more and more users express emotions to voice assistants and expect voice assistants to understand their emotions. In order to understand the emotions of users more deeply, voice assistants usually need to identify the emotional category information of user query and the emotional reason information that leads to the occurrence of the emotion. However, the manual cost of obtaining such labeled data is relatively high. The present application can focus on the emotional dialogue language understanding task, use the prompt method for data enhancement, expand and obtain corpus with emotional category and emotional reason labels, which is convenient and low-cost. For example, when expanding the sentence with the emotional category of sadness, the training label can be set as sad, so as to expand a large number of expanded sentences with the expanded vocabulary of the sad reason. For example, the sentences of I lost my love and I failed.

[0058] The data enhancement method in the embodiment of the present disclosure includes: preprocessing a training model; inputting a training sentence with a training label and a mask to the training model; based on the training label, performing vocabulary expansion training on the training sentence by the training model to obtain an expanded vocabulary; and outputting an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary. In the present application, when training the training sentence by the training model, the position of the training sentence where the expanded vocabulary is placed can be determined by the mask first, and then the training sentence with the mask is input to the training model; the training sentence is trained based on the training label to obtain the expanded vocabulary associated with the training label; and finally, the expanded sentence with the expanded vocabulary is obtained by replacing the position of the mask with the expanded vocabulary. Since the position of the expanded vocabulary is determined by the mask in advance, a large number of expanded vocabularies obtained can be placed in the same position in the training sentence, so that the expanded sentence with the same order can be obtained, which is beneficial to the extraction of the vocabulary during subsequent data training (the expanded sentence has the same order, and the expanded vocabulary is located in the same position), and thus the data enhancement is realized.

[0059] In some embodiments, the obtaining of the expanded vocabulary based on the training label by the training model includes:

[0060] determining an association relationship between the expanded vocabulary and the training label;

[0061] training the training sentence based on the training label and the determined association relationship to obtain the expanded vocabulary.

[0062] In the disclosed embodiment, the extended vocabulary is associated with the training label. The association relationship between the vocabulary to be expanded and the training label includes at least: a causal relationship, an inclusion relationship, etc. The causal relationship can be used to represent that the extended vocabulary is the cause, resulting in the result identified by the training label; or, the training label is represented as the cause resulting in the result identified by the extended vocabulary. The inclusion relationship can be used to represent that the extended vocabulary and the training label have a mutually inclusive attribute relationship. For example, the extended vocabulary included in the content identified by the training label is determined based on the training label.

[0063] In the disclosed embodiment, after identifying the association between the vocabulary to be expanded and the training label, the training sentence can be trained according to the training label and the determined association to obtain the expanded vocabulary.

[0064] In some embodiments, the training labels include at least: an emotion label representing an emotion;

[0065] The association relationship is that the extended vocabulary is used to represent the cause of the emotion in the emotion tag;

[0066] The step of training the training sentences based on the training labels and the determined association relationships to obtain the expanded vocabulary includes at least:

[0067] Based on the emotion label, an extended vocabulary representing the cause of the emotion is obtained through training.

[0068] In the disclosed embodiment, the training label may be any label having an identification function, including at least: an emotion label, a category label, an attribute label, and the like.

[0069] The emotion tags can be used to represent different emotions, such as happiness, sadness, pain, loss, etc.

[0070] Category labels can be used to represent the category to which an object belongs, such as plants, animals, commodities, transportation tools, etc.

[0071] Attribute tags can be used to characterize the properties of objects, such as material, intangible, heritage, non-heritage, etc.

[0072] When the training label is determined to be an emotion label representing an emotion, based on the causal relationship, the expanded vocabulary can be determined to represent the cause of the emotion in the emotion label. Based on the emotion label, the expanded vocabulary representing the cause of the emotion is trained. Figure 3 This is a schematic diagram of an application of a data enhancement method according to an exemplary embodiment. Figure 2 .like Figure 3 As shown in the figure, when the emotion label is determined to be sadness, a large number of expanded words can be obtained through data enhancement methods, including: divorce, failure, breakup, unemployment, homelessness, etc.

[0073] In some embodiments, performing vocabulary expansion training on the training sentence using the training model based on the training label to obtain an expanded vocabulary includes:

[0074] Determining a vocabulary length of the expanded vocabulary that can be accommodated by the mask position;

[0075] Based on the training labels, the expanded vocabulary that meets the vocabulary length is obtained through training.

[0076] In the disclosed embodiment, the word length may refer to the number of characters in the word. For example, if the word is "sad," the word length is 2; if the word is "very sad," the word length is 3.

[0077] In the embodiment of the present disclosure, by determining the length of the vocabulary, the extended vocabulary of the corresponding vocabulary length is determined. For example, when the length of the extended vocabulary position in the training sentence is 2 characters long, the extended vocabulary of 2 characters can be determined. Figure 3 As shown, a large number of expanded sentences with the same number of words and the same word order can be obtained. Since the positions of the expanded words have been determined, there is no need to manually mark a large number of expanded sentences.

[0078] In some embodiments, before inputting a training sentence with a training label and a mask into the training model, the method further includes:

[0079] Obtaining an initial statement, wherein the initial statement at least includes a user query statement;

[0080] Using the mask to mask the vocabulary associated with the training label in the initial sentence;

[0081] The position of the blocked word is determined to be the position of the mask.

[0082] In the embodiment of the present disclosure, Figure 3 As shown in the figure, the initial sentence is: "Alas, I'm heartbroken." The word associated with the training label "sad" is determined to be "heartbroken." A mask is then used to cover the position of the word "heartbroken," resulting in a masked training sentence: "Alas, I'm broken." The position of the word "heartbroken" covered by the mask is the expanded word position.

[0083] In some embodiments, the preprocessing of the training model includes at least:

[0084] Acquire training words in a predetermined field that do not have the training label, wherein the training words have language characteristics of the predetermined field;

[0085] inputting the training vocabulary into the training model;

[0086] train the training model based on the training vocabulary.

[0087] In the embodiments of the present disclosure, during sentence training, sentences of a specific field are used for training. At this time, the training model can be input with training vocabulary having predetermined field language features without the training label, so as to train the model, so that the training model can output sentences of the predetermined field language features. For example, for the medical field, language features such as surgery, medical malpractice, disease diagnosis, etc. that can reflect a specific field can be used. During sentence training, the feature vocabulary commonly used in this field can be appropriately output, thereby improving the professionalism.

[0088] In some embodiments, the method further comprises:

[0089] In the emotional dialogue task, the training label is determined, wherein the training label is used to represent the emotion category involved in the emotional dialogue task;

[0090] Based on the training label representing the emotion category, the extended vocabulary is trained.

[0091] In the embodiments of the present disclosure, the present application can focus on the emotional dialogue language understanding task, use the prompt method for data enhancement, expand and obtain corpus with emotion category and emotion reason label, which is convenient to operate and low in cost. The emotion category can include sad, happy, disappointed, etc. For example, when expanding the sentences of the sad emotion category, the training label can be set as sad, so as to expand a large number of extended sentences of the sad reason extended vocabulary. For example, the sentences of I lost my love, I failed, etc. that cause sadness.

[0092] In some embodiments, before the output of the extended sentence with the extended vocabulary, the method further comprises:

[0093] The obtained extended vocabulary is filled into the extended vocabulary position in the training sentence, to obtain the extended sentence with the extended vocabulary.

[0094] In the embodiments of the present disclosure, after a large number of extended vocabularies are obtained, the extended vocabulary is filled into the extended vocabulary position in the training sentence, thereby obtaining a large number of extended sentences with the same sequence.

[0095] In the embodiments of the present disclosure, the training label and the training sentence can also be spliced and input into the training model, as shown in Figure 2

[0096] The present disclosure also provides a data enhancement device. Figure 4 FIG. 1 is a structural schematic diagram of a data enhancement device according to an exemplary embodiment. As shown in Figure 4 The device comprises:

[0097] ​A first processing unit 41 is used to preprocess the training model;

[0098] A second processing unit 42 is configured to input a training sentence with a training label and a mask into the training model;

[0099] A third processing unit 43 is configured to perform vocabulary expansion training on the training sentence using the training model based on the training label to obtain an expanded vocabulary;

[0100] The fourth processing unit 44 is configured to output an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary.

[0101] In the disclosed embodiments, the training model may utilize the BERT (Bidirectional Encoder Representation from Transformers) model. Before inputting training labels and training sentences into the training model, the model may be pre-trained to enable the training model to be trained on training sentences. The pre-trained model offers powerful performance and strong language understanding and representation capabilities. During sentence training, the training model is not restricted by sentence length and exhibits strong generalization capabilities.

[0102] In the disclosed embodiment, the position of the expanded vocabulary in the training sentence can be determined in advance using a mask. The position of the expanded vocabulary can include: the position in the sentence word order, such as the attributive position, the adverbial position, etc., and / or the byte position of the vocabulary in the sentence, such as the Nth byte position from left to right in the sentence.

[0103] In the embodiment of the present disclosure, a large number of expanded sentences with expanded words at the same position are obtained by replacing the positions of the mask with expanded words, so that the expanded sentences have the same word order.

[0104] Figure 2 This is a schematic diagram of an application of a data enhancement method according to an exemplary embodiment. Figure 1 .like Figure 2 As shown in the figure, the training label (sadness) and the training sentence (Alas, I am ##) are input into the BERT model, and the training is used to obtain the expanded vocabulary (divorce).

[0105] The data enhancement device disclosed in the present invention can be applied to the task of emotional dialogue language understanding, because with the popularity of voice assistants, more and more users express their emotions to voice assistants and expect voice assistants to understand their emotions. In order to understand the user's emotions more deeply, the voice assistant usually needs to identify the emotion category information of the user's query and the emotional cause information that causes the emotion. However, the labor cost of obtaining such labeled data is relatively high. The present application can focus on the task of emotional dialogue language understanding, use the prompt method to perform data enhancement, expand and obtain corpus with emotion category and emotion cause labels, which is easy to operate and low-cost. For example, when expanding the sentence with the emotion category as sad, the training label can be set to sad, thereby expanding to obtain a large number of extended sentences that generate extended vocabulary for the cause of sadness. For example, sentences such as "I am heartbroken" and "I failed" that caused me to be sad.

[0106] The data enhancement device in the embodiment of the present disclosure includes: preprocessing the training model; inputting training sentences with training labels and marked with masks into the training model; based on the training labels, performing vocabulary expansion training on the training sentences through the training model to obtain expanded vocabulary; outputting expanded sentences with expanded vocabulary, wherein the expanded sentences are obtained by replacing the masked positions with the expanded vocabulary. In the present application, when training sentences through the training model, the positions of the expanded vocabulary in the training sentences can be first determined by the mask, and then the training sentences marked with the mask are input into the training model; the training sentences are trained based on the training labels to obtain expanded vocabulary associated with the training labels; and finally, the expanded sentences with the expanded vocabulary are obtained by replacing the masked positions with the expanded vocabulary. Since the positions for placing the expanded vocabulary are determined in advance by the mask, a large number of expanded vocabulary can be placed in the same position in the training sentences, thereby obtaining expanded sentences with the same word order, which is beneficial to the extraction of vocabulary during subsequent data training (the expanded sentences have the same word order and the expanded vocabulary is located in the same position), thereby achieving data enhancement.

[0107] In some embodiments, the third processing unit 43 is specifically configured to:

[0108] Determining the association between the vocabulary to be expanded and the training labels;

[0109] Based on the training labels and the determined association relationships, the training sentences are trained to obtain the expanded vocabulary.

[0110] In the embodiments of the present disclosure, the extended vocabulary is associated with the training label. The association between the extended vocabulary and the training label at least includes a cause-effect relationship, a containing relationship, etc. The cause-effect relationship can be used to represent that the extended vocabulary is the cause and results in the result identified by the training label; or the training label represents the cause and results in the result identified by the extended vocabulary. The containing relationship can be used to represent that the extended vocabulary and the training label have a mutual containing attribute relationship. For example, the extended vocabulary is determined to be contained in the content identified by the training label according to the training label.

[0111] In the embodiments of the present disclosure, after identifying the association between the extended vocabulary and the training label, the training sentence can be trained according to the association to obtain the extended vocabulary.

[0112] In some embodiments, the training label at least includes an emotion label representing an emotion.

[0113] The association relationship is that the extended vocabulary is used to represent the cause of the emotion in the emotion label.

[0114] The third processing unit is specifically configured to train the extended vocabulary representing the cause of the emotion based on the emotion label and the association relationship.

[0115] In some embodiments, the third processing unit is specifically configured to

[0116] Determine the vocabulary length of the extended vocabulary that can be accommodated by the mask position.

[0117] Train the extended vocabulary conforming to the vocabulary length based on the training label.

[0118] In the embodiments of the present disclosure, the vocabulary length can refer to the number of characters of the vocabulary. For example, the vocabulary is sad, and the vocabulary length is 2; the vocabulary is very sad, and the vocabulary length is 3.

[0119] In the embodiments of the present disclosure, the extended vocabulary corresponding to the vocabulary length is determined through the determined vocabulary length. For example, when the length of the extended vocabulary position in the training sentence is 2 character lengths, the extended vocabulary of 2 characters can be determined. As shown in the following table, a large number of extended sentences with the same number of characters and the same sequence can be obtained in this way. Since the extended vocabulary position has been determined, manual annotation of a large number of extended sentences is not required. Figure 3

[0120] In some embodiments, the second processing unit is specifically configured to

[0121] Obtain an initial sentence, and the initial sentence includes a user inquiry sentence.

[0122] ​masking the words in the initial sentence associated with the training label with the mask;

[0123] determining the position of the masked words as the position of the mask.

[0124] In the embodiments of the present disclosure, as shown in Figure 3 The initial sentence is: Oh, I am in love; and the word associated with the training label: sad, is love. Therefore, the position of the word love is masked to obtain the training sentence with the mask: Oh, I ##. The position of the masked word love is the extended word position.

[0125] In some embodiments, the first processing unit is specifically configured to

[0126] obtaining a training word without the training label in a predetermined field, wherein the training word has language characteristics of the predetermined field;

[0127] inputting the training word into the training model;

[0128] training the training model based on the training word.

[0129] In the embodiments of the present disclosure, during the training of the sentence, the sentence of a specific field is used for training. At this time, the training model can be input with the training word having the language characteristics of the predetermined field to train the model, so that the training model can output the sentence with the language characteristics of the predetermined field. For example, for the medical field, the language characteristics of the specific field such as operation, medical accident, disease diagnosis, etc. can be used. During the training of the sentence, the characteristic word of this field can be output appropriately, so as to improve the professionalism.

[0130] The embodiments of the present disclosure also provide an electronic device, comprising a processor and a memory, wherein the memory stores a computer program capable of running on the processor, and the processor is configured to run the computer program to perform the steps of the method of each embodiment.

[0131] The embodiments of the present disclosure also provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method of each embodiment.

[0132] Figure 5 is a block diagram of a terminal device according to an exemplary embodiment. For example, the terminal device can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0133] Referring to Figure 5The terminal device may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0134] The processing component 802 generally controls the overall operation of the terminal device, such as operations associated with touch, phone calls, data communications, camera operation, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-described method. In addition, the processing component 802 may include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.

[0135] The memory 804 is configured to store various types of data to support operations on the terminal device. Examples of such data include instructions for any application or method operating on the terminal device, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0136] The power component 806 provides power to various components of the terminal device. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the terminal device.

[0137] The multimedia component 808 includes a screen that provides an output interface between the terminal device and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the terminal device is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0138] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive an external audio signal when the terminal device is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0139] The I / O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0140] The sensor component 814 includes one or more sensors for providing status assessments of various aspects of the terminal device. For example, the sensor component 814 can detect an open / closed position of the terminal device, relative positioning of components, such as a display and a keypad of the terminal device, a change of position of the terminal device or a component of the terminal device, the presence or absence of user contact with the terminal device, the orientation or acceleration / deceleration / velocity of the terminal device, and a temperature change of the terminal device. The sensor component 814 can include an orientation sensor, an acceleration sensor, a proximity sensor, a gesture sensor, a biometric sensor, a chemical sensor, a light sensor, and / or a position sensor.

[0141] The communication component 816 is configured to facilitate wired or wireless communication between the terminal device and another device. The terminal device can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an example embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 816 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technology.

[0142] In an exemplary embodiment, the terminal device may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0143] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

[0144] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data enhancement method, characterized in that: The method comprises: Acquire training words without training labels in a predetermined domain, wherein the training words have language characteristics of the predetermined domain; inputting the training vocabulary into the training model; Training the training model based on the training vocabulary; Obtaining an initial statement, wherein the initial statement at least includes a user query statement; masking the vocabulary associated with the training label in the initial sentence; Determine the position of the obscured word as the position of the mask; Inputting a training sentence with a training label and a mask into the training model; Based on the training labels, performing vocabulary expansion training on the training sentences through the training model to obtain expanded vocabulary; outputting an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary; The method of performing vocabulary expansion training on the training sentences based on the training labels by the training model to obtain expanded vocabulary includes: determining an association relationship between the vocabulary to be expanded and the training labels, wherein the training labels at least include: an emotion label representing an emotion; the association relationship is that the expanded vocabulary is used to represent the cause of the emotion in the emotion label; Based on the emotion labels and the association relationships, an extended vocabulary representing the causes of the emotions is obtained through training.

2. The data enhancement method according to claim 1, wherein: The step of performing vocabulary expansion training on the training sentence based on the training label by using the training model to obtain an expanded vocabulary includes: Determining a vocabulary length of the expanded vocabulary that can be accommodated by the position of the mask; Based on the training labels, the expanded vocabulary that meets the vocabulary length is obtained through training.

3. The data enhancement method according to claim 1, wherein: The method further comprises: In the emotional dialogue task, determining the training label, wherein the training label is used to represent the emotion category involved in the emotional dialogue task; The expanded vocabulary is obtained through training based on training labels representing the emotion categories.

4. A data enhancement device, characterized in that: The device comprises: A first processing unit is configured to obtain a training vocabulary without a training label in a predetermined domain, wherein the training vocabulary has language characteristics of the predetermined domain; input the training vocabulary into a training model; and train the training model based on the training vocabulary; A second processing unit is configured to obtain an initial sentence, the initial sentence including at least a user query sentence; mask the words associated with the training label in the initial sentence with a mask; determine the position of the masked words as the position of the mask; and input the training sentence with the training label and the mask into the training model; a third processing unit, configured to perform vocabulary expansion training on the training sentence using the training model based on the training label to obtain an expanded vocabulary; a fourth processing unit, configured to output an expanded sentence with the expanded vocabulary, wherein the expanded sentence is obtained by replacing the position of the mask with the expanded vocabulary; The third processing unit is specifically configured to: Determining an association relationship between the vocabulary to be expanded and the training label, wherein the training label at least includes: an emotion label representing an emotion; the association relationship is that the expanded vocabulary is used to represent the cause of the emotion in the emotion label; Based on the emotion labels and the association relationships, an extended vocabulary representing the causes of the emotions is obtained through training.

5. An electronic device, characterized in that: include: A processor and a memory for storing a computer program that can be run on the processor, wherein the processor performs the steps of the method according to any one of claims 1 to 3 when running the computer program.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Text generation model training method and device and text generation method and device

    CN111783455A

  • Text classification model training method and device, equipment and storage medium

    CN112115267A