Intention recognition method and device, electronic equipment, storage medium and program product

By introducing large models into the intention recognition system to perform secondary prediction of low confidence samples and using the intention transfer score threshold judgment mechanism, the shortcomings of small models in dealing with noise and multi-round dialogue contexts are solved, and the intention recognition is significantly improved. Accuracy and the naturalness of dialogue.

CN119441491APending Publication Date: 2025-02-14CHINA MOBILE ONLINE SERVICES CO LTD +2
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411536864.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Existing intention recognition systems are prone to collect noise and redundant information during the data acquisition stage, resulting in poor model training results, and small models lack contextual understanding of multiple rounds of dialogue, resulting in incoherent intention recognition.

Method used

The system's context understanding ability is enhanced by introducing a second intent prediction model (large model) to predict low confidence samples and using the intent transfer score threshold judgment mechanism.

Benefits of technology

It significantly improves the accuracy of intention recognition, improves the naturalness and consistency of dialogue, and allows the system to handle multiple rounds of users' interactions more intelligently.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441491A_ABST
    Figure CN119441491A_ABST
Patent Text Reader

Abstract

The invention provides an intention recognition method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence. The method comprises the steps that a question text of a user is input into a small model, the confidence degree of at least one first user intention output by the small model is determined, and if the confidence degree of a target user intention is larger than a set confidence degree threshold value, the target user intention is recognized; if yes, determining an intention transfer score for transferring the second user intention of the last round of dialogue to the target user intention; judging whether the intention transfer score is greater than a set intention transfer score threshold, and if yes, outputting a target user intention; and if not, inputting the question text into the large model, and outputting a third user intention predicted by the large model. According to the method, secondary prediction is performed by introducing a large model, so that the intention recognition accuracy is improved; and through an intention transfer score threshold judgment mechanism, the context understanding capability of the system is enhanced, the naturalness and consistency of dialogues are improved, and the system can process multiple rounds of interaction of the user more intelligently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an intention recognition method, device, electronic device, storage medium and program product. Background Art

[0002] At present, the intent recognition system mainly completes the recognition and interaction of user intent through data collection and preprocessing, small model training, intent recognition and classification, and result output. However, a large amount of noise and redundant information is often collected in the data collection stage. Even after preprocessing, it may still affect the training effect of the model, resulting in misjudgment or inaccuracy of the model in practical applications. In addition, the small model lacks the ability to understand the context of multiple rounds of dialogue, which may lead to incoherent intent prediction in continuous dialogues and fail to accurately capture the potential changes in the user's intent during the dialogue. At the same time, due to the limitations of model scale and data training, the small model performs poorly when processing complex or marginalized intents, and cannot fully capture the subtle differences in user conversations, resulting in reduced accuracy and reliability of intent recognition. Therefore, how to improve the accuracy of intent recognition has become an urgent problem to be solved. Summary of the invention

[0003] The present invention provides an intention recognition method, device, electronic device, storage medium and program product, which are used to solve the defect of low accuracy of intention recognition in the prior art and improve the accuracy of intention recognition.

[0004] The present invention provides an intention recognition method, comprising the following steps: Obtaining a user's question text, inputting the question text into a first intention prediction model, and obtaining at least one first user intention output by the first intention prediction model; Determine the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than a set confidence threshold, determine the intention transfer score of the second user intention in the previous round of dialogue to the target user intention; the target user intention is the first user intention with the greatest confidence; If the intention transfer score is greater than a set intention transfer score threshold, outputting the target user intention; If the intention transfer score is less than or equal to the set intention transfer score threshold, the question text is input into the second intention prediction model to obtain the third user intention output by the second intention prediction model, and the third user intention is output.

[0005] According to an intention recognition method provided by the present invention, the determining of the confidence level of at least one of the first user intentions includes: Obtaining user intentions of multiple rounds of historical conversations and statistical features of the user intentions in the historical conversations; Generate intent evaluation data according to at least one of the first user intents, user intents of multiple rounds of historical conversations, statistical features of the user intents, the current conversation round number, and the user intent label; The intention evaluation data is input into an intention evaluator to obtain the confidence of at least one of the first user intentions output by the intention evaluator; the intention evaluator is obtained by training the intention evaluation sample data based on the lightweight gradient boosting machine LightGBM model.

[0006] According to an intention identification method provided by the present invention, determining the intention transfer score of the second user intention in the previous round of dialogue to the target user intention includes: Obtain the number of transfers from the second user intent to the target user intent, and the total number of all transfers starting from the second user intent; Determine a user intent-based transition probability according to the number of transitions from the second user intent to the target user intent and the total number of all transitions starting from the second user intent; An intent transfer score for transferring from the second user intent to the target user intent is determined according to the transfer probability based on the user intent, the context weight of the user intent, and the business relevance weight of the user intent.

[0007] According to an intent recognition method provided by the present invention, the context weight of the user intent is determined based on the following method: In the current round of conversation, obtaining a cumulative transfer count from the second user intention to the target user intention; wherein a round of conversation includes multiple rounds of dialogue; Obtain the number of occurrences of the second user intention in the historical conversations of the current user; Determining the context weight of the user intent according to the accumulated transfer count, the number of occurrences of the second user intent and a set context weight adjustment coefficient; The business relevance weight of the user's intention is determined based on the following method: Obtaining, in historical conversations of all users within a period of time, a first total number of conversations in which the second user intention and the target user intention appear simultaneously in the historical conversations, and a second total number of conversations in which the second user intention appears in the historical conversations; The business relevance weight of the user intention is determined according to the first total number of sessions, the second total number of sessions, and a set business relevance adjustment coefficient.

[0008] According to an intention recognition method provided by the present invention, after determining the confidence level of at least one of the first user intentions, the method further includes: If the confidence of the target user's intention is less than or equal to the set confidence threshold, the question text is input into the second intention prediction model to obtain the third user intention output by the second intention prediction model, and the third user intention is output.

