Model training method, intention recognition method, device and computer program product
By constructing a training method for intent recognition model, using the question-and-answer text samples and intent vectors in the intent library to calculate the similarity and adjust the model parameters, the shortcomings in the existing intent recognition model in terms of accuracy and efficiency are solved, and more efficient and accurate intent recognition are achieved.
Patent Information
- Application Number
- CN202411659181.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-11
AI Technical Summary
The existing intent recognition models have insufficient accuracy and efficiency, especially when facing language diversity and complexity, the recognition effect is poor and the dependence on computing resources and labeled data is high.
By obtaining a sample of Q&A text, constructing word embedding representations and sentence embedding representations, combining the intent vectors in the intent library for similarity calculations, determining the target intent vector, and adjusting the parameters of the intent identification model based on this vector and intent labels to improve the accuracy and efficiency of the model.
This method determines the target intent vector by calculating the similarity in the vector space, reducing the dependence on manual setting rules and large-scale annotation data, improving the accuracy and efficiency of intent recognition, and enhancing the scalability and easy-to-maintainability of the model.
Smart Images

Figure CN119599078A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a training method for an intent recognition model, an intent recognition method, a training device for an intent recognition model, an intent recognition device, a computer program product, and an electronic device. Background Art
[0002] With the development of computer technology, intent recognition models have become one of the key technologies for understanding and processing natural language input. Intent recognition models can be applied to many application scenarios, such as text generation, intelligent question answering, etc. However, although the current intent recognition models all have their own characteristics, for example, the traditional rule-based recognition method requires manual setting of dependent rules, which affects processing efficiency, and the traditional machine learning method relies on a large amount of labeled data, and the recognition effect is poor when facing the diversity and complexity of language. The deep learning method has high demand for computing resources and is highly dependent on the number of samples. Therefore, the current intent recognition model has the disadvantages of low accuracy and efficiency, which affects the user experience to a certain extent.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The purpose of the present disclosure is to provide a training method for an intent recognition model, an intent recognition method, a training device for an intent recognition model, an intent recognition device, a computer program product and an electronic device, thereby improving the accuracy and efficiency of training the intent recognition model at least to a certain extent.
[0005] According to a first aspect of the present disclosure, a training method for an intent recognition model is provided, comprising: obtaining a question and answer text sample, constructing a word embedding representation of the question and answer text sample, and generating a sentence embedding representation of the question and answer text sample based on the word embedding representation; performing similarity calculation between the sentence embedding representation and the intent vector in an intent library, and determining a target intent vector from the intent library according to the similarity calculation result, wherein the intent library is constructed according to intent categories and intent vector sets corresponding to the intent categories; adjusting parameters in the intent recognition model according to the target intent vector and the intent label of the question and answer text sample to obtain a target intent recognition model.
[0006] In an exemplary embodiment of the present disclosure, constructing an intent library includes:
[0007] Acquire historical text data, extract reference word embedding representations of the historical text data, and combine them according to the reference word embedding representations to generate reference sentence embedding representations of the historical text data; determine multiple intent categories based on application scenario information, and divide the reference sentence embedding representations corresponding to the historical text data into corresponding intent categories according to the categories to which the historical text data belongs, and obtain the intent vector set of each intent category.
[0008] In an exemplary embodiment of the present disclosure, reference word embedding representations of historical text data are extracted, and combined according to the reference word embedding representations to generate reference sentence embedding representations of the historical text data, including: masking the historical text data to obtain masked sample data; extracting reference word embedding representations of the masked sample data, and combining according to the reference word embedding representations of the masked sample data to obtain reference sentence embedding representations of the masked sample data; and simultaneously determining the reference sentence embedding representations of the masked sample data as the reference sentence embedding representations of the historical text data.
[0009] In an exemplary embodiment of the present disclosure, the method further includes: performing intent recognition on verification text data using a target intent recognition model; if the obtained verification result is an erroneous intent recognition result, updating the intent library using the verification text data.
[0010] In an exemplary embodiment of the present disclosure, if the verification result obtained is an erroneous intent recognition result, the intent library is updated using the verification text data, including: determining the reference intent category to which the verification text data belongs; if the reference intent category is not included in the intent category in the intent library, adding a new intent category and a corresponding intent vector set to the intent library based on the verification text data; or, if the reference intent category is included in the intent category in the intent library, updating the intent vector set of the target intent category in the intent library based on the verification text data.
[0011] In an exemplary embodiment of the present disclosure, an intent recognition model includes a word embedding module, a sentence embedding module and an intent recognition module, the word embedding module is used to extract vectorized representations of each word in a question and answer text sample, the sentence embedding module is used to extract sentence embedding representations of the question and answer text sample based on the word embedding representations extracted by the word embedding module, so as to construct an intent vector; the intent recognition module is used to determine a target intent vector based on an intent library; according to the target intent vector and the intent label of the question and answer text sample, the parameters in the intent recognition model are adjusted to obtain a target intent recognition model, including: determining a loss value according to the target intent vector and the intent label of the question and answer text sample, and adjusting the parameters in at least one of the word embedding module, the sentence embedding module and the intent recognition module based on the loss value.
[0012] According to a second aspect of the present disclosure, there is provided an intent recognition method, comprising: obtaining a text to be recognized; inputting the text to be recognized into a target intent recognition model, constructing a current word embedding representation of the text to be recognized through the target intent recognition model, and generating a current sentence embedding representation of the text to be recognized based on the current word embedding representation; wherein, the intent library is constructed based on intent categories and intent vector sets corresponding to the intent categories, and the target intent recognition model is obtained by training the intent recognition model according to any of the above methods; using the target intent recognition model to calculate the similarity between the current sentence embedding representation and the intent vector in the intent library, and determining the current target intent vector from the intent library based on the similarity calculation result; and determining the target intent of the text to be recognized based on the current target intent vector.
[0013] In an exemplary embodiment of the present disclosure, a target intent recognition model is used to calculate the similarity between the current sentence embedding representation and the intent vector in the intent library, and the current target intent vector is determined from the intent library based on the similarity calculation result, including: determining the current intent category of the text to be recognized; using the target intent recognition model, the current sentence embedding representation is calculated to have a similarity with the intent vector corresponding to the current intent category in the intent library, and the current target intent vector is determined based on the similarity calculation result.
[0014] According to a third aspect of the present disclosure, a training device for an intent recognition model is provided, comprising: a vector construction module, used to obtain a question and answer text sample, construct a word embedding representation of the question and answer text sample, and generate a sentence embedding representation of the question and answer text sample based on the word embedding representation; a similarity calculation module, used to calculate the similarity between the sentence embedding representation and the intent vector in the intent library, and determine a target intent vector from the intent library according to the similarity calculation result, wherein the intent library is constructed according to intent categories and intent vector sets corresponding to the intent categories; a model training module, used to adjust parameters in the intent recognition model according to the target intent vector and the intent label of the question and answer text sample to obtain a target intent recognition model.
[0015] According to a fourth aspect of the present disclosure, an intent recognition device is provided, comprising: a text acquisition module for acquiring text to be recognized; a first intent recognition module for inputting the text to be recognized into a target intent recognition model, constructing a current word embedding representation of the text to be recognized through the target intent recognition model, and generating a current sentence embedding representation of the text to be recognized based on the current word embedding representation; wherein the intent library is constructed based on intent categories and intention vector sets corresponding to the intent categories, and the target intent recognition model is obtained by training the intent recognition model according to any of the above methods; a second intent recognition module for calculating the similarity between the current sentence embedding representation and the intent vector in the intent library using the target intent recognition model, and determining the current target intent vector from the intent library based on the similarity calculation result; an intent determination module for determining the target intent of the text to be recognized based on the current target intent vector.
[0016] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above methods is implemented.
[0017] According to a sixth aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0018] In the technical solution provided by the embodiment of the present disclosure, a question and answer text sample is obtained, a word embedding representation of the question and answer text sample is constructed, and a sentence embedding representation of the question and answer text sample is generated based on the word embedding representation, the sentence embedding representation is calculated for similarity with the intent vector in the intent library, and the target intent vector is determined from the intent library according to the similarity calculation result, and finally, according to the target intent vector and the intent label of the question and answer text sample, the parameters in the intent recognition model are adjusted to obtain the target intent recognition model. On the one hand, by calculating the similarity in the vector space to determine the target intent vector, there is no need to rely on manually set rules, and it is more adaptable to the recognition of new intents, improves the scalability and maintainability of the solution, and ensures the accuracy of intent recognition. On the other hand, based on the word embedding representation and the sentence embedding representation, the semantics and context of unlabeled data can be better understood, the accuracy of intent recognition is high, and the dependence on large-scale labeled data is reduced. The problem of sample scarcity is compensated by semantic similarity, and the efficiency of model training is improved.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0021] Figure 1 A schematic diagram of the stages involved in the intent recognition solution of an embodiment of the present disclosure is shown.
[0022] Figure 2 A flowchart schematically illustrates a method for training an intent recognition model according to an exemplary embodiment of the present disclosure.
[0023] Figure 3 A flowchart schematically illustrates an implementation method of constructing an intent library according to an exemplary embodiment of the present disclosure.
[0024] Figure 4 The flowchart schematically shows another implementation manner of building intent in an exemplary embodiment of the present disclosure.
[0025] Figure 5 A schematic diagram of the structure of an intent recognition model in an exemplary embodiment of the present disclosure is schematically shown.
[0026] Figure 6 The following schematically shows a flow chart of an intention recognition method in an exemplary embodiment of the present disclosure.
[0027] Figure 7 The following is a schematic diagram schematically showing the composition of a training device for an intent recognition model in an exemplary embodiment of the present disclosure.
[0028] Figure 8 The following is a schematic diagram schematically showing the composition of an intention recognition device in an exemplary embodiment of the present disclosure.
[0029] Fig. 9 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0031] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0032] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0033] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0034] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0035] The technical solution provided by the exemplary embodiments of the present disclosure involves machine learning technology of artificial intelligence, which uses machine learning technology to obtain question and answer text samples, construct word embedding representations of the question and answer text samples, and generate sentence embedding representations of the question and answer text samples based on the word embedding representations; then, similarity is calculated between the sentence embedding representations and the intent vectors in the intent library, and a target intent vector is determined from the intent library based on the similarity calculation results; finally, according to the target intent vector and the intent label of the question and answer text sample, the parameters in the intent recognition model are adjusted to obtain the target intent recognition model.
[0036] It should be noted that the model training method of the exemplary embodiment of the present invention and the intent recognition model obtained by training can be applied to various natural language processing or artificial intelligence scenarios, such as intelligent question and answer, text generation, text translation and other tasks. For example, it can be applied to operation and maintenance knowledge question and answer in intelligent operation and maintenance systems, which can improve the accuracy and efficiency of training intent recognition models, reduce training costs, and improve the accuracy of intent recognition.
[0037] Figure 1 A schematic diagram of the stages involved in the technical solution of the exemplary embodiment of the present disclosure is shown, such as Figure 1 As shown, the technical solution of the exemplary embodiment of the present disclosure includes a model training stage and a model application stage.
[0038] In an exemplary embodiment of the present disclosure, the provided model training method can be executed by a terminal device. In this way, all steps in the model training method and intent recognition method provided by the exemplary embodiment of the present disclosure can be executed by the terminal device, and all steps can be executed by the processor of the terminal device.
[0039] The terminal device can be an intelligent device with data processing capabilities, such as monitoring equipment, smart phones, computers, tablet computers, vehicle-mounted devices, wearable devices and other intelligent devices. The terminal device can also be called a mobile terminal, terminal, mobile device, etc. The present disclosure does not limit the type of terminal device.
[0040] Furthermore, the technical solution provided by the exemplary embodiment of the present disclosure may also be executed by a server. Correspondingly, in this mode of execution by the server, the server may start executing the steps in the technical solution of the exemplary embodiment of the present disclosure in response to a trigger instruction, wherein the trigger instruction may be sent by a terminal device used by a user, or may be triggered locally by the server in response to some automation events. The server may be a background system that provides related services in the exemplary embodiment of the present disclosure, and may include a portable computer, a desktop computer, a smart phone, or a cluster formed by multiple electronic devices with computing functions.
[0041] In addition, the technical solutions of the exemplary embodiments of the present disclosure can also be executed collaboratively by a terminal device and a server. In this manner of collaborative execution by an electronic device and a server, some steps in the technical solutions provided by the exemplary embodiments of the present disclosure are executed by the terminal device, while other steps are executed by the server. For example, the technical solutions provided by the exemplary embodiments of the present disclosure can be executed by the server in the training phase of the intent recognition model, and the trained target intent recognition model is sent to the terminal device, and the terminal device executes the model application phase, that is, the target intent recognition model is used to perform intent recognition processing. In this manner of collaborative execution by a terminal device and a server, the steps respectively executed by the terminal device and the server can be dynamically adjusted according to actual conditions, and the exemplary embodiments of the present disclosure do not impose special restrictions on this.
[0042] It should be noted that in the technical solution disclosed herein, the collection / collection, updating, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken for user personal information to selectively block the use or access to personal information data to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. In addition, once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0043] The intent recognition model is one of the key technologies for understanding and processing natural language input. The intent recognition methods of related technologies have the following problems: The intent recognition method based on set rules requires a lot of manual maintenance work, cannot output accurate intent recognition results for complex or ambiguous question and answer texts, and is difficult to expand. The method based on traditional machine learning relies on a large amount of labeled data, which not only requires a lot of labeling work, but also has poor model performance in the face of language diversity and complexity. The method based on deep learning requires a lot of computing resources and has poor recognition effect on unseen intents or samples.
[0044] Based on one or more of the above problems, an exemplary embodiment of the present disclosure provides a method for training an intent recognition model.
[0045] Exemplarily, the intent recognition model of the exemplary embodiment of the present disclosure can be constructed using lightweight neural networks, such as CNN (Convolutional Neural Network), RNN (Recurrent Neural Networks), DNN (Deep Neural Networks), etc. Compared with lightweight neural networks, an intent recognition model with a more complex network structure can also be used, for example, it can be constructed using a heavyweight neural network, such as BERT (Bidirectional Encoder Representation from Transformers, feature encoder of bidirectional Transformers), Transformer (a language processing model), and any heavyweight neural network that can be used for task processing. Of course, the intent recognition model can also be a large model of billions of units as the intent recognition model. The exemplary embodiment of the present disclosure can select the network structure of the intent recognition model according to actual conditions.
[0046] The exemplary embodiments of the present disclosure first provide a method for training an intent recognition model. Figure 2 As shown, the training method of the intent recognition model of the embodiment of the present disclosure may include the following steps S210 and S230:
[0047] In step S210, a question and answer text sample is obtained, a word embedding representation of the question and answer text sample is constructed, and a sentence embedding representation of the question and answer text sample is generated based on the word embedding representation.
[0048] In an exemplary embodiment of the present disclosure, the question and answer text samples can be manually written or collected through various channels, such as obtaining question and answer text samples from historical logs, historical user feedback information, and historical operation and maintenance information, without limitation.
[0049] Among them, word embedding representation refers to mapping words or phrases into real vectors with fixed dimensions, which can capture the semantic similarity between words, that is, words with similar semantics are closer in the vector space, and words with farther semantics are farther in the vector space. Word embedding representations of question and answer text samples can be constructed using methods such as artificial neural networks, word co-occurrence matrix dimensionality reduction, and probability models. For example, Word2Vec can be used to construct word embedding representations, and the exemplary embodiments of the present disclosure are not limited to this. Sentence embedding representation refers to the process of converting sentences into numerical vectors in order to understand and process the semantic content of sentences. The sentence embedding representation of question and answer text samples can be generated using methods such as BERT model, TI-IDF (Term Frequency-Inverse Document Frequency, word frequency-inverse document frequency), and the exemplary embodiments of the present disclosure can flexibly select the method for generating sentence embedding representations according to the actual scenario.
[0050] For example, the word embedding representation of the question and answer text sample can be constructed by Word2Vec, and then the constructed word embedding representation is combined based on the TI-IDF weighted average method to obtain the sentence embedding representation of the question and answer text sample. By considering the weight information of different word embedding representations when constructing the sentence embedding representation, the sentence embedding representation can more accurately express the weight relationship between each word embedding, thereby improving the semantic understanding of the question and answer text sample.
[0051] In step S220, a similarity calculation is performed between the sentence embedding representation and the intent vector in the intent library, and a target intent vector is determined from the intent library based on the similarity calculation result.
[0052] In an exemplary embodiment of the present disclosure, the intent library is constructed based on the intent categories and the intent vector sets corresponding to the intent categories. Specifically, historical text data can be collected, and the historical text data can be preprocessed by text cleaning, word segmentation, and stop word removal, and then the intent library can be constructed based on the preprocessed historical text data.
[0053] The intent category is determined based on the actual application scenario. A corresponding number of intent categories can be set according to the actual application scenario, and an intent vector set can be set under each intent category. The intent vector set can be constructed based on historical text data or written according to the actual application scenario, without any restrictions. Similarly, the method of generating intent vectors in the intent library is the same as the method of generating sentence embedding representations.
[0054] The similarity between the sentence embedding representation and the intent vector in the intent library can be calculated by using methods such as cosine similarity, Euclidean distance, Manhattan distance, Chebyshev distance, etc., without specific limitation. The exemplary embodiment of the present disclosure is explained by taking the calculation of the cosine similarity between the sentence embedding representation and the intent vector in the intent library as an example. After obtaining the cosine similarity between the sentence embedding representation and the intent vector in the intent library, the intent vector corresponding to the maximum cosine similarity can be obtained as the target intent vector, that is, the intent vector that is most similar to the sentence embedding representation in the vector space is obtained.
[0055] In step S230, the parameters in the intent recognition model are adjusted according to the target intent vector and the intent label of the question and answer text sample to obtain the target intent recognition model.
[0056] In an exemplary embodiment of the present disclosure, a loss function can be constructed based on the target intent vector and the intent label of the question and answer text sample, and the parameters in the intent recognition model can be adjusted based on the loss function to obtain the target intent recognition model. The target intent recognition model is used to determine the target intent vector from the intent library based on the similarity between the sentence embedding representation of the query text and the intent vector in the intent library.
[0057] In the technical solution provided by the embodiment of the present disclosure, a question and answer text sample is obtained, a word embedding representation of the question and answer text sample is constructed, and a sentence embedding representation of the question and answer text sample is generated based on the word embedding representation, and the sentence embedding representation is calculated for similarity with the intent vector in the intent library, and the target intent vector is determined from the intent library based on the similarity calculation result, and finally, according to the target intent vector and the intent label of the question and answer text sample, the parameters in the intent recognition model are adjusted to obtain the target intent recognition model. On the one hand, by calculating the similarity in the vector space to determine the target intent vector, there is no need to rely on manually set rules, and it can better adapt to the recognition of new intents, improve the scalability and maintainability of the solution, and ensure the accuracy of intent recognition. On the other hand, based on the word embedding representation and the sentence embedding representation, the semantics and context of unlabeled data can be better understood, the accuracy of intent recognition can be improved, the dependence on large-scale labeled data can be reduced, and the efficiency of model training can be improved.
[0058] In an exemplary embodiment, a method for constructing an intent library is provided. Figure 3 As shown, building an intent library may include:
[0059] Step S310: Acquire historical text data, extract reference word embedding representations of the historical text data, and combine them according to the reference word embedding representations to generate reference sentence embedding representations of the historical text data.
[0060] Historical text data can be obtained and preprocessed by collecting historical operation and maintenance data, historical log data, and historical user feedback data. The method of extracting reference word embedding representation and reference sentence embedding representation of historical text data can refer to the above-mentioned implementation method of extracting word embedding representation and sentence embedding representation of question and answer text samples, which will not be described in detail.
[0061] Step S320: Determine multiple intent categories based on the application scenario information, and classify the reference sentence embedding representation corresponding to the historical text data into corresponding intent categories according to the categories to which the historical text data belongs, to obtain an intent vector set for each intent category.
[0062] Taking into account the different categories of intent recognition involved in different application scenarios, such as querying the weather, ordering goods, and system operation and maintenance, multiple intent categories are determined based on the application scenario information, and the corresponding reference sentence embedding representations of the historical text data are divided into corresponding intent categories according to the categories to which they belong.
[0063] Optionally, the historical text data can be processed by a pre-trained intent category recognition model to obtain the category to which the historical text data belongs. Optionally, keywords of the historical text data can also be extracted, and the intent category of the historical text data can be determined based on keyword matching. For example, keyword libraries corresponding to different intent categories are pre-set, keywords of the historical text data are extracted and matched with each keyword library, and the intent category of the historical text data is determined based on the matching results (such as determined based on the number of matched keywords). Exemplary embodiments of the present disclosure include but are not limited to the above-mentioned methods for determining intent categories.
[0064] By building an intent library based on historical text data, a rich and accurate intent vector foundation can be provided for subsequent intent recognition, so as to calculate the similarity in the vector space and improve the accuracy of intent recognition.
[0065] Based on the aforementioned exemplary embodiments, another implementation method of constructing the intent is also provided. Figure 4 As shown, extracting the reference word embedding representation of the historical text data, and combining according to the reference word embedding representation to generate the reference sentence embedding representation of the historical text data may include:
[0066] Step S410: Mask the historical text data to obtain masked sample data.
[0067] Among them, a preset dictionary can be used to mask a certain proportion of text data in the historical text data. Furthermore, the historical text data can be semantically segmented to obtain multiple semantic contents and non-semantic contents, and masking is performed on selected parts of the multiple semantic contents. The masking results are spliced with the unmasked semantic content and non-semantic content to obtain masked sample data. Text masking based on semantic segmentation can avoid the deviation of overall semantic understanding caused by the segmentation of semantically coherent content. In other words, this masking method can help the model to have an overall understanding of content with complete semantics.
[0068] Step S420: extracting the reference word embedding representation of the masked sample data, and combining it according to the reference word embedding representation of the masked sample data to obtain the reference sentence embedding representation of the masked sample data.
[0069] Among them, the method of extracting the reference word embedding representation and the reference sentence embedding representation of the masked sample data is the same as the implementation method of extracting the word embedding representation and the sentence embedding representation of the question and answer text sample mentioned above, which will not be described in detail here.
[0070] Step S430: The reference sentence embedding representation of the masked sample data is simultaneously determined as the reference sentence embedding representation of the historical text data.
[0071] By simultaneously determining the reference sentence embedding of the masked sample data as the reference sentence embedding of the historical text data, the number of intent vectors in the intent library can be increased. Since the masked sample data is obtained by masking the historical text data, the reference sentence embedding representation of the masked sample data is ensured to have the same domain and intent category as the reference sentence embedding representation of the historical text data, thereby improving the accuracy of model training.
[0072] In an exemplary embodiment, a method for updating an intent library is provided. The method for updating the intent library may include:
[0073] Use the target intent recognition model to perform intent recognition on the verification text data;
[0074] If the obtained verification result is an erroneous intent recognition result, the intent library is updated using the verification text data.
[0075] Specifically, verification text data refers to independent text data that is different from historical text data and question-answering text samples, and is selected from a verification text data set. The verification text data has corresponding verification label data, which is used to indicate the true intent of the verification text data. The target intent recognition model is used to perform intent recognition on the verification text data, which first extracts the word embedding representation of the verification text data, then generates its sentence embedding representation based on the word embedding representation of the verification text data, and finally calculates the similarity between its sentence embedding representation and the intent vector in the intent library, and determines the target verification intent, that is, the verification result, based on the similarity calculation result.
[0076] If the verification result is a correct intent recognition result, that is, the intent indicated by the verification tag data corresponding to the verification text data is Figure 1 If the verification result is consistent, it indicates that the current intent library is sufficient to meet the current intent recognition needs. On the contrary, if the verification result is an erroneous consciousness recognition result, that is, the intent indicated by the verification tag data corresponding to the verification text data is inconsistent, it indicates that the current intent library is insufficient to meet the current intent recognition needs, and the verification text data can be used to update the intent library.
[0077] Optionally, when it is determined that the verification result is an erroneous consciousness recognition result, the verification text data can be recognized again using the target intention recognition model to further verify the accuracy of the verification result. Alternatively, the accuracy of the verification result can also be verified by manual intervention. If the verification result is verified to be accurate, the intention library is updated using the verification text data.
[0078] In some optional embodiments, if the obtained verification result is an erroneous intent recognition result, updating the intent library using the verification text data may include:
[0079] Determine the reference intent category to which the verification text data belongs. If the reference intent category is not included in the intent category in the intent library, add a new intent category and a corresponding intent vector set to the intent library according to the verification text data.
[0080] Specifically, the method of determining the reference intent category to which the verification text data belongs is the same as the method of determining the intent category of the historical text data described above, which will not be described in detail. Among them, after determining the reference intent category to which the verification text data belongs, if the reference intent category is different from the intent category already in the intent library, it means that the reference intent category to which the verification text data belongs is a new intent category. In this scenario, a new intent category can be added to the intent library, and a corresponding intent vector set can be added under the new intent category.
[0081] In some optional embodiments, if the reference intent category is included in the intent category in the intent library, the intent vector set of the target intent category in the intent library is updated according to the verification text data.
[0082] Specifically, if the reference intent category is included in the intent category in the intent, that is, the reference intent category is an existing intent category. In this scenario, it indicates that the intent categories in the intent library are sufficient to cover all intent categories. Then there is no need to update the intent categories in the intent library, but to update the intent vector set of the corresponding target intent category.
[0083] By verifying the target intent recognition model through verification text data and updating the intent library based on the verification results, the accuracy of the intent library can be ensured, thereby improving the accuracy and response speed of intent recognition.
[0084] In an exemplary embodiment, if Figure 5 The figure shows a schematic diagram of the structure of an intent recognition model, which includes a word embedding module, a sentence embedding module and an intent recognition module. The word embedding module is used to extract the vectorized representation of each word in the question and answer text sample, and the sentence embedding module is used to extract the sentence embedding representation of the question and answer text sample based on the word embedding representation extracted by the word embedding module to construct the intent vector; the intent recognition module is used to determine the target intent vector based on the intent library. Of course, when the target intent recognition model is obtained for model application, the word embedding module is used to extract the word embedding representation of the text to be recognized, the sentence embedding module is used to extract the sentence embedding representation of the text to be recognized, and the intent recognition module is used to calculate the similarity between the sentence embedding representation and the intent vector in the intent library, and determine the target intent vector from the intent library based on the similarity calculation result.
[0085] Based on this, according to the target intent vector and the intent label of the question and answer text sample, the parameters in the intent recognition model are adjusted, and the target intent recognition model may include:
[0086] The loss value is determined according to the target intent vector and the intent label of the question and answer text sample, and the parameters of at least one of the word embedding module, the sentence embedding module, and the intent recognition module are adjusted based on the loss value. Specifically, when performing iterative model training, the parameters of one or more modules of the word embedding module, the sentence embedding module, and the intent recognition module can be adjusted so that each module can adapt to the new data, thereby improving the recognition accuracy of the target intent recognition model obtained.
[0087] For further reference, Figure 6 As shown, an exemplary embodiment of the present disclosure provides an intention recognition method, which may include:
[0088] Step S610: Obtain the text to be recognized.
[0089] Step S620: input the text to be recognized into the target intent recognition model, construct the current word embedding representation of the text to be recognized through the target intent recognition model, and generate the current sentence embedding representation of the text to be recognized based on the current word embedding representation; wherein, the intent library is constructed according to the intent category and the intent vector set corresponding to the intent category, and the target intent recognition model is obtained by training the intent recognition model according to the training method of the intent recognition model of any of the above exemplary embodiments.
[0090] Step S630: Utilize the target intent recognition model to calculate the similarity between the current sentence embedding representation and the intent vector in the intent library, and determine the current target intent vector from the intent library based on the similarity calculation result.
[0091] Step S640: Determine the target intent of the text to be recognized based on the current target intent vector.
[0092] It should be noted that the training process of the target intent recognition model and the details of how the target intent recognition model processes text data can be found in the above-mentioned exemplary embodiments and will not be elaborated here.
[0093] In an exemplary embodiment, using the target intent recognition model to perform similarity calculation between the current sentence embedding representation and the intent vector in the intent library, and determining the current target intent vector from the intent library according to the similarity calculation result may include:
[0094] First, determine the current intent category of the text to be recognized, then use the target intent recognition model to calculate the similarity between the current sentence embedding representation and the intent vector corresponding to the current intent category in the intent library, and determine the current target intent vector based on the similarity calculation result.
[0095] Among them, the method of determining the current intent category of the text to be recognized can refer to the above-mentioned method of determining the intent category of historical text data, which will not be described in detail.
[0096] Specifically, after determining the current intent category of the text to be recognized, the intent vector set corresponding to the current intent category can be obtained from the intent library, and then the intent vector in the intent vector set is used to perform similarity calculation with the current sentence embedding representation to determine the current target intent vector based on the similarity calculation result. This process can narrow the scope of the intent vector set that requires similarity calculation, thereby improving the speed and accuracy of intent recognition and reducing computing resource consumption.
[0097] In some optional embodiments, in order to ensure that the target intent recognition model can always handle new intent recognition requirements, if the intent recognition result is determined to be incorrect in actual application, the intent library can also be updated based on the text to be recognized. The updating method can refer to the method of updating the intent library based on the verification text data, which will not be elaborated here.
[0098] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0099] For further reference, Figure 7 As shown, in an exemplary embodiment of the present disclosure, a training device 700 for an intention recognition model is provided, comprising a vector construction module 710, a similarity calculation module 720 and a model training module 730. Among them:
[0100] The vector construction module 710 is used to obtain question and answer text samples, construct word embedding representations of the question and answer text samples, and generate sentence embedding representations of the question and answer text samples based on the word embedding representations; the similarity calculation module 720 is used to calculate the similarity between the sentence embedding representation and the intent vector in the intent library, and determine the target intent vector from the intent library based on the similarity calculation results. The intent library is constructed based on intent categories and intent vector sets corresponding to the intent categories; the model training module 730 is used to adjust the parameters in the intent recognition model based on the target intent vector and the intent label of the question and answer text sample to obtain a target intent recognition model.
[0101] In an exemplary embodiment, the similarity calculation module 720 is configured to perform: obtaining historical text data, extracting reference word embedding representations of the historical text data, and combining them according to the reference word embedding representations to generate reference sentence embedding representations of the historical text data; determining multiple intent categories according to application scenario information, and dividing the reference sentence embedding representations corresponding to the historical text data into corresponding intent categories according to the categories to which the historical text data belongs, to obtain an intent vector set for each intent category.
[0102] In an exemplary embodiment, the vector construction module 710 is configured to perform: masking the historical text data to obtain masked sample data; extracting the reference word embedding representation of the masked sample data, and combining it according to the reference word embedding representation of the masked sample data to obtain the reference sentence embedding representation of the masked sample data; and simultaneously determining the reference sentence embedding representation of the masked sample data as the reference sentence embedding representation of the historical text data.
[0103] In an exemplary embodiment, the similarity calculation module 720 is further configured to execute: performing intent recognition on the verification text data using the target intent recognition model; if the obtained verification result is an erroneous intent recognition result, updating the intent library using the verification text data.
[0104] In an exemplary embodiment, the similarity calculation module 720 is also configured to perform: determining the reference intent category to which the verification text data belongs; if the reference intent category is not included in the intent category in the intent library, adding a new intent category and a corresponding intent vector set to the intent library based on the verification text data; or, if the reference intent category is included in the intent category in the intent library, updating the intent vector set of the target intent category in the intent library based on the verification text data.
[0105] In an exemplary embodiment, the intent recognition model includes a word embedding module, a sentence embedding module and an intent recognition module. The word embedding module is used to extract vectorized representations of each word in the question and answer text sample. The sentence embedding module is used to extract sentence embedding representations of the question and answer text sample based on the word embedding representations extracted by the word embedding module to construct an intent vector. The intent recognition module is used to determine a target intent vector based on an intent library. The model training module 730 is configured to perform: determining a loss value based on the target intent vector and the intent label of the question and answer text sample, and adjusting parameters in at least one of the word embedding module, the sentence embedding module and the intent recognition module based on the loss value.
[0106] Since the detailed contents of each functional module of the training device of the intention recognition model of the exemplary embodiment of the present disclosure have been recorded in the exemplary embodiment of the training method of the intention recognition model mentioned above, they will not be repeated here.
[0107] For further reference, Figure 8 As shown, in an exemplary embodiment of the present disclosure, an intention recognition device 800 is provided, comprising a text acquisition module 810, a first intention recognition module 820, a second intention recognition module 830 and an intention determination module 840. Among them:
[0108] A text acquisition module 810 is used to acquire text to be recognized; a first intention recognition module 820 is used to input the text to be recognized into a target intention recognition model, construct a current word embedding representation of the text to be recognized through the target intention recognition model, and generate a current sentence embedding representation of the text to be recognized based on the current word embedding representation; wherein, the intention library is constructed based on intention categories and intention vector sets corresponding to the intention categories, and the target intention recognition model is obtained by training the intention recognition model according to any of the above methods; a second intention recognition module 830 is used to use the target intention recognition model to calculate the similarity between the current sentence embedding representation and the intention vector in the intention library, and determine the current target intention vector from the intention library based on the similarity calculation result; an intention determination module 840 is used to determine the target intention of the text to be recognized based on the current target intention vector.
[0109] In an exemplary embodiment, the second intent recognition module 830 is configured to perform: determining the current intent category of the text to be recognized; using the target intent recognition model to calculate the similarity between the current sentence embedding representation and the intent vector corresponding to the current intent category in the intent library, and determining the current target intent vector based on the similarity calculation result.
[0110] Since the details of the various functional modules of the intention recognition device of the exemplary embodiment of the present disclosure have been recorded in the exemplary embodiment of the above-mentioned intention recognition method, they will not be repeated here.
[0111] It should be noted that although the training device of the intent recognition model and several modules or units of the intent recognition device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0112] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above method is implemented.
[0113] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0114] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0115] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0116] The computer program may be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device may convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program is run on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device may execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned method.
[0117] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module", or "system".
[0118] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module", or "system".
[0119] Refer to the following Fig. 9 hereinafter describes an electronic device 900 according to such an embodiment of the present disclosure. Fig. 9 The electronic device 900 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure. Fig. 9As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), and a display unit 940.
[0120] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0121] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 921 and / or a cache storage unit 922, and may further include a read-only storage unit (ROM) 923. The storage unit 920 may also include a program / utility 924 having a set (at least one) of program modules 925, such program modules 925 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment.
[0122] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0123] The electronic device 900 may also communicate with one or more external devices 1000 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0124] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0125] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0126] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A training method for an intent recognition model, characterized in that: include: Obtain a question and answer text sample, construct a word embedding representation of the question and answer text sample, and generate a sentence embedding representation of the question and answer text sample based on the word embedding representation; Calculating similarity between the sentence embedding representation and the intent vector in the intent library, and determining a target intent vector from the intent library according to the similarity calculation result, wherein the intent library is constructed according to the intent categories and the intent vector sets corresponding to the intent categories; According to the target intent vector and the intent label of the question and answer text sample, the parameters in the intent recognition model are adjusted to obtain the target intent recognition model.
2. The method according to claim 1, characterized in that Building the intent library includes: Acquire historical text data, extract reference word embedding representations of the historical text data, and combine according to the reference word embedding representations to generate reference sentence embedding representations of the historical text data; Multiple intent categories are determined according to the application scenario information, and according to the category to which the historical text data belongs, the reference sentence embedding representation corresponding to the historical text data is divided into corresponding intent categories to obtain an intent vector set of each intent category.
3. The method according to claim 2, characterized in that The extracting the reference word embedding representation of the historical text data and combining according to the reference word embedding representation to generate the reference sentence embedding representation of the historical text data includes: Masking the historical text data to obtain masked sample data; Extracting the reference word embedding representation of the masked sample data, and combining according to the reference word embedding representation of the masked sample data to obtain a reference sentence embedding representation of the masked sample data; The reference sentence embedding representation of the masked sample data is simultaneously determined as the reference sentence embedding representation of the historical text data.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: Using the target intent recognition model to perform intent recognition on the verification text data; If the obtained verification result is an erroneous intent recognition result, the intent library is updated using the verification text data.
5. The method according to claim 4, characterized in that If the obtained verification result is an erroneous intent recognition result, the intent library is updated using the verification text data, including: Determining the reference intent category to which the verification text data belongs; If the reference intent category is not included in the intent category in the intent library, adding a new intent category and a corresponding intent vector set in the intent library according to the verification text data; Alternatively, if the reference intent category is included in the intent category in the intent library, the intent vector set of the target intent category in the intent library is updated according to the verification text data.
6. The method according to claim 2 or 3, characterized in that: The intention recognition model includes a word embedding module, a sentence embedding module and an intention recognition module, wherein the word embedding module is used to extract the vectorized representation of each word in the question and answer text sample, and the sentence embedding module is used to extract the sentence embedding representation of the question and answer text sample based on the word embedding representation extracted by the word embedding module to construct an intention vector; the intention recognition module is used to determine the target intention vector based on the intention library; The step of adjusting the parameters in the intent recognition model according to the target intent vector and the intent label of the question and answer text sample to obtain the target intent recognition model includes: A loss value is determined according to the target intent vector and the intent label of the question and answer text sample, and parameters in at least one of the word embedding module, the sentence embedding module and the intent recognition module are adjusted based on the loss value.
7. A method for intention recognition, characterized in that: include: Get the text to be recognized; The text to be recognized is input into a target intent recognition model, a current word embedding representation of the text to be recognized is constructed through the target intent recognition model, and a current sentence embedding representation of the text to be recognized is generated according to the current word embedding representation; wherein the intent library is constructed according to intent categories and intent vector sets corresponding to the intent categories, and the target intent recognition model is obtained by training the intent recognition model according to the method according to any one of claims 1 to 6; Using the target intent recognition model, similarity calculation is performed between the current sentence embedding representation and the intent vector in the intent library, and a current target intent vector is determined from the intent library according to the similarity calculation result; The target intent of the text to be recognized is determined based on the current target intent vector.
8. The method according to claim 7, characterized in that The using the target intent recognition model to perform similarity calculation between the current sentence embedding representation and the intent vector in the intent library, and determining the current target intent vector from the intent library according to the similarity calculation result, includes: Determining a current intent category of the text to be recognized; The target intent recognition model is used to calculate the similarity between the current sentence embedding representation and the intent vector corresponding to the current intent category in the intent library, and the current target intent vector is determined based on the similarity calculation result.
9. A training device for an intention recognition model, characterized in that: include: A vector construction module, used to obtain a question and answer text sample, construct a word embedding representation of the question and answer text sample, and generate a sentence embedding representation of the question and answer text sample based on the word embedding representation; A similarity calculation module, used to calculate the similarity between the sentence embedding representation and the intention vector in the intention library, and determine the target intention vector from the intention library according to the similarity calculation result, wherein the intention library is constructed according to the intention category and the intention vector set corresponding to the intention category; The model training module is used to adjust the parameters in the intent recognition model according to the target intent vector and the intent label of the question and answer text sample to obtain the target intent recognition model.
10. An intention recognition device, characterized in that: include: A text acquisition module is used to acquire the text to be recognized; A first intent recognition module, used for inputting the text to be recognized into a target intent recognition model, constructing a current word embedding representation of the text to be recognized through the target intent recognition model, and generating a current sentence embedding representation of the text to be recognized according to the current word embedding representation; wherein the intent library is constructed according to intent categories and intent vector sets corresponding to the intent categories, and the target intent recognition model is obtained by training the intent recognition model according to the method according to any one of claims 1 to 6; A second intent recognition module is used to calculate the similarity between the current sentence embedding representation and the intent vector in the intent library using the target intent recognition model, and determine the current target intent vector from the intent library according to the similarity calculation result; An intention determination module is used to determine the target intention of the text to be recognized based on the current target intention vector.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
12. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.