Interaction method, interaction device, intelligent device and storage medium

By using sequence labeling technology to process user sentences of smart devices and identify the control intentions and word slots of complex sentences, the problem of low accuracy in complex sentence recognition of smart devices is solved, and the user interaction experience is improved.

CN114780702BActive Publication Date: 2025-09-12UBTECH ROBOTICS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210446533.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2025-09-12
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

Existing smart devices have low recognition accuracy when processing complex user sentences, resulting in a poor user experience.

Method used

The user sentences are processed by sequence labeling. The control intention and word slots of the user sentences are identified through pre-trained natural language models and sequence labeling models, avoiding the lengthy processing flow of traditional multi-classification tasks.

Benefits of technology

It improves the recognition accuracy of complex user sentences by smart devices, simplifies the processing flow, reduces the dependence on ASR punctuation recognition, and realizes efficient and accurate user interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114780702B_ABST
    Figure CN114780702B_ABST
Patent Text Reader

Abstract

This application discloses an interaction method, interaction apparatus, smart device, and computer-readable storage medium. The method comprises: obtaining a user statement; processing the user statement based on sequence annotation to obtain the control intent of the user statement and the corresponding word slot for each control intent; and providing feedback on the user statement based on the control intent and the word slot to achieve interaction with the user. This application solution can improve the recognition accuracy of user statements by smart devices, enabling good interaction between the smart device and the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and in particular relates to an interaction method, an interaction device, an intelligent device, and a computer-readable storage medium. Background Art

[0002] With the development of smart devices, their application scenarios are expanding. Users can interact with smart devices through voice or text. During this interaction, it is crucial for smart devices to fully understand the user's input and identify the user's intended meaning, so that they can provide accurate interactive feedback.

[0003] Currently, smart devices have a high recognition accuracy for simple user sentences, but the recognition accuracy for complex user sentences is still low, resulting in a poor user experience of smart devices. Summary of the Invention

[0004] The present application provides an interaction method, an interaction apparatus, an intelligent device, and a computer-readable storage medium, which can improve the recognition accuracy of user sentences by the intelligent device and achieve good interaction between the intelligent device and the user.

[0005] In a first aspect, the present application provides an interaction method, comprising:

[0006] Get user statements;

[0007] Process the user's sentence based on sequence tagging to obtain the control intent of the user's sentence and the word slot corresponding to each control intent;

[0008] Feedback is provided to user statements based on control intent and word slots to achieve interaction with the user.

[0009] In a second aspect, the present application provides an interactive device, comprising:

[0010] Acquisition module, used to obtain user statements;

[0011] A processing module is used to process user sentences based on sequence labeling to obtain the control intent of the user sentences and the word slots corresponding to each control intent;

[0012] The feedback module is used to provide feedback to user sentences based on control intentions and word slots to achieve interaction with the user.

[0013] In a third aspect, the present application provides an intelligent device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method according to the first aspect are implemented.

[0014] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method of the first aspect are implemented.

[0015] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by one or more processors, it implements the steps of the method of the first aspect.

[0016] Compared to existing technologies, this application offers the following advantages: after receiving a user sentence, whether simple or complex, the smart device no longer uses traditional multi-classification tasks to classify the user's intent. Instead, it uses sequence labeling to obtain the user's control intent and corresponding word slots, and uses this as a basis for providing feedback on the user's sentence, enabling interaction with the user. This process avoids the lengthy processing flow of traditional multi-classification tasks and eliminates the need to rely on other models, enabling efficient and accurate recognition of user sentences.

[0017] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 This is a schematic diagram of the implementation flow of the interactive method provided in the embodiment of the present application;

[0020] Figure 2 This is a diagram illustrating an example structure of a statement processing model in the interactive method provided in an embodiment of the present application;

[0021] Figure 3 This is a structural block diagram of the interactive device provided in an embodiment of the present application;

[0022] Figure 4 It is a schematic diagram of the structure of the smart device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0023] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0024] When it comes to recognizing complex sentences, current mainstream systems have three main approaches: 1. Segmenting complex sentences using punctuation marks, converting complex sentences into multiple simple sentences and then recognizing them one by one; 2. Recognizing only one intent; and 3. Converting intent classification tasks into multi-label classification tasks.

[0025] The above three methods all have serious problems:

[0026] For processing method ①, the effect of sentence segmentation recognition is usually not ideal, because it relies heavily on the accurate recognition of punctuation marks by Automatic Speech Recognition (ASR) technology, and the accurate recognition of punctuation marks relies heavily on semantic information. However, generally speaking, the semantic recognition capability of ASR technology is weaker than that of Natural Language Processing (NLP) technology.

[0027] As for processing method ②, it completely avoids the user's needs and only partially implements user instructions, attempting to make users interact multiple times to complete complex instructions.

[0028] For processing method ③, there is a problem that intent and word slots cannot be recognized collaboratively, that is, it is impossible to correct the prediction of word slots through the classification of intent, nor is it possible to correct the classification of intent through the prediction of word slots.