[0009] According to an intention recognition method provided by the present invention, the first intention prediction model is trained based on the following method: According to user intent, low-confidence samples are grouped and the number of sample expansions for each group is set; According to the sample expansion quantity of each group, the low confidence samples of each group are expanded; Summarize the unexpanded low-confidence samples, the expanded low-confidence samples and the high-confidence samples, and shuffle the summarized samples; the low-confidence samples are question texts corresponding to a confidence level less than or equal to a set confidence threshold; the high-confidence samples are question texts corresponding to a confidence level greater than a set confidence threshold; Using the shuffled samples to train the first intention prediction model; The second intent prediction model is fine-tuned based on the following method: Data preprocessing is performed on the shuffled samples, and the preprocessed samples are used to fine-tune the second intent prediction model.

[0010] The present invention also provides an intention recognition device, comprising the following modules: an acquisition module, configured to acquire a question text of a user, input the question text into a first intention prediction model, and obtain at least one first user intention output by the first intention prediction model; A first intention prediction module, used to determine the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than a set confidence threshold, determine the intention transfer score of the second user intention in the previous round of dialogue to the target user intention; the target user intention is the first user intention with the greatest confidence; an intention output module, configured to output the target user intention if the intention transfer score is greater than a set intention transfer score threshold; The second intention prediction module is used to input the question text into the second intention prediction model if the intention transfer score is less than or equal to the set intention transfer score threshold, obtain the third user intention output by the second intention prediction model, and output the third user intention.

[0011] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the intention recognition method described above is implemented.

[0012] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the intention recognition method as described in any one of the above is implemented.

[0013] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned intention recognition methods.

[0014] The intention recognition method, device, electronic device, storage medium and program product provided by the present invention obtain the user's question text, input the question text into the first intention prediction model, and obtain at least one first user intention output by the first intention prediction model; determine the confidence of at least one first user intention, and if the confidence of the target user intention is greater than the set confidence threshold, determine the intention transfer score from the second user intention of the previous round of dialogue to the target user intention; the target user intention is the first user intention with the largest confidence; if the intention transfer score is greater than the set intention transfer score threshold, output the target user intention; if the intention transfer score is less than or equal to the set intention transfer score threshold, input the question text into the second intention prediction model, obtain the third user intention output by the second intention prediction model, and output the third user intention. The present invention significantly improves the accuracy of intention recognition by introducing the second intention prediction model (i.e., the large model) to perform secondary prediction on low-confidence samples; at the same time, through the intention transfer score threshold judgment mechanism, the system's context understanding ability is enhanced, the naturalness and consistency of the dialogue are improved, and the system can more intelligently handle multiple rounds of user interactions. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] Figure 1 It is a flowchart of the intention recognition method provided by the present invention.

[0017] Figure 2 It is a schematic diagram of the low confidence sample expansion process provided by the present invention.

[0018] Figure 3It is a schematic diagram of the processing flow of the intention training module provided by the present invention.

[0019] Figure 4 It is a schematic diagram of the framework of the dynamic intent recognition system based on large and small model fusion provided by the present invention.

[0020] Figure 5 It is a schematic diagram of the processing flow of the intention prediction module and the model selection module provided by the present invention.

[0021] Figure 6 It is a structural schematic diagram of the intention recognition device provided by the present invention.

[0022] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] In related technologies, intent recognition methods have the following shortcomings: 1) Data quality issues: A large amount of noise and redundant information is often collected during the data collection stage. Even after preprocessing, it may still affect the training effect of the model, resulting in misjudgment or inaccuracy in the model in actual applications. 2) Insufficient context understanding ability: Small models lack the ability to understand the context of multiple rounds of conversations, resulting in incoherent intent predictions in continuous conversations and inability to accurately capture the potential changes in the user's intent during the conversation. 3) Limitations of model performance: Due to the limitations of model scale and data training, small models perform poorly when processing complex or marginalized intents, and cannot fully capture the subtle differences in user conversations, resulting in reduced accuracy and reliability of intent recognition. 4) Fixed model training process: The model training process is preset and fixed, and cannot be dynamically adjusted according to actual needs, resulting in an inefficient model training process and difficulty in quickly adapting to new data and task requirements.

[0025] Based on the above problems, the present invention proposes an intent recognition method, specifically a dynamic intent recognition method based on large and small model fusion, which is mainly used to solve the following problems: 1) Improve data quality and training effect: By introducing a large model re-prediction mechanism for low-confidence samples and a real-time sample update process, the quality and consistency of data are improved, thereby improving the training effect of the model and reducing the occurrence of misjudgment. 2) Enhance the context understanding ability of the model: Through the intention transfer score threshold judgment mechanism, combined with the context understanding ability of the large model, the problem of incoherent intent prediction in multiple rounds of dialogue is solved, ensuring that the model can accurately capture the transformation and coherence of user intent in the dialogue. 3) Improve the accuracy of complex intent recognition: By combining the powerful understanding and processing capabilities of the large model, the limitations of the small model in processing complex intents are solved, and the accuracy and reliability of the system in processing complex and marginalized intents are improved. 4) Realize a flexible and efficient model training mechanism: By introducing sample shuffling and dynamic model update mechanisms, the shortcomings of the fixed training process are solved, making the model training process more flexible and efficient, able to quickly respond to data changes, and improving the overall performance of the model.

[0026] Combine the following Figure 1-Figure 7 The invention describes the intention recognition method, device, electronic device, storage medium and program product.

[0027] Figure 1 is a flow chart of the intention recognition method provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 101: obtain a user's question text, input the question text into a first intention prediction model, and obtain at least one first user intention output by the first intention prediction model.

[0028] In the embodiment of the present invention, the first intention prediction model refers to a small model, and the second intention prediction model refers to a large model, wherein the differences between the small model and the large model mainly include: 1) Different model scales: The small model has fewer parameters, faster training and reasoning speeds, and is suitable for real-time processing and rapid response. The main function of the small model is to make preliminary intention predictions for user input so as to quickly give feedback. The large model has more parameters, requires more computing resources and time during training, and is suitable for processing complex tasks. 2) Prediction accuracy: Due to its simplified structure and the size limitation of the training set, the small model may have lower prediction accuracy, but can quickly provide preliminary intention judgments. Due to its complexity and richer training data, the large model can usually provide higher accuracy and more comprehensive intent recognition capabilities, especially when facing complex and variable user input. 3) Different computing resource requirements: The small model has lower requirements for computing resources and is suitable for running on devices with limited resources or in situations where rapid response is required. The large model has higher requirements for computing resources and is usually run in a server or cloud environment to ensure sufficient computing power for reasoning.

