CN116861917A - Dialog intention recognition method and device, storage medium and electronic equipment - Google Patents

Dialog intention recognition method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116861917A
CN116861917A CN202310760483.4A CN202310760483A CN116861917A CN 116861917 A CN116861917 A CN 116861917A CN 202310760483 A CN202310760483 A CN 202310760483A CN 116861917 A CN116861917 A CN 116861917A
Authority
CN
China
Prior art keywords
model
dialogue
intention
dialog
sub
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
CN202310760483.4A
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 CN202310760483.4A priority Critical patent/CN116861917A/en
Publication of CN116861917A publication Critical patent/CN116861917A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • 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
    • 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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)

Abstract

The specification discloses a dialogue intention recognition method, a dialogue intention recognition device, a storage medium and an electronic device, wherein the dialogue intention recognition method comprises the following steps: and collecting dialogue data input by a user in real time, respectively carrying out dialogue intention recognition on the dialogue data based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model, and then determining dialogue intention corresponding to the dialogue data from the dialogue intention recognition results based on the dialogue intention matching table, a first recognition range corresponding to the small sample sub-model and a second recognition range corresponding to the main classification sub-model, wherein the first recognition range comprises the dialogue intention recognizable by the small sample sub-model, and the second recognition range comprises the dialogue intention recognizable by the main classification sub-model.

Description