[0029] To effectively circumvent the drawbacks of the above three approaches, the present invention proposes an interaction method, an interaction apparatus, an intelligent device, and a computer-readable storage medium. The interaction method is applied to an intelligent device capable of interacting with a user. By way of example only, the intelligent device may be a robot, a smartphone, a tablet computer, or a vehicle center console, among other examples, without limitation.

[0030] For ease of understanding, the following uses a robot as an example to illustrate the interaction method proposed in the embodiment of this application. Figure 1 , the implementation process of this interaction method is detailed as follows:

[0031] Step 101: Obtain user statements.

[0032] The robot may be equipped with a microphone to receive user sentences input by the user in the form of voice. Of course, the robot may also be equipped with a touch screen to receive user sentences input by the user in the form of text. In addition, the robot may establish a direct communication connection with the user terminal; or, it may establish an indirect communication connection with the user terminal through a server. In this way, the user can input user sentences into his user terminal in the form of voice or text, and the user terminal will send the user sentences to the robot through the established communication connection, so that the robot receives the user sentences. The embodiment of the present application does not limit the way in which the robot obtains user sentences.

[0033] Step 102 : Process the user sentence based on sequence tagging to obtain the control intent of the user sentence and the word slot corresponding to each control intent.

[0034] The robot no longer processes user sentences based on a multi-classification task, but processes user sentences based on a sequence labeling method. It should be noted that in the embodiment of the present application, the robot needs to label user sentences from two aspects. One aspect is the labeling of control intent; the other aspect is the labeling of word slots, where the word slots are used to indicate the expected execution level of the corresponding control intent, or to indicate the object to which the corresponding control intent is applied. Generally speaking, the important attributes of a control intent are: the control intent type; the important attributes of a word slot are: the word slot type and the word slot value.

[0035] It should be noted that the present embodiment does not limit the number of slots corresponding to each control intent. That is, after processing a user sentence, it is possible that the number of slots corresponding to a certain control intent in the user sentence is 0 (i.e., the slot is empty); of course, it is also possible that the number of slots corresponding to a certain control intent in the user sentence is more than two.

[0036] In some embodiments, the sequence tagging method relies on a trained sentence processing model. To ensure that the sentence processing model has a better recognition effect, a pre-trained model can be used as the base model of the sentence processing model, and the output structure can be modified based on the base model to make the sentence processing model suitable for the current recognition task. The following is a brief introduction to the sentence processing model:

[0037] The sentence processing model mainly consists of three parts: a pre-trained natural language model, a sequence labeling model for identifying control intent, and a sequence labeling model for identifying word slots.

[0038] As an example only, the natural language model can be a Bidirectional Encoder Representation from Transformers (BERT) model, an Enhanced language Representation with InformativeEntities (ERNIE) model, a BERT-wwm model, a RoBERTa model, a lightweight BERT (A Lite BERT, ALBERT) model, or an Efficiently Learning an Encoder that Classifies Token Replacements Accurately (ELECTRA) model, etc., which are not limited here. Taking the BERT model as an example, based on the output of the hidden state of the last layer of the BERT model, a 1*768-dimensional semantic encoding vector corresponding to each word (token) in the user sentence can be obtained. When the user sentence has N words (tokens), a 1*768-dimensional semantic encoding vector corresponding to the N words (tokens) can be obtained, that is, an N*768-dimensional semantic encoding vector. Generally speaking, the semantic encoding vector is a semantic understanding expression of the content of the user sentence.

[0039] The BERT model is followed by two sequence labeling models. As an example, the sequence labeling model used to identify control intent can be a Bi-directional Long Short-Term Memory (Bi-LSTM) model, and the sequence labeling model used to identify word slots can be a Bi-directional Long Short-Term Memory + Conditional Random Field (Bi-LSTM+CRF) model. The reasons for using different sequence labeling models are: the expression of word slots meets the requirements for CRF usage and inherently implies transition meaning, which conforms to the inherent conventions of linguistic expression. Therefore, the Bi-LSTM+CRF model can be used to identify word slots. However, in the case of complex user sentences, since complex sentences are combined through probabilistic random combinations, the learned transition probabilities can be influenced by controlling the probabilities. Therefore, the CRF model is not suitable for sequence labeling of control intent, and therefore only the Bi-LSTM model is used to identify control intent.

[0040] It should be noted that the output of the Bi-LSTM+CRF model and the Bi-LSTM model both use the BIO annotation format.

[0041] See also Figure 2, Figure 2 An example of the structure of the statement processing model is given.

[0042] Step 103: Feedback is given to the user's sentence based on the control intention and the word slot to achieve interaction with the user.