[0029] In the embodiment of the present invention, both the small model and the large model are trained based on the question text asked by the user. For example, the question text asked by the user is trained based on the BERT (Bidirectional Encoder Representations from Transformers) model.

[0030] In a user conversation, when the user initiates a new round of conversation, the question text asked by the user will enter the first intention prediction model (i.e., the small model) for user intention prediction, and obtain at least one first user intention of the user conversation output by the first intention prediction model. It can be understood that in the small model and the large model, the user intention of the user conversation refers to the specific purpose or demand expressed by the user during the conversation. For example, when the user asks "What's the weather like today?", the intention is to obtain weather information.

[0031] Step 102, determine the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than a set confidence threshold, determine the intention transfer score from the second user intention in the previous round of dialogue to the target user intention.

[0032] The intent evaluator is used to determine the confidence of each first user intent output by the small model, wherein the confidence reflects the confidence of the intent evaluator in different intent categories when identifying user intent. It can be understood that confidence is a numerical value that indicates the confidence of the model in a specific classification result, expressed in the form of probability, ranging from 0 to 1; the higher the confidence, the more the model is sure that the input data belongs to a specific category.

[0033] The first user intention with the highest confidence is selected as the target user intention, and then it is determined whether the confidence of the target user intention is greater than the set confidence threshold; if the confidence of the target user intention is greater than the set confidence threshold, it means that it is a high-confidence sample. In this case, it is necessary to further determine the intent transfer score from the second user intention in the previous round of conversation to the target user intention.

[0034] It can be understood that the intention transfer score is a quantitative indicator used to evaluate the degree of change in the user's intention state in multiple rounds of dialogue. The score is based on the analysis of the similarity or correlation of intentions between dialogue rounds, and expresses the strength of the association between the current intention and the previous intention in numerical form. In other words, the intention transfer score reflects the strength of the relationship between the intention of the current dialogue round and the intention of the previous dialogue round. If the intentions of the two rounds of dialogue are similar or related (such as continuing to discuss the same topic), the intention transfer score will be higher; if the user's intention has changed (for example, from asking for product information to asking for after-sales service), the intention transfer score will be lower.

[0035] In one embodiment, if the confidence of the target user's intention is less than or equal to the set confidence threshold, it means that it is a low-confidence sample. In this case, the question text needs to be input into the second intention prediction model to obtain the third user intention output by the second intention prediction model, and then the third user intention is output.

[0036] Step 103: If the intention transfer score is greater than a set intention transfer score threshold, output the target user intention.

[0037] If the intent transfer score is greater than the set intent transfer score threshold, it means that there is a strong logical relationship or similarity between the user intent of the current dialogue round and the user intent of the previous dialogue round, which means that the needs or questions expressed by the user in these two dialogue rounds are related to each other. In this case, the system can directly respond to the intent output by the small model because the output is considered to be credible and coherent.

[0038] Step 104: If the intention transfer score is less than or equal to the set intention transfer score threshold, the question text is input into the second intention prediction model to obtain the third user intention output by the second intention prediction model, and the third user intention is output.

[0039] If the intent transfer score is less than or equal to the set intent transfer score threshold, it means that there is no obvious correlation between the user intent of the current dialogue round and the user intent of the previous dialogue round, indicating that the user's intent has changed, or the system's understanding of the current user's intent is inaccurate. In this case, the output of the small model is considered to be low confidence and cannot be used directly for response. The large model needs to perform a secondary prediction on the low-confidence sample, that is, input the question text into the second intent prediction model, obtain the third user intent output by the second intent prediction model, and output the third user intent.

[0040] The intention recognition method provided by the embodiment of the present invention obtains the user's question text, inputs the question text into the first intention prediction model, obtains at least one first user intention output by the first intention prediction model; determines the confidence of at least one first user intention, and if the confidence of the target user intention is greater than the set confidence threshold, determines the intention transfer score from the second user intention of the previous round of dialogue to the target user intention; the target user intention is the first user intention with the largest confidence; if the intention transfer score is greater than the set intention transfer score threshold, outputs the target user intention; if the intention transfer score is less than or equal to the set intention transfer score threshold, inputs the question text into the second intention prediction model, obtains the third user intention output by the second intention prediction model, and outputs the third user intention. The present invention significantly improves the accuracy of intention recognition by introducing the second intention prediction model (i.e., the large model) to perform secondary prediction on low-confidence samples; at the same time, through the intention transfer score threshold judgment mechanism, the context understanding ability of the system is enhanced, the naturalness and consistency of the dialogue are improved, and the system can more intelligently handle multiple rounds of user interactions.

[0041] Based on the above embodiment, determining the confidence level of at least one of the first user intentions includes: Step 210, obtaining user intentions of multiple rounds of historical conversations, and statistical features of the user intentions in the historical conversations; Step 211, generating intent evaluation data according to at least one of the first user intents, user intents of multiple rounds of historical conversations, statistical features of the user intents, the current conversation round number, and the user intent label; Step 212, input the intention evaluation data into an intention evaluator to obtain the confidence of at least one of the first user intentions output by the intention evaluator; the intention evaluator is obtained by training the intention evaluation sample data based on the lightweight gradient boosting machine LightGBM model.

[0042] In the embodiment of the present invention, the user intent is accurately evaluated and selected by an intent evaluator based on LightGBM (Light Gradient Boosting Machine). The essence of the intent evaluator is to correct the intent evaluation based on the intent output result of the small model, combined with context and other features. The training process of the intent evaluator includes: (1) Sample construction: During the training process, the samples of the intent evaluator are composed of the following parts: 1.1) User intent output by the small model: The initial intent prediction of the small model after each round of dialogue, express.

[0043] 1.2) User intentions in the last five rounds of conversations: In this round of conversation, the output intentions of the last five rounds of conversations are extracted from the final intention output results of other rounds of conversations. If there are less than five rounds, they are supplemented with null values ​​and used express.

[0044] 1.3) User conversation intention statistical features: including the top 5 user intentions that appear most frequently in the user's historical conversations. If there are less than 5 user intentions, they will be supplemented with null values. express.

