Intent recognition method, intent recognition model training method, device and equipment
By obtaining and inputting the node data of the intention recognition model, the problem of inaccurate intentions in the intention recognition process is solved, ensuring the logical consistency and recognition accuracy of the business process.
Patent Information
- Application Number
- CN202110465878.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-28
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-04-28
AI Technical Summary
During the intent recognition process, it is difficult for the existing technology to accurately identify whether the data to be identified represents the intent of a specific node, resulting in business process logic conflicts and low recognition accuracy.
By obtaining the data to be identified and the node data where the current business process is located, the intent recognition model is input to generate intent recognition results, and the intent recognition range is divided based on the node data to ensure the accuracy of the recognition results.
It achieves accurate judgment on whether the data to be identified represents the intention of a specific node, avoids business process reversal and improves identification accuracy, and prevents the data to be identified from corresponding to multiple node intentions at the same time.
Smart Images

Figure CN113515594B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intent recognition, and in particular to an intent recognition method, an intent recognition device, an intent recognition model training method, an intent recognition model training device, an electronic device, and a computer-readable storage medium. Background Art
[0002] Intent recognition can also be called intent detection, which is used to determine which operation in which field the input information is used to perform. Its essence belongs to the problem of multi-classification. In actual use, business processes usually have multiple nodes, and each node corresponds to multiple intents. When related technologies perform intent recognition, the intent recognition model can recognize all intents corresponding to all nodes. Therefore, when the business process runs to a certain node, the input information may correspond to the intent of other nodes. In this case, it will cause problems in the reversal of the business process, which will cause conflicts in the business process logic and other problems, and it cannot be executed normally. Summary of the invention
[0003] In view of this, the purpose of the present application is to provide an intention recognition method, an intention recognition device, an intention recognition model training method, an intention recognition model training device, an electronic device and a readable storage medium. Since the acquired node data divides the intention recognition range of each node, intention recognition is performed based on the node data. It is possible to accurately determine whether the data to be identified represents a certain intention corresponding to the node data, and then accurately determine the operations that need to be performed in the current node.
[0004] In order to solve the above technical problems, in the first aspect, the present application provides an intention recognition method, which specifically includes:
[0005] Obtain the data to be identified and the node data of the current business process;
[0006] Inputting the data to be identified and the node data into an intention recognition model to obtain an intention recognition result corresponding to the node data;
[0007] Execute the target operation corresponding to the intention recognition result.
[0008] In a feasible implementation manner, the obtaining of the data to be identified and the node data where the current business process is located includes:
[0009] Obtaining initial data to be identified and initial node data;
[0010] Feature encoding is performed on the initial data to be identified and the initial node data respectively to obtain the data to be identified and the node data.
[0011] In a feasible implementation manner, the obtaining of the data to be identified and the node data where the current business process is located includes:
[0012] Acquire the speech to be tested, and perform speech-to-text recognition processing on the speech to be tested to obtain the data to be recognized;
[0013] Query the current business process progress and obtain the node data.
[0014] In a feasible implementation manner, the performing speech-to-text recognition processing on the speech to be tested to obtain the data to be recognized includes:
[0015] Performing speech-to-text conversion on the speech to be tested to obtain initial data;
[0016] The initial data is subjected to keyword extraction or invalid information filtering processing to obtain the data to be identified.
[0017] In a second aspect, the present application also provides an intent recognition model training method for generating the above-mentioned intent recognition model, the intent recognition model training method comprising:
[0018] Acquire training data, wherein the training data includes training intention data and training node data;
[0019] The initial model is trained using the training data to obtain an intent recognition model.
[0020] In a feasible implementation manner, the obtaining of training data includes:
[0021] Obtain multiple training intention data and multiple training node data;
[0022] Using each of the training intention data and each of the training node data to form a plurality of initial training data;
[0023] Setting a category label corresponding to the training intention data for the positive initial training data, and setting a negative label for the negative initial training data, to obtain the training data;
[0024] The positive initial training data is the initial training data in which the training intention data matches the training node data; the negative initial training data is the initial training data in which the training intention data does not match the training node data.
[0025] In a feasible implementation manner, the initial model is a tree model.
[0026] In a third aspect, the present application also provides an intention recognition device, comprising:
[0027] The module for acquiring data to be identified is used to acquire the data to be identified and the node data of the current business process;
[0028] An identification module, used for inputting the data to be identified and the node data into an intention identification model to obtain an intention identification result corresponding to the node data;
[0029] An execution module is used to execute the target operation corresponding to the intention recognition result.
[0030] In a fourth aspect, the present application also provides an intent recognition model training device, comprising:
[0031] A training data acquisition module, used to acquire training data, wherein the training data includes training intention data and training node data;
[0032] The training module is used to train the initial model using the training data to obtain an intent recognition model.
[0033] In a fifth aspect, the present application further provides an electronic device, including a memory and a processor, wherein:
[0034] The memory is used to store the computer program;
[0035] The processor is used to execute the computer program to implement the above-mentioned intention recognition method and / or the above-mentioned intention recognition model training method.
[0036] In a sixth aspect, the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned intent recognition method and / or the above-mentioned intent recognition model training method.
[0037] The intent recognition method provided in the present application obtains the data to be recognized and the node data of the current business process; inputs the data to be recognized and the node data into the intent recognition model to obtain the intent recognition result corresponding to the node data; and executes the target operation corresponding to the intent recognition result.
[0038] It can be seen that when the method recognizes the intent, it is necessary not only to obtain the data to be recognized, but also to obtain the node data. The node data can represent the running position of the current business process, and can also represent the intent corresponding to the node. By inputting the data to be recognized and the node data into the intent recognition model, the intent recognition result corresponding to the node data can be obtained. The intent recognition model can not only recognize whether the data to be recognized represents a certain intent, but also recognize whether the data to be recognized represents a certain intent corresponding to the node data based on the node data, and whether the data to be recognized represents a certain intent corresponding to the node data through the intent recognition result. After obtaining the intent recognition result, the corresponding specific operation, that is, the target operation, can be performed according to the specific content of the intent recognition result. Since the acquired node data divides the intent recognition range of each node, the intent recognition based on the node data can accurately determine whether the data to be recognized represents a certain intent corresponding to the node data, obtain an accurate intent recognition result, and then accurately determine the operation to be performed in the case of the current node. Even if the data to be recognized corresponds to the intent of other nodes, it can be determined that it does not represent any intent corresponding to the node data, so it will not turn to execute the process corresponding to the data to be recognized, so as to prevent problems in the reversal of the business process. At the same time, by limiting the scope of intent recognition, it is possible to avoid the situation where the data to be identified corresponds to multiple intents of multiple nodes at the same time, thereby improving the recognition accuracy of the model.
[0039] In addition, the present application also provides an intent recognition device, an intent recognition model training method, an intent recognition model training device, an electronic device and a computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0041] Figure 1 A flow chart of an intent recognition method provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of a specific intent recognition process provided in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of the structure of an intention recognition device provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of the structure of an intention recognition device provided in an embodiment of the present application;
[0045] Figure 5 A schematic diagram of a hardware composition framework applicable to an intent recognition method provided in an embodiment of the present application;
[0046] Figure 6 A schematic diagram of a hardware composition framework applicable to another intent recognition method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] When performing intent recognition in the related technology, the intent recognition model used can recognize all intents corresponding to all nodes in the business process. Therefore, when the business process runs to a certain node, the input information may correspond to the intent of other nodes. In this case, it will cause problems in the business process reversal. For example, when the business process is to confirm identity-confirm time-confirm item-confirm address, it includes 3 nodes in total, and each node may correspond to multiple intents. When it is at the confirmed time, if the input information is "need to modify the address", it belongs to an intent corresponding to the confirm address node. In this case, the intent recognition model can accurately identify its intent, but the intent does not belong to the intent corresponding to the confirm time node, so it will cause problems in the business process reversal. For example, directly entering the confirm address node and modifying the address will cause the business process to skip the confirm item node. At the same time, the input information may correspond to multiple intents of multiple nodes at the same time. For example, when the input information is "need to be modified", it can correspond to the intent of modifying the time of the confirm time node and the intent of modifying the address of the confirm address node. In this case, the recognized intent may be to modify the address, resulting in poor recognition accuracy.
[0049] In order to solve the above problems, this application provides an intention recognition method. Figure 1 , Figure 1 A flow chart of an intention recognition method provided in an embodiment of the present application. The method includes:
[0050] S101: Obtain the data to be identified and the node data of the current business process.
[0051] The data to be identified is the data that needs to be identified for intent, and its data format is not limited. For example, when the intent recognition model does not have a feature encoding part, the data to be identified can be data obtained after feature encoding; in another embodiment, the data to be identified can be text data after speech-to-text conversion, or it can be audio data. The specific method for obtaining the data to be identified is not limited, and the method for obtaining the data to be identified can be different depending on the data format of the data to be identified. For example, the audio to be identified can be obtained through an audio receiving device, or the data to be identified can be extracted from data sent by other electronic devices.
[0052] Node data is used to represent the data of the node where the business process is currently located. Since different nodes have different intent recognition ranges, by obtaining node data, when intent recognition is performed based on node data in the future, the intent recognition result can be obtained by integrating node data. Similar to the data to be recognized, the data format of node data is also not limited, and its specific data format can be the same as or different from the data to be recognized.
[0053] S102: Input the data to be identified and the node data into the intention recognition model to obtain the intention recognition result corresponding to the node data.
[0054] After obtaining the data to be identified and the node data, they are input into the intent recognition model so that the intent recognition model can be used to generate the intent recognition result. The intent recognition model is trained in advance, and its type and model architecture are not limited. When generating the intent recognition result, the intent recognition model is not only based on the data to be identified, but also on the node data. Therefore, the intent recognition result obtained is the result corresponding to the node data, which can indicate whether the data to be identified indicates any intention corresponding to the node data. Similarly, taking the business process of confirming identity-confirming time-confirming items-confirming address as an example, the node data corresponds to the confirmation time, and the intention corresponding to the node is modification time, non-modification time and other. If the data to be identified is "need to modify the address", the intention it indicates is to modify the address, but when the node data limits the scope of intent recognition, the data to be identified does not match the two intentions of modification time and non-modification time, but matches other such intentions. Therefore, the intent recognition result is other, not modification address.
[0055] S103: Execute the target operation corresponding to the intention recognition result.
[0056] After obtaining the intention recognition result, the corresponding target operation is performed according to the intention recognition result to continue the business process. Depending on the intention recognition result, the specific content of the target operation may also be different, which is not limited in this embodiment and can be set as needed.
[0057] When the intention recognition method provided by the embodiment of the present application is applied, when the intention is recognized, not only the data to be recognized is obtained, but also the node data is obtained. The node data can represent the running position of the current business process, and can also represent the intention corresponding to the node. By inputting the data to be recognized and the node data into the intention recognition model, the intention recognition result corresponding to the node data can be obtained. The intention recognition model can not only recognize whether the data to be recognized represents a certain intention, but also recognize whether the data to be recognized represents a certain intention corresponding to the node data based on the node data, and whether the data to be recognized represents a certain intention corresponding to the node data through the intention recognition result. After obtaining the intention recognition result, the corresponding specific operation, i.e., the target operation, can be performed according to the specific content of the intention recognition result. Since the acquired node data divides the intention recognition range of each node, the intention recognition based on the node data can accurately determine whether the data to be recognized represents a certain intention corresponding to the node data, obtain an accurate intention recognition result, and then accurately determine the operation to be performed in the case of the current node. Even if the data to be recognized corresponds to the intention of other nodes, it can be determined that it does not represent any intention corresponding to the node data, so it will not turn to execute the process corresponding to the data to be recognized, so as to prevent problems in the business process reversal. At the same time, by limiting the scope of intent recognition, it is possible to avoid the situation where the data to be identified corresponds to multiple intents of multiple nodes at the same time, thereby improving the recognition accuracy of the model.
[0058] Based on the above embodiment, this embodiment will specifically describe several steps in the above embodiment. In one embodiment, the intent recognition model does not have a feature encoding part, and is specifically a classification model. In this case, the process of obtaining the data to be recognized and the node data may include:
[0059] Step 11: Obtain initial data to be identified and initial node data.
[0060] In this embodiment, the initial data to be identified and the initial node data are raw data that has not been encoded, which may be audio data or text data. The initial data to be identified and the initial node data may be obtained in the same manner, such as both being input from the outside, or may be obtained in different manners, which is not limited in this embodiment.
[0061] Step 12: Feature encode the initial data to be identified and the initial node data respectively to obtain the data to be identified and the node data.
[0062] The encoding methods of the initial data to be identified and the initial node data may be the same or different. In one embodiment, the BERT (Bidirectional Encoder Representations from Transformers) model may be used to encode the initial data to be identified to obtain the data to be identified. The data to be identified may be encoded using BertAsService, i.e., a feature vector obtained based on the BERT model. The BERT model is a pre-trained language model. For the initial node data, since each node in the business process is discrete, a One-Hot encoding method may be used to perform feature encoding on it. One-Hot encoding, also known as one-bit valid encoding, uses an N-bit state register to encode N states. Each state has an independent register bit, and only one bit is valid at any time. Through feature encoding, the data to be identified and the node data can be obtained.
[0063] Based on the above embodiments, in application scenarios such as intelligent outbound call scenarios or customer service scenarios, the initial data is usually data in audio format. In this case, in order to identify the meaning corresponding to the audio, it can be processed by voice text recognition to obtain the corresponding text data, and the text data is used as the data to be identified. Specifically, the process of obtaining the data to be identified and the node data may include the following steps:
[0064] Step 21: Acquire the speech to be tested, and perform speech-to-text recognition processing on the speech to be tested to obtain data to be recognized.
[0065] Through speech-to-text recognition processing, the speech to be tested can be converted into data to be recognized in the form of text, so as to subsequently recognize the intention therein. This embodiment does not limit the specific process of speech-to-text recognition processing. For example, text recognition can be directly performed on the speech to be tested to obtain the corresponding data to be recognized; in another embodiment, the speech to be tested can be recognized first to obtain a recognition result, and the recognition result can be processed by data filtering, sentence structure adjustment, etc., and the processed result can be determined as the data to be recognized.
[0066] Step 22: Query the current business process progress and obtain node data.
[0067] In this embodiment, in order to ensure the accuracy of node data, it is not necessary to obtain node data from the outside, but directly query the progress of the current business process, and obtain corresponding node data based on the progress. This embodiment does not limit the specific process and method of querying progress, and reference may be made to related technologies.
[0068] Furthermore, in order to improve the accuracy of the intention recognition result, in one embodiment, invalid data can be filtered during the speech-to-text recognition process. Specifically, the speech to be tested is subjected to speech-to-text recognition processing to obtain the data to be recognized, including:
[0069] Step 31: Perform speech-to-text conversion on the speech to be tested to obtain initial data.
[0070] Speech-to-text conversion is used to convert the speech to be tested into initial data in text format.
[0071] Step 32: Perform keyword extraction or invalid information filtering on the initial data to obtain data to be identified.
[0072] In this embodiment, keywords in the initial data can be extracted and the keywords can be used to form the data to be identified, or invalid information in the initial data can be filtered and the remaining data can be used to form the data to be identified. Keywords and invalid information can be set as needed, and their specific contents are not limited in this embodiment. Through keyword extraction or invalid information filtering, the content in the initial data that is not conducive to intent identification can be deleted to obtain data to be identified with valid information.
[0073] Based on the above embodiments, it can be understood that before using the intent recognition model to perform intent recognition, it is necessary to generate a corresponding intent recognition model. The generation process of the intent recognition model may specifically include the following steps:
[0074] Step 41: Obtain training data;
[0075] It should be noted that the training data in this embodiment includes training intention data and training node data. This embodiment does not limit the specific method of obtaining training data, for example, external input training data can be obtained, such as obtaining training data from the cloud, external storage medium or other electronic devices.
[0076] Specifically, in a feasible implementation, training data may be constructed locally. In this case, the process of obtaining training data may specifically include the following steps:
[0077] Step 51: Obtain multiple training intention data and multiple training node data.
[0078] It is understandable that in order to comprehensively train the intent recognition model, the training node data needs to cover each node of the business process, and the training intent data covers all intents corresponding to all nodes.
[0079] Step 52: Utilize each training intention data and each training node data to form a plurality of initial training data.
[0080] By combining the training intention data and the training node data, multiple initial training data can be obtained, including the case where the training intention data matches the training node data and the case where the two do not match.
[0081] Step 53: Set the category label corresponding to the training intention data for the positive initial training data, and set the negative label for the negative initial training data to obtain the training data.
[0082] Among them, the positive initial training data is the initial training data in which the training intent data matches the training node data, and the negative initial training data is the initial training data in which the training intent data does not match the training node data. By setting a negative label for the negative initial training data, the model can learn any training intent data that does not correspond to the training node data, so that after the training is completed, the intent of the data to be identified can be identified based on the node data.
[0083] Step 42: Use the training data to train the initial model to obtain an intent recognition model.
[0084] The initial model is a model that has not been trained. It should be noted that since the training node data is a strong feature, its role is to limit the scope of intent recognition. In ordinary deep learning models, the training node data may be overwhelmed, resulting in poor results in the trained intent recognition model. To solve this problem, a tree model can be used as the initial model, such as the xgboost tree model.
[0085] Please refer to Figure 2 , Figure 2A schematic diagram of a specific intent recognition process provided for an embodiment of the present application. Among them, the Xgboost model is a classification model, which can be used alone as an intent recognition model, or can be used together with the BERT model to form an intent recognition model. The BERT model is used to extract text features, and the text sentence vector corresponding to the data to be recognized is obtained by obtaining BertAsService, that is, sentence embedding, and the dimension of the text sentence vector is the default 768 dimensions. At the same time, node information extraction can be performed. Since the nodes are discrete, one-hot encoding is adopted, and the feature dimension is consistent with the number of nodes. For example, there are 5 nodes in total, so the dimension of the node feature is 5. If it is the first node, the node feature can be expressed as (1, 0, 0, 0, 0). If it is the second node, it can be expressed as (0, 1, 0, 0, 0), and other nodes are similar. By One Hot encoding the node information, the node feature can be obtained. Finally, the text sentence vector and the node feature are spliced. After splicing, the feature dimension is 768 + the number of nodes. At this point, the complete feature construction is completed. By inputting the complete features into the Xgboost model, the intent recognition result can be obtained, and then the corresponding target operation can be performed according to the intent recognition result.
[0086] The intention recognition device provided in an embodiment of the present application is introduced below. The intention recognition device described below and the intention recognition method described above can be referenced to each other.
[0087] Please refer to Figure 3 , Figure 3 A schematic diagram of the structure of an intention recognition device provided in an embodiment of the present application includes:
[0088] The to-be-identified data acquisition module 110 is used to acquire the to-be-identified data and the node data of the current business process;
[0089] The recognition module 120 is used to input the data to be recognized and the node data into the intention recognition model to obtain the intention recognition result corresponding to the node data;
[0090] The execution module 130 is used to execute the target operation corresponding to the intention recognition result.
[0091] Optionally, the to-be-identified data acquisition module 110 includes:
[0092] An acquisition unit, used for acquiring initial data to be identified and initial node data;
[0093] The encoding unit is used to perform feature encoding on the initial data to be identified and the initial node data respectively to obtain the data to be identified and the node data.
[0094] Optionally, the to-be-identified data acquisition module 110 includes:
[0095] The speech recognition unit is used to obtain the speech to be tested and perform speech-to-text recognition processing on the speech to be tested to obtain data to be recognized;
[0096] The query unit is used to query the current business process progress and obtain node data.
[0097] Optionally, the speech recognition unit comprises:
[0098] The conversion subunit is used to convert the speech to be tested into text to obtain initial data;
[0099] The information extraction subunit is used to perform keyword extraction or invalid information filtering on the initial data to obtain the data to be identified.
[0100] The intention recognition device provided in an embodiment of the present application is introduced below. The intention recognition device described below and the intention recognition method described above can be referenced to each other.
[0101] Please refer to Figure 4 , Figure 4 A schematic diagram of the structure of an intention recognition device provided in an embodiment of the present application includes:
[0102] A training data acquisition module 210 is used to acquire training data, where the training data includes training intent data and training node data;
[0103] The training module 220 is used to train the initial model using the training data to obtain an intent recognition model.
[0104] Optionally, the training data acquisition module 210 includes:
[0105] An acquisition unit, used for acquiring a plurality of training intention data and a plurality of training node data;
[0106] A combining unit, used to respectively use each training intention data and each training node data to form a plurality of initial training data;
[0107] A labeling unit, used to set a category label corresponding to the training intention data for the positive initial training data, and to set a negative label for the negative initial training data, to obtain training data;
[0108] Among them, the positive initial training data is the initial training data in which the training intention data matches the training node data; the negative initial training data is the initial training data in which the training intention data does not match the training node data.
[0109] The electronic device provided in the embodiment of the present application is introduced below. The electronic device described below and the intention recognition method described above can be referenced to each other.
[0110] Please refer to Figure 5 , Figure 5 A schematic diagram of a hardware composition framework applicable to an intent recognition method provided in an embodiment of the present application. The electronic device 100 may include a processor 101 and a memory 102, and may further include one or more of a multimedia component 103, an information input / information output (I / O) interface 104, and a communication component 105.
[0111] Among them, the processor 101 is used to control the overall operation of the electronic device 100 to complete all or part of the steps in the above-mentioned intention recognition method; the memory 102 is used to store various types of data to support the operation of the electronic device 100, and these data may include, for example, instructions for any application or method used to operate on the electronic device 100, and application-related data. The memory 102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), programmable read-only memory (Programmable Read-Only Memory, PROM), read-only memory (Read-Only Memory, ROM), magnetic memory, flash memory, magnetic disk or optical disk. In this embodiment, the memory 102 stores at least programs and / or data for implementing the following functions:
[0112] Obtain the data to be identified and the node data of the current business process;
[0113] Inputting the data to be identified and the node data into an intention recognition model to obtain an intention recognition result corresponding to the node data;
[0114] Execute the target operation corresponding to the intention recognition result.
[0115] and / or,
[0116] Acquire training data; the training data includes training intention data and training node data;
[0117] The initial model is trained using the training data to obtain an intent recognition model.
[0118] The multimedia component 103 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 102 or sent through the communication component 105. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 104 provides an interface between the processor 101 and other interface modules, and the above-mentioned other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 105 is used for wired or wireless communication between the electronic device 100 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 105 may include: Wi-Fi components, Bluetooth components, NFC components.
[0119] The electronic device 100 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the intention recognition method given in the above embodiment.
[0120] certainly, Figure 5 The structure of the electronic device 100 shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device 100 may include Figure 5 More or fewer components than shown, or combinations of certain components.
[0121] It is understandable that the number of electronic devices is not limited in the embodiments of the present application, and multiple electronic devices may work together to complete the intention recognition method. Figure 6 , Figure 6A schematic diagram of a hardware composition framework applicable to another intent recognition method provided in an embodiment of the present application. Figure 6 It can be known that the hardware composition framework may include: a first electronic device 11 and a second electronic device 12 , which are connected via a network 13 .
[0122] In the embodiment of the present application, the hardware structure of the first electronic device 11 and the second electronic device 12 can refer to Figure 5 In the electronic device 100. That is, it can be understood that there are two electronic devices 100 in this embodiment, and the two exchange data. Further, the form of the network 13 is not limited in the embodiment of the present application, that is, the network 13 can be a wireless network (such as WIFI, Bluetooth, etc.) or a wired network.
[0123] Among them, the first electronic device 11 and the second electronic device 12 can be the same electronic device, such as the first electronic device 11 and the second electronic device 12 are both servers; or they can be different types of electronic devices, for example, the first electronic device 11 can be a computer, and the second electronic device 12 can be a server. The interaction between the first electronic device 11 and the second electronic device 12 can be: the first electronic device 11 obtains the data to be identified and the node data, and sends the data to be identified and the node data to the second electronic device 12. The second electronic device 12 inputs the data to be identified and the node data into the intention recognition model for identification, and obtains the intention recognition result. The second electronic device 12 sends the intention recognition result to the first electronic device 11, so that the first electronic device 11 performs the corresponding target operation according to the intention recognition result.
[0124] The following is an introduction to the readable storage medium provided in the embodiments of the present application. The readable storage medium described below and the intention recognition method described above can be referenced to each other.
[0125] The present application also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned intention recognition method are implemented.
[0126] The readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0127] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0128] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0129] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0130] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms include, include or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0131] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for intention recognition, characterized in that: include: Obtain the data to be identified and the node data of the current business process; Inputting the data to be identified and the node data into an intention recognition model to obtain an intention recognition result corresponding to the node data, wherein the intention recognition result is used to reflect whether the data to be identified represents the intention corresponding to the node data; Execute the target operation corresponding to the intention recognition result; wherein obtaining the node data of the current business process includes: obtaining initial node data; performing feature encoding on the initial node data using a One-Hot encoding method to obtain the node data; The training process of the intent recognition model includes: Acquire multiple training intention data and multiple training node data, wherein the training node data covers each node of the business process, and the training intention data covers all intentions corresponding to all nodes; Using each of the training intention data and each of the training node data to form a plurality of initial training data; Setting a category label corresponding to the training intention data for the positive initial training data, and setting a negative label for the negative initial training data, to obtain training data; wherein the positive initial training data is the initial training data in which the training intention data matches the training node data; and the negative initial training data is the initial training data in which the training intention data does not match the training node data; Using the training data to train the initial model to obtain the intent recognition model, the initial model is a model composed of an xgboost tree model and a BERT model; The executing of the target operation corresponding to the intention recognition result includes: If the intention recognition result reflects that the data to be recognized does not represent any intention corresponding to the node data, it is prohibited to switch to executing the process corresponding to the data to be recognized.
2. The method for intention recognition according to claim 1, characterized in that: The obtaining of the data to be identified and the node data of the current business process includes: Obtaining initial data to be identified and initial node data; Feature encoding is performed on the initial data to be identified and the initial node data respectively to obtain the data to be identified and the node data.
3. The method for identifying intention according to claim 1, characterized in that: The obtaining of the data to be identified and the node data of the current business process includes: Acquire the speech to be tested, and perform speech-to-text recognition processing on the speech to be tested to obtain the data to be recognized; Query the current business process progress and obtain the node data.
4. The method for intention recognition according to claim 3, characterized in that: The performing speech-to-text recognition processing on the speech to be tested to obtain the data to be recognized includes: Performing speech-to-text conversion on the speech to be tested to obtain initial data; The initial data is subjected to keyword extraction or invalid information filtering processing to obtain the data to be identified.
5. A method for training an intent recognition model, characterized in that: Used to generate the intention recognition model described in any one of claims 1 to 4, comprising: Acquire training data; the training data includes training intent data and training node data, the training node data covers each node of the business process, and the training intent data covers all intents corresponding to all nodes; Using the training data to train the initial model to obtain an intent recognition model; Wherein, the obtaining of training data includes: Obtain multiple training intention data and multiple training node data; Using each of the training intention data and each of the training node data to form a plurality of initial training data; Setting a category label corresponding to the training intention data for the positive initial training data, and setting a negative label for the negative initial training data, to obtain the training data; Among them, the positive initial training data is the initial training data in which the training intention data matches the training node data; the negative initial training data is the initial training data in which the training intention data does not match the training node data, and the initial model is a model composed of an xgboost tree model and a BERT model.
6. An intention recognition device, characterized in that: include: The module for acquiring data to be identified is used to acquire the data to be identified and the node data of the current business process; An identification module, used for inputting the data to be identified and the node data into an intention identification model to obtain an intention identification result corresponding to the node data, wherein the intention identification result is used to reflect whether the data to be identified represents the intention corresponding to the node data; An execution module, used to execute the target operation corresponding to the intention recognition result; The to-be-identified data acquisition module is used to: acquire initial node data; perform feature encoding on the initial node data using a One-Hot encoding method to obtain the node data; Among them, the training process of the intent recognition model includes: obtaining multiple training intent data and multiple training node data, the training node data covers each node of the business process, and the training intent data covers all intentions corresponding to all nodes; using each of the training intent data and each of the training node data to form multiple initial training data; setting the category label corresponding to the training intent data for the positive initial training data, and setting the negative label for the negative initial training data to obtain the training data; wherein the positive initial training data is the initial training data in which the training intent data matches the training node data; the negative initial training data is the initial training data in which the training intent data does not match the training node data; using the training data to train the initial model to obtain the intent recognition model, the initial model is a model composed of the xgboost tree model and the BERT model; The execution module is used to prohibit switching to the process corresponding to the data to be identified if the intention identification result reflects that the data to be identified does not represent any intention corresponding to the node data.
7. An intention recognition model training device, characterized in that: include: A training data acquisition module is used to acquire training data, wherein the training data includes training intent data and training node data, wherein the training node data covers each node of the business process, and the training intent data covers all intents corresponding to all nodes; A training module, used to train the initial model using the training data to obtain an intent recognition model; Wherein, the training data acquisition module includes: An acquisition unit, used for acquiring a plurality of training intention data and a plurality of training node data; A combining unit, used to respectively use each of the training intention data and each of the training node data to form a plurality of initial training data; A labeling unit is used to set a category label corresponding to the training intention data for the positive initial training data, and to set a negative label for the negative initial training data, to obtain the training data; wherein the positive initial training data is the initial training data in which the training intention data matches the training node data; the negative initial training data is the initial training data in which the training intention data does not match the training node data, and the initial model is a model composed of an xgboost tree model and a BERT model.
8. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the intention recognition method as described in any one of claims 1 to 4 and / or the intention recognition model training method as described in claim 5.
9. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, it implements the intention recognition method as described in any one of claims 1 to 4 and / or the intention recognition model training method as described in claim 5.