Dialog intention recognition 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 identifying a dialog intention, a storage medium, and an electronic device.
Background
With the development of AI technology, many dialogue robots such as microsoft ice, google assistant, etc. are emerging in society. Conversational robots are typically obtained by iterative training of neural network models based on a large number of samples, which require a large number of training samples to converge the model.
However, in some scenes requiring dialogue, because the scene has a short time, there are fewer active users in the scene, and there may not be more training samples for the model to train, at this time, the dialogue robot cannot perform dialogue in such scenes.
Disclosure of Invention
According to the dialogue intention recognition method, the dialogue intention recognition device, the storage medium and the electronic equipment, dialogue intention recognition is carried out on dialogue data through the dialogue intention matching table, the small sample submodel and the main classification submodel, dialogue intention recognition on dialogue data can be achieved under the scenes of zero sample training data, a small amount of sample training data and a large amount of sample training data, full scene coverage of dialogue intention recognition is achieved, and user experience is improved. The technical scheme is as follows:
in a first aspect, embodiments of the present disclosure provide a dialog intention recognition method applied to a dialog intention matching table and a dialog intention recognition model, the dialog intention recognition model including a small sample sub-model including correspondence specifying dialog data and dialog intention, the small sample sub-model being a recognition model trained based on a small sample training data, and a main classification sub-model being a recognition model trained based on a large sample training data, the method comprising:
Collecting dialogue data input by a user in real time;
respectively carrying out dialogue intention recognition on the dialogue data based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model;
determining the dialogue intention corresponding to the dialogue data from each dialogue intention recognition result based on the dialogue intention matching table, a first recognition range corresponding to the small sample sub-model and a second recognition range corresponding to the main classification sub-model, wherein the first recognition range comprises the dialogue intention recognizable by the small sample sub-model, and the second recognition range comprises the dialogue intention recognizable by the main classification sub-model.
In a second aspect, embodiments of the present disclosure provide a dialog intention recognition model training method, the dialog intention recognition model including a small sample sub-model and a main classification sub-model, the method comprising:
when the dialogue data newly recorded in the dialogue log reaches the preset quantity, extracting the dialogue data with the preset quantity and dialogue intents corresponding to the dialogue data respectively from the dialogue log, wherein the dialogue data is text data input by a user in a dialogue system;
Generating sample training data based on the dialogue data and dialogue intents respectively corresponding to the dialogue data;
training the small sample sub-model based on each sample training data to obtain a small sample sub-model after training is finished, and determining a first recognition range corresponding to the small sample sub-model after training is finished, wherein the first recognition range comprises dialog intents recognizable by the small sample sub-model;
and training the main classification sub-model based on each sample training data to obtain a main classification sub-model after training is finished, and determining a second recognition range corresponding to the main classification sub-model after training is finished, wherein the second recognition range comprises dialog intents recognizable by the main classification sub-model.
In a third aspect, embodiments of the present disclosure provide a dialog intention recognition device, the device including:
the dialogue data acquisition module is used for acquiring dialogue data input by a user in real time;
the dialogue intention recognition module is used for respectively carrying out dialogue intention recognition on the dialogue data based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model;
And the dialog intention determining module is used for determining the dialog intention corresponding to the dialog data from each dialog intention recognition result based on the dialog intention matching table, a first recognition range corresponding to the small sample sub-model and a second recognition range corresponding to the main classification sub-model, wherein the first recognition range comprises the dialog intention recognizable by the small sample sub-model, and the second recognition range comprises the dialog intention recognizable by the main classification sub-model.
In a fourth aspect, embodiments of the present disclosure provide a dialog intention recognition model training device, the device including:
the dialogue data extraction module is used for extracting dialogue data with preset quantity and dialogue intents respectively corresponding to the dialogue data from the dialogue log after the dialogue data newly recorded in the dialogue log reaches the preset quantity, wherein the dialogue data is text data input by a user in a dialogue system;
the training data generation module is used for generating sample training data based on the dialogue data and dialogue intents respectively corresponding to the dialogue data;
the first model training module is used for training the small sample sub-model based on the sample training data to obtain a small sample sub-model after training is finished, and determining a first recognition range corresponding to the small sample sub-model after training is finished, wherein the first recognition range comprises dialog intents recognizable by the small sample sub-model;
The second model training module is used for training the main classification sub-model based on the sample training data to obtain a main classification sub-model after training is finished, and determining a second recognition range corresponding to the main classification sub-model after training is finished, wherein the second recognition range comprises dialog intents recognizable by the main classification sub-model.
In a fifth aspect, the present description embodiments provide a computer program product storing at least one instruction adapted to be loaded by a processor and to perform the above-described method steps.
In a sixth aspect, the present description provides a storage medium storing a computer program adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a seventh aspect, embodiments of the present disclosure provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The technical scheme provided by some embodiments of the present specification has the following beneficial effects:
according to the dialogue intention recognition method provided by the embodiment of the specification, firstly dialogue data input by a user are collected in real time, dialogue intention recognition is carried out on the dialogue data based on a dialogue intention matching table, a small sample sub-model and a main classification sub-model respectively, dialogue intention recognition results corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model are obtained, dialogue intention corresponding to the dialogue data is determined from the dialogue intention recognition results based on a first recognition range corresponding to the dialogue intention matching table, the small sample sub-model and a second recognition range corresponding to the main classification sub-model, dialogue intention recognition is carried out on the dialogue data through the dialogue intention matching table, the small sample sub-model and the main classification sub-model respectively, dialogue intention recognition on the dialogue data can be realized under zero sample training data, a small sample training data and a large number of sample training data scenes, full scene coverage of dialogue intention recognition on the dialogue data is realized, and user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a dialog intention recognition method according to an embodiment of the present disclosure;
FIG. 2 is an exemplary diagram of dialog intention recognition provided in an embodiment of the present disclosure;
FIG. 3 is an exemplary schematic diagram of a dialog intention recognition provided in an embodiment of the present disclosure;
fig. 4 is a flow chart of a dialog intention recognition method according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of a training method for dialog intention recognition model according to an embodiment of the present disclosure;
FIG. 6 is a flowchart of a training method for dialog intention recognition model according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a dialog intention recognition device according to an embodiment of the present disclosure;
Fig. 8 is a schematic structural diagram of a dialog intention recognition device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a training device for dialog intention recognition model according to an embodiment of the present disclosure;
fig. 10 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. 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.
In the description of the present specification, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present specification, it should be noted that, unless expressly specified and limited otherwise, "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. The specific meaning of the terms in this specification will be understood by those of ordinary skill in the art in the light of the specific circumstances. In addition, in the description of the present specification, unless otherwise indicated, "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The following is a detailed description of embodiments in connection with the examples of the present specification. The implementations described in the following exemplary examples do not represent all implementations consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present description as detailed in the accompanying claims. The flow diagrams depicted in the figures are exemplary only and are not necessarily to be taken in the order shown. For example, some steps are juxtaposed and there is no strict order of logic, so the actual order of execution is variable.
Referring to fig. 1, a flow chart of a dialog intention recognition method according to an embodiment of the present disclosure is provided. In this embodiment of the present disclosure, the dialog intention recognition method is applied to a dialog intention recognition device or an electronic apparatus configured with a dialog intention recognition device, the dialog intention recognition device or the electronic apparatus configured with a dialog intention recognition device includes a dialog intention matching table including a small sample sub-model, which is a recognition model trained based on a small number of sample training data, and a main classification sub-model, which is a recognition model trained based on a large number of sample training data, and a main classification sub-model. The following details about the flow shown in fig. 1, the dialog intention recognition method may specifically include the following steps:
S102, collecting dialogue data input by a user in real time;
in the embodiment of the present disclosure, dialogue data input by a user is collected in real time, where the dialogue data is dialogue data input by the user at dialogue interface data, and the dialogue data is used by a dialogue intention recognition device to recognize dialogue intention based on a dialogue intention matching table and a dialogue intention recognition model. The dialogue intention matching table comprises a corresponding relation between appointed dialogue data and dialogue intention, the small sample sub-model is an identification model trained based on a small amount of sample training data, and the main classification sub-model is an identification model trained based on a large amount of sample training data.
It should be noted that the small sample sub-model is a lightweight neural network model, and the model can be converged only by a small amount of sample training data, and the trained model has a certain generalization and flexible configuration; the main classification sub-model is a heavy-weight neural network model, a large amount of sample training data is needed for iterative training, and the trained model has good generalization.
Optionally, the small sample sub-model may be a structure of a semantic analysis network and a classification network, where the semantic analysis network is used to perform semantic analysis on the dialogue data to generate word vectors corresponding to the dialogue data, and the classification network is used to classify the word vectors to determine the dialogue intent corresponding to the dialogue data. The semantic analysis network can be a lightweight neural network such as word2vec, sense-bert, all-mpnet-base-v2 and the like, and the classification network can be an SVM support vector machine network or an FC full-connection layer network.
Optionally, the main classification sub-model may be a structure of a semantic analysis network and a classification network, where the semantic analysis network is used to perform semantic analysis on the dialogue data to generate word vectors corresponding to the dialogue data, and the classification network is used to classify the word vectors to determine the dialogue intent corresponding to the dialogue data. The semantic analysis network may be a BERT encoding network, and the classification network may be an FC full-connection layer network.
In this embodiment of the present disclosure, the small sample sub-model and the main classification sub-model are neural network models that need to be model-trained based on sample training data, and after each training, a dialog intention that can be identified by the small sample sub-model and the main classification sub-model may be determined, where the sample training data required for model training may be obtained from a user dialog log.
In an initial stage of arranging the dialogue intention matching table and the dialogue intention recognition model in a new scene, because the small sample submodel and the main classification submodel in the dialogue intention recognition model cannot recognize the dialogue intention of the user of the dialogue data in the new scene due to lack of relevant sample training data, the dialogue data is subjected to dialogue intention matching only based on the dialogue intention matching table at this time, and the dialogue intention corresponding to the dialogue data is determined.
It should be noted that, session content data of each session may be stored in a session log, when session data accumulated in the session log reaches a preset number, a preset number of session data and session intentions corresponding to each session data respectively may be extracted from the session log, sample training data may be generated according to the session data and the session intentions, a small sample sub-model and a main classification sub-model in the session intention recognition model may be trained based on the sample training data, and session intentions identifiable by the small sample sub-model and the main classification sub-model after the training is completed may be determined. And respectively carrying out dialogue intention recognition on the dialogue data by using the dialogue intention matching table, the small sample submodel and the main classification submodel to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample submodel and the main classification submodel.
S104, respectively carrying out dialogue intention recognition on dialogue data based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model;
In the embodiment of the present disclosure, after session data is acquired, session intention recognition is performed on the session data based on the session intention matching table, the small sample sub-model and the main classification sub-model, so as to obtain session intention recognition results corresponding to the session intention matching table, the small sample sub-model and the main classification sub-model. The small sample sub-model and the main classification sub-model are neural network models trained by sample training data in a dialogue log, the dialogue intention identifiable by the small sample sub-model corresponds to a first recognition range, and the dialogue intention identifiable by the main classification sub-model corresponds to a second recognition range.
Optionally, the dialog intention recognition result corresponding to the dialog intention matching table may be indication information indicating that the dialog intention matching table cannot recognize dialog data, or may be determined dialog intention. When the dialogue intention matching table can identify the dialogue data, generating a dialogue intention identification result which can not identify the dialogue data, and when the dialogue intention matching table can identify the dialogue data, generating the dialogue intention identification result as the determined dialogue intention. It is understood that the dialog intention matching table contains a one-to-one correspondence relationship between dialog data and dialog intention, has no generalization, and cannot be identified for dialog data that does not exist in the dialog intention matching table.
In the embodiment of the present disclosure, if the small sample sub-model does not have the first recognition range and the main classification sub-model does not have the second recognition range, after the dialogue data is collected, dialogue intention matching is performed on the dialogue data only based on the dialogue intention matching table, and the dialogue intention corresponding to the dialogue data is determined.
S106, determining the dialogue intention corresponding to the dialogue data from the dialogue intention recognition results based on the dialogue intention matching table, the first recognition range corresponding to the small sample sub-model and the second recognition range corresponding to the main classification sub-model, wherein the first recognition range comprises the dialogue intention recognizable by the small sample sub-model, and the second recognition range comprises the dialogue intention recognizable by the main classification sub-model.
The first recognition range is a recognizable sample intention range determined by the small sample sub-model after model training, the first recognition range comprises various sample intention types recognizable by the small sample sub-model, the second recognition range is a recognizable sample intention range determined by the main classification sub-model after model training, and the second recognition range comprises various sample intention types recognizable by the main classification sub-model.
In the embodiment of the present disclosure, after dialog intention recognition is performed on dialog data based on a dialog intention matching table, a small sample sub-model, and a main classification sub-model, respectively, dialog intention recognition results corresponding to the dialog intention matching table, the small sample sub-model, and the main classification sub-model are obtained, and then dialog intention corresponding to the dialog data is determined in the dialog intention recognition results corresponding to the dialog intention matching table, the small sample sub-model, and the main classification sub-model, respectively, according to a sample intention range identifiable by the dialog intention matching table, the small sample sub-model, and a sample intention range identifiable by the main classification sub-model.
After the dialogue data input by the user is acquired, if the small sample sub-model and the main classification sub-model have no identifiable dialogue intention in the scene corresponding to the dialogue data, the small sample sub-model and the main classification sub-model indicate that the small sample sub-model and the main classification sub-model have no dialogue intention recognition effect on the dialogue data, and at this time, the dialogue data input by the user is matched only based on the dialogue intention matching table.
Referring to fig. 2, an exemplary schematic diagram of dialog intention recognition is provided in the embodiment of the present disclosure. As shown in fig. 2, when the small sample sub-model and the main classification sub-model do not have a dialogue intention recognition effect on dialogue data in a scene, dialogue intention corresponding to the dialogue data is recognized based only on a dialogue intention matching table for dialogue data collected in real time, and the dialogue data collected in real time and the recognized dialogue intention are stored and collected in a dialogue log.
After enough dialogue data samples are accumulated in the dialogue log, dialogue data in the dialogue log is extracted to generate sample training data, a small sample sub-model and a main classification sub-model are trained based on the sample training data, a small sample sub-model after training is obtained, a first recognition range corresponding to the small sample sub-model after training is determined, the first recognition range comprises dialogue intentions recognizable by the small sample sub-model, a main classification sub-model after training is obtained, a second recognition range corresponding to the main classification sub-model after training is determined, and the second recognition range comprises dialogue intentions recognizable by the main classification sub-model.
In another case, after the dialogue data input by the user is acquired, in a scene corresponding to the dialogue data, if identifiable dialogue intentions exist in the small sample sub-model and the main classification sub-model, the small sample sub-model and the main classification sub-model are indicated to have an identification effect on some dialogue intentions in the scene, at this time, dialogue intention identification processing is performed on the dialogue data input by the user based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model respectively, dialogue intention identification results corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model respectively are obtained, and then the dialogue intention identification result with highest accuracy is determined as the dialogue intention corresponding to the dialogue data in the dialogue intention matching table, the small sample sub-model and the dialogue intention identification results corresponding to the main classification sub-model respectively.
Referring to fig. 3, an exemplary schematic diagram of dialog intention recognition is provided in the embodiment of the present disclosure. As shown in fig. 3, when the small sample sub-model and the main classification sub-model have identifiable conversational intentions, that is, the small sample sub-model and the main classification sub-model have conversational intention recognition effects on conversational data in a scene, at this time, conversational intention recognition processing is performed on conversational data input by a user based on a conversational intention matching table, the small sample sub-model and the main classification sub-model respectively, so as to obtain conversational intention recognition results corresponding to the conversational intention matching table, the small sample sub-model and the main classification sub-model respectively, and a conversational intention recognition result with highest accuracy is determined as a conversational intention corresponding to the conversational data in conversational intention matching table, the small sample sub-model and the main classification sub-model respectively. The dialogue data collected in real time and the determined dialogue intents are stored and collected in a dialogue log.
It can be understood that the dialog intention matching table is preset with a one-to-one correspondence relationship between dialog data and dialog intention, so that the highest accuracy is achieved, but the dialog intention matching table does not have generalization, so that the number of the dialog data which can be matched is small. After training the small sample sub-model based on a small number of samples, part of dialogue intentions can be identified, and the model has a certain generalization property, and the identification accuracy is lower than that of the main classification sub-model. After the main classification sub-model is trained based on a large number of samples, the main classification sub-model has strong generalization aiming at identifiable dialogue intentions and has high identification accuracy.
In one embodiment of the present specification, if the dialog intention recognition result corresponding to the dialog intention matching table is a determined dialog intention, the dialog intention recognition result corresponding to the dialog intention matching table is taken as the dialog intention corresponding to the dialog data.
In one embodiment of the present disclosure, if the dialog intention recognition result corresponding to the dialog intention matching table indicates that the dialog intention matching table cannot recognize the dialog data, determining the dialog intention corresponding to the dialog data from the dialog intention recognition results corresponding to the small sample sub-model and the main classification sub-model, respectively, based on the first recognition range and the second recognition range.
Optionally, if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model does not exist in the second recognition range, taking the dialog intention recognition result corresponding to the small sample sub-model as the dialog intention corresponding to the dialog data;
optionally, if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, taking the dialog intention recognition result corresponding to the main classification sub-model as the dialog intention corresponding to the dialog data;
optionally, if the dialog intention recognition result corresponding to the small sample sub-model does not exist in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, the dialog intention recognition result corresponding to the main classification sub-model is used as the dialog intention corresponding to the dialog data.
In the embodiment of the specification, firstly, dialogue data input by a user are collected in real time, dialogue intention recognition is carried out on the dialogue data based on a dialogue intention matching table, a small sample sub-model and a main classification sub-model, dialogue intention recognition results corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model are obtained, dialogue intention corresponding to the dialogue data is determined from the dialogue intention recognition results based on a first recognition range corresponding to the dialogue intention matching table, the small sample sub-model and a second recognition range corresponding to the main classification sub-model, dialogue intention recognition is carried out on the dialogue data through the dialogue intention matching table, the small sample sub-model and the main classification sub-model, dialogue intention recognition on the dialogue data can be realized under zero sample training data, a small amount of sample training data and a large amount of sample training data scenes, full scene coverage of dialogue intention recognition is realized, and user experience is improved.
Fig. 4 is a schematic flow chart of a dialog intention recognition method according to an embodiment of the present disclosure. As shown in fig. 4, the dialog intention recognition method may include the steps of:
s202, collecting dialogue data input by a user in real time;
in the embodiment of the present disclosure, step S202 is referred to in another embodiment of the present disclosure for detailed description of step S102, and will not be described herein.
S204, respectively carrying out dialogue intention recognition on dialogue data based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model;
in the embodiment of the present specification, after dialogue data is acquired, a dialogue intention recognition result generated by a dialogue intention matching table for the acquired dialogue data is obtained based on correspondence between each dialogue data and dialogue intention recorded in the dialogue intention matching table; inputting the collected dialogue data into a small sample sub-model, and outputting a corresponding dialogue intention recognition result by the small sample sub-model; and inputting the collected dialogue data into a main classification sub-model, and outputting a corresponding dialogue intention recognition result by the main classification sub-model.
S206, if the dialog intention recognition result corresponding to the dialog intention matching list is the determined dialog intention, using the dialog intention recognition result corresponding to the dialog intention matching list as the dialog intention corresponding to the dialog data;
it can be understood that, though the dialog intention matching table is preset with a one-to-one correspondence relationship between dialog data and dialog intention, and the dialog intention obtained by matching is necessarily accurate for the dialog data identifiable by the dialog intention matching table. Therefore, after the collected user input dialogue data is subjected to dialogue intention recognition based on the dialogue intention matching table, if the dialogue intention matching table can recognize the dialogue intention corresponding to the dialogue data, the obtained dialogue intention recognition result is the determined dialogue intention, and at this time, the dialogue intention corresponding to the dialogue intention recognition result is directly taken as the dialogue intention corresponding to the dialogue data.
If the dialog intention recognition result corresponding to the dialog intention matching table indicates that the dialog intention matching table cannot recognize the dialog data, S208 determines the dialog intention corresponding to the dialog data from the dialog intention recognition results corresponding to the small sample sub-model and the main classification sub-model based on the first recognition range and the second recognition range.
It is understood that, since the dialogue intention matching table does not have generalization, only the dialogue intention of the dialogue data recorded in the table can be recognized, and after the dialogue intention is recognized based on the dialogue intention matching table, if the dialogue intention matching table cannot recognize the dialogue intention corresponding to the dialogue data after the collected dialogue data input by the user is recognized based on the dialogue intention matching table, at this time, the dialogue intention corresponding to the dialogue data is determined from the dialogue intention recognition results respectively corresponding to the small sample sub-model and the main classification sub-model according to the first recognition range corresponding to the small sample sub-model and the second recognition range corresponding to the main classification sub-model.
Optionally, if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model does not exist in the second recognition range, using the dialog intention recognition result corresponding to the small sample sub-model as the dialog intention corresponding to the dialog data;
it can be understood that the dialog intention recognition result after the dialog intention recognition is performed on the dialog data by the small sample sub-model exists in the first recognition range, which indicates that the dialog intention corresponding to the dialog data can be effectively recognized by the small sample sub-model. The dialog intention recognition result corresponding to the main classification sub-model does not exist in the second recognition range, which indicates that the dialog intention corresponding to the dialog data cannot be effectively recognized by the main classification sub-model. At this time, the dialog intention recognition result of the small sample submodel to the dialog data is directly taken as the dialog intention corresponding to the dialog data.
Optionally, if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, taking the dialog intention recognition result corresponding to the main classification sub-model as the dialog intention corresponding to the dialog data;
it can be understood that the dialog intention recognition result after the dialog intention recognition is performed on the dialog data by the small sample sub-model exists in the first recognition range, which indicates that the dialog intention corresponding to the dialog data can be effectively recognized by the small sample sub-model. The dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, which indicates that the dialog intention corresponding to the dialog data can be effectively recognized by the main classification sub-model. At this time, since the main classification sub-model is a model trained based on a large number of sample training data, the main classification sub-model has a better recognition effect on the dialogue data under the condition that both the small sample sub-model and the main classification sub-model can recognize the dialogue intention corresponding to the dialogue data. At this time, the dialog intention recognition result of the dialog data by the main classification sub-model is taken as the dialog intention corresponding to the dialog data.
Optionally, if the dialog intention recognition result corresponding to the small sample sub-model does not exist in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, the dialog intention recognition result corresponding to the main classification sub-model is used as the dialog intention corresponding to the dialog data.
It can be understood that the dialog intention recognition result after the dialog intention recognition is performed on the dialog data by the small sample sub-model does not exist in the first recognition range, which indicates that the dialog intention corresponding to the dialog data cannot be effectively recognized by the small sample sub-model. The dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, which indicates that the dialog intention corresponding to the dialog data can be effectively recognized by the main classification sub-model. At this time, the dialog intention recognition result of the dialog data by the main classification sub-model is directly used as the dialog intention corresponding to the dialog data.
In this embodiment of the present disclosure, firstly, dialogue data input by a user is collected in real time, dialogue intent recognition is performed on the dialogue data based on a dialogue intent matching table, a small sample sub-model and a main classification sub-model, dialogue intent recognition results corresponding to the dialogue intent matching table, the small sample sub-model and the main classification sub-model are obtained, if the dialogue intent recognition results corresponding to the dialogue intent matching table are determined dialogue intentions, the dialogue intent recognition results corresponding to the dialogue intent matching table are used as dialogue intentions corresponding to the dialogue data, if the dialogue intent recognition results corresponding to the dialogue intent matching table indicate that the dialogue intent matching table cannot recognize the dialogue data, dialogue intentions corresponding to the dialogue data are determined from the dialogue intent recognition results corresponding to the small sample sub-model and the main classification sub-model based on a first recognition range and a second recognition range, dialogue intent recognition is performed on the dialogue data through the dialogue intent matching table, the small sample sub-model and the main classification sub-model, respectively, dialogue intent recognition can be performed on dialogue intent training data in a zero sample training data, a small sample training data and a large number of sample training data, full scene of dialogue intent recognition can be realized on the dialogue data, and full scene coverage of dialogue intent recognition is realized, and user experience is improved.
Referring to fig. 5, a flowchart of a training method for dialog intention recognition model is provided in an embodiment of the present disclosure. As shown in fig. 5, the dialog intention recognition model training method may include the steps of:
s302, when the dialogue data newly recorded in the dialogue log reaches the preset quantity, extracting the dialogue data with the preset quantity and dialogue intents corresponding to the dialogue data respectively from the dialogue log, wherein the dialogue data is text data input by a user in a dialogue system;
the dialogue log is used for recording all dialogue data of a dialogue performed by a user and the dialogue robot. In the embodiment of the present disclosure, content data of a conversation performed by a user and a conversation robot is recorded in a conversation log, and when conversation data newly recorded in the conversation log is accumulated to a preset number, the conversation data of the preset number and conversation intents corresponding to the conversation data are extracted from the conversation log.
It is to be understood that, in the embodiment of the present disclosure, the conversation robot predicts the conversation intention corresponding to the conversation data of the user by combining the conversation intention matching table, the small sample sub-model and the main classification sub-model, where the small sample sub-model and the main classification sub-model are neural network models requiring sample training data for training, and for a new scene, a better conversation intention recognition effect can be obtained only by training a large amount of sample training data.
In the embodiment of the specification, the content data of the conversation performed by the user and the conversation robot is recorded through the conversation log, after the conversation data in the conversation log is accumulated to a certain amount, the conversation data in the conversation log is extracted and used as sample training data to train the small sample sub-model and the main classification sub-model, so that the conversation intention recognition effect of the model is ensured.
S304, generating sample training data based on dialogue data and dialogue intents respectively corresponding to the dialogue data;
in the embodiment of the present specification, after the dialogue log extracts a preset number of dialogue data and dialogue intents corresponding to each dialogue data, the dialogue data and the dialogue intents corresponding one to one are combined to generate sample training data.
S306, training a small sample sub-model based on the training data of each sample to obtain a small sample sub-model after training is finished, and determining a first recognition range corresponding to the small sample sub-model after training, wherein the first recognition range comprises dialog intents recognizable by the small sample sub-model;
in the embodiment of the present disclosure, training a small sample sub-model based on the generated training data of each sample, obtaining a small sample sub-model after training, and determining a first recognition range corresponding to the small sample sub-model after training. The first recognition range is a recognizable sample intention range determined by the small sample sub-model after model training, and comprises various sample intention types recognizable by the small sample sub-model.
Optionally, referring to fig. 6, a flow chart of a training method for a dialog intention recognition model provided in this embodiment of the present disclosure, as shown in fig. 6, is that training a small sample sub-model based on training data of each sample, obtaining a trained small sample sub-model, and determining a first recognition range corresponding to the trained small sample sub-model, and specifically includes the following steps:
s3061, classifying each sample training data according to dialogue intentions to obtain sample training data sets respectively corresponding to the dialogue intentions;
specifically, after each dialogue data and the dialogue intention corresponding to each dialogue data are extracted from the dialogue log, each sample training data is generated, each sample training data is classified according to the dialogue intention, and the sample training data which belongs to the same dialogue intention is divided into unified sample training data sets, so that sample training data sets respectively corresponding to each dialogue intention are obtained.
S3062, respectively inputting each sample training data set into a small sample sub-model for training, and determining the recognition performance index of the small sample sub-model after training on each dialogue intention;
in the embodiment of the present disclosure, each sample training data set is respectively input into a small sample sub-model for training, and an identification performance index of the small sample sub-model after training on each dialog intention is determined, which specifically includes: dividing each sample training data in a sample training data set into training data and verification data to obtain a training data subset and a verification data subset, inputting each training data subset into a small sample sub-model for training to obtain a small sample sub-model after training is finished, inputting each verification data subset into the small sample sub-model for verification to obtain the recognition performance index of the small sample sub-model after training to each dialog intention.
Optionally, the identification performance index may be one or more of identification accuracy, identification precision and recall.
S3063, taking the conversation intention with the identification performance index larger than the preset performance index as the conversation intention which can be identified by the small sample submodel.
In this embodiment of the present disclosure, after sample training data sets corresponding to each sample intent are input to a small sample sub-model for training, whether the dialog intention is a dialog intention that can be accurately identified by the small sample sub-model is determined according to the obtained identification performance index, and the dialog intention with the identification performance index greater than the preset performance index is used as the dialog intention that can be accurately identified by the small sample sub-model.
S308, training the main classification sub-model based on the training data of each sample to obtain a main classification sub-model after training is finished, and determining a second recognition range corresponding to the main classification sub-model after training, wherein the second recognition range comprises dialog intents recognizable by the main classification sub-model.
In the embodiment of the present disclosure, the main classification sub-model is trained based on the generated training data of each sample, so as to obtain a main classification sub-model after training is completed, and a second recognition range corresponding to the main classification sub-model after training is determined. The second recognition range is a recognizable sample intention range determined by the main classification sub-model after model training, and the second recognition range comprises each sample intention type recognizable by the main classification sub-model.
Optionally, referring to fig. 6, a flow chart of a training method for a dialog intention recognition model provided in this embodiment of the present disclosure, as shown in fig. 6, is shown, in which the training of the main classification sub-model based on the training data of each sample is performed to obtain a main classification sub-model after the training is finished, and a second recognition range corresponding to the main classification sub-model after the training is determined, and specifically includes the following steps:
s3081, classifying each sample training data according to dialogue intentions to obtain sample training data sets respectively corresponding to the dialogue intentions;
specifically, after each dialogue data and the dialogue intention corresponding to each dialogue data are extracted from the dialogue log, each sample training data is generated, each sample training data is classified according to the dialogue intention, and the sample training data which belongs to the same dialogue intention is divided into unified sample training data sets, so that sample training data sets respectively corresponding to each dialogue intention are obtained.
S3082, respectively inputting each sample training data set into the main classification sub-model for training, and determining the recognition performance index of the main classification sub-model after training on each dialogue intention;
in the embodiment of the present disclosure, each sample training data set is respectively input into a main classification sub-model for training, and the recognition performance index of the main classification sub-model after training on each dialog intention is determined, which specifically includes: dividing each sample training data in a sample training data set into training data and verification data to obtain a training data subset and a verification data subset, inputting each training data subset into a main classification sub-model for training to obtain a main classification sub-model after training is finished, inputting each verification data subset into the main classification sub-model for verification to obtain the recognition performance index of the main classification sub-model after training to each dialog intention.
Optionally, the identification performance index may be one or more of identification accuracy, identification precision and recall.
S3083, taking the conversation intention with the identification performance index larger than the preset performance index as the conversation intention which can be identified by the main classification sub-model.
In this embodiment of the present disclosure, after a sample training data set corresponding to each sample intent is input to a main classification sub-model for training, whether the dialog intent is a dialog intent that can be accurately identified by the main classification sub-model is determined according to the obtained identification performance index, and the dialog intent with the identification performance index greater than the preset performance index is used as the dialog intent that can be accurately identified by the main classification sub-model.
In this embodiment of the present disclosure, after the newly recorded dialogue data in the dialogue log reaches the preset number, the preset number of dialogue data and dialogue intents corresponding to each dialogue data are extracted from the dialogue log, sample training data are generated based on the dialogue data and the dialogue intents corresponding to each dialogue data, the small sample submodel is trained based on each sample training data, a first recognition range corresponding to the small sample submodel after training is obtained, the first recognition range includes dialogue intents identifiable by the small sample submodel, the main classification submodel after training is obtained based on each sample training data, the main classification submodel after training is determined, the second recognition range includes dialogue intents identifiable by the main classification submodel, finally the small sample submodel and the main classification submodel with the small sample recognition dialogue intent range can be obtained, dialogue intents are respectively identified based on the small sample submodel with the small sample recognition intent range and the main classification submodel and the dialogue intention matching table, the dialogue intents can be recognized in a zero sample training data, the large amount of dialogue training data can be recognized, the whole dialogue scene can be recognized, and the user intention can be recognized in a small amount, and the user experience can be recognized by using the whole dialogue intention can be realized.
Fig. 7 is a schematic structural diagram of a dialog intention recognition device according to an embodiment of the present disclosure. As shown in fig. 7, the dialog intention recognition device 1 may be implemented as all or part of an electronic apparatus by software, hardware or a combination of both. According to some embodiments, the dialog intention recognition device 1 comprises a dialog data acquisition module 11, a dialog intention recognition module 12, a dialog intention determination module 13, comprising in particular:
the dialogue data acquisition module 11 is used for acquiring dialogue data input by a user in real time;
a dialogue intent recognition module 12, configured to perform dialogue intent recognition on the dialogue data based on the dialogue intent matching table, the small sample sub-model, and the main classification sub-model, to obtain dialogue intent recognition results corresponding to the dialogue intent matching table, the small sample sub-model, and the main classification sub-model, respectively;
a dialog intention determining module 13, configured to determine, from each dialog intention recognition result, a dialog intention corresponding to the dialog data based on the dialog intention matching table, a first recognition range corresponding to the small sample sub-model, and a second recognition range corresponding to the main classification sub-model, where the first recognition range includes dialog intents recognizable by the small sample sub-model, and the second recognition range includes dialog intents recognizable by the main classification sub-model.
Optionally, please refer to fig. 8, which is a schematic structural diagram of a dialog intention recognition device according to an embodiment of the present disclosure. As shown in fig. 8, the dialog intention recognition device further includes a dialog intention matching module 14, configured to, when the small sample sub-model does not have the first recognition range and the main classification sub-model does not have the second recognition range, perform dialog intention matching on the dialog data based on the dialog intention matching table, and determine a dialog intention corresponding to the dialog data.
Optionally, the dialog intention determining module 13 is specifically configured to:
if the dialog intention recognition result corresponding to the dialog intention matching table is the determined dialog intention, taking the dialog intention recognition result corresponding to the dialog intention matching table as the dialog intention corresponding to the dialog data;
if the dialog intention recognition result corresponding to the dialog intention matching table indicates that the dialog intention matching table cannot recognize the dialog data, determining the dialog intention corresponding to the dialog data from the dialog intention recognition results respectively corresponding to the small sample sub-model and the main classification sub-model based on the first recognition range and the second recognition range.
Optionally, when the dialog intention determining module determines the dialog intention corresponding to the dialog data from dialog intention recognition results respectively corresponding to the small sample sub-model and the main classification sub-model based on the first recognition range and the second recognition range, the dialog intention determining module is specifically configured to:
if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model does not exist in the second recognition range, taking the dialog intention recognition result corresponding to the small sample sub-model as the dialog intention corresponding to the dialog data;
if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, taking the dialog intention recognition result corresponding to the main classification sub-model as the dialog intention corresponding to the dialog data;
and if the dialog intention recognition result corresponding to the small sample sub-model does not exist in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, taking the dialog intention recognition result corresponding to the main classification sub-model as the dialog intention corresponding to the dialog data.
In the embodiment of the specification, firstly, dialogue data input by a user are collected in real time, dialogue intention recognition is carried out on the dialogue data based on a dialogue intention matching table, a small sample sub-model and a main classification sub-model, dialogue intention recognition results corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model are obtained, dialogue intention corresponding to the dialogue data is determined from the dialogue intention recognition results based on a first recognition range corresponding to the dialogue intention matching table, the small sample sub-model and a second recognition range corresponding to the main classification sub-model, dialogue intention recognition is carried out on the dialogue data through the dialogue intention matching table, the small sample sub-model and the main classification sub-model, dialogue intention recognition on the dialogue data can be realized under zero sample training data, a small amount of sample training data and a large amount of sample training data scenes, full scene coverage of dialogue intention recognition is realized, and user experience is improved.
It should be noted that, when the dialog intention recognition device provided in the above embodiment performs the dialog intention recognition method, only the division of the above functional modules is used as an example, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the dialog intention recognition device and the dialog intention recognition method provided in the above embodiments belong to the same concept, which embody the detailed implementation process in the method embodiment, and are not repeated here.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
Referring to fig. 9, a schematic structural diagram of a training device for dialog intention recognition model is provided in the embodiment of the present disclosure. As shown in fig. 9, the dialog intention recognition model training device 2 may be implemented as all or part of an electronic apparatus by software, hardware, or a combination of both. According to some embodiments, the dialog intention recognition model training device 2 includes a dialog data extraction module 21, a training data generation module 22, a first model training module 23, and a second model training module 24, specifically including:
a dialogue data extraction module 21, configured to extract, from a dialogue log, a preset number of dialogue data and dialogue intents respectively corresponding to the dialogue data when the dialogue data newly recorded in the dialogue log reaches the preset number, where the dialogue data is text data input by a user in a dialogue system;
a training data generating module 22, configured to generate sample training data based on the dialogue data and dialogue intents respectively corresponding to the dialogue data;
a first model training module 23, configured to train the small sample sub-model based on each sample training data, obtain a small sample sub-model after training is completed, and determine a first recognition range corresponding to the small sample sub-model after training is completed, where the first recognition range includes a dialog intention recognizable by the small sample sub-model;
And a second model training module 24, configured to train the main classification sub-model based on each sample training data, obtain a main classification sub-model after training is finished, and determine a second recognition range corresponding to the main classification sub-model after training is finished, where the second recognition range includes a dialog intention recognizable by the main classification sub-model.
Optionally, the first model training module 23 is specifically configured to:
classifying each sample training data according to dialogue intentions to obtain sample training data sets respectively corresponding to each dialogue intention;
respectively inputting each sample training data set into the small sample sub-model for training, and determining the recognition performance index of the small sample sub-model after training on each dialogue intention;
and taking the conversation intention with the identification performance index larger than a preset performance index as the conversation intention which can be identified by the small sample submodel.
Optionally, when the first model training module 23 performs the training by inputting each of the sample training data sets into the small sample sub-model, and determines the recognition performance index of the small sample sub-model after the training on each of the dialog intents, the first model training module is specifically configured to:
Dividing each sample training data in the sample training data set into training data and verification data to obtain a training data subset and a verification data subset;
inputting each training data subset into the small sample sub-model for training to obtain a small sample sub-model after training is finished;
inputting each verification data subset into the small sample sub-model for verification, and obtaining the recognition performance index of the small sample sub-model after training on each dialogue intention.
Optionally, the second model training module 24 is specifically configured to:
classifying each sample training data according to dialogue intentions to obtain sample training data sets respectively corresponding to each dialogue intention;
respectively inputting each sample training data set into the main classification sub-model for training, and determining the recognition performance index of the main classification sub-model after training on each dialogue intention;
and taking the conversation intention with the identification performance index larger than a preset performance index as the conversation intention which can be identified by the main classification sub-model.
Optionally, when the second model training module 24 performs the training by inputting each of the sample training data sets into the small sample sub-model, and determines the recognition performance index of the small sample sub-model after the training on each of the dialog intents, the second model training module is specifically configured to:
Dividing each sample training data in the sample training data set into training data and verification data to obtain a training data subset and a verification data subset;
inputting each training data subset into the main classification sub-model for training to obtain a main classification sub-model after training is finished;
inputting each verification data subset into the main classification sub-model for verification, and obtaining the recognition performance index of the main classification sub-model after training on each dialogue intention.
In this embodiment of the present disclosure, after the newly recorded dialogue data in the dialogue log reaches the preset number, the preset number of dialogue data and dialogue intents corresponding to each dialogue data are extracted from the dialogue log, sample training data are generated based on the dialogue data and the dialogue intents corresponding to each dialogue data, the small sample submodel is trained based on each sample training data, a first recognition range corresponding to the small sample submodel after training is obtained, the first recognition range includes dialogue intents identifiable by the small sample submodel, the main classification submodel after training is obtained based on each sample training data, the main classification submodel after training is determined, the second recognition range includes dialogue intents identifiable by the main classification submodel, finally the small sample submodel and the main classification submodel with the small sample recognition dialogue intent range can be obtained, dialogue intents are respectively identified based on the small sample submodel with the small sample recognition intent range and the main classification submodel and the dialogue intention matching table, the dialogue intents can be recognized in a zero sample training data, the large amount of dialogue training data can be recognized, the whole dialogue scene can be recognized, and the user intention can be recognized in a small amount, and the user experience can be recognized by using the whole dialogue intention can be realized.
It should be noted that, when the dialog intention recognition model training device provided in the above embodiment executes the dialog intention recognition model training method, only the division of the above functional modules is used for illustration, in practical application, the above functional allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the dialog intention recognition model training device and the dialog intention recognition model training method provided in the above embodiments belong to the same concept, which embody detailed implementation procedures and are not described herein.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The embodiment of the present disclosure further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are adapted to be loaded by a processor and executed by the processor to perform the method for identifying a dialog intention according to the embodiment shown in fig. 1 to 6, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 6, which is not repeated herein.
The present disclosure further provides a computer program product, where at least one instruction is stored, where the at least one instruction is loaded by the processor and executed by the processor to perform the dialog intention recognition method according to the embodiment shown in fig. 1 to 6, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 6, which is not repeated herein.
Referring to fig. 10, a block diagram of an electronic device according to an embodiment of the present disclosure is provided. The electronic device in this specification may include one or more of the following: processor 110, memory 120, input device 130, output device 140, and bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall terminal using various interfaces and lines, performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in at least one hardware form of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), programmable logic array (programmable logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processor (central processing unit, CPU), an image processor (graphics processing unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The memory 120 may include a random access memory (random Access Memory, RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In the embodiment of the present disclosure, the input device 130 may be a temperature sensor for acquiring an operation temperature of the terminal. The output device 140 may be a speaker for outputting audio signals.
In addition, those skilled in the art will appreciate that the configuration of the terminal illustrated in the above-described figures does not constitute a limitation of the terminal, and the terminal may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the terminal further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (wireless fidelity, WIFI) module, a power supply, a bluetooth module, and the like, which are not described herein again.
In the embodiment of the present specification, the execution subject of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or other operating systems, which embodiments of the present specification are not limited to.
In the electronic device of fig. 10, the processor 110 may be configured to invoke the dialog intention recognition program stored in the memory 120 and execute to implement the dialog intention recognition method as described in the various method embodiments of the present description.
In the embodiment of the specification, firstly, dialogue data input by a user are collected in real time, dialogue intention recognition is carried out on the dialogue data based on a dialogue intention matching table, a small sample sub-model and a main classification sub-model, dialogue intention recognition results corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model are obtained, dialogue intention corresponding to the dialogue data is determined from the dialogue intention recognition results based on a first recognition range corresponding to the dialogue intention matching table, the small sample sub-model and a second recognition range corresponding to the main classification sub-model, dialogue intention recognition is carried out on the dialogue data through the dialogue intention matching table, the small sample sub-model and the main classification sub-model, dialogue intention recognition on the dialogue data can be realized under zero sample training data, a small amount of sample training data and a large amount of sample training data scenes, full scene coverage of dialogue intention recognition is realized, and user experience is improved.
It will be clear to a person skilled in the art that the solution according to the present description can be implemented by means of software and/or hardware. "Unit" and "module" in this specification refer to software and/or hardware capable of performing a specific function, either alone or in combination with other components, such as Field programmable gate arrays (Field-Programmable Gate Array, FPGAs), integrated circuits (Integrated Circuit, ICs), etc.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present description is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present description. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the specification.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this specification, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, such as the division of the units, merely a logical function division, and there may be additional manners of dividing the actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some service interface, device or unit indirect coupling or communication connection, electrical or otherwise.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present specification may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be performed by hardware associated with a program that is stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing is merely exemplary embodiments of the present specification and is not intended to limit the scope of the present specification. It is intended that all equivalent variations and modifications as taught herein fall within the scope of the present disclosure. Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.

Claims (14)

1. A dialog intention recognition method applied to a dialog intention matching table including correspondence specifying dialog data and dialog intention, and a main classification sub-model which is a recognition model trained based on a small number of sample training data, and a dialog intention recognition model including a small sample sub-model which is a recognition model trained based on a large number of sample training data, the method comprising:
collecting dialogue data input by a user in real time;
respectively carrying out dialogue intention recognition on the dialogue data based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model;
determining the dialogue intention corresponding to the dialogue data from each dialogue intention recognition result based on the dialogue intention matching table, a first recognition range corresponding to the small sample sub-model and a second recognition range corresponding to the main classification sub-model, wherein the first recognition range comprises the dialogue intention recognizable by the small sample sub-model, and the second recognition range comprises the dialogue intention recognizable by the main classification sub-model.
2. The method of claim 1, further comprising, if the small sample sub-model does not have a first recognition range and the main classification sub-model does not have a second recognition range, prior to the respectively dialog intention recognition of the dialog data based on the dialog intention match table, the small sample sub-model, and the main classification sub-model:
and carrying out dialogue intention matching on the dialogue data based on the dialogue intention matching table, and determining the dialogue intention corresponding to the dialogue data.
3. The method of claim 1, the determining the dialog intent corresponding to the dialog data from each of the dialog intent recognition results based on the dialog intent matching table, the first recognition range corresponding to the small sample sub-model, and the second recognition range corresponding to the main classification sub-model, comprising:
if the dialog intention recognition result corresponding to the dialog intention matching table is the determined dialog intention, taking the dialog intention recognition result corresponding to the dialog intention matching table as the dialog intention corresponding to the dialog data;
if the dialog intention recognition result corresponding to the dialog intention matching table indicates that the dialog intention matching table cannot recognize the dialog data, determining the dialog intention corresponding to the dialog data from the dialog intention recognition results respectively corresponding to the small sample sub-model and the main classification sub-model based on the first recognition range and the second recognition range.
4. The method of claim 3, the determining a dialog intention corresponding to the dialog data from dialog intention recognition results respectively corresponding to the small sample sub-model and the main classification sub-model based on the first recognition range and the second recognition range, comprising:
if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model does not exist in the second recognition range, taking the dialog intention recognition result corresponding to the small sample sub-model as the dialog intention corresponding to the dialog data;
if the dialog intention recognition result corresponding to the small sample sub-model exists in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, taking the dialog intention recognition result corresponding to the main classification sub-model as the dialog intention corresponding to the dialog data;
and if the dialog intention recognition result corresponding to the small sample sub-model does not exist in the first recognition range and the dialog intention recognition result corresponding to the main classification sub-model exists in the second recognition range, taking the dialog intention recognition result corresponding to the main classification sub-model as the dialog intention corresponding to the dialog data.
5. A dialog intention recognition model training method, the dialog intention recognition model comprising a small sample sub-model and a main classification sub-model, comprising:
when the dialogue data newly recorded in the dialogue log reaches the preset quantity, extracting the dialogue data with the preset quantity and dialogue intents corresponding to the dialogue data respectively from the dialogue log, wherein the dialogue data is text data input by a user in a dialogue system;
generating sample training data based on the dialogue data and dialogue intents respectively corresponding to the dialogue data;
training the small sample sub-model based on each sample training data to obtain a small sample sub-model after training is finished, and determining a first recognition range corresponding to the small sample sub-model after training is finished, wherein the first recognition range comprises dialog intents recognizable by the small sample sub-model;
and training the main classification sub-model based on each sample training data to obtain a main classification sub-model after training is finished, and determining a second recognition range corresponding to the main classification sub-model after training is finished, wherein the second recognition range comprises dialog intents recognizable by the main classification sub-model.
6. The method of claim 5, wherein training the small sample sub-model based on the sample training data to obtain a trained small sample sub-model, and determining a first recognition range corresponding to the trained small sample sub-model, comprises:
classifying each sample training data according to dialogue intentions to obtain sample training data sets respectively corresponding to each dialogue intention;
respectively inputting each sample training data set into the small sample sub-model for training, and determining the recognition performance index of the small sample sub-model after training on each dialogue intention;
and taking the conversation intention with the identification performance index larger than a preset performance index as the conversation intention which can be identified by the small sample submodel.
7. The method of claim 6, wherein the respectively inputting the sample training data sets into the small sample sub-models for training, and determining the recognition performance index of the small sample sub-models after training on the dialog intention comprises:
dividing each sample training data in the sample training data set into training data and verification data to obtain a training data subset and a verification data subset;
Inputting each training data subset into the small sample sub-model for training to obtain a small sample sub-model after training is finished;
inputting each verification data subset into the small sample sub-model for verification, and obtaining the recognition performance index of the small sample sub-model after training on each dialogue intention.
8. The method according to claim 5, wherein training the main classification sub-model based on each sample training data to obtain a main classification sub-model after training, and determining a second recognition range corresponding to the main classification sub-model after training, comprises:
classifying each sample training data according to dialogue intentions to obtain sample training data sets respectively corresponding to each dialogue intention;
respectively inputting each sample training data set into the main classification sub-model for training, and determining the recognition performance index of the main classification sub-model after training on each dialogue intention;
and taking the conversation intention with the identification performance index larger than a preset performance index as the conversation intention which can be identified by the main classification sub-model.
9. The method of claim 8, wherein the inputting each sample training data set into the small sample sub-model for training, and determining the recognition performance index of the small sample sub-model after training on each dialog intention, comprises:
Dividing each sample training data in the sample training data set into training data and verification data to obtain a training data subset and a verification data subset;
inputting each training data subset into the main classification sub-model for training to obtain a main classification sub-model after training is finished;
inputting each verification data subset into the main classification sub-model for verification, and obtaining the recognition performance index of the main classification sub-model after training on each dialogue intention.
10. A dialog intention recognition device comprising:
the dialogue data acquisition module is used for acquiring dialogue data input by a user in real time;
the dialogue intention recognition module is used for respectively carrying out dialogue intention recognition on the dialogue data based on the dialogue intention matching table, the small sample sub-model and the main classification sub-model to obtain dialogue intention recognition results respectively corresponding to the dialogue intention matching table, the small sample sub-model and the main classification sub-model;
and the dialog intention determining module is used for determining the dialog intention corresponding to the dialog data from each dialog intention recognition result based on the dialog intention matching table, a first recognition range corresponding to the small sample sub-model and a second recognition range corresponding to the main classification sub-model, wherein the first recognition range comprises the dialog intention recognizable by the small sample sub-model, and the second recognition range comprises the dialog intention recognizable by the main classification sub-model.
11. A dialog intention recognition model training device comprising:
the dialogue data extraction module is used for extracting dialogue data with preset quantity and dialogue intents respectively corresponding to the dialogue data from the dialogue log after the dialogue data newly recorded in the dialogue log reaches the preset quantity, wherein the dialogue data is text data input by a user in a dialogue system;
the training data generation module is used for generating sample training data based on the dialogue data and dialogue intents respectively corresponding to the dialogue data;
the first model training module is used for training the small sample sub-model based on the sample training data to obtain a small sample sub-model after training is finished, and determining a first recognition range corresponding to the small sample sub-model after training is finished, wherein the first recognition range comprises dialog intents recognizable by the small sample sub-model;
the second model training module is used for training the main classification sub-model based on the sample training data to obtain a main classification sub-model after training is finished, and determining a second recognition range corresponding to the main classification sub-model after training is finished, wherein the second recognition range comprises dialog intents recognizable by the main classification sub-model.
12. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-4 or 5-9.
13. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the method according to any of claims 1-4 or 5-9.
14. A computer program product having stored thereon at least one instruction, which when executed by a processor, implements the steps of the method of any of claims 1 to 4 or 5 to 9.
CN202310760483.4A 2023-06-26 2023-06-26 Dialog intention recognition method and device, storage medium and electronic equipment Pending CN116861917A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310760483.4A CN116861917A (en) 2023-06-26 2023-06-26 Dialog intention recognition method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310760483.4A CN116861917A (en) 2023-06-26 2023-06-26 Dialog intention recognition method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116861917A true CN116861917A (en) 2023-10-10

Family

ID=88225997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310760483.4A Pending CN116861917A (en) 2023-06-26 2023-06-26 Dialog intention recognition method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116861917A (en)

Similar Documents

Publication Publication Date Title
CN108764487B (en) Method and device for generating model, method and device for identifying information
CN107591152B (en) Voice control method, device and equipment based on earphone
US10621971B2 (en) Method and device for extracting speech feature based on artificial intelligence
CN111858869B (en) Data matching method and device, electronic equipment and storage medium
CN108447471A (en) Audio recognition method and speech recognition equipment
CN109360550A (en) Test method, device, equipment and the storage medium of voice interactive system
CN109637525B (en) Method and apparatus for generating an on-board acoustic model
CN110009059B (en) Method and apparatus for generating a model
CN110444206A (en) Voice interactive method and device, computer equipment and readable medium
CN107958059B (en) Intelligent question answering method, device, terminal and computer readable storage medium
CN113408570A (en) Image category identification method and device based on model distillation, storage medium and terminal
CN112667510A (en) Test method, test device, electronic equipment and storage medium
CN110569984A (en) configuration information generation method, device, equipment and storage medium
CN108304434B (en) Information feedback method and terminal equipment
CN113468344B (en) Entity relationship extraction method and device, electronic equipment and computer readable medium
CN114065720A (en) Conference summary generation method and device, storage medium and electronic equipment
CN108765011A (en) Method and apparatus for creating user portrayal and creating state information analysis model
CN111126358A (en) Face detection method, face detection device, storage medium and equipment
CN116861917A (en) Dialog intention recognition method and device, storage medium and electronic equipment
CN113470653A (en) Voiceprint recognition method, electronic equipment and system
CN111680514A (en) Information processing and model training method, device, equipment and storage medium
CN114897126A (en) Time delay prediction method and device, electronic equipment and storage medium
CN110109697B (en) SDK output method and device of neural network model, electronic equipment and storage medium
CN113436613A (en) Voice recognition method and device, electronic equipment and storage medium
CN114218428A (en) Audio data clustering method, device, equipment and storage medium

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