[0045] 1.4) Current conversation round number: Add the intent evaluation sample as a time series feature, using express.

[0046] 1.5) The user intent output by the fusion of the large and small models in this round of dialogue is used as the label of the sample. express.

[0047] So the intent evaluation sample is expressed as: .

[0048] (2) Model initialization: Use the LightGBM model for initialization and set the initial parameters suitable for multi-classification tasks, such as the number of trees, learning rate, maximum depth, etc. The LightGBM model will use these parameters to train the input samples.

[0049] (3) Gradient calculation: In each iteration, by calculating the loss function Gradient , to guide the update of model parameters. Specifically, the gradient calculation formula is as follows: ; in, is the true label, For the model The predicted value of a sample.

[0050] (4) Fitting residuals: The residuals are expressed as the difference between the model prediction and the actual value. In each round of training, the process of fitting the residuals is to minimize this difference by adjusting the model parameters. The residuals can be expressed as: LightGBM corrects the model's predictions by fitting these residuals.

[0051] (5) Model update: The model parameters are updated by gradient descent to reduce the residual error. The model is continuously updated in the above way until convergence. Through the above steps, the LightGBM model gradually learns the patterns in the data so that it can accurately evaluate and select the appropriate intent in the subsequent reasoning process.

[0052] After the intent evaluator is trained, the intent evaluator is used for reasoning. Specifically, the user intent of multiple rounds of historical conversations and the statistical features of the user intent in the historical conversations are obtained; the intent evaluation data is generated according to at least one first user intent, the user intent of multiple rounds of historical conversations, the statistical features of the user intent, the current conversation round number and the user intent label; the intent evaluation data is input into the intent evaluator to obtain the confidence of at least one first user intent output by the intent evaluator. For example, after the question text asked by the user is input into the small model, the small model outputs the intent classification, and after the intent evaluation data is constructed in combination with the corresponding features, the intent evaluation data is put into the intent evaluator, and the intent evaluator outputs the confidence for the intent classification. For example, for a classification task with three categories, the intent evaluator may output the following confidence distribution: [0.1, 0.7, 0.2]. This means that the intent evaluator believes that the confidence that the input text belongs to the second category is the highest, that is, 0.7. Compared with directly outputting the intent through the small model, adding an intent evaluator can make a correction to the user intent output by the small model through contextual intent, user historical conversation intent and time series features.

[0053] By introducing an intent evaluator, the embodiment of the present invention not only retains the original intent result, but also incorporates the prior knowledge of the conversation context and the user's historical conversation intention, so that the evaluated user intent can more accurately reflect the contextual intent information, thereby improving the accuracy of intent recognition and context relevance.

[0054] Based on the above embodiment, determining the intention transfer score of the second user intention in the previous round of dialogue to the target user intention includes: Step 220, obtaining the number of transfers from the second user intent to the target user intent, and the total number of all transfers starting from the second user intent; Step 221, determining a user intention-based transition probability according to the number of transitions from the second user intention to the target user intention and the total number of all transitions starting from the second user intention; Step 222: Determine the intent transfer score from the second user intent to the target user intent based on the transfer probability based on the user intent, the context weight of the user intent, and the business relevance weight of the user intent.

[0055] The intent transfer score is calculated based on historical data, the context of the user conversation, and the correlation between intents. The intent transfer score is calculated as follows: ; in, The transition probability based on the user intention is determined by obtaining the number of transfers from the second user intention to the target user intention and the total number of all transfers starting from the second user intention, and then determining the transition probability based on the user intention according to the number of transfers from the second user intention to the target user intention and the total number of all transfers starting from the second user intention.

[0056] The calculation formula of the transition probability based on user intention is: ; in, Indicates intention (i.e. second user intent) transfer to intent (i.e., target user intent) times; Indicates intention The total number of all possible transfers that have been made.

[0057] The context weight representing the user intention is determined as follows: in the current round of conversation, the cumulative transfer count from the second user intention to the target user intention is obtained; wherein one round of conversation includes multiple rounds of dialogue; the number of occurrences of the second user intention in the historical dialogues of the current user is obtained; and the context weight of the user intention is determined according to the cumulative transfer count, the number of occurrences of the second user intention and the set context weight adjustment coefficient.

[0058] The calculation formula of the contextual weight of user intent is: ; in, Indicates that in the current round of conversation, from the intention Shift to Intent The cumulative transfer count of Indicates the intent in the current user's conversation history Number of occurrences; Represents the context weight adjustment coefficient, which is used to adjust the influence of context weight on the overall transition probability.

[0059] The business relevance weight representing the user intention is determined by: obtaining, in historical conversations of all users within a period of time, a first total number of conversations in which the second user intention and the target user intention simultaneously appear in historical conversations, and a second total number of conversations in which the second user intention appears in the historical conversations; and determining the business relevance weight of the user intention according to the first total number of conversations, the second total number of conversations, and a set business relevance adjustment coefficient.

[0060] The calculation formula for the business relevance weight of user intention is: ; in, Indicates the intent of all users in the historical sessions over a period of time. With intention The total number of first sessions that appear in the historical sessions at the same time; Indicates the intent of all users in the historical sessions over a period of time. The total number of second sessions that appeared in the historical sessions; Represents the business relevance adjustment coefficient, which is used to determine the influence weight of the business relevance weight on the final transfer probability.

[0061] Substitute the above partial formulas into After that, the intention transfer score formula is obtained as follows: .

[0062] In one embodiment, if the current user has a request related to broadband service, assuming that the current user has two rounds of dialogue, the user intentions of the dialogues are "broadband fault repair" and "broadband repair progress query", and in the third round, the user intention output by the small model is "change broadband package". Therefore, it is necessary to calculate the intention transfer score of "broadband repair progress query" to "change broadband package".

[0063] First, calculate the transfer probability based on the transfer of "broadband maintenance progress query" to "change broadband package". Assume that in the user's historical conversation, the number of transfers of the "broadband maintenance progress query" intent is 100 times, of which "broadband maintenance progress query" transfers to the "change broadband package" intent 50 times, so the transfer probability based on the user's intent is: .

[0064] After calculating the transition probability based on user intention, we need to calculate the context weight of user intention. First, set the context weight adjustment coefficient to In the user's current conversation, the intention of transferring from "broadband maintenance progress query" to "change broadband package" appeared once. In the user's historical conversation, the intention of "broadband maintenance progress query" appeared 5 times. Then the context weight of the corresponding user intention is: .

[0065] The business relevance weight of user intention is further calculated. First, the business relevance weight is set to In all the user's historical sessions, the number of sessions in which the intents "query broadband repair progress" and "change broadband package" appear in the same session is 5 times, and the total number of sessions in which "query broadband repair progress" appears is 50 times. Then the business relevance weight of the corresponding user intent is: .

[0066] Finally, the intention transfer score is: .

[0067] After each output intent reaches a certain batch, the intent transfer score threshold will be updated. Each intent has an intent transfer score threshold. There is a strong head effect through statistical intent transfer scores, so the intent transfer score threshold is set to the 0.8 quantile of all transfer scores of the intent as its threshold.

[0068] The embodiment of the present invention solves the problem of incoherent intent recognition in multiple rounds of dialogue through the intent transfer score threshold judgment mechanism. By calculating the transfer score of the intent of the previous round of dialogue to the intent of the next round of dialogue, the system can determine whether the current intent is coherent with the context; if it is coherent, it is directly output; if it is not coherent, it is handed over to the large model for processing. This mechanism significantly enhances the system's context understanding ability, improves the naturalness and consistency of the dialogue, and enables the system to handle multiple rounds of user interactions more intelligently.

[0069] Based on the above embodiment, the first intention prediction model is trained based on the following method: Step 310, grouping low confidence samples according to user intention and setting the number of sample expansions for each group; Step 311, expanding the samples of low confidence in each group according to the number of sample expansions in each group; Step 312, summarizing the unexpanded low-confidence samples, the expanded low-confidence samples, and the high-confidence samples, and shuffling the summed samples; Step 313, using the shuffled samples to train the first intention prediction model; The second intent prediction model is fine-tuned based on the following method: Step 320: perform data preprocessing on the shuffled samples, and use the preprocessed samples to fine-tune the second intent prediction model.

[0070] It can be understood that the low confidence sample is the question text corresponding to a confidence level less than or equal to a set confidence threshold; the high confidence sample is the question text corresponding to a confidence level greater than the set confidence threshold.

[0071] Obtain low-confidence samples, then group the low-confidence samples according to the user's intention, set the number of sample expansions for each group, and expand the samples of the low-confidence samples in each group according to the number of sample expansions for each group. Figure 2 , when the low-confidence samples settle to a certain batch size, they will be uniformly output to the general sample expansion model for sample expansion. Before sample expansion, the entire low-confidence sample needs to be grouped according to user intent. The reason for grouping is that the larger model has a better generation effect for more specific scenarios, and the sample expansion for the same user intent is easier to control. After grouping, it is also necessary to set the number of sample expansions corresponding to each group. The expansion number should not be set too much. If the expansion number is large, the number of calls to the large model needs to be increased. The low-confidence samples are expanded through the general sample expansion model. Finally, the previous low-confidence samples and the expanded low-confidence samples are merged and the samples are uniformly output.

[0072] Furthermore, the unexpanded low-confidence samples, the expanded low-confidence samples and the high-confidence samples are summarized, and the summarized samples are shuffled, and the shuffled samples are used to train the first intent prediction model, and the shuffled samples are preprocessed, and the preprocessed samples are used to fine-tune the second intent prediction model.

[0073] refer to Figure 3, high-confidence samples are sent to Kafka after the intent is recognized by the small model; low-confidence samples are stored in another storage unit after the intent is recognized by the large model, and are uniformly output to the large model for sample expansion after reaching a certain batch size. Then, the unexpanded low-confidence samples, the expanded low-confidence samples, and the high-confidence samples are summarized, and the entire sample is shuffled. Among them, the reasons for shuffling the samples include: first, the model may be affected by the order of the data during training. For example, if all similar samples are together, the model may overfit these samples and perform poorly when processing different types of data. Second, by shuffling the data, the model can better learn the overall distribution of the data rather than a specific order, which helps the model perform better when facing new and unseen data. Finally, shuffling the data helps prevent the model from falling into a local optimal solution during training, because the diversity of the data allows the model to be exposed to different types of data in each training cycle, thereby improving the robustness of the model.

[0074] After shuffling the samples, these samples can be used as training sets for both large and small models. When used as training sets for small models, no additional adjustments are required for the samples. Before training the small model, the samples need to be divided into training sets and test sets, such as 80% for the training set and 20% for the test set. After training one version of the model, the new version of the model is verified by the test set, such as the accuracy. If the model effect is higher than the set threshold, the model is automatically put online to replace the old model; if the model effect is lower than the set threshold, the model is not replaced and the training is performed again through the above process until the target effect is achieved.

[0075] When used as a fine-tuning training set for a large model, this part of the data also needs to be preprocessed, for example, the data needs to be transformed into a data format acceptable to the large model, that is, the structured training set data needs to be transformed into a format similar to the user and assistant roles acceptable to the large model. In the user role, the corresponding user question text is added through common prompt words to form the dialogue sentence of the user role; in the assistant role, the corresponding recognized intent result is directly output. By constructing such a format, it is put into the large model for fine-tuning. The division of the training set and the test set is consistent with that of the small model, and the test set is also used to verify the effect of the new version of the model. If the effect of the model is higher than the set threshold, the model is automatically put online to replace the old version of the model; if the effect of the model is lower than the set threshold, the model is not replaced, and the above process is used again for fine-tuning training until the target effect is achieved. Through the above process, a closed-loop mechanism for dynamic model update is realized.

[0076] The embodiment of the present invention updates high-confidence samples in real time through Kafka, and performs sample shuffling and retraining after the data accumulates to a certain extent, forming a dynamically updated model training mechanism. Unlike static training data sets, this mechanism allows the model to learn and adapt to the latest user intention data in real time, thereby continuously improving the system's adaptability to new scenarios. Through this technical advantage, the system can quickly respond to changes in user behavior and intentions, keeping the model efficient and accurate. On the other hand, by introducing sample shuffling technology, the impact of data order on model training is avoided, ensuring that the model can fully learn the overall distribution of data during training. This technical advantage makes model training more efficient, reduces the risk of overfitting, and improves the performance of the model when processing different types of data. This optimization not only improves the generalization ability of the model, but also speeds up the training speed of the model and reduces the cost of model training.

[0077] In order to further analyze and illustrate the intention recognition method proposed in the present invention, refer to the following examples.

[0078] The embodiment of the present invention specifically proposes a dynamic intent recognition method and system based on large and small model fusion. Figure 4 The framework of the dynamic intent recognition system based on the fusion of large and small models consists of three main modules: intent prediction module, model selection module and intent training module. In a user's conversation, when the user initiates a new round of dialogue, the dialogue text asked by the user will first enter the intent prediction module to predict the intent; after the small model predicts the user's intent, the user's intent predicted by the small model will be put into the intent evaluator for intent evaluation and calculation of the intent transfer score. Finally, the confidence and intent transfer score are comprehensively evaluated, and the model selection module determines whether the output is the user intent recognized by the large model or the user intent recognized by the small model. The large model and the small model work together to maximize the model performance. In the prediction process, data precipitation will also be carried out for different types of sample diversions to diversify the training samples, thereby improving the generalization ability of intent prediction of the large model and the small model.

[0079] refer to Figure 5, the overall process of the intent prediction module and the model selection module is as follows: when the user enters a user question, the question text is first predicted by the small model. The user intent output by the small model is combined with other contextual intents in the previous rounds of conversations, the user's historical conversation intentions, and the temporal features of this round of conversations to form an intent evaluation data, which is output by the intent evaluator. Among them, the intent evaluator is a classifier based on lightGBM trained by using historical intent evaluation data as a training set. The intent evaluator is designed to perform confidence evaluation for user intent and select the most appropriate user intent to output to the next step. The confidence mean of the test sample obtained during the training of the small model is obtained by the intent evaluator as the confidence threshold. In the prediction process of the small model, if the confidence of the user intent predicted by the small model after the output of the intent evaluator is higher than the confidence threshold, the sample is judged to be a high-confidence sample; otherwise, the sample is judged to be a low-confidence sample. If it is a low-confidence sample, the sample is predicted again using the large model to output the user intent, and the predicted intent sample is saved and stored in the warehouse. If it is a high-confidence sample, the intention transfer score threshold needs to be determined.

[0080] It is understandable that the intent transfer score is mainly in multi-round dialogues, where the intents of two dialogues have a certain relationship. It may be a dialogue with coherent intent, where the intents of each dialogue are consistent; or it may be a dialogue with switching intent, where the intents of the two dialogues have no direct relationship. However, in general, there is a certain relationship between the intents of the two dialogues.

[0081] After the final intent of each intent recognition is output, the intent transfer score is calculated. Each intent has an intent transfer score. Because the distribution of intent transfer scores has a head effect, the 0.8 quantile is taken as the intent transfer score threshold. Due to the insufficient generalization ability of the small model and the limitation of input data, the small model does not have the ability to understand the context. Therefore, if the intent output by the small model is lower than the intent transfer score threshold, it means that in general, the intent output by the small model does not have much coherence with the intent of the previous round of dialogue, so it is still necessary to output the intent through the context understanding of the large model; if the intent output by the small model is higher than the intent transfer score threshold, it means that the intent output by the small model is coherent, and the small model intent is directly output. And put this part of high-confidence samples into Kafka for real-time training of samples.

[0082] refer to Figure 3, high-confidence samples are sent to Kafka after the small model recognizes the intent; low-confidence samples are stored in another storage unit after the large model recognizes the intent, and are uniformly output to the large model for sample expansion after reaching a certain batch size. Then, the unexpanded low-confidence samples, the expanded low-confidence samples, and the high-confidence samples are summarized, and the entire sample is shuffled. The shuffled samples are used to train the small model; and the shuffled samples are preprocessed, and the preprocessed samples are used to fine-tune the large model.

[0083] The dynamic intent recognition method based on large and small model fusion proposed in the embodiment of the present invention has the following advantages: 1) Improve the accuracy of intent recognition: By introducing a large model to perform secondary predictions on low-confidence samples, the accuracy of intent recognition is significantly improved. Traditional small models will have recognition errors or low confidence when dealing with complex or uncertain user intents. The large model, with its stronger language understanding and context processing capabilities, can make up for the shortcomings of the small model, ensuring that the system can still accurately predict when facing complex intents, improving the reliability of the overall system and user experience.

[0084] 2) Enhance the system's contextual understanding ability: The intention transfer score threshold judgment mechanism solves the problem of incoherent intent recognition in multiple rounds of dialogue. By calculating the transfer score of the previous round of dialogue intent to the next round of dialogue intent, the system can determine whether the current intent is coherent with the context. If it is coherent, it is directly output; if it is not coherent, it is handed over to the large model for processing. This mechanism significantly enhances the system's contextual understanding ability, improves the naturalness and consistency of the dialogue, and enables the system to handle multiple rounds of user interactions more intelligently.

[0085] 3) Ability to dynamically adapt to new data: High-confidence samples are updated in real time through Kafka, and samples are shuffled and retrained after data accumulation reaches a certain level, forming a dynamically updated model training mechanism. Unlike traditional static training data sets, this mechanism allows the model to learn and adapt to the latest user intent data in real time, thereby continuously improving the system's ability to adapt to new scenarios. Through this technical advantage, the system can quickly respond to changes in user behavior and intent, keeping the model efficient and accurate.

[0086] 4) Optimizing model training efficiency: The sample shuffling technology is introduced to avoid the impact of data order on model training and ensure that the model can fully learn the overall distribution of data during training. This technical advantage makes model training more efficient, reduces the risk of overfitting, and improves the performance of the model when processing different types of data. This optimization not only improves the generalization ability of the model, but also speeds up the training of the model and reduces the cost of model training.

[0087] 5) Flexible response to the needs of different models: A targeted strategy is adopted in the preprocessing of training data, and different preprocessing methods are used for small models and large models. The training data of the small model directly uses shuffled samples, while the large model is converted into a structured data format suitable for the large model. This flexible preprocessing method ensures the effective training of different models under the same framework, allowing the small model and the large model to perform at their best and form a coordinated and unified intent recognition system.