[0043] After the robot identifies the control intent and corresponding word slot contained in the user's sentence, it can use this control intent and word slot to understand the user's current desired operation. The robot can provide feedback on the user's sentence based on the identified control intent and corresponding word slot, thereby achieving interaction with the user. Generally speaking, feedback on user sentences can be roughly divided into two situations: in one case, the user expects the robot to perform a specific action, in which case the robot will perform the corresponding action through the action module related to the target action; in the other case, the user expects the robot to interact with them verbally, in which case the robot can output a corresponding response through the dialogue system.

[0044] In some embodiments, the sentence processing model needs to be trained before it is put into use. The following is a brief introduction to the training process of the sentence processing model:

[0045] Because the sentence processing model involves processing sentences, corpus collection is necessary in the preparatory phase before formal training begins. Specifically, three types of tables can be set up, and the corresponding corpus can be organized based on the different requirements of each type of table to facilitate corpus collection. For ease of explanation, these three types of tables can be referred to as the first table, the second table, and the third table.

[0046] The first table is used to list the possible expression sample data of each control intention. For ease of understanding, the format of the first table can be found in Table 1 below:

[0047] Control Intention Expression sample data move_front Take {steps} forward|||take a few steps|||take a few steps|||... shake_hand Shake your hands! Shake your hands! Show me how to shake your hands!... move_right Go right {steps}|||Go right {steps}|||... stop Stop|||Pause|||Take a break|||... ... ...

[0048] Table 1

[0049] In Table 1 above, "{}" indicates the word slot type. To facilitate distinction, different expression sample data under the same control intent are separated by a specified first spacing symbol, which can be "|||". As can be seen from Table 1 above, by replacing the specific value of the word slot with the word slot type, the expression sample data can show the possible sentence patterns under the corresponding control intent; and there are also some expression sample data that do not require word slots to express the corresponding control intent. It should be noted that when collecting corpus to construct the first table, attention should be paid to the data balance between samples.

[0050] The second table is used to list the slot types associated with each control intent. For ease of understanding, the format of the second table can be found in Table 2 below:

[0051] Control Intention Slot Type move_front steps shake_hand hands move_right steps ... ...

[0052] Table 2

[0053] As mentioned above, a control intent can be associated with a varying number of slot types. That is, a given control intent may be associated with zero, one, two, or multiple slot types, without limitation. For example, Table 2 shows that the control intent "move_front" is associated with a single slot type, "steps." Meanwhile, a control intent "play_music" might be associated with multiple slot types, such as "singer" and "song."

[0054] Combining Table 1 and Table 2, it can be seen that the word slot type contained in the expression sample data under a certain control intent in Table 1 can be found in Table 2.

[0055] The third table is used to list the possible values ​​for each slot type. For ease of understanding, the format of the third table can be found in Table 3 below:

[0056]

[0057] Table 3

[0058] Considering that when expressing a meaning in language, there are often multiple possible synonyms, the third table not only lists the possible values ​​for each slot type, but also the synonyms for each value. To facilitate distinction, different values ​​within the same slot type, as well as synonyms for different values, can be separated by a designated second separator, such as "|||". Synonyms for the same value within the same slot type can be separated by a designated third separator, such as "|".

[0059] For example, Table 3 above shows that the value of steps can be one step, two steps, or three steps, and these different values ​​are connected by "|||"; synonyms of one step include 1 step, one foot, one big step, and one small step, and these different synonyms with the same value are connected by "|"; at the same time, 1 small step is a synonym for one step, and 2 steps is a synonym for two steps. It can be seen that 1 small step and 2 steps are synonyms with different values, respectively, and they are connected by "|||".

[0060] It should be noted that if a value has no synonyms, the original value of the value can be directly filled in the corresponding synonym to avoid the situation where the "|||" connection is empty. For example, the word slot type is city, and its values ​​include: Guangzhou, London, and Shanghai. Among them, the synonyms of Guangzhou are Yangcheng, Suicheng, and Huacheng, London has no synonyms, and the synonyms of Shanghai are Modu, Shencheng, and Hushang. In the third table, the synonyms of the value of the word slot type city can be expressed as: Yangcheng|Suicheng|Huacheng|||London|||Modu|Shencheng|Hushang|||... In this way, the connection between synonyms of different values ​​in the same word slot type can be avoided as empty. In addition, if a word slot type has only one possible value and this value has no synonyms, the original value of the value can also be directly filled in the corresponding synonym.

[0061] As can be seen, the above three tables can be used to collect various expressions of control intent and the possible values ​​of each word slot. Based on these three tables, a simple sentence corpus can be generated. This simple sentence corpus includes multiple simple sentence corpora, each of which is annotated with the corresponding control intent and word slot. It can be understood that the control intent and word slot annotated for each simple sentence corpus are the label data.

[0062] As an example only, see Table 4 below:

[0063]

[0064] Table 4

