CN116127305A - Model training method and device, storage medium and electronic equipment - Google Patents

Model training method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116127305A
CN116127305A CN202211659316.2A CN202211659316A CN116127305A CN 116127305 A CN116127305 A CN 116127305A CN 202211659316 A CN202211659316 A CN 202211659316A CN 116127305 A CN116127305 A CN 116127305A
Authority
CN
China
Prior art keywords
vocabulary
target
determining
intention
undetermined
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211659316.2A
Other languages
Chinese (zh)
Inventor
王昊天
吴晓烽
王维强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202211659316.2A priority Critical patent/CN116127305A/en
Publication of CN116127305A publication Critical patent/CN116127305A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Machine Translation (AREA)
  • Input From Keyboards Or The Like (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The specification provides a model training method, device, storage medium and electronic equipment. In the model training method provided by the specification, a target dialogue is acquired; selecting vocabulary with the occurrence frequency not less than the designated frequency from the target dialogue as candidate vocabulary; inputting the candidate vocabulary into an intention recognition model, and determining an intention recognition result of the candidate vocabulary output by the intention recognition model; taking the intention recognition result as a candidate word without intention recognition as a target word; taking the target vocabulary as a training sample, and determining the actual intention of the target vocabulary as a label corresponding to the training sample; inputting the target vocabulary into an intention recognition model, and determining an output result of the intention recognition model; and training the intention recognition model by taking the minimum difference between the output result and the before labeling as an optimization target.

Description

Model training method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for model training, a storage medium, and an electronic device.
Background
In the context of human-machine conversations, it is crucial if the artificial intelligence (Artificial Intelligence, AI) of the conversation with the user is able to understand what the user expresses. Typically, a great deal of training is performed on the AI that is engaged in a conversation with the user before being put into use to ensure that the AI has sufficient knowledge to understand each sentence expressed by the user.
In practice, however, it is difficult to ensure that the AI can learn all the vocabulary during the training process; and new words are continually being generated over time. This results in the AI sometimes not being able to understand the meaning of the individual words entered by the user when conducting a conversation with the user. Meanwhile, in the process of man-machine conversation, private data of users needs to be protected. In this case, it is critical to supplement the AI with new knowledge reserves.
Therefore, how to supplement new knowledge to models used for human-machine conversations is a highly desirable problem.
Disclosure of Invention
The present disclosure provides a model training method and a model training apparatus, so as to partially solve the above-mentioned problems in the prior art.
The technical scheme adopted in the specification is as follows:
the present specification provides a method of model training, comprising:
acquiring a target dialogue;
selecting vocabulary with the occurrence frequency not less than the designated frequency from the target dialogue as candidate vocabulary;
inputting the candidate vocabulary into an intention recognition model, and determining an intention recognition result of the candidate vocabulary output by the intention recognition model;
the intention recognition result is taken as a candidate word without intention recognition as a target word;
Taking the target vocabulary as a training sample, and determining the actual intention of the target vocabulary as a label corresponding to the training sample;
inputting the target vocabulary into the intention recognition model, and determining an output result of the intention recognition model;
and training the intention recognition model by taking the minimum difference between the output result and the before-labeling as an optimization target.
Optionally, the intention recognition result is a candidate vocabulary without intention recognition, and the candidate vocabulary is used as a target vocabulary, and specifically includes:
taking the candidate vocabulary with the intention recognition result of not recognizing the intention as a pending vocabulary;
matching the undetermined vocabulary with standard vocabulary in a preset vocabulary library;
and when the vocabulary library does not contain the undetermined vocabulary, determining the undetermined vocabulary as a target vocabulary.
Optionally, the intention recognition result is a candidate vocabulary without intention recognition, and the candidate vocabulary is used as a target vocabulary, and specifically includes:
taking the candidate vocabulary with the intention recognition result of not recognizing the intention as a pending vocabulary;
determining the reverse text frequency of the undetermined vocabulary according to the total number of the history dialogues acquired in advance and the number of the history dialogues containing the undetermined vocabulary, wherein the reverse text frequency is used for representing the unique degree of the undetermined vocabulary;
And when the inverse text frequency is not less than a first specified threshold, determining the undetermined vocabulary as a target vocabulary.
Optionally, when the inverse text frequency is not less than a first specified threshold, determining the undetermined vocabulary as the target vocabulary specifically includes:
and when the inverse text frequency is not smaller than a first specified threshold value and is not larger than a second specified threshold value, determining the undetermined vocabulary as a target vocabulary, wherein the second specified threshold value is larger than the first specified threshold value.
Optionally, determining the undetermined vocabulary as the target vocabulary specifically includes:
sequencing the undetermined words according to the sequence from low to high of the reverse text frequency to form a undetermined word queue;
and determining the pre-designated number of the pending words in the pending word queue as target words.
Optionally, taking the target vocabulary as a training sample, and determining the actual intention of the target vocabulary as a label corresponding to the training sample specifically includes:
and determining at least part of available target words from the target words as training samples, and determining the actual intention of the available target words as labels corresponding to the training samples.
Optionally, determining at least part of available target vocabulary from the target vocabulary as a training sample, and determining the actual intention of the available target vocabulary as a label corresponding to the training sample specifically includes:
and displaying the target vocabulary to a training person, enabling the training person to select at least part of available target vocabulary from the target vocabulary, and determining the actual intention of the available target vocabulary as a label corresponding to the training sample.
The present specification provides a model training apparatus comprising:
the acquisition module is used for acquiring the target dialogue;
the first screening module is used for selecting vocabulary with the occurrence frequency not less than the designated frequency from the target dialogue to be used as candidate vocabulary;
the first input module is used for inputting the candidate vocabulary into an intention recognition model and determining an intention recognition result of the candidate vocabulary output by the intention recognition model;
the second screening module is used for taking the intention recognition result as a candidate vocabulary without intention recognition as a target vocabulary;
the annotation determining module is used for taking the target vocabulary as a training sample and determining the actual intention of the target vocabulary as an annotation corresponding to the training sample;
The second input module is used for inputting the target vocabulary into the intention recognition model and determining an output result of the intention recognition model;
and the training module is used for training the intention recognition model by taking the minimum difference between the output result and the before-labeling as an optimization target.
The present specification provides a computer readable storage medium storing a computer program which when executed by a processor implements the method of model training described above.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of model training as described above when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
in the model training method provided by the specification, a target dialogue is acquired; selecting vocabulary with the occurrence frequency not less than the designated frequency from the target dialogue as candidate vocabulary; inputting the candidate vocabulary into an intention recognition model, and determining an intention recognition result of the candidate vocabulary output by the intention recognition model; taking the intention recognition result as a candidate word without intention recognition as a target word; taking the target vocabulary as a training sample, and determining the actual intention of the target vocabulary as a label corresponding to the training sample; inputting the target vocabulary into an intention recognition model, and determining an output result of the intention recognition model; and training the intention recognition model by taking the minimum difference between the output result and the before labeling as an optimization target.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. Attached at
In the figure:
FIG. 1 is a flow chart of a method of model training provided in the present specification;
FIG. 2 is a schematic diagram of an example of a human-machine conversation provided in the present specification;
FIG. 3 is a schematic diagram of a model training apparatus provided herein;
fig. 4 is a schematic view of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a flow chart of a method for model training provided in the present specification, including the following steps:
s100: a target dialog is acquired.
In the present specification, the execution subject of the method for implementing model training may refer to a designated device such as a server provided on a service platform, and for convenience of description, the present specification uses only the server as an execution subject, and describes a model training method provided in the present specification.
In the model training method provided in the present specification, AI refers to an intelligent robot that performs a conversation with a user in a man-machine conversation, without other description. The model training method provided by the specification is applied to supervised training, is mainly used for supplementing knowledge to AI, and under the scene of man-machine conversation, the knowledge mainly refers to the knowledge of the AI which carries out conversation with the user on vocabulary, namely the meaning of the vocabulary can be identified in the conversation model corresponding to the AI, and the knowledge of the amount of the AI depends on the vocabulary which can be identified by the adopted conversation model. When a vocabulary which cannot be recognized by the AI appears, the AI does not have the knowledge, and at this time, the knowledge is needed to be supplemented.
In fact, in the process of knowledge supplementation, it is most critical how to find out the vocabulary that needs supplementation. In general, the vocabulary which cannot be recognized by the dialogue model is the vocabulary which is omitted during training or some new vocabularies, and because the cardinality of the vocabulary is too large, the vocabulary which cannot be recognized by the AI cannot be directly found, so in the model training method provided by the specification, the vocabulary which needs to be supplemented is more conveniently obtained from the dialogue between the AI and the user.
Where a session refers to the entire content of a complete session of AI with the user, and a target session is a session selected as the target for knowledge replenishment in the present method. In other words, the model training provided in this specification will find words in the target dialog that require knowledge supplementation. The target dialog may be a complete man-machine dialog that has already occurred at either end.
S102: and selecting the vocabulary with the occurrence frequency not less than the designated frequency from the target dialogue as the candidate vocabulary.
In the process of man-machine conversation, if words which cannot be known by the AI exist in sentences which are stated or sent to the AI by the user, the AI normally makes some abnormal replies to the user. And when the user faces an abnormal answer made by the AI, the own demand is often repeated again. As shown in fig. 2, the user wishes to purchase a "quick heat". In fact, the term "quick heater" is an electric heater, and the term "quick heater" is not a formal term of the article, and is a popular term in daily life. Therefore, the term "fast heat" may not be included in the samples taken when training the AI. In this case, the meaning of the word "fast heat" cannot be recognized by the AI who performs a dialogue with the user, resulting in deviation of the understanding of the sentence transmitted by the user by the AI, and thus the dialogue as shown in fig. 2 occurs.
It can be seen that in fig. 2, the AI inquires of the user whether this is a physical commodity or a virtual commodity after he says that he wishes to purchase "quick heat". From the normal dialogue point of view, this question of AI is quite paradoxical, and "fast-heating" is clearly a real object. The user itself is surprised and confused about the problem posed by AI, so the user again emphasizes in the following answers that the merchandise he wants to purchase is "hot.
It can be seen that when the AI cannot recognize a word in the sentence of the user, the AI often causes unreasonable problems to be raised to the user, and when the user faces the problems, the user often restates and emphasizes the own requirement. On this basis, the vocabulary repeatedly appearing in the dialogue can be initially selected, that is, the vocabulary appearing in the dialogue for a number of times not less than the designated number of times is selected as the candidate vocabulary for use in the next step. The specified times can be set according to specific requirements, and in general, the specified times are 2, so that a better effect can be obtained.
S104: and inputting the candidate vocabulary into an intention recognition model, and determining an intention recognition result of the candidate vocabulary output by the intention recognition model.
It is conceivable that any vocabulary may be repeated in one dialogue, so that the candidate vocabulary screened in step S102 includes not only the vocabulary that may not be recognized by the AI, but also some of the vocabulary that the AI has learned and is able to recognize the intention. Therefore, further screening of candidate words is also required.
In this step, the candidate vocabulary obtained in step S102 may be input into the intention recognition model, thereby judging whether the candidate vocabulary can be recognized by the intention recognition model. The intention recognition model is adopted when the AI is used for carrying out a dialogue with the user. Further, the model training method provided in the present specification is mainly used for the intention recognition model in the man-machine conversation AI.
S106: and taking the intention recognition result as a candidate word without recognizing the intention as a target word.
After the candidate vocabulary is input into the intent recognition model in step S104, the target vocabulary requiring knowledge supplement may be further screened out according to the intent recognition result of the intent recognition model. When the intention recognition model can recognize the intention of a candidate vocabulary, the candidate vocabulary is not the vocabulary which cannot be recognized by the AI, and knowledge supplement is not needed; otherwise, when the intention recognition model cannot recognize the intention of a candidate vocabulary, the candidate vocabulary is likely to be a vocabulary that cannot be recognized by the AI, and knowledge supplement is required, so that the candidate vocabulary is used as a target vocabulary in the subsequent step.
S108: and taking the target vocabulary as a training sample, and determining the actual intention of the target vocabulary as a label corresponding to the training sample.
After the target vocabulary needing to be subjected to knowledge supplementation is selected, the determined target vocabulary can be used as a training sheep back for subsequent knowledge supplementation through model training. Because supervised training is adopted in training the intention recognition model, labels corresponding to training samples need to be determined before training. It is conceivable that the model to be trained is an intention recognition model, and thus the actual intention of the target vocabulary is marked corresponding to the target vocabulary.
S110: and inputting the target vocabulary into the intention recognition model, and determining an output result of the intention recognition model.
When training the intention recognition model, the target vocabulary can be input into the intention recognition model, and the output result of the intention recognition model can be determined.
S112: and training the intention recognition model by taking the minimum difference between the output result and the before-labeling as an optimization target.
Comparing the recognition result of the intention recognition model determined in the step S110 with the label determined in the step S108, and adjusting parameters in the intention recognition model by taking the minimum difference between the output result and the label as an optimization target. Finally, the intention recognition model can recognize the intention of the target vocabulary, and the purpose of supplementing the knowledge of the AI for the man-machine conversation is achieved.
When the model training method provided by the specification is used for carrying out knowledge supplementation on the AI used for the man-machine conversation, the habit of the user in the conversation with the AI can be utilized to accurately screen the target vocabulary needing knowledge supplementation from the conversation of the user with the AI, so that the model training method has higher accuracy, does not need additional manual participation, and effectively reduces time and labor cost.
Furthermore, after the vocabulary is screened by the model training method provided by the specification, the number of the finally obtained target vocabulary is not too large, so that the vocabulary which really needs to be subjected to knowledge supplement can be further selected in a manual identification mode. Since the target vocabulary is usually less, excessive workload is not increased, and the vocabulary needing to be supplemented can be selected most accurately and effectively to complete the knowledge supplement of the dialog AI.
In addition, in the model training method provided in the present specification, after the candidate vocabulary is screened out from the target dialogue, the intention of the candidate vocabulary needs to be identified by using the intention identification model, so that the target vocabulary is further screened out. However, in general, the number of candidate words that can be screened from the target dialog is large, and not all words for which no intention can be recognized are words for which knowledge supplement is required. In order to further increase the accuracy of the screening, the number of the reserved vocabulary can be reduced again by adopting a method with lower complexity after the candidate vocabulary is input into the intention recognition model.
Specifically, candidate vocabularies with the intention recognition result being that no intention is recognized can be used as pending vocabularies; matching the undetermined vocabulary with standard vocabulary in a preset vocabulary library; and when the vocabulary library does not contain the undetermined vocabulary, determining the undetermined vocabulary as a target vocabulary.
In fact, in normal dialogue, there are many words that are frequently repeated, such as word, preposition, assisted word, etc., and these words usually do not contain any meaning, and the intention recognition model cannot recognize the intention of these words. When selecting candidate words from the target dialogue, these words are also selected together, but it is obvious that this word is not a word requiring knowledge supplement and needs to be removed. Generally, the vocabulary is known and can be determined in advance, so a vocabulary library can be preset, and the vocabulary which can occur frequently but does not need to be learned is added to the vocabulary library as a standard vocabulary.
When screening candidate words through the intention model, firstly, the words which cannot be identified by the intention identification model are used as pending words, and the pending words are matched with standard words in a word library, so that whether the words which are the same as the standard words exist in the pending words or not is judged. For each pending word, if the standard word which is the same as the pending word is matched in the word library, the pending word is indicated not to need to be learned, and the pending word is discarded; otherwise, if the standard vocabulary which is the same as the undetermined vocabulary is not matched in the vocabulary library, the undetermined vocabulary is indicated to need to be subjected to knowledge supplement, and the undetermined vocabulary is determined to be reserved as the target vocabulary for subsequent model training.
In addition to more accurate screening of the target vocabulary by the method of the preset vocabulary library, the purpose can be achieved by using the reverse text frequency. Specifically, candidate vocabularies with the intention recognition result being that no intention is recognized can be used as pending vocabularies; determining the reverse text frequency of the undetermined vocabulary according to the total number of the history dialogues acquired in advance and the number of the history dialogues containing the undetermined vocabulary, wherein the reverse text frequency is used for representing the unique degree of the undetermined vocabulary; and when the inverse text frequency is not less than a first specified threshold, determining the undetermined vocabulary as a target vocabulary.
From the training point of view, the vocabulary which cannot be identified by the AI is the vocabulary with insufficient sample number during training, so that the AI does not grasp the meaning of the vocabulary during training, and the training sample is usually obtained according to various historical data. That is, the vocabulary that cannot be identified by AI must be the unusual vocabulary at the current stage, such as some rare words, proper nouns, or newly appearing words. It is conceivable that these unusual words must occur less frequently in a historical dialog, just as there is a lack of sample of these unusual words in the training sample. Therefore, this phenomenon can be utilized to screen the vocabulary to be determined by calculating the inverse text frequency of the vocabulary to be determined. The inverse text frequency of the vocabulary to be defined can be calculated according to the following formula:
Figure BDA0004013100410000071
Wherein IDF represents the inverse text frequency of the pending vocabulary, D represents the total number of history dialogues, and n represents the number of history dialogues in which the pending vocabulary appears; the frequency of the reverse text represents the unique degree of a word to be determined, and the higher the frequency of the reverse text is, the higher the unique degree of the word to be determined is; the above formula shows that the smaller the number of historical dialogs containing a pending word, the more unique the pending word. It should be noted that n is independent of the number of times a pending word appears in the same history dialogue, and is independent of the total number of times the pending word appears in all history dialogues, and is dependent only on the number of history dialogues in which the pending word appears. In this specification, the target session is also a session that has already occurred, and thus the history session includes the target session.
It is conceivable that the higher the frequency of the reverse text of a pending word, the less historical conversations that appear for that pending word, the more likely that the pending word is a word that is missing due to insufficient sample in training. Conversely, if the inverse text frequency of a word to be determined is low, it indicates that the word to be determined frequently appears in the history dialogue, and the word to be determined is the word that has been learned with a high probability.
However, in practical applications, it has to be considered that when the frequency of the inverse text of a word to be determined is too high, the word to be determined may not be a word for which knowledge supplement is required. For example, when a word to be defined appears only once or twice in all the history dialogues, it is highly probable that the word to be defined is a word which the user himself or herself composes or that the user has made a mistake in inputting a sentence, and the wrong word is inputted. For words that are too frequent in this case, the exclusion is also required. Specifically, the undetermined vocabulary may be determined as the target vocabulary when the inverse text frequency is not less than a first specified threshold and is not greater than a second specified threshold, wherein the second specified threshold is greater than the first specified threshold.
In summary, a threshold range with a higher upper limit and lower limit, that is, a first specified threshold and a second specified threshold, may be set, and the word to be determined may be the target word only when the inverse text frequency of the word to be determined is between the first specified threshold and the second specified threshold.
Additionally, since the target vocabulary needs to be labeled when training the intention recognition model, in practice, the training is mostly labeled manually. Thus, there may be cases where the training person does not have enough time to annotate all of the selected, screened vocabulary, but only some of them. Specifically, at least part of available target vocabulary can be determined from the target vocabulary to serve as a training sample, and the actual intention of the available target vocabulary is determined to serve as a label corresponding to the training sample. Various methods may be employed in determining the available target vocabulary, such as random screening, screening according to specified rules, etc., which are not particularly limited in this specification.
And after determining the available target vocabulary, displaying the target vocabulary to a training person, so that the training person selects at least part of the available target vocabulary from the target vocabulary, and determining the actual intention of the available target vocabulary as the label corresponding to the training sample. Through the process, the marking of the available target vocabulary can be completed.
Preferably, under the above circumstances, in order to ensure that the model training achieves the best effect, the vocabulary used for model training should be ensured as much as possible, that is, the vocabulary marked by the training staff is the vocabulary with higher priority and the vocabulary that needs AI to learn most. Therefore, the selected vocabulary can be ordered based on the inverse text frequency.
Specifically, the words to be determined can be ordered according to the order from low to high of the reverse text frequency to form a word queue to be determined; and determining the pre-designated number of the pending words in the pending word queue as target words.
In the case of ensuring that the frequency of the inverse text of the word to be determined is between the first specified threshold and the second specified threshold, the lower the frequency of the inverse text of the word to be determined, the greater the number of occurrences of the word to be determined in the history dialogue, that is, the greater the number of users who refer to the word to be determined. It is conceivable that the more users mention a pending word that an AI cannot recognize, the more important it is that the pending word is, the more the AI is required to grasp as soon as possible. Therefore, the undetermined words with the reverse text frequency between the first appointed threshold value and the second appointed threshold value can be ordered according to the sequence from low to high of the reverse text frequency, the first appointed number of undetermined words are taken to be determined as target words, the training personnel marks the target words and trains AI, and model training is completed.
The foregoing describes one or more methods for implementing model training according to the present disclosure, and further provides a corresponding model training apparatus based on the same concept, as shown in fig. 3.
Fig. 3 is a schematic diagram of a model training device provided in the present specification, including:
an acquisition module 200, configured to acquire a target session;
a first filtering module 202, configured to select, from the target dialogues, a vocabulary having a number of occurrences not less than a specified number of occurrences, as a candidate vocabulary;
a first input module 204, configured to input the candidate vocabulary into an intent recognition model, and determine an intent recognition result of the candidate vocabulary output by the intent recognition model;
a second filtering module 206, configured to use the intent recognition result as a candidate vocabulary without intent recognition as a target vocabulary;
the annotation determining module 208 is configured to determine, using the target vocabulary as a training sample, an actual intention of the target vocabulary as an annotation corresponding to the training sample;
a second input module 210, configured to input the target vocabulary into the intent recognition model, and determine an output result of the intent recognition model;
the training module 212 is configured to train the intent recognition model with a minimum difference between the output result and the before-labeling result as an optimization target.
Optionally, the second filtering module 206 is specifically configured to take, as the pending vocabulary, the candidate vocabulary whose intent is not recognized as the intent recognition result; matching the undetermined vocabulary with standard vocabulary in a preset vocabulary library; and when the vocabulary library does not contain the undetermined vocabulary, determining the undetermined vocabulary as a target vocabulary.
Optionally, the second filtering module 206 is specifically configured to take, as the pending vocabulary, the candidate vocabulary whose intent is not recognized as the intent recognition result; determining the reverse text frequency of the undetermined vocabulary according to the total number of the history dialogues acquired in advance and the number of the history dialogues containing the undetermined vocabulary, wherein the reverse text frequency is used for representing the unique degree of the undetermined vocabulary; and when the inverse text frequency is not less than a first specified threshold, determining the undetermined vocabulary as a target vocabulary.
Optionally, the second filtering module 206 is specifically configured to determine the undetermined vocabulary as the target vocabulary when the inverse text frequency is not less than a first specified threshold and is not greater than a second specified threshold, where the second specified threshold is greater than the first specified threshold.
Optionally, the second filtering module 206 is specifically configured to sort the pending words in order from low to high according to the reverse text frequency, so as to form a pending word queue; and determining the pre-designated number of the pending words in the pending word queue as target words.
Optionally, the label determining module 208 is specifically configured to determine at least part of the available target vocabulary from the target vocabulary as a training sample, and determine an actual intention of the available target vocabulary as a label corresponding to the training sample.
Optionally, the annotation determining module 208 is specifically configured to display the target vocabulary to a training person, enable the training person to select at least a part of available target vocabulary from the target vocabulary, and determine an actual intention of the available target vocabulary as the annotation corresponding to the training sample.
The present specification also provides a computer readable storage medium having stored thereon a computer program operable to perform a method of model training as provided in fig. 1 above.
The present specification also provides a schematic structural diagram of an electronic device corresponding to fig. 1 shown in fig. 4. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, as described in fig. 4, although other hardware required by other services may be included. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the model training method described above with respect to fig. 1. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.

Claims (16)

1. A method of model training, comprising:
acquiring a target dialogue;
selecting vocabulary with the occurrence frequency not less than the designated frequency from the target dialogue as candidate vocabulary;
inputting the candidate vocabulary into an intention recognition model, and determining an intention recognition result of the candidate vocabulary output by the intention recognition model;
the intention recognition result is taken as a candidate word without intention recognition as a target word;
Taking the target vocabulary as a training sample, and determining the actual intention of the target vocabulary as a label corresponding to the training sample;
inputting the target vocabulary into the intention recognition model, and determining an output result of the intention recognition model;
and training the intention recognition model by taking the minimum difference between the output result and the before-labeling as an optimization target.
2. The method of claim 1, wherein the intention recognition result is a candidate vocabulary without intention recognition, and the method specifically comprises:
taking the candidate vocabulary with the intention recognition result of not recognizing the intention as a pending vocabulary;
matching the undetermined vocabulary with standard vocabulary in a preset vocabulary library;
and when the vocabulary library does not contain the undetermined vocabulary, determining the undetermined vocabulary as a target vocabulary.
3. The method of claim 1, wherein the intention recognition result is a candidate vocabulary without intention recognition, and the method specifically comprises:
taking the candidate vocabulary with the intention recognition result of not recognizing the intention as a pending vocabulary;
determining the reverse text frequency of the undetermined vocabulary according to the total number of the history dialogues acquired in advance and the number of the history dialogues containing the undetermined vocabulary, wherein the reverse text frequency is used for representing the unique degree of the undetermined vocabulary;
And when the inverse text frequency is not less than a first specified threshold, determining the undetermined vocabulary as a target vocabulary.
4. The method of claim 3, wherein determining the undetermined vocabulary as the target vocabulary when the inverse text frequency is not less than a first specified threshold comprises:
and when the inverse text frequency is not smaller than a first specified threshold value and is not larger than a second specified threshold value, determining the undetermined vocabulary as a target vocabulary, wherein the second specified threshold value is larger than the first specified threshold value.
5. The method according to any one of claims 3 or 4, wherein determining the undetermined vocabulary as a target vocabulary specifically comprises:
sequencing the undetermined words according to the sequence from low to high of the reverse text frequency to form a undetermined word queue;
and determining the pre-designated number of the pending words in the pending word queue as target words.
6. The method of claim 1, wherein the target vocabulary is used as a training sample, and the determining the actual intention of the target vocabulary is used as a label corresponding to the training sample, specifically comprises:
and determining at least part of available target words from the target words as training samples, and determining the actual intention of the available target words as labels corresponding to the training samples.
7. The method according to claim 6, wherein determining at least part of available target vocabulary from the target vocabulary as training sample and determining actual intention of the available target vocabulary as label corresponding to the training sample comprises:
and displaying the target vocabulary to a training person, enabling the training person to select at least part of available target vocabulary from the target vocabulary, and determining the actual intention of the available target vocabulary as a label corresponding to the training sample.
8. A model training apparatus comprising:
the acquisition module is used for acquiring the target dialogue;
the first screening module is used for selecting vocabulary with the occurrence frequency not less than the designated frequency from the target dialogue to be used as candidate vocabulary;
the first input module is used for inputting the candidate vocabulary into an intention recognition model and determining an intention recognition result of the candidate vocabulary output by the intention recognition model;
the second screening module is used for taking the intention recognition result as a candidate vocabulary without intention recognition as a target vocabulary;
the annotation determining module is used for taking the target vocabulary as a training sample and determining the actual intention of the target vocabulary as an annotation corresponding to the training sample;
The second input module is used for inputting the target vocabulary into the intention recognition model and determining an output result of the intention recognition model;
and the training module is used for training the intention recognition model by taking the minimum difference between the output result and the before-labeling as an optimization target.
9. The apparatus of claim 8, wherein the second filtering module is specifically configured to take, as the pending vocabulary, a candidate vocabulary whose intent is not recognized as a result of the intent recognition; matching the undetermined vocabulary with standard vocabulary in a preset vocabulary library; and when the vocabulary library does not contain the undetermined vocabulary, determining the undetermined vocabulary as a target vocabulary.
10. The apparatus of claim 8, wherein the second filtering module is specifically configured to take, as the pending vocabulary, a candidate vocabulary whose intent is not recognized as a result of the intent recognition; determining the reverse text frequency of the undetermined vocabulary according to the total number of the history dialogues acquired in advance and the number of the history dialogues containing the undetermined vocabulary, wherein the reverse text frequency is used for representing the unique degree of the undetermined vocabulary; and when the inverse text frequency is not less than a first specified threshold, determining the undetermined vocabulary as a target vocabulary.
11. The apparatus of claim 10, wherein the second filtering module is specifically configured to determine the undetermined vocabulary as the target vocabulary when the inverse text frequency is not less than a first specified threshold and not greater than a second specified threshold, wherein the second specified threshold is greater than the first specified threshold.
12. The apparatus according to any one of claims 10 or 11, wherein the second screening module is specifically configured to sort the pending words in order of the reverse text frequency from low to high to form a pending word queue; and determining the pre-designated number of the pending words in the pending word queue as target words.
13. The apparatus of claim 8, wherein the annotation determining module is specifically configured to determine at least a portion of available target vocabulary from the target vocabulary as a training sample, and determine an actual intention of the available target vocabulary as an annotation corresponding to the training sample.
14. The apparatus of claim 13, wherein the annotation determining module is specifically configured to present the target vocabulary to a training person, enable the training person to select at least a part of available target vocabulary from the target vocabulary, and determine an actual intention of the available target vocabulary as the annotation corresponding to the training sample.
15. A computer readable storage medium storing a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-7.
16. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the preceding claims 1-7 when the program is executed.
CN202211659316.2A 2022-12-22 2022-12-22 Model training method and device, storage medium and electronic equipment Pending CN116127305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211659316.2A CN116127305A (en) 2022-12-22 2022-12-22 Model training method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211659316.2A CN116127305A (en) 2022-12-22 2022-12-22 Model training method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116127305A true CN116127305A (en) 2023-05-16

Family

ID=86303728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211659316.2A Pending CN116127305A (en) 2022-12-22 2022-12-22 Model training method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116127305A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116822657A (en) * 2023-08-25 2023-09-29 之江实验室 Method and device for accelerating model training, storage medium and electronic equipment
CN117370536A (en) * 2023-12-07 2024-01-09 之江实验室 Task execution method and device, storage medium and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116822657A (en) * 2023-08-25 2023-09-29 之江实验室 Method and device for accelerating model training, storage medium and electronic equipment
CN116822657B (en) * 2023-08-25 2024-01-09 之江实验室 Method and device for accelerating model training, storage medium and electronic equipment
CN117370536A (en) * 2023-12-07 2024-01-09 之江实验室 Task execution method and device, storage medium and electronic equipment
CN117370536B (en) * 2023-12-07 2024-03-12 之江实验室 Task execution method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN116127305A (en) Model training method and device, storage medium and electronic equipment
CN113221555B (en) Keyword recognition method, device and equipment based on multitasking model
CN116227474B (en) Method and device for generating countermeasure text, storage medium and electronic equipment
CN115952272B (en) Method, device and equipment for generating dialogue information and readable storage medium
CN112417093B (en) Model training method and device
CN115618964B (en) Model training method and device, storage medium and electronic equipment
CN116188971A (en) Robot character recognition method, device and storage medium
CN116720008B (en) Machine reading method and device, storage medium and electronic equipment
CN115146601A (en) Method and device for executing language processing task, readable storage medium and equipment
CN109903754B (en) Method, device and memory device for speech recognition
CN115658891B (en) Method and device for identifying intention, storage medium and electronic equipment
CN117786107A (en) Training method and device of text classification model, medium and electronic equipment
CN116384515B (en) Model training method and device, storage medium and electronic equipment
CN116501852B (en) Controllable dialogue model training method and device, storage medium and electronic equipment
CN116795972B (en) Model training method and device, storage medium and electronic equipment
CN117591622A (en) Model training and service executing method, device, storage medium and equipment
CN118098266A (en) Voice data processing method and device based on multi-model selection
CN117520850A (en) Model training method and device, storage medium and electronic equipment
CN117195871A (en) Model training method and device, storage medium and electronic equipment
CN117668543A (en) Model training method and device, storage medium and electronic equipment
CN117876114A (en) Method and device for service execution and model training
CN117313739A (en) Training method, device, equipment and storage medium of language model
CN114428746A (en) Bad case identification method, device, equipment and storage medium
CN114882566A (en) Method, device and equipment for training expression recognition model
CN117079274A (en) Training method and device for recognition model, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination