An ai conversation scene control method with emotion recognition function
By using multimodal sentiment analysis and dynamic scene classification, personalized dialogue response strategies are generated, solving the problem of insufficient sentiment recognition and achieving efficient, natural, and user-friendly interaction in the dialogue system.
Patent Information
- Application Number
- CN202510671855.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-05-23
AI Technical Summary
Existing technologies for emotion recognition and dialogue control suffer from insufficient accuracy in identifying emotional states, leading to untimely system responses, difficulty in balancing user efficiency and emotional communication needs, and challenges in designing dialogue strategies.
A multimodal sentiment analysis model is used to extract sentiment features. Combined with a time decay weighted algorithm and a dynamic scene classification rule base, the sentiment change trend is calculated to generate personalized dialogue response strategies. Natural dialogue content is generated through semantic optimization and tone adaptation.
It improves the accuracy of emotion recognition and the fluency of dialogue, enhances the user experience, and ensures the adaptability and personalization of dialogue strategies.
Smart Images

Figure CN120670594B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of AI, in particular to an AI dialogue scene control method with emotion recognition function. BACKGROUND
[0002] In the field of artificial intelligence dialogue, the application of emotion recognition technology is becoming a key pillar to improve user experience, especially in scenarios that require emotional connection with users. By recognizing user emotions and adjusting dialogue strategies accordingly, the system can provide a more user-demand-oriented interactive experience, which not only concerns technological innovation, but also directly affects user satisfaction and trust in services.
[0003] However, many current solutions still have obvious deficiencies in emotion recognition and dialogue control. Traditional methods often rely on simple keyword matching or pre-set emotion dictionaries, making it difficult to capture the diversity and implicitness of user emotional expression, resulting in system responses that often appear harsh or inappropriate, making it difficult to truly meet users' emotional needs.
[0004] In-depth, the core challenges in this field are first in the accurate recognition of emotional state. Since user emotional expression often has complexity and context dependence, relying solely on surface language features cannot accurately determine its true emotions, which directly leads to deviations in the system's understanding of user intent. This lack of recognition further leads to the problem of operation control strategy design, as inaccurate emotion recognition makes it difficult for the system to choose the appropriate dialogue strategy, and even in different scenarios, it is difficult to balance the user's demand for efficiency and emotional communication. In addition, when emotion-driven control strategies need to be dynamically adjusted, how to avoid frequent or abrupt changes to ensure the coherence and natural flow of dialogue also becomes a technical bottleneck that needs to be solved.
[0005] Therefore, how to improve the accuracy of emotion recognition and context understanding in complex and variable dialogue scenarios, and design an operation control strategy that can adapt to different scene needs and smooth transitions, has become a key problem that needs to be overcome in this research. SUMMARY
[0006] Therefore, the purpose of the present application is to provide an AI dialogue scene control method with emotion recognition function, which can at least solve one of the technical problems mentioned in the background.
[0007] According to one aspect of the present application, an AI dialogue scene control method with emotion recognition function is provided, the method comprising:
[0008] The text and voice data provided by the user are obtained, emotional features are extracted using a multi-modal emotion analysis model, the emotional features are fused through a pre-trained feature fusion algorithm, and the emotion category label is classified;
[0009] According to the emotion category label, context features are extracted from historical dialogue records, and a time decay weighting algorithm is used to calculate the quantitative value of the emotion change trend;
[0010] A dynamic scene classification rule library is called, the scene category corresponding to the quantitative value is matched, and the emotion response priority coefficient is calculated in combination with the preset demand priority weight;
[0011] According to the priority coefficient, the response strategy framework is extracted from the operation control strategy mapping table, the response frequency and emotion expression intensity parameters are adjusted, and the dialogue content generation rule is generated;
[0012] Based on the dialogue content generation rule, a sentence template is selected from the emotion empathy expression library through semantic reasoning, and a dialogue response text is generated through a semantic optimization algorithm and a tone adaptation rule;
[0013] According to historical dialogue rhythm data and user feedback records, a time interval and speech speed matching algorithm is used to adjust the output timing parameters of the dialogue response text, and the final output configuration is determined;
[0014] The dialogue response text is output through voice synthesis or text display, and the format is adapted according to the user device type.
[0015] In the above technical solution, the method aims to build an AI dialogue system that can identify and respond to user emotions in real time. By fusing emotional features from text and voice data, quantifying emotion change trends, and combining dynamic scene classification and priority calculation, appropriate dialogue responses are generated. This method not only improves the personalization and humanization of dialogue, but also ensures the fluency and adaptability of dialogue, thereby enhancing user experience.
[0016] Emotional feature extraction and fusion: Obtain the user's text and voice data, and use a multi-modal emotion analysis model to extract emotional features. This step integrates the emotional information of both text and voice modalities, providing more comprehensive emotion recognition. Through a pre-trained feature fusion algorithm, the extracted emotional features are fused, and the emotion category label is classified. This step ensures the accuracy and reliability of emotion recognition.
[0017] Emotion change trend quantification: According to the emotion category label, context features are extracted from historical dialogue records. This step considers the historical context of the dialogue, providing background information for emotion change. A time decay weighting algorithm is used to calculate the quantitative value of the emotion change trend. This step emphasizes the importance of recent emotional changes and provides dynamic quantification of emotional changes.
[0018] Dynamic scene classification and priority calculation: call the dynamic scene classification rule library, match the scene category corresponding to the quantization value. This step associates emotional changes with specific dialogue scenes, providing a contextualized response foundation. Combine preset demand priority weights to calculate emotional response priority coefficients. This step determines the priority of different emotional responses, ensuring the efficiency and relevance of the dialogue.
[0019] Response strategy generation: according to the priority coefficient, extract the response strategy framework from the operation control strategy mapping table. This step provides specific emotional response strategies to guide subsequent dialogue generation. Adjust the response frequency and emotional expression intensity parameters to generate dialogue content generation rules. This step adjusts the dialogue strategy according to the priority of the emotional response, ensuring the appropriateness and effectiveness of the dialogue.
[0020] Dialogue content generation: based on the dialogue content generation rules, select sentence templates from the emotional empathy expression library through semantic reasoning. This step uses semantic understanding to generate appropriate dialogue content, providing emotional dialogue responses. Generate dialogue response text through semantic optimization algorithm and tone adaptation rules. This step optimizes the quality and tone of the dialogue text, ensuring the naturalness and affinity of the dialogue.
[0021] Output timing adjustment: according to historical dialogue rhythm data and user feedback records, use time interval and speech speed matching algorithm to adjust the output timing parameters of the dialogue response text. This step considers the rhythm of the dialogue and the feedback of the user, providing timely dialogue responses. Determine the final output configuration to ensure the timeliness and appropriateness of the dialogue response.
[0022] Response output: output the response text through speech synthesis or text display, format adaptation according to user device type and output. This step ensures the good presentation of dialogue responses on different devices, providing a user-friendly interaction experience.
[0023] The above method integrates the emotional features of text and speech data, improving the accuracy and comprehensiveness of emotional recognition. Through dynamic scene classification and priority calculation, real-time adjustment and adaptability of dialogue strategy are ensured. Based on the emotional empathy expression library and semantic optimization algorithm, personalized and natural dialogue responses are generated, improving user experience.
[0024] In some embodiments, text and speech data provided by the user are obtained, emotional features are extracted using a multi-modal emotion analysis model, and the emotional features are fused through a pre-trained feature fusion algorithm to obtain emotional category labels, including:
[0025] Text information and speech data are obtained from user submissions, and a multi-modal emotion analysis model is used for preliminary processing to extract emotional features;
[0026] Based on the extracted sentiment features, a pre-trained fusion algorithm is applied to weight the features to obtain a comprehensive sentiment vector.
[0027] For the comprehensive sentiment vector, perform classification processing to determine the corresponding sentiment category label;
[0028] If the confidence level of the sentiment category identifier is lower than the preset threshold, secondary feature extraction is performed on the original text information and voice data to obtain supplementary sentiment features;
[0029] By fusing supplementary emotional features and comprehensive emotional vectors, and then re-performing weighted processing, the final emotional category identifier is obtained.
[0030] In the above technical solution, the method aims to extract and fuse emotional features from user-provided text and speech data using a multimodal sentiment analysis model and a pre-trained feature fusion algorithm, thereby accurately identifying the user's sentiment category. If the confidence of the initial classification is insufficient, it is optimized through secondary feature extraction and supplementary fusion to ensure the accuracy and reliability of sentiment recognition.
[0031] Analysis of each step: Text information and voice data are obtained from user submissions, and a multimodal sentiment analysis model is used for preliminary processing to extract sentiment features.
[0032] Feature fusion: Based on the extracted emotional features, a pre-trained fusion algorithm is applied to weight the features to obtain a comprehensive emotional vector. This step integrates textual and speech emotional features through weighted processing to form a unified comprehensive emotional vector, improving the integration and effectiveness of emotional representation.
[0033] Emotion Classification: For the comprehensive emotion vector, classification processing is performed to determine the corresponding emotion category identifier. This step uses classification algorithms to analyze the comprehensive emotion vector and map it to specific emotion categories, such as joy, anger, and sadness, thus achieving the quantification and identification of emotions.
[0034] Low-confidence handling: If the confidence level of the sentiment category identifier is lower than a preset threshold, secondary feature extraction is performed on the original text information and speech data to obtain supplementary sentiment features. This step enhances the robustness of sentiment recognition through secondary feature extraction, ensuring that richer sentiment information can be obtained even when the initial classification uncertainty is high.
[0035] Feature Supplementation and Fusion: By fusing and supplementing sentiment features with the comprehensive sentiment vector, a new weighted processing is performed to obtain the final sentiment category label. This step again utilizes the feature fusion algorithm to integrate new sentiment features, re-weights and classifies them, improving the accuracy and confidence of sentiment recognition.
[0036] The aforementioned method combines text and speech data for sentiment analysis, enabling a more comprehensive and accurate capture of user emotions compared to single-modal methods. A pre-trained fusion algorithm weights the features, effectively integrating multimodal sentiment features and improving sentiment recognition performance. A confidence threshold is introduced to assess the reliability of the classification results; when the confidence level is insufficient, secondary feature extraction and supplementary fusion are used for optimization, enhancing the system's robustness and accuracy.
[0037] In some embodiments, based on the emotion category identifier, contextual features are extracted from historical dialogue records, and a time decay weighted algorithm is used to calculate a quantitative value of the emotion change trend, including:
[0038] Contextual feature data is obtained from historical dialogue records, and preliminary classification is performed based on sentiment category identifiers. The preliminary sentiment classification results are determined by comparing with a pre-set sentiment feature library.
[0039] Based on the preliminary sentiment classification results, the time decay weighting method was used to calculate the sentiment changes in historical dialogues, and a weighted value sequence of sentiment changes was obtained.
[0040] For the weighted sequence of emotional changes, the time dimension features are obtained. By analyzing the effect of time decay, the direction of fluctuation of emotional change trend is determined. If the fluctuation value exceeds the preset threshold, it is marked as a significant change point.
[0041] Based on the significant change points, the corresponding contextual features and sentiment category data are extracted, and the change trend is quantified using a linear regression model to obtain trend quantification indicators;
[0042] For the trend quantification indicator, obtain its correlation characteristics with historical dialogue records. If the correlation characteristics are lower than the preset matching degree, the quantification indicator is corrected to determine the final sentiment change trend value.
[0043] In the above technical solution, the method aims to calculate a quantitative value of the trend of emotional change by analyzing the contextual features in historical dialogue records and combining them with a time decay weighted algorithm. This helps to more accurately capture the dynamic changes in users' emotions and provides data support for subsequent dialogue scenario control.
[0044] Contextual Feature Extraction and Preliminary Sentiment Classification: Contextual feature data is obtained from historical dialogue records, and preliminary classification is performed based on sentiment category identifiers. The preliminary sentiment classification results are determined by comparing the data with a pre-defined sentiment feature database. This step combines contextual features from historical dialogues with sentiment category identifiers, providing a foundation for subsequent sentiment change analysis.
[0045] Sentiment Change Weighted Calculation: Based on the preliminary sentiment classification results, a time-decay weighted method is used to calculate sentiment changes in historical dialogues, resulting in a weighted sequence of sentiment changes. The time-decay weighted method emphasizes the importance of recent sentiment changes, making the model more attentive to the sentiment trends most recently expressed by users.
[0046] Sentiment Change Trend Analysis: This step involves extracting the time-dimensional characteristics of the weighted sequence of sentiment changes. By analyzing the impact of time decay, the direction of fluctuation in the sentiment change trend is determined. If the fluctuation value exceeds a preset threshold, it is marked as a significant change point. This step, through time-dimensional analysis, identifies key nodes in sentiment changes, providing crucial information for subsequent trend quantification.
[0047] Trend Quantification: Based on significant changes, corresponding contextual features and sentiment category data are extracted. A linear regression model is used to quantify the trend, resulting in trend indicators. This step transforms the trend of sentiment change into specific quantitative indicators, making sentiment changes more intuitive to measure and analyze.
[0048] Quantitative indicator calibration and final trend determination: For the trend quantification indicator, its correlation characteristics with historical dialogue records are obtained. If the correlation characteristics are lower than the preset matching degree, the quantification indicator is calibrated to determine the final sentiment change trend value. This step ensures the accuracy and reliability of the quantification indicator and avoids misjudgments caused by data noise or outliers.
[0049] The method described above, through a time-decay weighted algorithm, can dynamically capture the changing trends of user emotions, paying closer attention to recent emotional shifts. A linear regression model is used to quantify these trends, providing an intuitive metric for measuring emotional changes. A correlation correction mechanism between the quantified metrics and historical dialogue records ensures the accuracy and reliability of the emotional trend analysis.
[0050] In some embodiments, a dynamic scene classification rule base is invoked to match the scene category corresponding to the quantified value, and an emotional response priority coefficient is calculated by combining preset demand priority weights, including:
[0051] By using a pre-defined rule base, matching rule data for scene classification is obtained, and a preliminary comparison is made with the input quantified values to determine the initial scene category.
[0052] Based on the initial scene category attribution, the quantified value is verified a second time using classification judgment logic. If the verification result is consistent with the initial attribution, the final scene category attribution is confirmed.
[0053] After obtaining the final scenario category, assess the priority of the needs, extract the corresponding weight data from the preset priority weight table, and calculate the priority coefficient of the emotional response.
[0054] The urgency of the response is determined by the calculated priority coefficient and the response calculation logic. If the priority coefficient exceeds the preset threshold, a high-priority response process is triggered.
[0055] Based on the triggering results of the high-priority response process, the calculated priority coefficients and response process data are structured and stored to obtain persistent business records.
[0056] By persistent business records, correlation analysis is performed on scenario categories and emotional response data to determine the execution path of subsequent business processes;
[0057] After obtaining the execution path of the subsequent business process, the emotional response data in the path is optimized and adjusted, and it is determined whether the optimized response data meets the preset standard. If it meets the standard, the final response data is output.
[0058] In the above technical solution, the method aims to calculate the priority coefficient of emotional responses using a dynamic scene classification rule base and preset demand priority weights, and trigger corresponding response processes based on the priority coefficient. Through structured storage and correlation analysis, emotional response data is optimized to ensure that the urgency and quality of responses meet standards, thereby achieving efficient management of emotional responses and optimization of business processes.
[0059] Preliminary Scene Classification Comparison: Using a pre-defined rule base, matching rule data for scene classification is obtained, and a preliminary comparison is performed on the input quantified values to determine the initial scene category. This step utilizes the rule base to perform preliminary classification of the quantified values, providing a foundation for subsequent verification and confirmation.
[0060] Secondary scene classification verification: Based on the initial scene category assignment, a secondary verification of the quantified value is performed using classification judgment logic. If the verification result matches the initial assignment, the final scene category assignment is confirmed. This secondary verification improves the accuracy of scene classification and ensures the reliability of scene category assignment.
[0061] Emotional Response Priority Calculation: After obtaining the final scene category classification, the priority of the needs is assessed. Corresponding weight data is extracted from a pre-defined priority weight table to calculate the priority coefficient of the emotional response. This step combines scene category and pre-defined weights to quantify the priority of the emotional response, providing a basis for triggering subsequent response processes.
[0062] High-priority response process triggering: By calculating the priority coefficient and combining it with the response calculation logic, the urgency of the response is determined. If the priority coefficient exceeds a preset threshold, the high-priority response process is triggered. This step ensures that urgent emotional responses are handled promptly, improving the system's response efficiency.
[0063] Structured storage of business records: Based on the triggering results of high-priority response processes, the calculated priority coefficients and response process data are structured and stored to obtain persistent business records. This step, through structured storage, ensures data integrity and traceability, providing data support for subsequent analysis and optimization.
[0064] Scenario Category and Sentiment Response Correlation Analysis: By persistently storing business records, correlation analysis is performed on scenario category and sentiment response data to determine the execution path of subsequent business processes. This step optimizes business processes through data analysis, ensuring the targetedness and effectiveness of subsequent operations.
[0065] Response data optimization and output: After obtaining the execution path of subsequent business processes, the emotional response data in the path is optimized and adjusted. It is then determined whether the optimized response data meets preset standards. If it does, the final response data is output. This step ensures the quality and applicability of the emotional response data, improving the user experience.
[0066] The above method ensures the accuracy and reliability of scene classification through a rule base and classification logic. Combined with a pre-set weight table, it accurately calculates the priority coefficient of emotional responses, ensuring that the urgency of the response is appropriately assessed. Through structured storage and correlation analysis, it optimizes business processes and improves data utilization efficiency.
[0067] In some embodiments, based on the priority coefficient, a response strategy framework is extracted from the operation control strategy mapping table, and the response frequency and emotion expression intensity parameters are adjusted to generate dialogue content generation rules, including:
[0068] The initial response strategy framework structure is determined by retrieving the control strategy corresponding to the priority coefficient from the preset mapping table data.
[0069] Based on the obtained framework structure, the parameter values of response frequency and emotional intensity are adjusted to obtain an appropriate dialogue generation mode.
[0070] For the adjusted parameter values, a preset logic judgment is used. If the response frequency exceeds the preset threshold, the frequency parameter is reduced and the emotional intensity is recalculated to determine the final parameter combination.
[0071] Extract dialogue content generation rules from the determined final combination of parameters.
[0072] The aforementioned technical solution aims to extract a response strategy framework from an operation control strategy mapping table based on an emotion response priority coefficient, and generate personalized dialogue content generation rules by adjusting response frequency and emotion expression intensity parameters. This helps ensure that the dialogue system can generate appropriate and effective dialogue responses based on the user's emotional state and priority needs.
[0073] Obtain the initial response strategy framework: Retrieve the control strategies corresponding to the priority coefficients from the preset mapping table data to determine the initial response strategy framework structure. This step associates the priority coefficients with specific control strategies through the mapping table, providing a basis for subsequent parameter adjustments.
[0074] Adjusting Response Frequency and Emotion Intensity: Based on the acquired framework structure, the parameter values for response frequency and emotion intensity are adjusted to obtain a suitable dialogue generation pattern. This step, through parameter adjustment, enables the dialogue generation pattern to adapt to different priorities of emotional response needs.
[0075] Parameter value verification and optimization: For the adjusted parameter values, a preset logical judgment is used. If the response frequency exceeds a preset threshold, the frequency parameter is reduced, and the emotional intensity is recalculated to determine the final parameter combination. This step ensures that the parameter values are within a reasonable range, avoiding abnormal dialogue responses due to improper parameter settings.
[0076] Extracting Dialogue Content Generation Rules: This step extracts dialogue content generation rules from the final determined parameter combination. It transforms the optimized parameter combination into specific dialogue content generation rules, guiding subsequent dialogue response generation.
[0077] The above method dynamically adjusts the response strategy based on priority coefficients, ensuring the personalization and adaptability of the dialogue response. Through logical judgment and parameter adjustment, it ensures the rationality of response frequency and emotional intensity, improving the dialogue effect. Transforming parameter combinations into specific dialogue content generation rules enhances the controllability and consistency of dialogue generation.
[0078] In some embodiments, based on dialogue content generation rules, sentence templates are selected from an emotional empathy expression library through semantic reasoning, and dialogue response text is generated through semantic optimization algorithms and tone adaptation rules, including:
[0079] Based on the dialogue content generation rules, initial sentence templates are obtained from a pre-established emotional empathy expression database through semantic reasoning. Initial screening is performed for different contexts to obtain a set of candidate templates that match the emotional tone.
[0080] Based on the candidate template set, a semantic optimization algorithm is used to adjust the template content at the semantic level. Combined with the context information processing step, if the semantic matching degree is lower than the preset threshold, the template is re-extracted until a semantically fitting optimized template is determined.
[0081] The optimized template is obtained, and the tone of the text is fine-tuned in combination with tone adaptation rules. The emotional tendency of the user input is matched to determine whether the tone is in line with the current dialogue scenario, and the adapted sentence text is obtained. The final dialogue response text is generated from the adapted sentence text.
[0082] In the above technical solution, the method aims to select and optimize sentence templates from an emotional empathy expression library through semantic reasoning and optimization algorithms to generate dialogue response text that conforms to the current dialogue scenario. Through semantic and tone adaptation, it ensures that the dialogue response is not only semantically coherent but also emotionally appropriate, ultimately outputting the dialogue content in a structured form.
[0083] Initial statement template acquisition and filtering: Based on dialogue content generation rules, initial statement templates are obtained from a pre-established emotional empathy expression library through semantic reasoning. Preliminary filtering is performed for different contexts to obtain a set of candidate templates that match the emotional tone. This step ensures that the emotional tone of the statement templates matches the current dialogue scenario, providing a suitable starting point for subsequent optimization.
[0084] Semantic optimization and template adjustment: Based on the candidate template set, a semantic optimization algorithm is used to adjust the template content at the semantic level. Combined with the context information processing step, if the semantic matching degree is lower than a preset threshold, the template is re-extracted until a semantically fitting optimized template is determined. This step ensures semantic consistency between the statement template and the dialogue content through semantic optimization, improving the coherence and logic of the dialogue.
[0085] Tone Adaptation and Fine-tuning: After obtaining the optimized template, the tone of the text is fine-tuned based on tone adaptation rules. This involves matching the tone to the emotional inclination of the user input to determine if it fits the current dialogue scenario, resulting in adapted sentence text. This step ensures that the tone of the dialogue response matches the user's emotions, enhancing the friendliness and naturalness of the conversation.
[0086] Dialogue Response Generation and Formatting: The final dialogue response content is generated from the adapted statement text. A preset formatting tool is used to structure the text, determining its output format. This step transforms the optimized statement text into the final dialogue response, ensuring its format meets system output requirements and providing a good user experience.
[0087] The aforementioned method, by combining semantic reasoning and an emotional empathy expression library, generates dialogue responses that are not only semantically coherent but also emotionally relevant, improving dialogue quality and user satisfaction. The introduction of a semantic matching threshold and template re-extraction mechanism ensures the accuracy and adaptability of the dialogue content, enabling dynamic responses to different dialogue scenarios. Fine-tuning the tone adaptation rules makes the tone of the dialogue responses more natural and friendly, enhancing the user's dialogue experience.
[0088] In some embodiments, based on historical dialogue rhythm data and user feedback records, an algorithm for matching time intervals and speech rates is used to adjust the output timing parameters of the dialogue response text to determine the final output configuration, including:
[0089] Obtain the raw records of historical conversations and user feedback, use data cleaning tools to remove invalid entries, and obtain a preliminarily processed data set;
[0090] Based on the pre-processed dataset, the time interval analysis method is used to calculate the rhythm information features in the dialogue and determine the characteristic values of the rhythm distribution.
[0091] Based on the characteristic values of rhythm distribution, obtain speech rate-related evaluations from user feedback, use a linear regression model to analyze the correlation of speech rate matching, and determine the benchmark value for speech rate adjustment.
[0092] If the baseline value for speech rate adjustment exceeds the preset threshold, the timing of the response text output will be dynamically adjusted to obtain the adjusted timing parameters.
[0093] By adjusting the timing parameters and combining rhythm information from historical dialogues, the output configuration of the response text is optimized to determine the final output scheme.
[0094] Based on the final output scheme, verify the fit between the time interval and the speech rate, obtain the verification result data, and determine whether the configuration meets the expected standard.
[0095] If the verification results do not meet the expected standards, the process is traced back to the calculation of the rhythm distribution characteristic value, the analysis parameters are adjusted, and a new output configuration is obtained.
[0096] In the above technical solution, the method adjusts the output timing parameters of the dialogue response text based on the historical dialogue rhythm and user feedback to optimize the naturalness of the dialogue and user experience. Through time interval and speech rate matching algorithms, the output timing is dynamically adjusted, and the configuration effect is verified to ensure that the dialogue system can respond to the user with an appropriate rhythm and speech rate.
[0097] Data preprocessing: Obtain the raw records of historical conversations and user feedback, and use data cleaning tools to remove invalid entries, resulting in a pre-processed dataset. This step ensures the data quality and validity for subsequent analysis.
[0098] Rhythm Information Feature Calculation: Based on the initially processed dataset, a time interval analysis method is used to calculate the rhythm information features in the dialogue and determine the feature values of the rhythm distribution. This step extracts the key features of the dialogue rhythm, providing a foundation for subsequent speech rate matching analysis.
[0099] Determining the baseline value for speech rate matching: Based on the characteristic values of rhythm distribution, speech rate-related evaluations from user feedback are obtained. A linear regression model is used to analyze the correlation of speech rate matching and determine the baseline value for speech rate adjustment. This step, through the combination of user feedback and rhythm characteristics, establishes the standard for speech rate adjustment.
[0100] Dynamic timing adjustment of output: If the baseline value for speech rate adjustment exceeds a preset threshold, the timing of the response text output is dynamically adjusted to obtain the adjusted timing parameters. This step ensures that the speech rate and timing of the dialogue response meet the user's expectations.
[0101] Output configuration optimization: By adjusting the timing parameters and combining rhythm information from historical dialogues, the output configuration of the response text is optimized to determine the final output scheme. This step integrates the adjusted parameters and historical rhythm information to generate the optimal output configuration.
[0102] Configuration Verification: Based on the final output scheme, verify the fit between the time interval and the speech rate, obtain the verification result data, and determine whether the configuration meets the expected standards. This step ensures the validity and reliability of the output configuration through verification.
[0103] Feedback loop: If the verification results do not meet the expected standards, the process returns to the calculation of the rhythm distribution characteristic values, adjusts the analysis parameters, and obtains a new output configuration. This step continuously optimizes the configuration through the feedback loop until the expected standards are met.
[0104] The above method dynamically adjusts output timing parameters, enabling the dialogue system to adapt to different conversational rhythms and user preferences. Adjustments based on historical data and user feedback ensure the scientific validity and effectiveness of the adjustments. The optimized dialogue output timing and speech rate matching significantly improve the naturalness of the dialogue and user satisfaction.
[0105] In some embodiments, the dialogue response text is generated through speech synthesis or text display, formatted and output according to the user device type, and then further includes:
[0106] Record user feedback after output, perform secondary emotional feature extraction on the user feedback, calculate the satisfaction quantification index and compare it with the dynamic threshold. If it is lower than the threshold, trigger the strategy adjustment process.
[0107] New dialogue response content is generated based on historical emotional states and current contextual features, and the interaction scheme is updated.
[0108] The above technical solution describes how to further optimize the dialogue system based on user feedback after outputting the response text to the user. The system records user feedback and extracts emotional features to calculate a satisfaction index. If the satisfaction level is lower than a dynamic threshold, the system will adjust the dialogue strategy and generate new response content to improve the user experience.
[0109] User feedback recording and sentiment feature extraction: After outputting the response text to the user in voice or text form, the system records the user's subsequent feedback behavior. Secondary sentiment feature extraction is performed on this feedback to further understand the user's emotional state.
[0110] Satisfaction quantification and threshold comparison: Calculate the user satisfaction quantification index based on the extracted emotional features.
[0111] The satisfaction index is compared with the dynamic threshold set by the system to determine whether the user is satisfied with the current conversation.
[0112] Strategy adjustment trigger: If the user's satisfaction quantification index is lower than the dynamic threshold, it indicates that the user may be dissatisfied with the conversation, and the strategy adjustment process will be triggered at this time.
[0113] New dialogue response generation: This involves combining the user's historical emotional state with current contextual features to generate new dialogue response content. The interaction scheme of the dialogue system is then updated based on this new response content to improve the user experience.
[0114] The above methods, by recording and analyzing user feedback, enable the system to proactively identify and respond to users' emotional needs, thereby improving dialogue quality. Adjusting dialogue strategies based on real-time sentiment analysis enhances the adaptability and flexibility of the dialogue system. The introduction of quantitative satisfaction indicators and dynamic threshold comparisons provides a quantitative basis for continuous system improvement.
[0115] In some embodiments, user feedback after output is recorded, secondary emotional feature extraction is performed on the user feedback, a satisfaction quantification index is calculated and compared with a dynamic threshold, and if it is lower than the threshold, a strategy adjustment process is triggered, including:
[0116] Initial data is obtained from feedback records, and text analysis tools are used to perform preliminary cleaning and word segmentation on the data to obtain structured text content.
[0117] Based on the structured text content, a pre-established sentiment classification model is used to extract sentiment features from the text and determine the sentiment category.
[0118] For sentiment categories, a secondary extraction process is implemented, and natural language processing technology is used to deeply analyze sentiment features to obtain refined sentiment labels;
[0119] Key emotional elements are extracted from refined emotional tags, quantitative indicators of satisfaction are calculated, and numerical results of satisfaction are determined.
[0120] If the satisfaction score is lower than the preset dynamic threshold, the indicator comparison logic is triggered to determine whether the strategy adjustment conditions are met; if the strategy adjustment conditions are met, the adjustment process is initiated.
[0121] In the above technical solution, the method focuses on in-depth processing and strategy optimization of user feedback, aiming to accurately identify the user's satisfaction level with the dialogue response through secondary emotional feature extraction and quantitative satisfaction assessment. Once a substandard satisfaction level is detected, a strategy adjustment process is initiated to achieve continuous improvement and optimization of the dialogue system's performance.
[0122] User feedback data preprocessing: Initial data is obtained from feedback records, and preliminary cleaning and word segmentation are performed using text analysis tools to produce structured text content. This step lays the foundation for subsequent sentiment analysis and ensures the standardization and usability of the data.
[0123] Initial Sentiment Feature Extraction: Based on a pre-defined sentiment classification model, sentiment features are extracted from structured text content to accurately pinpoint the text's sentiment orientation. This step initially reveals the sentiment direction of user feedback, laying the groundwork for in-depth analysis.
[0124] In-depth sentiment feature mining: For the identified sentiment categories, a secondary extraction process is initiated, using natural language processing technology to deeply analyze sentiment features and generate refined sentiment tags. This step delves deeper into the connotation of emotions, making sentiment understanding more accurate.
[0125] Satisfaction Quantification Assessment: Key emotional elements are extracted from refined emotional tags, and quantitative satisfaction indicators are calculated and converted into specific numerical satisfaction results. This step quantifies emotional feedback, facilitating subsequent comparative analysis.
[0126] Satisfaction threshold comparison and strategy adjustment: The quantified satisfaction value is compared with a preset dynamic threshold. If it falls below the threshold, the indicator comparison logic is activated to determine whether it meets the conditions for strategy adjustment. Once the conditions are met, the adjustment process is immediately initiated to ensure that the dialogue system can dynamically optimize its strategy based on user satisfaction.
[0127] The above method fully leverages the value of user feedback through secondary emotional feature extraction and quantitative analysis, driving dialogue system optimization. Adjustments are triggered in real-time based on dynamic satisfaction thresholds, ensuring the dialogue system responds swiftly to changes in user emotional needs. Natural language processing technology deeply analyzes emotional features, generating refined emotional tags to help accurately grasp user emotions.
[0128] In some embodiments, new dialogue response content is generated based on historical emotional states and current contextual features, and the interaction scheme is updated, including:
[0129] Historical emotional state data is obtained, and emotional state records from past user interactions are extracted from a pre-established database. The records are then preliminarily classified to obtain the distribution characteristics of emotional states.
[0130] Based on the distribution characteristics of emotional states and combined with the input information of the current context, the key emotional tendencies in the current context are determined by analyzing the features of the text input by the current user through context matching technology.
[0131] Based on key sentiment tendencies and combined with the distribution characteristics of historical sentiment states, dialogue response content is generated. It is then judged whether the response content meets the semantic requirements of the current context. If it does not meet the requirements, the content generation logic is readjusted to obtain response text that meets the context.
[0132] Based on the generated response text, strategies for adjusting the interaction scheme are formulated. If the adjustment strategy conflicts with the historical interaction scheme, a selection is made according to preset priority rules to determine the final version of the interaction scheme.
[0133] In the aforementioned technical solution, the method aims to generate new dialogue response content by analyzing historical emotional states and current contextual features, and update the interaction scheme accordingly. This not only enhances the relevance and emotional resonance of the dialogue, but also ensures continuous optimization of the dialogue system and improved user experience through dynamic adjustment of interaction strategies.
[0134] Historical Emotional State Data Acquisition and Classification: This step involves acquiring historical emotional state data by extracting records of user past interactions from a pre-established database. These records are then preliminarily classified to determine the distribution characteristics of emotional states. This process, by analyzing users' historical emotional data, provides a foundation for subsequent sentiment analysis and response generation.
[0135] Contextual Feature Analysis and Sentiment Determination: Based on the distribution characteristics of emotional states and combined with the input information of the current context, contextual matching technology is used to analyze the features of the text input by the current user to determine the key sentiment tendencies in the context. This step accurately identifies the user's current emotional needs by combining historical sentiment with the current context.
[0136] Dialogue response content generation and semantic verification: Based on key sentiment trends and combined with the distribution characteristics of historical sentiment states, dialogue response content is generated. The system determines whether the response content conforms to the semantic requirements of the current context. If not, the content generation logic is readjusted to obtain a context-appropriate response text. This step ensures that the generated dialogue response is not only sentimentally relevant but also semantically accurate.
[0137] Interaction scheme adjustment and conflict resolution: Based on the generated response text, adjustment strategies are formulated for the interaction scheme. If the adjustment strategy conflicts with the historical interaction scheme, a selection is made according to preset priority rules to determine the final interaction scheme version. This step ensures the consistency and effectiveness of the dialogue system's strategy by dynamically adjusting the interaction scheme.
[0138] The above methods, combining historical emotional states with current contextual features, generate dialogue responses that better match users' emotional and semantic needs, enhancing the naturalness and approachability of the dialogue. By continuously updating the interaction scheme, the dialogue system can adapt to changes in users' emotional states and contextual needs, ensuring continuous optimization of the dialogue strategy. Introducing priority rules resolves conflicts between the adjustment strategy and historical schemes, guaranteeing the consistency and reliability of the interaction scheme. Attached Figure Description
[0139] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0140] Figure 1 This is a flowchart illustrating an embodiment of an AI dialogue scene control method with emotion recognition function according to the present invention. Detailed Implementation
[0141] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0142] Example 1
[0143] Please see Figure 1 A method for controlling AI dialogue scenarios with emotion recognition capabilities, the method includes:
[0144] S1. Obtain text and voice data provided by the user, extract emotional features using a multimodal sentiment analysis model, fuse the emotional features using a pre-trained feature fusion algorithm, and classify them to obtain emotional category labels;
[0145] In this embodiment, S1, the user-provided text and voice data are acquired, a multimodal sentiment analysis model is used to extract sentiment features, and a pre-trained feature fusion algorithm is used to fuse the sentiment features and classify them to obtain sentiment category identifiers, including:
[0146] S11. By obtaining text information and voice data from user submissions, a multimodal sentiment analysis model is used for preliminary processing to extract sentiment features.
[0147] S12. Based on the extracted sentiment features, a pre-trained fusion algorithm is applied to weight the features to obtain a comprehensive sentiment vector.
[0148] S13. Perform classification processing on the comprehensive sentiment vector to determine the corresponding sentiment category label;
[0149] S14. If the confidence level of the sentiment category identifier is lower than the preset threshold, then perform secondary feature extraction on the original text information and voice data to obtain supplementary sentiment features.
[0150] S15. By fusing supplementary emotional features and comprehensive emotional vectors, a weighted processing is re-executed to obtain the final emotional category label.
[0151] For example, in the process of implementing multimodal sentiment analysis, the system first automatically acquires the text content and voice data provided by the user. For instance, the user inputs a text message, "I'm in a terrible mood today, and I'm under too much work pressure," and uploads a 30-second voice file. The system uses natural language processing technology to segment and semantically analyze the text, extracting the sentiment words "terrible" and "pressure," and calculates the sentiment score. Assuming the score for "terrible" is -0.8 and the score for "pressure" is -0.6, the overall text sentiment score is -0.7. Next, feature extraction is performed on the voice data. The Mel frequency-cephalic coefficient algorithm is used to analyze the pitch and speech rate of the voice. Assuming the average pitch frequency is 200Hz and the speech rate is 5 words / second, which is below the normal range, the extracted sentiment features result in a voice sentiment score of -0.5. Subsequently, the system employs a pre-trained multimodal feature fusion algorithm, such as the Transformer model based on an attention mechanism, to weight and integrate text and speech features. Assuming a text feature weight of 0.6 and a speech feature weight of 0.4, the resulting comprehensive sentiment score is -0.7*0.6 + (-0.5)*0.4 = -0.62. Then, the system maps the comprehensive score to a sentiment category using a classifier. Assuming a threshold of -0.3, values below this are considered "negative sentiment," and the resulting sentiment category identifier is "negative." This identifier is stored in a temporary storage unit, such as a temporary key-value pair in a Redis database, with the key "user_123_emotion" and the value "negative," and an expiration time of 24 hours. To establish business relationships, the system combines this sentiment identifier with user behavior logs, such as recording whether a user triggered the help function while in a negative sentiment state. This log data is stored as "user_123_log:negative_help_1," facilitating subsequent analysis of the correlation between user behavior patterns and sentiment states, ensuring rigorous data processing logic and traceability.
[0152] S2. Based on the emotion category identifier, extract contextual features from historical dialogue records and use a time decay weighted algorithm to calculate the quantitative value of the emotion change trend;
[0153] In this embodiment, S2, based on the emotion category identifier, extract contextual features from historical dialogue records, and calculate the quantitative value of the emotion change trend using a time decay weighted algorithm, including:
[0154] S21. Obtain contextual feature data from historical dialogue records, perform preliminary classification processing based on emotion category identifiers, and determine the preliminary emotion classification results by comparing with a preset emotion feature library.
[0155] S22. Based on the preliminary sentiment classification results, the time decay weighting method is used to calculate the sentiment changes in historical dialogues, and a weighted value sequence of sentiment changes is obtained.
[0156] S23. For the weighted value sequence of emotional changes, obtain the time dimension features, and determine the direction of fluctuation of the emotional change trend by analyzing the effect of time decay. If the fluctuation value exceeds the preset threshold, it is marked as a significant change point.
[0157] S24. Based on the significant change points, extract the corresponding contextual features and sentiment category data, and use a linear regression model to quantify the change trend to obtain trend quantification indicators.
[0158] S25. For the trend quantification indicator, obtain its correlation characteristics with historical dialogue records. If the correlation characteristics are lower than the preset matching degree, then correct the quantification indicator and determine the final sentiment change trend value.
[0159] For example, in processing sentiment category identification and analyzing sentiment change trends, the system first extracts contextual features from historical dialogue records. Assuming a user's dialogue records from the past 7 days contain 10 sentiment-related data points, 5 are labeled "positive" (sentiment value set to 1.0), 3 are "neutral" (sentiment value set to 0.0), and 2 are "negative" (sentiment value set to -1.0). The system uses natural language processing technology to extract contextual keywords from each dialogue, such as "happy" and "thankful" corresponding to positive sentiment, and "disappointed" and "complaining" corresponding to negative sentiment, forming a contextual feature vector. Next, the system uses a time-decay weighted algorithm to calculate the quantitative value of sentiment change trends. Specifically, each sentiment data point is weighted according to its temporal proximity. The weight of the most recent day's data is 1.0, decreasing by 0.1 for each day prior, with the weight of the data from the most distant 7 days being 0.4. The calculation formula is: Sentiment Trend Value = Σ(Sentiment Value × Time Weight) / Σ Time Weight. The calculated sentiment trend value is 0.35, indicating that the overall sentiment is biased towards positive but of moderate intensity. Subsequently, the system performs a correlation analysis on this quantified value with other business data, such as user activity (assuming activity is the number of daily logins, currently 3 times). The analysis reveals a positive correlation between the sentiment trend value and activity, suggesting that positive sentiment may promote user engagement. Finally, the system updates the sentiment trend value of 0.35 and the related analysis results to a temporary storage unit, using a database transaction mechanism to ensure data consistency. The storage format is JSON, containing the fields "trend_value:0.35" and "update_time: current timestamp," facilitating subsequent real-time calls and dynamic adjustments by the sentiment monitoring module.
[0160] S3. Call the dynamic scene classification rule library, match the scene category corresponding to the quantified value, and calculate the emotional response priority coefficient in combination with the preset demand priority weight.
[0161] In this embodiment, S3, calling the dynamic scene classification rule library, matching the scene category corresponding to the quantified value, and calculating the emotional response priority coefficient by combining the preset demand priority weight, including:
[0162] S31. Using a preset rule base, obtain matching rule data for scene classification, perform a preliminary comparison against the input quantified value, and determine the preliminary scene category attribution.
[0163] S32. Based on the initial scene category attribution, the quantified value is verified a second time using classification judgment logic. If the verification result is consistent with the initial attribution, the final scene category attribution is confirmed.
[0164] S33. After obtaining the final scene category classification, assess the priority of the needs, extract the corresponding weight data from the preset priority weight table, and calculate the priority coefficient of the emotional response.
[0165] S34. By calculating the priority coefficient and combining it with the response calculation logic, the urgency of the response is determined. If the priority coefficient exceeds the preset threshold, a high-priority response process is triggered.
[0166] S35. Based on the triggering result of the high-priority response process, the calculated priority coefficient and response process data are stored in a structured manner to obtain persistent business records.
[0167] S36. By persistent business records, perform correlation analysis on scene categories and emotional response data to determine the execution path of subsequent business processes;
[0168] S37. After obtaining the execution path of the subsequent business process, optimize and adjust the emotional response data in the path, and determine whether the optimized response data meets the preset standard. If it meets the standard, complete the output of the final response data.
[0169] For example, in the process of calling the dynamic scene classification rule base and subsequent processing, suppose we have an intelligent emotion response system. First, the system calls the rule base to match the scene category corresponding to the quantification value. For example, the system receives a user's voice input with an emotion quantification value of 0.75 (range 0 to 1, 1 represents extremely positive). Through the preset threshold matching in the rule base, the rule stipulates that a quantification value between 0.7 and 1.0 corresponds to a "positive scene", 0.4 to 0.7 is a "neutral scene", and below 0.4 is a "negative scene". Therefore, 0.75 is classified as a "positive scene". Next, the emotion response priority coefficient is calculated by combining the preset demand priority weight. Assuming that the priority weight of "positive scene" is 0.8, "neutral scene" is 0.5, and "negative scene" is 0.9 (negative scene has a higher priority for timely intervention), the calculation formula is: priority coefficient = quantification value × weight + basic adjustment value (set to 0.1). Then, the priority coefficient of the current scene is 0.75 × 0.8 + 0.1 = 0.7. The analysis showed that a coefficient of 0.7 indicates a high priority response, but not as high as the potential high value for a negative scenario (e.g., the quantified value of 0.3 × 0.9 + 0.1 = 0.37 may still be adjusted due to other factors). Finally, the coefficient was stored in the database, and the system automatically generated a record containing the scenario category "positive scenario," the quantified value of 0.75, the priority coefficient of 0.7, and associated with the user ID and timestamp for subsequent querying and analysis, forming a complete data chain. For example, if subsequent business involves user behavior tracking, the system can automatically adjust the frequency of push notifications based on the stored priority coefficient, ensuring that users in high-priority scenarios receive more timely feedback.
[0170] S4. Based on the priority coefficient, extract the response strategy framework from the operation control strategy mapping table, adjust the response frequency and emotion expression intensity parameters, and generate dialogue content generation rules.
[0171] In this embodiment, S4, based on the priority coefficient, extract the response strategy framework from the operation control strategy mapping table, adjust the response frequency and emotion expression intensity parameters, and generate dialogue content generation rules, including:
[0172] S41. Determine the initial response strategy framework structure by obtaining the control strategy corresponding to the priority coefficient from the preset mapping table data.
[0173] S42. Based on the obtained framework structure, adjust the parameter values of response frequency and emotional intensity to obtain an adapted dialogue generation mode.
[0174] S43. For the adjusted parameter values, a preset logic judgment is adopted. If the response frequency exceeds the preset threshold, the frequency parameter is reduced and the emotional intensity is recalculated to determine the final parameter combination.
[0175] S44. Extract dialogue content generation rules from the determined final parameter combination.
[0176] For example, when processing the dialogue generation task, the system first extracts the response strategy framework from the operation control strategy mapping table based on the priority coefficient. Assuming the priority coefficient is 0.85, the system uses a weighted algorithm to calculate the matching degree between this coefficient and the strategy in the mapping table. The formula is: Matching degree = Priority coefficient × Strategy weight (assuming the weight is 0.6), resulting in a matching degree of 0.51. The system selects strategy framework A, which has the highest matching degree, and its core is rapid response and neutral emotion expression. Next, the system adjusts the response frequency and emotion expression intensity parameters. Based on the analysis of the user's historical interaction data, the system finds that the average response interval is 3.5 seconds. Combining this with the current priority coefficient of 0.85, the response frequency is adjusted to 2.8 seconds. The calculation formula is: New frequency = Original frequency × (1 - Priority coefficient × 0.2). At the same time, the emotion expression intensity parameter is increased from the default value of 5 to 7 (out of 10). The user's emotion fluctuation value is calculated to be 0.3 using the emotion analysis model. Combining this with the intensity adjustment formula, New intensity = Default intensity + Fluctuation value × 10, the final value is 7. Then, the system generates dialogue content generation rules. Based on strategy framework A and the adjusted parameters, the system constructs rules such as "the response must contain at least 30% comforting words and the speaking speed should be controlled at 120 words per minute".
[0177] S5. Based on the dialogue content generation rules, select sentence templates from the emotional empathy expression library through semantic reasoning, and generate dialogue response text through semantic optimization algorithm and tone matching rules;
[0178] In this embodiment, S5, based on the dialogue content generation rules, selects a sentence template from the emotional empathy expression library through semantic reasoning, and generates dialogue response text through semantic optimization algorithms and tone adaptation rules, including:
[0179] S51. Based on the dialogue content generation rules, the initial sentence templates are obtained from the pre-established emotional empathy expression library through semantic reasoning. The initial screening is carried out for different contexts to obtain a set of candidate templates that conform to the emotional tone.
[0180] S52. Based on the candidate template set, the semantic optimization algorithm is used to adjust the template content at the semantic level. Combined with the context information processing step, if the semantic matching degree is lower than the preset threshold, the template is re-extracted until the optimized template with semantic fit is determined.
[0181] S53. Obtain the optimized template, fine-tune the tone of the text according to the tone adaptation rules, match the emotional tendency of the user input, determine whether the tone is in line with the current dialogue scenario, and obtain the adapted sentence text; generate the final dialogue response text through the adapted sentence text.
[0182] For example, rules based on dialogue content are generated using a natural language generation algorithm. For instance, the rule "The response must contain at least 30% comforting words, and the speaking speed should be controlled at 120 words per minute" is transformed into the template "We understand how you feel. We will resolve this as soon as possible, expected to be completed within X hours," where X is calculated by the system as 2 hours based on the task's urgency. Finally, the generated rules are cached in an in-memory database with a 24-hour expiration time. The LRU (Least Recently Used) algorithm is used to manage the cache space; if the cache occupancy rate exceeds 80%, the oldest 10% of data is automatically cleaned up to ensure efficient system operation. For example, when building an emotional empathy dialogue system, the system first selects sentence templates from an emotional empathy expression library based on dialogue content generation rules and semantic reasoning. Assuming the system detects that the rule must contain at least 30% comforting words, the semantic reasoning module calculates the sentiment vector value of the input text based on a sentiment classification model (such as a BERT-based sentiment analysis model). If the confidence score for the "feeling of loss" is 0.85, exceeding the preset threshold of 0.7, a template matching the "feeling of loss" tag is selected from the expression library, such as "I can sense you're not feeling well. Is there anything I can do to help you?". Next, the system enters the semantic optimization algorithm stage. Using a natural language generation model (such as GPT-2), the system semantically expands the template, combining the user's specific input context of "failing the exam," optimizing the template to "I can sense you're not feeling well because you failed the exam. Is there anything I can do to help you?". During the optimization process, semantic similarity calculation (cosine similarity value of 0.92) ensures that the sentence is highly relevant to the user's context. Subsequently, the tone-adaptation rules adjust the tone of the sentences based on the user's historical dialogue style data (analysis shows that the user prefers a mild tone, with a weight of 0.8). This involves adding gentle words such as "really," ultimately generating the sentence, "I can really feel that you're not in a good mood because you didn't do well on the exam. Is there anything I can do to help you?" The tone-adaptation score is evaluated using a tone-rating model, achieving a tone fit of 0.88, which meets the output criteria. Finally, the generated dialogue response text is stored in the database. The system uses a distributed storage architecture, categorizing and storing the text by user ID and timestamp (e.g., 2023-10-01 14:30:25). A unique identifier (e.g., RESP_20231001_143025_001) is generated for subsequent retrieval and analysis, ensuring data traceability. The entire process forms a complete logical chain from sentiment recognition to sentence generation and storage, with quantitative indicators such as sentiment confidence, semantic similarity, and tone scoring ensuring the quality of the generated text.
[0183] S6. Based on historical dialogue rhythm data and user feedback records, adjust the output timing parameters of the dialogue response text using a time interval and speech rate matching algorithm to determine the final output configuration.
[0184] In this embodiment, S6, based on historical dialogue rhythm data and user feedback records, an algorithm for matching time intervals and speech rates is used to adjust the output timing parameters of the dialogue response text to determine the final output configuration, including:
[0185] S61. Obtain the original records of historical dialogues and user feedback, use data cleaning tools to remove invalid entries, and obtain a pre-processed data set;
[0186] S62. Based on the pre-processed data set, use the time interval analysis method to calculate the rhythm information features in the dialogue and determine the characteristic values of the rhythm distribution.
[0187] S63. Based on the characteristic values of rhythm distribution, obtain speech rate-related evaluations from user feedback, use a linear regression model to analyze the correlation of speech rate matching, and determine the benchmark value for speech rate adjustment.
[0188] S64. If the baseline value for speech rate adjustment exceeds the preset threshold, the timing of the response text output will be dynamically adjusted to obtain the adjusted timing parameters.
[0189] S65. By adjusting the timing parameters and combining the rhythm information in historical dialogues, optimize the output configuration of the response text and determine the final output scheme.
[0190] S66. Based on the final output scheme, verify the fit between the time interval and the speech rate, obtain the verification result data, and determine whether the configuration meets the expected standard.
[0191] S67. If the verification results do not meet the expected standards, then backtrack to the calculation of the rhythm distribution characteristic value, adjust the analysis parameters, and obtain a new output configuration.
[0192] For example, in adjusting the timing parameters of the response text output, the system first analyzes historical dialogue rhythm data to extract the average time interval between user and system interactions. Assuming historical data shows an average user reply interval of 3.5 seconds and an average system response interval of 2.0 seconds, a time interval matching algorithm is used to adjust the system response time in the current dialogue scenario to approximately 3.0 seconds, close to the user's habit. The calculation formula is: Target interval = (Average user interval + Average system interval) / 2, i.e., (3.5 + 2.0) / 2 = 2.75 seconds, rounded down to 3.0 seconds, to improve the smoothness of the user experience. Next, combining user feedback records, the system analyzes user satisfaction ratings for response speed. Assuming that 60% of users in the rating data believe that a too-fast response leads to information processing pressure, the system uses weighted analysis to increase the response time by 0.5 seconds as a buffer, ultimately determining it to be 3.5 seconds. The calculation process is: Adjusted time = Target interval + Buffer time, i.e., 3.0 + 0.5 = 3.5 seconds. Next, for the speech rate matching algorithm, the speech rate features of the user input text are extracted. Assuming the user's input speech rate is 300 words per minute, the system output speech rate is set to approximately 280 words per minute, close to the user's, through the speech rate adjustment interface of the speech synthesis system. The calculation method is: target speech rate = user speech rate × 0.93, i.e., 300 × 0.93 = 279, rounded to 280 words per minute, ensuring a natural and easily understandable speech rate. Finally, the time interval and speech rate parameters are integrated into the final output configuration. The system automatically generates a configuration file, setting the response time to 3.5 seconds and the speech rate to 280 words per minute. The adjustment effect is recorded through background logs. If subsequent user feedback indicates discomfort, an adaptive algorithm is triggered to recalculate the parameters based on new data, forming a closed-loop optimization logic to ensure that the output timing is highly matched with user habits.
[0193] S7. The dialogue response text is generated through speech synthesis or text display, and the format is adapted and output according to the user's device type.
[0194] In this embodiment, S7, the dialogue response text is displayed via speech synthesis or text display, formatted and output according to the user device type, including:
[0195] S71. By obtaining response text data from the source system, the processing flow is started to obtain the initial text to be processed.
[0196] S72. Based on the characteristics of the initial text to be processed, determine its applicable scenario. If the text is suitable for speech output, it is transmitted to the speech synthesis module to determine the speech format data; if the text is suitable for visual output, it is transmitted to the text display module to determine the display format data.
[0197] S73. For voice format data or display format data, obtain the user's device type information. If the device type supports high-resolution display, adjust it to a high-adaptability format to obtain the adapted output content; if the device type is audio-only, optimize it to an audio-first format to obtain the adapted output content.
[0198] S74. Using the adapted output content and combining it with the device type information, distribute the data through the output interface, determine whether the distribution was successful, and obtain the distribution status information.
[0199] S75. Extract user interaction data from the distribution status information, classify the interaction data, and if the interaction data contains feedback information, transmit it to the storage module to determine the feedback data record.
[0200] S76. Based on the feedback data records and combined with the preset analysis rules, obtain user preference information through logical comparison, determine whether the preference information meets the preset threshold, and obtain the user preference classification result.
[0201] S77. Based on the user preference classification results, adjust the processing strategy for subsequent response texts, adopt the classification result update module transmission rules, and determine the optimized processing flow.
[0202] For example, the specific implementation method for passing the response text to the speech synthesis module or text display module, adapting the format and outputting it according to the user's device type, and storing user feedback records can be achieved as follows: First, assuming the response text is a 500-word article, the system will transmit the text data in JSON format to the speech synthesis module and text display module via an interface. The speech synthesis module uses deep learning-based TTS technology, sets the sampling rate to 44.1kHz, the pitch parameter to 1.2, and generates an audio file, with an estimated processing time of 3 seconds. The text display module adjusts the font size to 16px and the line spacing to 1.5 times according to the device type (e.g., a mobile phone screen resolution of 1080x1920) to ensure reading comfort. The adaptation algorithm calculates the optimal layout based on the screen aspect ratio, with an error controlled within 5%. Second, device type recognition is achieved through user agent string analysis. The system parses the device information in the HTTP request header and matches it against the preset device rule base in the database, achieving a recognition rate of 98%. If recognition fails, the system defaults to adapting to the standard PC layout to ensure error-free output. Next, during the output process, the audio files are stored in MP3 format, with a file size of approximately 2MB, while the text is rendered using HTML5, with loading time controlled within 0.5 seconds to ensure a smooth user experience. Finally, when storing user feedback records, the system automatically generates a unique identifier ID (such as UUID format) and stores the user's device type, output format (audio or text), feedback timestamp (e.g., 2023-10-01 14:30:00), and satisfaction rating (assuming 4.2 out of 5) in a MySQL database. The storage process uses a transaction mechanism to ensure data consistency, with an average write time of 0.02 seconds. Simultaneously, by analyzing the feedback data, the system calculates the average satisfaction score. If it falls below 3.5, an optimization algorithm is triggered to adjust the audio pitch or text layout parameters, forming a closed-loop optimization logic to ensure improved output quality in subsequent outputs.
[0203] In this embodiment, S7, the dialogue response text is synthesized or displayed via speech synthesis, formatted according to the user device type, and then output. This process further includes:
[0204] S8. Record the user feedback after output, perform secondary emotional feature extraction on the user feedback, calculate the satisfaction quantification index and compare it with the dynamic threshold. If it is lower than the threshold, trigger the strategy adjustment process.
[0205] In this embodiment, S8, the user feedback after output is recorded, secondary emotional feature extraction is performed on the user feedback, a satisfaction quantification index is calculated and compared with a dynamic threshold, and if it is lower than the threshold, a strategy adjustment process is triggered, including:
[0206] S81. By obtaining initial data from feedback records, a text analysis tool is used to perform preliminary cleaning and word segmentation on the data to obtain structured text content;
[0207] S82. Based on the structured text content, use a pre-established sentiment classification model to extract sentiment features from the text and determine the sentiment tendency category;
[0208] S83. For sentiment tendency categories, implement a secondary extraction process and use natural language processing technology to conduct in-depth analysis of sentiment features to obtain refined sentiment labels;
[0209] S84. Extract key emotional elements from refined emotional tags, calculate quantitative indicators of satisfaction, and determine the numerical results of satisfaction.
[0210] S85. If the satisfaction value is lower than the preset dynamic threshold, the indicator comparison logic is triggered to determine whether the strategy adjustment conditions are met; if the strategy adjustment conditions are met, the adjustment process is started.
[0211] For example, a specific implementation method for extracting secondary sentiment features from feedback records and calculating a quantitative satisfaction index can be achieved by analyzing user feedback text using natural language processing technology. For instance, assuming a feedback record is received stating "The text quality is average, and the response speed is too slow," the text is first segmented and sentiment words are extracted using a sentiment analysis model. "Average" corresponds to a neutral sentiment value of 0.5, and "too slow" corresponds to a negative sentiment value of -0.8. The overall sentiment score is calculated using a weighted average algorithm as (0.5*0.4+(-0.8)*0.6)=-0.28, indicating a slightly negative sentiment. Next, the quantitative satisfaction index is calculated. Assuming the satisfaction formula is: Satisfaction = Sentiment Score * 50 + 50, the satisfaction score is (-0.28*50+50)=36 points. Subsequently, this index is compared with a dynamic threshold. Assuming the dynamic threshold is set to 40 points based on historical data and user behavior analysis, the system automatically compares the scores and finds that 36 points is lower than 40 points, triggering a strategy adjustment process. The system automatically invokes preset strategy adjustment algorithms. For example, based on the keyword "response speed is too slow" in the feedback, it matches strategies to optimize response speed and generates adjustment suggestions such as "shorten the response time to 2.5 seconds and increase the speech speed by 30%." These suggestions are then pushed to relevant business systems for execution. Simultaneously, to ensure a closed-loop logic, the system records the effect data after adjustments. For instance, if user satisfaction increases to 45 points after the adjustment, a data feedback loop is formed for subsequent dynamic threshold adjustments and strategy optimization, ensuring the entire process is automated through information technology.
[0212] S9. Generate new dialogue response content based on historical emotional states and current context features, and update the interaction scheme.
[0213] In this embodiment, S9, generating new dialogue response content based on historical emotional states and current context features, and updating the interaction scheme, includes:
[0214] S91. Obtain historical emotional state data, extract emotional state records from past user interactions from a pre-established database, perform preliminary classification on the records, and obtain the distribution characteristics of emotional states.
[0215] S92. Based on the distribution characteristics of emotional states and combined with the input information of the current context, the key emotional tendencies in the current context are determined by analyzing the features of the text input by the current user through context matching technology.
[0216] S93. Based on key sentiment tendencies and combined with the distribution characteristics of historical sentiment states, generate dialogue response content, determine whether the response content meets the semantic requirements of the current context, and if not, readjust the content generation logic to obtain response text that meets the context.
[0217] S94. Based on the generated response text, formulate an adjustment strategy for the interaction scheme. If the adjustment strategy conflicts with the historical interaction scheme, select the final interaction scheme version by means of a preset priority rule.
[0218] For example, when generating new dialogue response content, the system first analyzes the user's historical emotional state data, extracting records of the user's emotional fluctuations over the past 30 days. For instance, positive emotions account for 60%, negative emotions for 30%, and neutral emotions for 10%. This data is then combined with an emotional intensity score (average 7.5, range 1 to 10) to construct an emotional model. A weighted average algorithm is used to calculate the current emotional tendency index as 6.8, indicating that the user is likely in a relatively positive but slightly fluctuating state. Next, the system analyzes the current contextual features, extracting keywords and tone features from the user's input text. For example, it detects that the word "happy" appears 3 times per 100 characters in the input, with a tone analysis score of 8.2 (based on a natural language processing model). Combining this with the context, the system determines that the user's current context is relaxed and pleasant. Based on this, the system adjusts its dialogue strategy, prioritizing a warm and encouraging tone, generating a response such as, "I'm so glad to hear you're so happy. Is there anything special you'd like to share lately?" Subsequently, the system updated the interaction scheme, inputting the sentiment index of 6.8 and the context score of 8.2 as parameters into the dialogue generation model. It dynamically adjusted the selection probability of positive corpora in the response library, increasing it from the default 50% to 70%, and decreasing the selection probability of neutral corpora to 20%, to ensure that subsequent dialogues better match the user's emotional needs. Finally, the system stored the adjustment results in the database, recording the update logs of sentiment model parameters, context analysis data, and response generation strategies. For example, it stored the sentiment index of 6.8, the context score of 8.2, and the probability adjustment values (70% positive, 20% neutral), and used timestamps as unique identifiers for the current session for easy retrieval and optimization. Simultaneously, an automatic backup mechanism was triggered to ensure that data is stored both in the cloud and locally, guaranteeing the continuity and traceability of interaction scheme adjustments. Through this series of automated processes, the system achieved a complete closed loop from sentiment analysis to response generation to strategy updates, ensuring a high degree of match between dialogue content and user state, while providing data support for subsequent business operations such as user behavior prediction, forming a tight logical chain.
[0219] This embodiment discloses an AI dialogue scene control method with emotion recognition functionality. The method analyzes user-provided text and voice data, extracts emotional features, and fuses and classifies them to obtain emotion category identifiers. Combining historical dialogue records, it calculates emotional change trends and matches corresponding scene categories. Based on priority coefficients, it selects a response framework from a strategy library and adjusts parameters to generate dialogue rules. Semantic reasoning is used to select suitable expression templates from an emotion empathy library to optimize the generated response text. Considering the rhythm of historical dialogues and user feedback, the output timing is adjusted. Finally, the response content is output to the corresponding module and further adjusted based on user feedback. This invention achieves intelligent emotion recognition, analysis, and response, improving the naturalness of human-computer dialogue and user satisfaction.
[0220] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1.An AI conversation scenario control method having an emotion recognition function, the method comprising: receiving a user input; determining a user emotion based on the user input; and controlling an AI conversation scenario based on the determined user emotion. The method comprises: Obtaining text and voice data provided by a user, extracting emotional features by using a multi-modal emotion analysis model, fusing the emotional features by using a pre-trained feature fusion algorithm, and classifying to obtain an emotional category identifier; According to the emotional category identifier, extracting context features from historical dialogue records, and calculating a quantitative value of an emotional change trend by using a time decay weighting algorithm; Calling a dynamic scene classification rule library, matching the scene category corresponding to the quantitative value, and calculating an emotional response priority coefficient in combination with a preset demand priority weight; According to the priority coefficient, extracting a response strategy framework from an operation control strategy mapping table, adjusting response frequency and emotional expression intensity parameters, and generating dialogue content generation rules; Based on the dialogue content generation rules, selecting a sentence template from an emotional empathy expression library through semantic reasoning, and generating dialogue response text through a semantic optimization algorithm and a tone adaptation rule; According to historical dialogue rhythm data and user feedback records, adjusting the output timing parameters of the dialogue response text by using a time interval and speech speed matching algorithm, and determining the final output configuration; The dialogue response text is output through voice synthesis or text display, format adaptation according to the user device type and output. 2.The AI conversation scenario control method with emotion recognition function of claim 1, wherein, Obtaining text and voice data provided by a user, extracting emotional features by using a multi-modal emotion analysis model, fusing the emotional features by using a pre-trained feature fusion algorithm, and classifying to obtain an emotional category identifier, comprising: By obtaining text information and voice data from user submission, using a multi-modal emotion analysis model for preliminary processing, and extracting emotional features; According to the extracted emotional features, applying a pre-trained fusion algorithm to weight the features to obtain a comprehensive emotional vector; Classifying the comprehensive emotional vector to determine the corresponding emotional category identifier; If the confidence of the emotional category identifier is lower than a preset threshold, perform secondary feature extraction on the original text information and voice data to obtain supplementary emotional features; By fusing the supplementary emotional features and the comprehensive emotional vector, re-performing the weighting processing to obtain the final emotional category identifier. 3.The AI conversation scenario control method with emotion recognition function of claim 1, wherein, According to the emotional category identifier, extracting context features from historical dialogue records, and calculating a quantitative value of an emotional change trend by using a time decay weighting algorithm, comprising: Obtaining context feature data from historical dialogue records, performing preliminary classification processing on the emotional category identifier, and determining a preliminary emotional classification result by comparing a preset emotional feature library; According to the preliminary emotional classification result, calculating the emotional change in the historical dialogue by using a time decay weighting method to obtain a weighted value sequence of the emotional change; For the weighted value sequence of the emotional change, obtain the time dimension features therein, analyze the influence of time decay, determine the fluctuation direction of the emotional change trend, and if the fluctuation value exceeds a preset threshold, mark it as a significant change point; According to the significant change point, extracting the corresponding context features and emotional category data, and quantitatively processing the change trend by using a linear regression model to obtain a trend quantitative index; For the trend quantification index, the relevance feature with the historical dialogue record is obtained, and if the relevance feature is lower than the preset matching degree, the quantification index is corrected to determine the final emotional change trend value. 4.The AI conversation scenario control method with emotion recognition function of claim 1, wherein, The dynamic scene classification rule library is called to match the scene category corresponding to the quantification value, and the emotional response priority coefficient is calculated combined with the preset demand priority weight, including: Through the preset rule library, the matching rule data of scene classification is obtained, and the input quantification value is preliminarily compared to determine the preliminary scene category attribution; According to the preliminary scene category attribution, the quantification value is verified again using classification judgment logic, and if the verification result is consistent with the preliminary attribution, the final scene category attribution is confirmed; After obtaining the final scene category attribution, the demand priority is evaluated, the corresponding weight data is extracted from the preset priority weight table, and the priority coefficient of the emotional response is calculated; Through the calculated priority coefficient, combined with the response calculation logic, the emergency degree of the response is judged, and if the priority coefficient exceeds the preset threshold, the high-priority response process is triggered; According to the triggering result of the high-priority response process, the calculated priority coefficient and response process data are stored in a structured manner to obtain a persistent business record; Through the persistent business record, the scene category and emotional response data are associated and analyzed to determine the execution path of the subsequent business process; After obtaining the execution path of the subsequent business process, the emotional response data in the path is optimized and adjusted, and it is judged whether the optimized response data meets the preset standard, and if it meets the standard, the final response data is output. 5.The AI conversation scenario control method with emotion recognition function of claim 1, wherein, According to the priority coefficient, the response strategy framework is extracted from the operation control strategy mapping table, the response frequency and emotional expression intensity parameters are adjusted, and the dialogue content generation rule is generated, including: By obtaining the control strategy corresponding to the priority coefficient from the preset mapping table data, the initial response strategy framework structure is determined; According to the obtained framework structure, the parameter values of response frequency and emotional intensity are adjusted to obtain an adaptive dialogue generation mode; For the adjusted parameter values, a preset logic judgment is used, and if the response frequency exceeds the preset threshold, the frequency parameter is reduced and the emotional intensity is recalculated to determine the final parameter combination; The dialogue content generation rule is extracted from the determined final parameter combination. 6.The AI conversation scenario control method with emotion recognition function of claim 1, wherein, Based on the dialogue content generation rule, the sentence template is selected from the emotional empathy expression library through semantic reasoning, and the dialogue response text is generated through the semantic optimization algorithm and the tone adaptation rule, including: Based on the dialogue content generation rule, the initial sentence template is obtained from the pre-established emotional empathy expression library through semantic reasoning, and is preliminarily screened for different contexts to obtain a candidate template set that meets the emotional tone; According to the candidate template set, the semantic optimization algorithm is used to adjust the template content in the semantic level, combined with the context information processing link, and if the semantic matching degree is lower than the preset threshold, the template is re-extracted until the optimized template with semantic fit is determined; The optimized template is obtained, the text tone is fine-tuned by combining with the tone adaptation rule, the emotional tendency of the user input is matched, it is judged whether the tone meets the current dialogue scene, and an adapted sentence text is obtained; and a final dialogue response text is generated through the adapted sentence text. 7.The AI conversation scenario control method with emotion recognition function of claim 1, wherein, According to historical dialogue rhythm data and user feedback records, a time interval and speech speed matching algorithm is used to adjust the output timing parameters of the dialogue response text, and a final output configuration is determined, including: Obtain the original records of historical dialogues and user feedback, remove invalid items using a data cleaning tool, and obtain a preliminary processed data set; According to the preliminary processed data set, a time interval analysis method is used to calculate the rhythm information features in the dialogue, and the feature values of the rhythm distribution are determined; According to the feature values of the rhythm distribution, the speech speed related evaluation in the user feedback is obtained, a linear regression model is used to analyze the relevance of speech speed matching, and the reference value of speech speed adjustment is determined; If the reference value of speech speed adjustment exceeds the preset threshold value, the output timing of the response text is dynamically adjusted to obtain adjusted timing parameters; Through the adjusted timing parameters, the rhythm information in the historical dialogue is combined to optimize the output configuration of the response text, and a final output scheme is determined; According to the final output scheme, the fit degree of the time interval and the speech speed matching is verified, the verification result data is obtained, and it is judged whether the configuration meets the expected standard; If the verification result data does not meet the expected standard, backtrack to the calculation link of the rhythm distribution feature value, adjust the analysis parameters, and obtain a new output configuration. 8.The AI conversation scenario control method with emotion recognition function of claim 1, wherein, The dialogue response text is output through voice synthesis or text display, format adaptation is performed according to the user device type, and then the following steps are included: Record the user feedback after output, perform secondary emotion feature extraction on the user feedback, calculate the satisfaction quantization index, and compare it with the dynamic threshold value. If it is lower than the threshold value, trigger the strategy adjustment process; Generate new dialogue response content according to the historical emotional state and the current context features, and update the interaction scheme. 9.The AI conversation scenario control method with emotion recognition function of claim 8, wherein, Record the user feedback after output, perform secondary emotion feature extraction on the user feedback, calculate the satisfaction quantization index, and compare it with the dynamic threshold value. If it is lower than the threshold value, trigger the strategy adjustment process, including: Obtain initial data from the feedback records, and use a text analysis tool to perform preliminary cleaning and word segmentation processing on the data to obtain structured text content; According to the structured text content, a pre-established emotion classification model is used to perform emotion feature extraction on the text to determine the emotion tendency category; For the emotion tendency category, a secondary extraction process is implemented, and natural language processing technology is used to perform in-depth analysis on the emotion features to obtain refined emotion labels; Key emotional elements are obtained from the refined emotion labels, the satisfaction quantization index is calculated, and the satisfaction numerical result is determined; If the satisfaction numerical result is lower than the preset dynamic threshold value, trigger the index comparison logic to judge whether the strategy adjustment condition is met; if the strategy adjustment condition is met, start the adjustment process. 10.The AI conversation scenario control method with emotion recognition function of claim 8, wherein, Generate new dialogue response content according to the historical emotional state and the current context features, and update the interaction scheme, including: The historical emotional state data is obtained from the pre-established database to extract the emotional state records in the past interaction of the user, the records are preliminarily classified to obtain the distribution characteristics of the emotional state; According to the distribution characteristics of the emotional state, the input information of the current context is combined, the text input by the current user is analyzed through the context matching technology, and the key emotional tendency in the context is determined; Using the key emotional tendency as the basis, combining the distribution characteristics of the historical emotional state, the response content of the dialogue is generated, it is judged whether the response content meets the semantic demand of the current context, if not, the content generation logic is adjusted, and the response text meeting the context is obtained; Through the generation result of the response text, the adjustment strategy of the interaction scheme is made, if the adjustment strategy conflicts with the historical interaction scheme, the selection is made through the preset priority rule, and the final version of the interaction scheme is determined.
Citation Information
Patent Citations
Voice interaction method and system applied to AI digital human
CN117409780A
Real-time contextually aware artificial intelligence (AI) assistant system and a method for providing a contextualized response to a user using ai
US20240412720A1