[0065] Table 4 above provides an example of a simple sentence corpus collection. The first column contains the simple sentence corpus, which is obtained by combining the first, second, and third tables. The second column contains the control intent to which the simple sentence corpus belongs. The third column contains the slot type and start and end positions of the word slots in the simple sentence corpus, represented using a dictionary. The key value is the slot type, and the value is the start and end positions, which are represented using a list. For example, the slot annotation for the simple sentence corpus "Take a step forward" in Table 4 is {"steps":[3,4]}, where "steps" represents the slot type of the word slot contained in the simple sentence corpus, "3" indicates that the fourth word in the simple sentence corpus is the starting position of the value of steps, and "4" indicates that the fifth word in the simple sentence corpus is the ending position of the value of steps. It can be understood that the second column in Table 4 above is the annotation of the control intent, and the third column is the annotation of the word slot.

[0066] Note that in Table 4 above, the numbering starts with the first word of the corresponding corpus at position "0" as the basis for marking the start and end positions. Of course, in actual application scenarios, the numbering can also start with the first word of the corresponding corpus at position "1", and this is not limited here.

[0067] It should be noted that for simple sentence corpora that do not have word slot information, the word slot annotation can be empty, specifically represented by "{}".

[0068] To minimize the number of false negative examples identified by the sentence processing model, a special control intent, "none," or empty intent, was added when constructing the simple sentence corpus. Based on this, all intents that do not fall under any of the listed control intents can be classified as empty intent. For example, the intent to query the weather does not fall under any of the control intents listed in the first or second tables. Therefore, the simple sentence corpus collected under this intent, "What's the weather like in Beijing today?", falls under the empty intent. Obviously, the word slot associated with an empty intent must also be empty; that is, for simple sentence corpus that falls under an empty intent, its word slot must also be empty.

[0069] By constructing a simple sentence corpus set, a number of simple sentence corpora that meet the input format of the sentence processing model have been obtained. However, since simple sentences only contain one control intention, it is not possible to train a sentence processing model that can accurately recognize complex sentences based on the simple sentence corpus set. Based on this, in order to ensure the robot's ability to recognize complex sentences, it is necessary to further construct a complex sentence corpus set. Specifically, the simple sentence corpora in the simple sentence corpus set can be arranged to obtain a variety of possible arrangement results, and the simple sentence corpora can be spliced ​​based on the arrangement results, thereby obtaining multiple complex sentence corpora and constructing a corresponding complex sentence corpus set.

[0070] It's important to note that the simple sentence corpus set contains a large number of simple sentence corpora. In real life, even if a user inputs a complex sentence, the sentence will not be too long. Therefore, the number of simple sentence corpora contained in the simple sentence corpus set is defined as N. The operation of arranging the simple sentence corpora in the simple sentence corpus set can be specifically as follows: select M simple sentence corpora from the simple sentence corpus set and arrange them, where M = 2, ..., K, and K < N. The value of K can be set according to the specific application scenario.

[0071] It should be noted that when splicing simple sentence materials based on the arrangement results, conjunctions such as "again", "then" or "next" can be added with a certain probability to conform to general language expression habits; in addition, punctuation marks such as commas or periods can be added according to the position of the simple sentences in the complex sentences after splicing.

[0072] For example only, see Table 5 below.

[0073]

[0074] Table 5

[0075] Table 5 above gives an example of a complex sentence corpus collection. Among them, the first column is the complex sentence corpus obtained by arrangement and splicing; the second column is the control intention and start and end position of each simple sentence corpus in the complex sentence corpus. For example, the control intention annotation of the complex sentence corpus "Take a step forward and shake your hand." in Table 5 above is {"move_front":[0,4], "shake_hand":[7,9]}, where "move_front":[0,4] indicates that the first to fifth words of the complex sentence corpus show the control intention move_front, and "shake_hand":[7,9] indicates that the eighth to tenth words of the complex sentence corpus show the control intention shake_hand; the third column is the word slot type and start and end position of the word slot of each simple sentence corpus in the complex sentence corpus. For example, the word slot annotation of the complex sentence corpus "Take a step forward and shake your hand." in Table 5 above is {"steps":[3,4]}, where "steps":[3,4] indicates that the fourth to fifth words of the complex sentence corpus show the value of steps. It can be understood that the second column of Table 5 above is the annotation of the control intention, and the third column is the annotation of the word slot.

[0076] At this point, the construction of the simple sentence corpus and the complex sentence corpus has been completed. The preparation phase is over and we can enter the training phase.

[0077] During the training phase, corpus data from a simple sentence corpus and a complex sentence corpus can be mixed in a certain proportion based on actual application scenarios to obtain a training sample set. The model to be trained can then be trained based on this training sample set. If the training sample set has a small amount of data, the models to be trained may include the BERT model, the BiLSTM model, and the BiLSTM+CRF model; if the training sample set has a large amount of data, the models to be trained may include the BiLSTM model and the BiLSTM+CRF model. In other words, in the sentence processing model, the BiLSTM model and the BiLSTM+CRF model must be trained, while whether the BERT model is trained or not depends on the amount of data in the training sample set.