[0088] 6) Build a closed-loop model update mechanism: By continuously collecting, evaluating, and updating high-confidence and low-confidence samples, a closed-loop model update mechanism is established. Whether in the training of small or large models, model parameters can be dynamically adjusted and optimized. This closed-loop mechanism not only improves the robustness of the model, but also ensures the continuous optimization and progress of the system in practical applications, allowing the model to maintain high performance for a long time.

[0089] The intention recognition device provided by the present invention is described below. The intention recognition device described below and the intention recognition method described above can be referenced to each other.

[0090] refer to Figure 6 The intention recognition device provided by the present invention includes: an acquisition module 601, a first intention prediction module 602, an intention output module 603 and a second intention prediction module 604.

[0091] An acquisition module 601 is used to acquire a question text of a user, input the question text into a first intention prediction model, and obtain at least one first user intention output by the first intention prediction model; The first intention prediction module 602 is used to determine the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than a set confidence threshold, determine the intention transfer score of the second user intention in the previous round of dialogue to the target user intention; the target user intention is the first user intention with the greatest confidence; The intention output module 603 is used to output the target user intention if the intention transfer score is greater than a set intention transfer score threshold; The second intention prediction module 604 is used to input the question text into the second intention prediction model if the intention transfer score is less than or equal to the set intention transfer score threshold, obtain the third user intention output by the second intention prediction model, and output the third user intention.

[0092] The intention recognition device provided by the embodiment of the present invention obtains the user's question text, inputs the question text into the first intention prediction model, obtains at least one first user intention output by the first intention prediction model; determines the confidence of at least one first user intention, and if the confidence of the target user intention is greater than the set confidence threshold, determines the intention transfer score from the second user intention of the previous round of dialogue to the target user intention; the target user intention is the first user intention with the largest confidence; if the intention transfer score is greater than the set intention transfer score threshold, outputs the target user intention; if the intention transfer score is less than or equal to the set intention transfer score threshold, inputs the question text into the second intention prediction model, obtains the third user intention output by the second intention prediction model, and outputs the third user intention. The present invention significantly improves the accuracy of intention recognition by introducing the second intention prediction model (i.e., the large model) to perform secondary prediction on low-confidence samples; at the same time, through the intention transfer score threshold judgment mechanism, the system's context understanding ability is enhanced, the naturalness and consistency of the dialogue are improved, and the system can more intelligently handle multiple rounds of user interactions.

[0093] In one embodiment, the first intention prediction module 602 is specifically configured to: Obtain user intentions of multiple rounds of historical conversations and statistical features of the user intentions in the historical conversations; generate intention evaluation data based on at least one of the first user intentions, user intentions of multiple rounds of historical conversations, statistical features of the user intentions, the current conversation round number and the user intention label; input the intention evaluation data into an intention evaluator to obtain the confidence of at least one of the first user intentions output by the intention evaluator; the intention evaluator is obtained by training the intention evaluation sample data based on the lightweight gradient boosting machine LightGBM model.

[0094] In one embodiment, the first intention prediction module 602 is specifically configured to: Obtain the number of transfers from the second user intent to the target user intent and the total number of all transfers starting from the second user intent; determine the user intention-based transfer probability according to the number of transfers from the second user intent to the target user intent and the total number of all transfers starting from the second user intent; determine the intent transfer score from the second user intent to the target user intent according to the user intention-based transfer probability, the context weight of the user intent and the business relevance weight of the user intent.

[0095] In one embodiment, the first intention prediction module 602 is specifically configured to: In the current round of conversation, the cumulative transfer count from the second user intention to the target user intention is obtained; wherein, one round of conversation includes multiple rounds of conversation; the number of occurrences of the second user intention in the historical conversations of the current user is obtained; the context weight of the user intention is determined according to the cumulative transfer count, the number of occurrences of the second user intention and the set context weight adjustment coefficient; the business relevance weight of the user intention is determined based on the following method: in the historical conversations of all users within a period of time, the first total number of conversations in which the second user intention and the target user intention appear in the historical conversations at the same time, and the second total number of conversations in which the second user intention appears in the historical conversations are obtained; the business relevance weight of the user intention is determined according to the first total number of conversations, the second total number of conversations and the set business relevance adjustment coefficient.

[0096] In one embodiment, the first intention prediction module 602 is further configured to: If the confidence of the target user's intention is less than or equal to the set confidence threshold, the question text is input into the second intention prediction model to obtain the third user intention output by the second intention prediction model, and the third user intention is output.

[0097] In one embodiment, the intention recognition apparatus further includes a model training module for: According to user intention, low confidence samples are grouped, and the number of sample expansions for each group is set; according to the number of sample expansions for each group, the low confidence samples in each group are expanded; the unexpanded low confidence samples, the expanded low confidence samples and the high confidence samples are summarized, and the summarized samples are shuffled; the low confidence samples are question texts corresponding to a confidence less than or equal to a set confidence threshold; the high confidence samples are question texts corresponding to a confidence greater than a set confidence threshold; the shuffled samples are used to train the first intention prediction model; the second intention prediction model is fine-tuned based on the following method: data preprocessing is performed on the shuffled samples, and the preprocessed samples are used to fine-tune the second intention prediction model.

[0098] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor (processor) 710 , a communication interface (Communications Interface) 720 , a memory (memory) 730 and a communication bus 740 , wherein the processor 710 , the communication interface 720 , and the memory 730 communicate with each other through the communication bus 740 . The processor 710 can call the logic instructions in the memory 730 to execute the intention recognition method, which includes: obtaining the user's question text, inputting the question text into the first intention prediction model, and obtaining at least one first user intention output by the first intention prediction model; determining the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than the set confidence threshold, determining the intention transfer score from the second user intention in the previous round of dialogue to the target user intention; the target user intention is the first user intention with the largest confidence; if the intention transfer score is greater than the set intention transfer score threshold, outputting the target user intention; if the intention transfer score is less than or equal to the set intention transfer score threshold, inputting the question text into the second intention prediction model, obtaining the third user intention output by the second intention prediction model, and outputting the third user intention.

