Intention recognition method, recognition model training method and related equipment
By matching session text in the knowledge base and generating small sample prompt data, inputting it into the intention recognition model, combined with semantic analysis, the problem of identification errors in the NLP model in long text processing is solved, and the accurate identification of incoming users' intentions is achieved.
Patent Information
- Application Number
- CN202411313481.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, the NLP model has limited processing capabilities for long texts, and it is difficult to accurately identify the incoming intentions of incoming users from a complete session dimension, resulting in errors in the identified intent.
By obtaining the session text between the incoming user and the virtual customer service, text matching is performed in the preset knowledge base, the matching training text is determined as reference text, and the small sample prompt data is generated, and input it into the target intention recognition model. Semantic analysis to improve the accuracy of intent recognition.
It realizes the accurate identification of incoming users' incoming intentions based on the complete session text, improves the accuracy of intent recognition, and can identify new intents that have not appeared in the training data.
Smart Images

Figure CN119250081A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an intent recognition method, a recognition model training method, and related equipment. Background Art
[0002] Enterprise customer service needs to answer a large number of questions from incoming users every day and provide corresponding solutions. In order to improve the efficiency of customer service, more and more companies use AI customer service to identify the incoming user's intentions, and then assign corresponding manual customer service to the user based on the incoming intentions.
[0003] In the prior art, the conversation text between the incoming user and the AI customer service is analyzed and the natural language processing (NLP) model is applied to obtain the incoming user's incoming intention. However, the NLP model has limited processing capabilities for long texts and it is difficult to accurately identify the incoming user's incoming intention from a complete conversation dimension, which may result in errors in the identified incoming intention. Summary of the invention
[0004] The main purpose of this application is to provide an intention recognition method, a recognition model training method and related equipment, aiming to solve the technical problem of poor accuracy of the incoming user's incoming intention.
[0005] To achieve the above objectives, the present application provides an intention recognition method, which includes:
[0006] Obtain the conversation text between the incoming user and the virtual customer service;
[0007] Performing text matching on the conversation text in a preset knowledge base;
[0008] Determine the training text stored in the knowledge base and matching the conversation text as a reference text;
[0009] Based on the conversation text and the reference text, obtaining a small number of sample prompt data;
[0010] The few sample prompt data are input into a target intention recognition model to obtain the incoming intention corresponding to the incoming user.
[0011] Optionally, the knowledge base stores training text vectors corresponding to each training text;
[0012] The step of determining the training text stored in the knowledge base and matching the conversation text as the reference text comprises:
[0013] Performing text processing on the conversation text to obtain a conversation text vector corresponding to the conversation text;
[0014] Calculating the cosine similarity between the conversation text vector and each training text vector;
[0015] The training text corresponding to the training text vector with the largest cosine similarity is determined as the reference text.
[0016] Optionally, the knowledge base stores the first incoming line intention corresponding to each training text;
[0017] The obtaining of a small number of sample prompt data based on the conversation text and the reference text includes:
[0018] The reference text and the first incoming line intention corresponding to the reference text are spliced into the conversation text to obtain a small number of sample prompt data.
[0019] Optionally, the inputting the few-sample prompt data into a target intention recognition model to obtain the incoming intention corresponding to the incoming user includes:
[0020] Inputting the few sample prompt data into a target intent recognition model to obtain a second incoming line intent corresponding to the conversation text;
[0021] Performing semantic analysis on the second incoming line intention and the first incoming line intention to obtain semantic similarity between the second incoming line intention and the first incoming line intention;
[0022] When the semantic similarity is higher than a first preset threshold, the second incoming call intention is determined as the incoming call intention corresponding to the incoming call user.
[0023] In addition, to achieve the above purpose, the present application also provides a method for training an intent recognition model, the method comprising:
[0024] Acquire training text; the training text is used to represent the conversation between the user and the virtual customer service;
[0025] The training text is applied to iteratively train a preset intent recognition model to obtain a target recognition model.
[0026] Optionally, the applying the training text to iteratively train a preset intent recognition model to obtain a target recognition model includes:
[0027] Applying the training text to iteratively train a preset intent recognition model;
[0028] When the number of iterations of the intention recognition model reaches a preset number, or the loss function corresponding to the intention recognition model is less than a second preset threshold, the target recognition model is obtained.
[0029] In addition, to achieve the above-mentioned purpose, the present application also provides an intention recognition device, the intention recognition device comprising:
[0030] The first acquisition module is used to acquire the conversation text between the incoming user and the virtual customer service;
[0031] A matching module, used for performing text matching on the conversation text in a preset knowledge base;
[0032] A determination module, used for determining the training text stored in the knowledge base and matching the conversation text as a reference text;
[0033] A first processing module, configured to obtain a small number of sample prompt data based on the conversation text and the reference text;
[0034] The second processing module is used to input the few sample prompt data into a target intention recognition model to obtain the incoming intention corresponding to the incoming user.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a training device for an intent recognition model, the training device for the intent recognition model comprising:
[0036] A second acquisition module is used to acquire training text; the training text is used to represent the conversation between the user and the virtual customer service;
[0037] The training module is used to apply the training text to iteratively train the preset intent recognition model to obtain the target recognition model.
[0038] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0039] The computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the steps of any one of the intention recognition methods proposed in the embodiments of the present application, or implements the steps of any one of the recognition model training methods proposed in the embodiments of the present application.
[0040] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0041] A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the intent recognition method proposed in any one of the embodiments of the present application are implemented, or the steps of the recognition model training method proposed in any one of the embodiments of the present application are implemented.
[0042] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0043] The present application provides an intent recognition method, a training method for a recognition model, and related equipment. The above-mentioned intent recognition method includes: obtaining the conversation text between the incoming user and the virtual customer service; performing text matching on the conversation text in a preset knowledge base; determining the training text that matches the conversation text and is stored in the knowledge base as a reference text; obtaining a small sample of prompt data based on the conversation text and the reference text; inputting the small sample of prompt data into the target intent recognition model to obtain the incoming intention corresponding to the incoming user. In an embodiment of the present application, a small sample of prompt data is obtained based on the conversation text and the training text that matches the conversation text, and then the small sample of prompt data is input into the target intent recognition model to obtain the incoming intention corresponding to the incoming user. Thereby, the incoming intention of the incoming user is accurately identified based on the complete conversation text, and the accuracy of intent recognition is provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0046] Figure 2 is a flow chart of the intent recognition method provided in an embodiment of the present application;
[0047] Figure 3 is a flow chart of a method for training a recognition model provided in an embodiment of the present application;
[0048] Figure 4 It is an application flow chart provided by an embodiment of the present application;
[0049] Figure 5 is a schematic structural diagram of an embodiment of an intention recognition device provided in an embodiment of the present application;
[0050] Figure 6 It is a structural schematic diagram of an embodiment of a training device for a recognition model provided in an embodiment of the present application;
[0051] Figure 7 It is a basic structural block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The intent recognition method provided in the embodiment of the present application is applied to the intent recognition device, and the training method of the recognition model provided in the embodiment of the present application is applied to the training device of the recognition model. Unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by technicians in the technical field of this application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned drawings and any variations thereof are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0053] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0054] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0055] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0056] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social online platform software, etc.
[0057] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0058] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0059] It should be noted that the intent recognition method and the recognition model training method provided in the embodiments of the present application are generally executed by a server / terminal device. Accordingly, the intent recognition device and the recognition model training device are generally arranged in the server / terminal device.
[0060] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0061] Please refer to Figure 2 , shows a flow chart of an embodiment of the intention recognition method proposed in the present application. The embodiment of the present application can acquire and process relevant data based on artificial intelligence technology.
[0062] The intent recognition method provided in the embodiment of the present application comprises the following steps:
[0063] S210, obtaining the conversation text between the incoming user and the virtual customer service.
[0064] In this step, the user's call is first transferred to the virtual customer service, and the virtual customer service communicates with the user to form a conversation text.
[0065] It should be understood that if the caller's question is answered by the virtual customer service, the user's call process ends and there is no need to perform subsequent steps.
[0066] S220: Perform text matching on the conversation text in a preset knowledge base.
[0067] S230: Determine the training text that matches the conversation text and is stored in the knowledge base as a reference text.
[0068] In this step, a knowledge base is pre-set, and the knowledge base stores training texts for training the intent recognition model.
[0069] In this step, after obtaining the conversation text between the incoming user and the virtual customer service, the conversation text is input into a preset knowledge base, and text matching is performed on the conversation text to obtain a training text that matches the conversation text, and then the above training text is determined as a reference text.
[0070] S240, obtaining a small number of sample prompt data based on the conversation text and the reference text.
[0071] In this step, after obtaining the reference text, a small number of sample prompt data are obtained based on the conversation text and the reference text. For a specific technical solution on how to obtain the small number of sample prompt data, please refer to the subsequent embodiments.
[0072] S250, inputting the few sample prompt data into a target intention recognition model to obtain the incoming intention corresponding to the incoming user.
[0073] In this step, a trained intent recognition model, namely a target intent recognition model, is pre-set. Optionally, the target intent recognition model is a large language model (LLM).
[0074] In this step, the few sample prompt data are input into the target intention recognition model to obtain the incoming user's corresponding incoming intention.
[0075] An optional implementation method is that the above-mentioned intention can be represented as a binary number, and a mapping relationship between the intention and the binary number is pre-established. The binary number output by the target intention recognition model can be used to obtain the incoming user's corresponding incoming intention.
[0076] Another optional implementation is that the target intention recognition model outputs text information indicating the incoming intention, and the user's incoming intention can be obtained by parsing the text information.
[0077] For example, a binary number 11 is preset to represent the query behavior score. When the binary number output by the target intention recognition model is 11, it is determined that the incoming intention corresponding to the incoming user is the query behavior score.
[0078] In the embodiment of the present application, a small number of sample prompt data is obtained based on the conversation text and the training text matching the conversation text, and then the small number of sample prompt data is input into the target intention recognition model to obtain the incoming user's corresponding incoming intention. Thus, based on the complete conversation text, the incoming user's incoming intention is accurately identified, and the accuracy of intention recognition is improved.
[0079] In addition, the intent recognition method provided in the embodiment of the present application can identify new intents that do not appear in the training data through the language trace of the LLM model.
[0080] Optionally, the knowledge base stores training text vectors corresponding to each training text;
[0081] The step of determining the training text stored in the knowledge base and matching the conversation text as the reference text comprises:
[0082] Performing text processing on the conversation text to obtain a conversation text vector corresponding to the conversation text;
[0083] Calculating the cosine similarity between the conversation text vector and each training text vector;
[0084] The training text corresponding to the training text vector with the largest cosine similarity is determined as the reference text.
[0085] It should be noted that the knowledge base can store the training text vectors corresponding to each training text.
[0086] In this embodiment, text processing is performed on the conversation text to obtain a conversation text vector corresponding to the conversation text.
[0087] Optionally, the Bag of Words (BoW) model can be applied to obtain the conversation text vector corresponding to the conversation text. The Bag of Words model is a text vectorization method based on word frequency, which represents the text as a vector, where each dimension of the vector corresponds to a word in the dictionary, and the value represents the number of times the word appears in the text.
[0088] Optionally, TF-IDF may be applied to obtain a conversation text vector corresponding to the conversation text.
[0089] Optionally, each word can be represented as a high-dimensional sparse vector through one-hot encoding to obtain a conversation text vector.
[0090] It should be understood that other methods may also be used to obtain the conversation text vector corresponding to the conversation text, which is not specifically limited here.
[0091] After obtaining the conversation text vector corresponding to the conversation text, the cosine similarity between the conversation text vector and each training text vector is calculated; and the training text corresponding to the training text vector with the largest cosine similarity is determined as the reference text.
[0092] In this embodiment, the cosine similarity between the conversation text vector and each training text vector is calculated, thereby accurately obtaining the training text that best matches the conversation text.
[0093] Optionally, the knowledge base stores the first incoming line intention corresponding to each training text;
[0094] The obtaining of a small number of sample prompt data based on the conversation text and the reference text includes:
[0095] The reference text and the first incoming line intention corresponding to the reference text are spliced into the conversation text to obtain a small number of sample prompt data.
[0096] It should be noted that the knowledge base also stores the first incoming line intention corresponding to each training text.
[0097] In this embodiment, the spliced reference text and the first incoming line intention corresponding to the reference text, together with the conversation text, constitute complete few-shot prompt data.
[0098] In this embodiment, the small sample prompt data is used as the prediction data of the target intention recognition model to achieve the purpose of reducing the amount of data.
[0099] Optionally, the inputting the few-sample prompt data into a target intention recognition model to obtain the incoming intention corresponding to the incoming user includes:
[0100] Inputting the few sample prompt data into a target intent recognition model to obtain a second incoming line intent corresponding to the conversation text;
[0101] Performing semantic analysis on the second incoming line intention and the first incoming line intention to obtain semantic similarity between the second incoming line intention and the first incoming line intention;
[0102] When the semantic similarity is higher than a first preset threshold, the second incoming call intention is determined as the incoming call intention corresponding to the incoming call user.
[0103] In this embodiment, the few sample prompt data obtained above are input into the target intention recognition model to obtain the second incoming line intention corresponding to the conversation text.
[0104] After the second incoming line intention is obtained, a semantic analysis is performed on the second incoming line intention and the first incoming line intention to obtain the semantic similarity between the second incoming line intention and the first incoming line intention.
[0105] An optional implementation manner is to calculate the word frequency and inverse document frequency in the first incoming line intention and the second incoming line intention respectively by using the TF-IDF method, and then calculate the semantic similarity between the first incoming line intention and the second incoming line intention.
[0106] Another optional implementation is to calculate the cosine similarity between the first entry intention and the second entry intention, and determine the cosine similarity as the semantic similarity between the second entry intention and the first entry intention.
[0107] In this embodiment, a first preset threshold is preset. When the semantic similarity is higher than the first preset threshold, it indicates that the first incoming intention and the second incoming intention are relatively close, and the second incoming intention is determined as the incoming intention corresponding to the incoming user.
[0108] It should be understood that when the semantic similarity is not higher than the first preset threshold, it means that the first incoming intention and the second incoming intention are not close, and the second incoming intention is not determined as the incoming intention corresponding to the incoming user.
[0109] In this embodiment, after obtaining the second approaching intention, by calculating the semantic similarity between the first approaching intention and the second approaching intention, the approaching intention corresponding to the approaching user is accurately determined according to the difference between the semantic similarity and the first preset threshold.
[0110] Please refer to Figure 3 , shows a flow chart of an embodiment of a training method for an intention recognition model proposed in the present application. The present application embodiment can acquire and process relevant data based on artificial intelligence technology.
[0111] The training method of the intent recognition model provided in the embodiment of the present application includes the following steps:
[0112] S310, obtaining training text.
[0113] In this step, a training text is obtained, wherein the training text is used to characterize the conversation between the user and the virtual customer service.
[0114] S320, applying the training text to iteratively train a preset intent recognition model to obtain a target recognition model.
[0115] An intention recognition model is pre-set, and optionally, the intention recognition model is an LLM model.
[0116] In this step, the training text is used to iteratively train the preset intent recognition model to obtain the target recognition model.
[0117] Optionally, the applying the training text to iteratively train a preset intent recognition model to obtain a target recognition model includes:
[0118] Applying the training text to iteratively train a preset intent recognition model;
[0119] When the number of iterations of the intention recognition model reaches a preset number, or the loss function corresponding to the intention recognition model is less than a second preset threshold, the target recognition model is obtained.
[0120] An optional implementation is that when the number of iterations of the intent recognition model reaches a preset number, it is determined that the training of the intent recognition model is completed, and the trained intent recognition model is determined as the target intent recognition model.
[0121] Another optional implementation is, when the loss function corresponding to the intent recognition model is less than a second preset threshold, it is determined that the training of the intent recognition model is completed, and the trained intent recognition model is determined as the target intent recognition model.
[0122] In this embodiment, the intent recognition model is iteratively trained by applying training texts, and the conditions for completing the training of the intent recognition model are set, thereby ensuring that the trained intent recognition model can accurately identify the user's incoming intention.
[0123] To understand the overall technical solution, please refer to Figure 4 ,like Figure 4 As shown, the training text is input into the intent recognition model, the intent recognition model is trained, and the target intent recognition model is obtained; and the training text is stored in the knowledge base.
[0124] The conversation text is obtained, and the conversation text is queried in the knowledge base to obtain the reference text matching the conversation text, and then a few sample prompt data are generated based on the reference text and the conversation text.
[0125] The above few sample prompt data are input into the target intention recognition model to obtain the user's incoming line intention.
[0126] See also Figure 5 , an embodiment of the present application provides an intention recognition device 500, the intention recognition device 500 comprising:
[0127] The first acquisition module 510 is used to acquire the conversation text between the incoming user and the virtual customer service;
[0128] A matching module 520, configured to perform text matching on the conversation text in a preset knowledge base;
[0129] A determination module 530 is used to determine the training text stored in the knowledge base and matching the conversation text as a reference text;
[0130] A first processing module 540 is used to obtain a small number of sample prompt data based on the conversation text and the reference text;
[0131] The second processing module 550 is used to input the few sample prompt data into a target intention recognition model to obtain the incoming intention corresponding to the incoming user.
[0132] Optionally, the knowledge base stores training text vectors corresponding to each training text;
[0133] The determination module 530 is specifically configured to:
[0134] Performing text processing on the conversation text to obtain a conversation text vector corresponding to the conversation text;
[0135] Calculating the cosine similarity between the conversation text vector and each training text vector;
[0136] The training text corresponding to the training text vector with the largest cosine similarity is determined as the reference text.
[0137] Optionally, the knowledge base stores the first incoming line intention corresponding to each training text;
[0138] The first processing module 540 is specifically configured to:
[0139] The reference text and the first incoming line intention corresponding to the reference text are spliced into the conversation text to obtain a small number of sample prompt data.
[0140] Optionally, the second processing module 550 is specifically configured to:
[0141] Inputting the few sample prompt data into a target intent recognition model to obtain a second incoming line intent corresponding to the conversation text;
[0142] Performing semantic analysis on the second incoming line intention and the first incoming line intention to obtain semantic similarity between the second incoming line intention and the first incoming line intention;
[0143] When the semantic similarity is higher than a first preset threshold, the second incoming call intention is determined as the incoming call intention corresponding to the incoming call user.
[0144] See also Figure 6 , an embodiment of the present application provides a training device 600 for an intent recognition model, and the training device 600 for the intent recognition model includes:
[0145] The second acquisition module 610 is used to acquire training text; the training text is used to represent the conversation between the user and the virtual customer service;
[0146] The training module 620 is used to apply the training text to iteratively train the preset intent recognition model to obtain a target recognition model.
[0147] Optionally, the training module 620 is specifically used to:
[0148] Applying the training text to iteratively train a preset intent recognition model;
[0149] When the number of iterations of the intention recognition model reaches a preset number, or the loss function corresponding to the intention recognition model is less than a second preset threshold, the target recognition model is obtained.
[0150] To solve the above technical problems, the present application also provides a computer device. Figure 7 , Figure 7 This is a basic structural block diagram of the computer device in this embodiment.
[0151] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 7 with components 71-73, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0152] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0153] The memory 71 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 71 can be an internal storage unit of the computer device 7, such as a hard disk or memory of the computer device 7. In other embodiments, the memory 71 can also be an external storage device of the computer device 7, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 7. Of course, the memory 71 can also include both the internal storage unit of the computer device 7 and its external storage device. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the computer device 7, such as the program code of the intention recognition method, or the program code of the training method of the recognition model, etc. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or are to be output.
[0154] The processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 72 is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to run the program code stored in the memory 71 or process data, such as running the program code of the intention recognition method or the program code of the training method of the recognition model.
[0155] The network interface 73 may include a wireless network interface or a wired network interface. The network interface 73 is generally used to establish a communication connection between the computer device 7 and other electronic devices.
[0156] The present application also provides another embodiment, that is, providing a computer-readable storage medium, wherein the computer-readable storage medium stores an intent recognition method program, or a recognition model training program. The intent recognition program can be executed by at least one processor so that the at least one processor performs the steps of the intent recognition method as described above, or the recognition model training program can be executed by at least one processor so that the at least one processor performs the steps of the recognition model training method as described above.
[0157] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware online platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0158] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0159] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for intention recognition, characterized in that: include: Obtain the conversation text between the incoming user and the virtual customer service; Performing text matching on the conversation text in a preset knowledge base; Determine the training text stored in the knowledge base and matching the conversation text as the reference text; Based on the conversation text and the reference text, obtaining a small number of sample prompt data; The few sample prompt data are input into a target intention recognition model to obtain the incoming intention corresponding to the incoming user.
2. The method according to claim 1, characterized in that The knowledge base stores training text vectors corresponding to each training text; The step of determining the training text stored in the knowledge base and matching the conversation text as the reference text comprises: Performing text processing on the conversation text to obtain a conversation text vector corresponding to the conversation text; Calculating the cosine similarity between the conversation text vector and each training text vector; The training text corresponding to the training text vector with the largest cosine similarity is determined as the reference text.
3. The method according to claim 1, characterized in that The knowledge base stores the first incoming line intention corresponding to each training text; The obtaining of a small number of sample prompt data based on the conversation text and the reference text includes: The reference text and the first incoming line intention corresponding to the reference text are spliced into the conversation text to obtain a small number of sample prompt data.
4. The method according to claim 3, characterized in that The step of inputting the few sample prompt data into a target intention recognition model to obtain the incoming intention corresponding to the incoming user includes: Inputting the few sample prompt data into a target intent recognition model to obtain a second incoming line intent corresponding to the conversation text; Performing semantic analysis on the second incoming line intention and the first incoming line intention to obtain semantic similarity between the second incoming line intention and the first incoming line intention; When the semantic similarity is higher than a first preset threshold, the second incoming call intention is determined as the incoming call intention corresponding to the incoming call user.
5. A method for training an intent recognition model, characterized in that: include: Get training text; The training text is used to represent the conversation between the user and the virtual customer service; The training text is applied to iteratively train a preset intent recognition model to obtain a target recognition model.
6. The method according to claim 5, characterized in that The applying the training text to iteratively train a preset intent recognition model to obtain a target recognition model includes: Applying the training text to iteratively train a preset intent recognition model; When the number of iterations of the intention recognition model reaches a preset number, or the loss function corresponding to the intention recognition model is less than a second preset threshold, the target recognition model is obtained.
7. An intention recognition device, characterized in that: include: The first acquisition module is used to acquire the conversation text between the incoming user and the virtual customer service; A matching module, used for performing text matching on the conversation text in a preset knowledge base; A determination module, configured to determine a training text stored in the knowledge base and matching the conversation text as a reference text; A first processing module, configured to obtain a small number of sample prompt data based on the conversation text and the reference text; The second processing module is used to input the few sample prompt data into a target intention recognition model to obtain the incoming intention corresponding to the incoming user.
8. A training device for an intention recognition model, characterized in that: include: The second acquisition module is used to acquire training text; The training text is used to represent the conversation between the user and the virtual customer service; The training module is used to apply the training text to iteratively train the preset intent recognition model to obtain the target recognition model.
9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the intention recognition method as described in any one of claims 1 to 4, or implements the steps of the recognition model training method as described in claim 5 or 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the intent recognition method as described in any one of claims 1 to 4, or implements the steps of the recognition model training method as described in claim 5 or 6.