[0078] When training a sentence processing model, any piece of corpus data from the training sample set (which could be simple or complex sentences) can be input into the sentence processing model to obtain the model's predicted output during training. This predicted output is then compared with the standard output of the corpus data to obtain the loss of the sentence processing model. Based on this loss, the parameters of the model to be trained in the sentence processing model are optimized. It should be noted that in practice, batch training is typically employed. This involves training the sentence processing model using the corpus data from the training sample set in batches. The data size of each batch (i.e., batch size) can be adjusted based on the specific training situation. This process is repeated repeatedly to obtain a trained sentence processing model. It is understood that the standard output of any piece of corpus data can be generated based on the control intent and word slots that have been annotated for that piece of corpus data. To facilitate understanding, an example of the standard output of a piece of corpus data is provided below.

[0079]

[0080] Table 6

[0081] Table 6 shows the standard output for the corpus data set "Take a step forward, then shake your hand." This standard output shows that the corpus data set consists of two simple sentences: one is "Take a step forward," with a control intent of move_front and a slot of "one step," belonging to the slot type steps; the other is "Shake your hand," with a control intent of shake-hand and an empty slot.

[0082] It can be understood that the sentence processing model can be trained on other electronic devices and then deployed and transplanted to the smart device; alternatively, the sentence processing model can be trained directly on the smart device. There is no limitation here on the execution entity of the training model operation.

[0083] In some embodiments, based on the sentence processing model proposed above, step 102 can be specifically performed as follows: inputting the user sentence into the BERT model to obtain the semantic encoding vector of the user sentence; inputting the semantic encoding vector into the BiLSTM model and the BiLSTM+CRF model respectively to obtain the intent labeling results and the word slot labeling results; determining the control intent of the user sentence and the word slot corresponding to each control intent based on the intent labeling results and the word slot labeling results. That is, in actual application, the control intent contained in the user sentence and the corresponding word slot can be directly obtained through the trained sentence processing model. In this process, when the robot recognizes the user sentence, the multi-classification task of the control intent is transformed into a labeling task, which effectively reduces the processing flow when recognizing the user sentence and reduces the dependence on the punctuation labeling of the ASR.

[0084] In some embodiments, based on the classification of control intentions, step 103 may be specifically performed as follows:

[0085] For each first control intention of the user's sentence, a dialogue is conducted with the user based on a target sentence, wherein the type of the first control intention is an empty intention and the target sentence is a simple sentence corresponding to the first control intention in the user's sentence;

[0086] For each second control intention of the user statement, execute the target action, wherein the type of the second control intention is not an empty intention, and the target action is the action described by the second control intention and the word slot corresponding to the second control intention.

[0087] The definition of an empty intent has been previously explained. Generally speaking, when a user's statement has an empty intent, it indicates that the statement is a conversational statement (usually a casual chat) and generally cannot control the robot to perform a specific action. Furthermore, user statements can be simple or complex; that is, when recognizing a user statement, at least one control intent is identified. Considering that users are likely to insert control statements during a conversation (or dialogue statements during a control process), the robot will provide feedback for each control intent in the recognized user statement. Once the first control intent is present, it is known that the target sentence does not belong to any meaningful control intent, and the robot can therefore trigger the dialogue system to communicate with the user based on the target sentence. Similarly, once the second control intent is present, it is known that the user currently wishes to control the robot to perform a specific action (also known as the target action), and the robot can therefore trigger the action module associated with the target action to execute the target action.

[0088] In some embodiments, when applying the sentence processing model, a post-processing mechanism may be added after the sentence processing model. The post-processing mechanism is mainly used to coordinately correct the identified control intent and its corresponding word slot. Then, after step 102 and before step 103, the interactive method further includes:

[0089] For each control intention in the user's sentence, determine whether the control intention matches the word slot corresponding to the control intention;

[0090] If the control intention does not match the word slot corresponding to the control intention, the control intention or the word slot corresponding to the control intention is corrected so that the control intention matches the word slot corresponding to the control intention.

[0091] Generally speaking, the slot type associated with a certain control intent is fixed. For example, the slot type associated with move_front is steps. As shown in the second table, for the corpus belonging to the move_front control intent, there are only two possible slot results: one is that it contains no slots (that is, the slot is empty); the other is that the slot it contains is of the steps slot type. In other words, generally speaking, control intents can only correspond to specific slot types. Because slot recognition relies primarily on BiLSTM+CRF and control intent recognition primarily relies on BiLSTM, when the slot corresponding to a control intent obtained from the user sentence is not empty, the slot may not match the slot type associated with the control intent. In this case, it may be a control intent recognition error, or it may be a slot recognition error. Based on this, when the word slot corresponding to the identified control intent is not empty, if the second table determines that the control intent does not match the word slot (that is, the word slot does not belong to the word slot type associated with the control intent), the robot should correct the control intent or word slot of the user statement through the post-processing mechanism so that the control intent of the user statement matches the word slot corresponding to the control intent. It can be understood that the post-processing mechanism can ensure the coordination of the control intent involved in step 103 and the corresponding word slot, allowing the robot to better understand the user statement and provide effective feedback, thereby achieving reasonable interaction with the user.