[0099] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0100] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the intention recognition method provided by the above methods, and the method includes: obtaining a user's question text, inputting the question text into a first intention prediction model, and obtaining at least one first user intention output by the first intention prediction model; determining the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than a set confidence threshold, determining an intention transfer score from the second user intention of the previous round of conversation to the target user intention; the target user intention is the first user intention with the largest confidence; if the intention transfer score is greater than the set intention transfer score threshold, outputting the target user intention; if the intention transfer score is less than or equal to the set intention transfer score threshold, inputting the question text into a second intention prediction model, obtaining a third user intention output by the second intention prediction model, and outputting the third user intention.

[0101] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the intent recognition method provided by the above-mentioned methods, the method comprising: obtaining a user's question text, inputting the question text into a first intent prediction model, and obtaining at least one first user intent output by the first intent prediction model; determining the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than a set confidence threshold, determining an intention transfer score from the second user intention of the previous round of conversation to the target user intention; the target user intention is the first user intention with the largest confidence; if the intention transfer score is greater than a set intention transfer score threshold, outputting the target user intention; if the intention transfer score is less than or equal to the set intention transfer score threshold, inputting the question text into a second intention prediction model, obtaining a third user intention output by the second intention prediction model, and outputting the third user intention.

[0102] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0103] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for intention recognition, characterized in that: include: Obtaining a user's question text, inputting the question text into a first intention prediction model, and obtaining at least one first user intention output by the first intention prediction model; Determine the confidence of at least one of the first user intentions, and if the confidence of the target user intention is greater than a set confidence threshold, determine the intention transfer score of the second user intention in the previous round of conversation to the target user intention; The target user intention is the first user intention with the greatest confidence; If the intention transfer score is greater than a set intention transfer score threshold, outputting the target user intention; If the intention transfer score is less than or equal to the set intention transfer score threshold, the question text is input into the second intention prediction model to obtain the third user intention output by the second intention prediction model, and the third user intention is output.

2. The method for intention recognition according to claim 1, characterized in that: The determining of the confidence level of at least one of the first user intentions comprises: Obtaining user intentions of multiple rounds of historical conversations and statistical features of the user intentions in the historical conversations; Generate intent evaluation data according to at least one of the first user intents, user intents of multiple rounds of historical conversations, statistical features of the user intents, the current conversation round number, and the user intent label; The intention evaluation data is input into an intention evaluator to obtain the confidence of at least one of the first user intentions output by the intention evaluator; the intention evaluator is obtained by training the intention evaluation sample data based on the lightweight gradient boosting machine LightGBM model.

3. The method for identifying intention according to claim 1, characterized in that: The determining of the intent transfer score of the second user intent in the previous round of dialogue being transferred to the target user intent includes: Obtain the number of transfers from the second user intent to the target user intent, and the total number of all transfers starting from the second user intent; Determine a user intent-based transition probability according to the number of transitions from the second user intent to the target user intent and the total number of all transitions starting from the second user intent; An intent transfer score for transferring from the second user intent to the target user intent is determined according to the transfer probability based on the user intent, the context weight of the user intent, and the business relevance weight of the user intent.

4. The method for identifying intention according to claim 1, characterized in that: The contextual weight of the user intent is determined based on: In the current round of conversation, obtaining a cumulative transfer count from the second user intention to the target user intention; wherein a round of conversation includes multiple rounds of dialogue; Obtain the number of occurrences of the second user intention in the historical conversations of the current user; Determining the context weight of the user intent according to the accumulated transfer count, the number of occurrences of the second user intent and a set context weight adjustment coefficient; The business relevance weight of the user's intention is determined based on the following method: Obtaining, in historical conversations of all users within a period of time, a first total number of conversations in which the second user intention and the target user intention appear simultaneously in the historical conversations, and a second total number of conversations in which the second user intention appears in the historical conversations; The business relevance weight of the user intention is determined according to the first total number of sessions, the second total number of sessions, and a set business relevance adjustment coefficient.

5. The method for intention recognition according to claim 1, characterized in that: After determining the confidence level of at least one of the first user intentions, the method further includes: If the confidence of the target user's intention is less than or equal to the set confidence threshold, the question text is input into the second intention prediction model to obtain the third user intention output by the second intention prediction model, and the third user intention is output.

6. The method for identifying intention according to any one of claims 1 to 5, characterized in that: The first intention prediction model is trained based on the following method: According to user intent, low-confidence samples are grouped and the number of sample expansions for each group is set; According to the sample expansion quantity of each group, the low confidence samples of each group are expanded; Aggregate the unexpanded low-confidence samples, the expanded low-confidence samples, and the high-confidence samples, and shuffle the aggregated samples; The low confidence sample is a question text corresponding to a confidence level less than or equal to a set confidence threshold; The high confidence sample is a question text corresponding to a confidence level greater than a set confidence threshold; Using the shuffled samples to train the first intention prediction model; The second intent prediction model is fine-tuned based on the following method: Data preprocessing is performed on the shuffled samples, and the preprocessed samples are used to fine-tune the second intent prediction model.

7. An intention recognition device, characterized in that: include: an acquisition module, configured to acquire a question text of a user, input the question text into a first intention prediction model, and obtain at least one first user intention output by the first intention prediction model; A first intention prediction module, configured to determine a confidence level of at least one of the first user intentions, and if the confidence level of the target user intention is greater than a set confidence level threshold, determine an intention transfer score of the second user intention in the previous round of conversation to the target user intention; The target user intention is the first user intention with the greatest confidence; an intention output module, configured to output the target user intention if the intention transfer score is greater than a set intention transfer score threshold; The second intention prediction module is used to input the question text into the second intention prediction model if the intention transfer score is less than or equal to the set intention transfer score threshold, obtain the third user intention output by the second intention prediction model, and output the third user intention.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the intention recognition method as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the intention recognition method as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the intention recognition method as described in any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Cross-institution patient primary index dynamic matching system based on reinforcement learning

    CN120596487A

  • Reinforcement learning based cross-institutional patient master index dynamic matching system

    CN120596487B

  • Intention understanding method and system

    CN120611353A

  • Image processing method, intelligent glasses, intelligent equipment, system and medium

    CN120635498A

  • Operation method and device based on graphical user interface, equipment and medium

    CN121255059A