[0092] As an example, the word slot type associated with "move-front" is "steps." When the sentence processing model recognizes "take two steps forward," it labels "two steps" as a word slot with the word slot type "hands" (that is, the word slot corresponding to "two" is labeled "B-hands," and the word slot corresponding to "steps" is labeled "I-hands"). It also identifies the control intent as "move-front." Through the above post-processing mechanism, it can be determined that the two (the control intent move-front and the word slot type hands associated with the word slot "two steps") do not match. At this point, the robot will perform corrective actions to eliminate the adverse consequences of misidentification.

[0093] As can be seen from the above, in the embodiment of the present application, the intent classification problem is converted into a sequence labeling problem to solve the problem of identifying the intent and word slots of complex sentences, while avoiding lengthy processing procedures and effectively improving the accuracy of sentence recognition. Specifically, the sequence labeling problem only relies on a sentence processing model; that is, the smart device can quickly identify the intent and word slots of complex sentences only by relying on the output of the sentence processing model. The processing flow of the sentence processing model is simple and the recognition accuracy is high. At the same time, the recognition of intent and slots can have a certain degree of synergy and does not rely on the recognition effect of other models (such as ASR).

[0094] Corresponding to the interaction method provided above, the embodiment of the present application also provides an interaction device. Figure 3 As shown, the interactive device 300 includes:

[0095] Acquisition module 301, used to acquire user statements;

[0096] Processing module 301 is used to process the user sentence based on sequence labeling to obtain the control intent of the user sentence and the word slot corresponding to each control intent;

[0097] The feedback module 303 is used to provide feedback to the user's sentence based on the control intention and the word slot to achieve interaction with the user.

[0098] In some embodiments, the processing module 301 includes:

[0099] A first processing unit is configured to input the user sentence into the BERT model to obtain a semantic encoding vector of the user sentence;

[0100] The second processing unit is used to input the semantic encoding vector into the BiLSTM model and the BiLSTM+CRF model respectively to obtain the intent labeling results and the word slot labeling results;

[0101] The result determination unit is used to determine the control intent of the user sentence and the word slot corresponding to each control intent based on the intention labeling result and the word slot labeling result.

[0102] In some embodiments, the interactive device further includes a training module, the training module including:

[0103] The first construction unit is used to construct a simple sentence corpus set, where the simple sentence corpus set includes multiple simple sentence corpora, and each simple sentence corpus is annotated with a control intention and a word slot;

[0104] a second construction unit, configured to construct a complex sentence corpus set by arranging the simple sentence corpora in the simple sentence corpus set, wherein the complex sentence corpus set includes a plurality of complex sentence corpora, each complex sentence corpus is composed of at least two simple sentence corpora, and each complex sentence corpus is annotated with a control intent and a word slot;

[0105] The training unit is used to train the model to be trained based on the simple sentence corpus set and the complex sentence corpus set, where the model to be trained is a BERT model, a BiLSTM model, and a BiLSTM+CRF model, or the model to be trained is a BiLSTM model and a BiLSTM+CRF model.

[0106] In some embodiments, the first building block comprises:

[0107] A table acquisition subunit is used to acquire a first table, a second table, and a third table, wherein the first table is used to list possible expression sample data of each control intent, the second table is used to list the word slot types associated with each control intent, and the third table is used to list possible values ​​of each word slot type;

[0108] The set construction subunit is used to construct a simple sentence corpus set according to the first table, the second table and the second table.

[0109] In some embodiments, the feedback module 303 includes:

[0110] a dialogue unit, configured to dialogue with the user according to a target sentence for each first control intention in the user's sentence, wherein the type of the first control intention is an empty intention and the target sentence is a simple sentence corresponding to the first control intention in the user's sentence;

[0111] An execution unit is used to execute a target action for each second control intention of a user statement, wherein the type of the second control intention is not an empty intention, and the target action is the action described by the second control intention and the word slot corresponding to the second control intention.

[0112] In some embodiments, the interactive device 300 further includes:

[0113] A judgment module, configured to judge, for each control intent in the user sentence, whether the control intent matches the word slot corresponding to the control intent before the feedback module 303 provides feedback on the user sentence based on the control intent and the word slot;

[0114] The correction module is used to correct the control intent or the word slot corresponding to the control intent if the control intent does not match the word slot corresponding to the control intent, so that the control intent matches the word slot corresponding to the control intent.

[0115] As can be seen from the above, in the embodiment of the present application, the intent classification problem is converted into a sequence labeling problem to solve the problem of identifying the intent and word slots of complex sentences, while avoiding lengthy processing procedures and effectively improving the accuracy of sentence recognition. Specifically, the sequence labeling problem only relies on a sentence processing model; that is, the smart device can quickly identify the intent and word slots of complex sentences only by relying on the output of the sentence processing model. The processing flow of the sentence processing model is simple and the recognition accuracy is high. At the same time, the recognition of intent and slots can have a certain degree of synergy and does not rely on the recognition effect of other models (such as ASR).

[0116] Corresponding to the interaction method provided above, the embodiment of the present application also provides a smart device. As an example only, the smart device can be a robot, a smart phone, a tablet computer, a smart TV or a car console, etc., which is not limited here. Figure 4The smart device 4 in the embodiment of the present application includes: a memory 401, one or more processors 402 ( Figure 4 Only one is shown) and a computer program stored in memory 401 and executable on the processor. Memory 401 is used to store software programs and units. Processor 402 executes the software programs and units stored in memory 401 to perform various functional applications and data processing to obtain resources corresponding to the above-mentioned preset events. Specifically, when processor 402 executes the above-mentioned computer program stored in memory 401, it implements the following steps:

[0117] Get user statements;

[0118] Process the user's sentence based on sequence tagging to obtain the control intent of the user's sentence and the word slot corresponding to each control intent;

[0119] Feedback is provided to user statements based on control intent and word slots to achieve interaction with the user.

[0120] Assuming that the above is the first possible implementation, in the second possible implementation provided on the basis of the first possible implementation, the user sentence is processed based on a sequence tagging method to obtain the control intent of the user sentence and the word slot corresponding to each control intent, including:

[0121] Input the user sentence into the BERT model to obtain the semantic encoding vector of the user sentence;

[0122] The semantic encoding vectors are input into the BiLSTM model and the BiLSTM+CRF model respectively to obtain the intent tagging results and the word slot tagging results;

[0123] The control intent of the user's sentence and the word slot corresponding to each control intent are determined based on the intention labeling results and the word slot labeling results.

[0124] In a third possible implementation provided as a basis for the first possible implementation, the processor 402 further implements the following steps when running the computer program stored in the memory 401:

[0125] Construct a simple sentence corpus collection, which includes multiple simple sentence corpora, and each simple sentence corpus is annotated with control intent and word slots;

[0126] By arranging the simple sentence corpora in the simple sentence corpus set, a complex sentence corpus set is constructed. The complex sentence corpus set includes multiple complex sentence corpora, each complex sentence corpus is composed of at least two simple sentence corpora, and each complex sentence corpus is annotated with control intent and word slots;

[0127] The model to be trained is trained according to the simple sentence corpus set and the complex sentence corpus set. The model to be trained is a BERT model, a BiLSTM model, and a BiLSTM+CRF model, or the model to be trained is a BiLSTM model and a BiLSTM+CRF model.

[0128] In a fourth possible implementation provided on the basis of the third possible implementation, a simple sentence corpus set is constructed, including:

[0129] Obtain a first table, a second table, and a third table, wherein the first table is used to list possible expression sample data for each control intent, the second table is used to list the word slot types associated with each control intent, and the third table is used to list possible values ​​for each word slot type;

[0130] Construct a simple sentence corpus according to the first table, the second table, and the third table.

[0131] In a fifth possible implementation provided on the basis of the first possible implementation, providing feedback on user sentences based on control intent and word slots includes:

[0132] For each first control intention of the user's sentence, a dialogue is conducted with the user based on a target sentence, wherein the type of the first control intention is an empty intention and the target sentence is a simple sentence corresponding to the first control intention in the user's sentence;

[0133] For each second control intention of the user statement, execute the target action, wherein the type of the second control intention is not an empty intention, and the target action is the action described by the second control intention and the word slot corresponding to the second control intention.

[0134] In a sixth possible implementation provided on the basis of the first possible implementation, or the second possible implementation, or the third possible implementation, or the fourth possible implementation, or the fifth possible implementation, before providing feedback on the user sentence according to the control intention and the word slot, the processor 402 further implements the following steps when running the computer program stored in the memory 401:

[0135] For each control intention in the user's sentence, determine whether the control intention matches the word slot corresponding to the control intention;

[0136] If the control intention does not match the word slot corresponding to the control intention, the control intention or the word slot corresponding to the control intention is corrected so that the control intention matches the word slot corresponding to the control intention.

[0137] It should be understood that in the embodiment of the present application, the processor 402 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0138] The memory 401 may include a read-only memory and a random access memory, and provides instructions and data to the processor 402. A portion or all of the memory 401 may also include a non-volatile random access memory. For example, the memory 401 may also store device category information.

[0139] As can be seen from the above, in the embodiment of the present application, the intent classification problem is converted into a sequence labeling problem to solve the problem of identifying the intent and word slots of complex sentences, while avoiding lengthy processing procedures and effectively improving the accuracy of sentence recognition. Specifically, the sequence labeling problem only relies on a sentence processing model; that is, the smart device can quickly identify the intent and word slots of complex sentences only by relying on the output of the sentence processing model. The processing flow of the sentence processing model is simple and the recognition accuracy is high. At the same time, the recognition of intent and slots can have a certain degree of synergy and does not rely on the recognition effect of other models (such as ASR).

[0140] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0141] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0142] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of external device software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0143] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0144] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the associated hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The above-mentioned computer-readable storage medium may include: any entity or device that can carry the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer-readable memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the above-mentioned computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable storage media does not include electrical carrier signals and telecommunication signals.

[0146] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. An interactive method, characterized in that: include: Get user statements; The user sentence is processed in a model-based sequence labeling manner to obtain the control intent of the user sentence and the word slot corresponding to each control intent, including: inputting the user sentence into a BERT model to obtain a semantic encoding vector of the user sentence; inputting the semantic encoding vector into a BiLSTM model and a BiLSTM+CRF model respectively to obtain an intent labeling result and a word slot labeling result, wherein the intent labeling result and the word slot labeling result both use the BIO labeling format; determining the control intent of the user sentence and the word slot corresponding to each control intent based on the intent labeling result and the word slot labeling result; wherein the word slot is used to indicate the expected execution degree of the corresponding control intent, or to indicate the application object of the corresponding control intent, and the number of word slots corresponding to each identified control intent is at least 0; Providing feedback on the user's sentence according to the control intention and the word slot to achieve interaction with the user; The training process of the model includes: Constructing a simple sentence corpus set, wherein the simple sentence corpus set includes a plurality of simple sentence corpora, and each simple sentence corpus is annotated with a control intent and a word slot; Constructing a complex sentence corpus set by arranging the simple sentence corpora in the simple sentence corpus set, wherein the complex sentence corpus set includes a plurality of complex sentence corpora, each complex sentence corpus is composed of at least two simple sentence corpora, and each complex sentence corpus is annotated with a control intent and a word slot; The model to be trained is trained according to the simple sentence corpus set and the complex sentence corpus set.

2. The interactive method according to claim 1, wherein: The interaction method further includes: The model to be trained is a BERT model, a BiLSTM model, and a BiLSTM+CRF model, or the model to be trained is a BiLSTM model and a BiLSTM+CRF model.

3. The interactive method according to claim 1, wherein: The construction of a simple sentence corpus collection includes: Obtain a first table, a second table, and a third table, wherein the first table is used to list possible expression sample data for each control intent, the second table is used to list the word slot types associated with each control intent, and the third table is used to list possible values ​​for each word slot type; The simple sentence corpus set is constructed according to the first table, the second table and the second table.

4. The interactive method according to claim 1, wherein: Providing feedback on the user sentence according to the control intention and the word slot includes: For each first control intention of the user sentence, dialogue with the user according to a target sentence, wherein the type of the first control intention is an empty intention, and the target sentence is a simple sentence corresponding to the first control intention in the user sentence; For each second control intention of the user statement, execute the target action, wherein the type of the second control intention is not an empty intention, and the target action is the action described by the second control intention and the word slot corresponding to the second control intention.

5. The interactive method according to any one of claims 1 to 4, characterized in that: Before providing feedback to the user statement according to the control intention and the word slot, the interaction method further includes: For each control intention in the user sentence, determining whether the control intention matches a word slot corresponding to the control intention; If the control intention does not match the word slot corresponding to the control intention, the control intention or the word slot corresponding to the control intention is corrected so that the control intention matches the word slot corresponding to the control intention.

6. An interactive device, characterized in that: include: Acquisition module, used to obtain user statements; a processing module, configured to process the user statement using a model-based sequence labeling method to obtain a control intent of the user statement and a word slot corresponding to each control intent; wherein the word slot is used to indicate an expected execution degree of the corresponding control intent, or to indicate an object to which the corresponding control intent is applied, and the number of word slots corresponding to each identified control intent is at least 0; A feedback module, configured to provide feedback to the user's statement based on the control intention and the word slot to achieve interaction with the user; Wherein, the processing module includes: A first processing unit, configured to input the user sentence into a BERT model to obtain a semantic encoding vector of the user sentence; A second processing unit is configured to input the semantic encoding vector into a BiLSTM model and a BiLSTM+CRF model respectively to obtain an intent tagging result and a word slot tagging result, wherein the intent tagging result and the word slot tagging result both use a BIO tagging format; A result determination unit, configured to determine the control intent of the user sentence and the word slot corresponding to each control intent based on the intention labeling result and the word slot labeling result; The interactive device further includes a training module, which includes: A first construction unit is configured to construct a simple sentence corpus set, wherein the simple sentence corpus set includes a plurality of simple sentence corpora, and each simple sentence corpus is annotated with a control intent and a word slot; a second construction unit, configured to construct a complex sentence corpus set by arranging simple sentence corpora in the simple sentence corpus set, wherein the complex sentence corpus set includes a plurality of complex sentence corpora, each complex sentence corpus is composed of at least two simple sentence corpora, and each complex sentence corpus is annotated with a control intent and a word slot; A training unit is used to train the model to be trained based on the simple sentence corpus set and the complex sentence corpus set.

7. An intelligent device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Interactive knowledge feedback method and device and computer storage medium

    CN112380332A