Intelligent dialogue generation method and system based on multi-dimensional sentiment analysis
Through multi-dimensional emotion analysis technology, the shift changes of emotional characteristics are evaluated and processed, and the emotional change matrix and dynamic weight distribution are constructed, which solves the problems of single and inconsistent emotions capture in the existing technology, and achieves high consistency emotional matching and tone expression.
Patent Information
- Application Number
- CN202510032009.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-09
AI Technical Summary
The prior art captures emotional characteristics too single and cannot fully portray emotional changes, resulting in insufficient fit between dialogue content and contextual emotions, which is manifested in the lack of coherence of emotional expression in multiple rounds of dialogue.
Through multi-dimensional emotion analysis, the emotional effect value, arousal value, and dominance value are evaluated, combined with the semantic intensity value and emotional preference parameters in the user's portrait, the offset range of emotional characteristics is calculated, and the emotional offset characteristics are generated. Then, based on the emotional offset characteristics, an emotion change matrix is constructed, the global emotion change amplitude is calculated, the weight value is smoothed to obtain the set of emotional weights in the current round, and an emotional dynamic weight distribution value is generated.
The meticulous capture and dynamic processing of emotional changes is achieved, ensuring the high consistency of the generated dialogue in emotional matching and tone expression, solving the problem of incoherence of emotional expression, and forming a continuous response of multiple rounds of emotional progress.
Smart Images

Figure CN119938849A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sentiment analysis, and in particular to an intelligent dialogue generation method and system based on multi-dimensional sentiment analysis. Background Art
[0002] Sentiment analysis is a natural language processing technology that aims to identify, extract and understand the emotions and subjective attitudes contained in text, speech or other forms of data. This technology combines machine learning, deep learning and linguistics, and is often used to analyze user emotional tendencies, emotional intensity and positive and negative emotional classification. Sentiment analysis is widely used in customer evaluation analysis, public opinion monitoring, intelligent customer service systems and marketing, helping companies or individuals better understand user feedback and social emotional dynamics, thereby optimizing decision-making and services.
[0003] Among them, the intelligent dialogue generation method refers to the generation of natural language dialogue content that conforms to the user's emotions and context by capturing and analyzing multi-dimensional emotional information. This technology aims to improve the naturalness and emotional adaptability of human-computer interaction, and is mainly used in scenarios such as intelligent customer service, virtual assistants, and emotional companion robots, providing users with a more humane communication experience and personalized services.
[0004] The existing technology is too simplistic in capturing emotional features and cannot fully characterize emotional changes. Its emotional matching method relies on static emotional data, resulting in insufficient fit between the conversation content and the contextual emotions, which manifests as a lack of coherence in emotional expression in multiple rounds of conversations. In addition, the lack of tone analysis and emotional weight adjustment makes it difficult for generated sentences to accurately convey the target emotion, and it is easy to have a stiff tone or emotional expression deviation. In multi-round interaction scenarios, there is a lack of effective processing of emotional progression and dynamic smoothness, making it difficult to achieve natural and coherent emotional expression, affecting the emotional adaptability and content resonance in the user experience. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an intelligent dialogue generation method and system based on multi-dimensional sentiment analysis.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: an intelligent dialogue generation method based on multi-dimensional sentiment analysis, comprising the following steps:
[0007] S1: Evaluate the emotional effectiveness value, arousal value, and dominance value through user input, obtain the semantic strength value through semantic content analysis, merge the emotional preference parameters in the user portrait, calculate the offset change range of the emotional feature, and generate the emotional offset feature;
[0008] S2: Based on the emotion shift feature, compare the current emotion trend, construct an emotion change matrix, calculate the global emotion change amplitude, smooth the weight value to obtain the emotion weight set of the current round, and generate the emotion dynamic weight distribution value;
[0009] S3: Based on the emotional dynamic weight distribution value, extract the dialogue intention classification value, analyze the target tone type, calculate the prompt content weight, check the consistency weight with the dialogue context emotion, integrate the prompt content emotion and consistency distribution parameters, adjust the adaptation weight, and generate the adaptation prompt weight distribution value;
[0010] S4: Based on the adaptation prompt weight distribution value, analyze the difference between the emotional feature value in the generated sentence and the target emotional intensity, calculate the adjustment coefficient, dynamically correct the emotional feature parameters of the current sentence, recalibrate the emotional weight matrix of the content, and generate optimized emotional response content;
[0011] S5: Based on the optimized emotional response content, the progressive emotional change matrix is analyzed, the difference between the progressive parameters and the emotional weight distribution value is compared, the emotional expression smooth curve is reconstructed, the continuous parameters of multiple rounds of emotional responses are generated by dynamic smoothing operations, and the recursive emotional generation response value is generated.
[0012] The emotion shift characteristics include emotion effectiveness value shift, arousal value shift, dominance value shift, semantic intensity value change range, and emotion preference parameters; the emotion dynamic weight distribution value includes the global emotion change amplitude, emotion change matrix, current round emotion weight set, and smooth weight value; the adaptation prompt weight distribution value includes dialogue intention classification value, target tone type, prompt content weight, emotion consistency distribution parameter, and adaptation weight; the optimized emotion response content includes emotion feature value, target emotion intensity difference, adjustment coefficient, and emotion weight matrix; the recursive emotion generation response value includes progressive emotion change matrix, emotion weight distribution value difference, emotion expression smooth curve, and continuous parameter.
[0013] As a further solution of the present invention, the step of acquiring the emotion shift feature is specifically as follows:
[0014] S111: Analyze user input, evaluate emotional effectiveness value, arousal value and dominance value, and obtain a comprehensive emotional index by calculating the weighted average of the indexes;
[0015] S112: performing semantic analysis on the text input by the user, extracting the semantic strength value, combining the comprehensive sentiment index, analyzing the difference between the text and the sentiment preference in the user portrait, and obtaining the sentiment difference value;
[0016] S113: Based on the emotion difference value and the emotion comprehensive index, the formula is adopted:
[0017]
[0018] Calculate the sentiment shift feature;
[0019] Among them, E represents the sentiment shift feature, E sd Represents the sentiment difference value, E ci represents the comprehensive emotional index, a represents the adjustment coefficient of the emotional difference value, which is used to adjust the weight influence of the emotional offset feature on the emotional difference value, b represents the adjustment coefficient of the comprehensive emotional index, which is used to adjust the weight influence of the emotional offset feature on the comprehensive emotional index, and c represents the total adjustment parameter, which is used to normalize the calculation results of the entire formula.
[0020] As a further solution of the present invention, the step of obtaining the emotional dynamic weight distribution value is specifically as follows:
[0021] S211: By comparing the current emotion trend with the emotion shift feature, an emotion change matrix is established, multi-unit element values in the matrix are normalized, an average change value of the normalized matrix is calculated, and an emotion change amplitude value is generated;
[0022] S212: Based on the emotion change amplitude value, multiple emotion weight factors are processed by weight smoothing calculation, using the formula:
[0023]
[0024] Calculate the smoothed weight set to generate a sentiment weight set;
[0025] Among them, W i represents the smoothed sentiment weight value, C i represents the initial emotion weight factor, F represents the emotion change amplitude value, P i It represents the emotional preference weight factor associated with the current emotional trend, providing reverse adjustment to balance the intensity of preference, and k is the adjustment coefficient, which controls the amplitude of the overall weight adjustment;
[0026] S213: performing a normalization operation on the emotion weight set, integrating the dynamic relationship between multiple normalized weights and weight factors, and calculating the emotion dynamic weight distribution value.
[0027] As a further solution of the present invention, the step of obtaining the adaptation prompt weight distribution value is specifically as follows:
[0028] S311: Analyzing the emotional dynamic weight distribution value, extracting the conversation intention classification value, calculating the weight of the conversation intention and the emotional trend matching, and generating a conversation intention weight set;
[0029] S312: parsing the target tone type, synthesizing the dialogue intention weight set, using a quantitative analysis method to compare the consistency of the target tone with the context emotion, calculating the tone matching weight, and generating a tone adaptation weight set;
[0030] S313: Based on the prompt content weight and the tone adaptation weight set, the formula is adopted:
[0031]
[0032] Calculate and generate the adaptation prompt weight distribution value;
[0033] Among them, W c It represents the weight obtained based on content analysis, reflecting the importance and influence of the content itself. t represents the tone matching weight, which shows the matching degree between the target tone and the current conversation emotion, W m Represents the inverse strength of context emotion matching, and adjusts the weight influence by calculating the inverse ratio of the matching degree. p Indicates the adaptation hint weight distribution value.
[0034] As a further solution of the present invention, the step of obtaining the optimized emotional response content is specifically as follows:
[0035] S411: Based on the adaptation prompt weight distribution value, the generated sentence is analyzed for emotional feature values, the emotional feature values are compared with the preset target emotional intensity, the difference between the two is identified, the difference index is calculated, and the emotional difference evaluation result is generated;
[0036] S412: quantitatively calculating the required adjustment coefficients according to the emotion difference evaluation results, dynamically adjusting the emotion feature parameters of the current sentence, and generating an adjustment coefficient set;
[0037] S413: Apply the adjustment coefficient set to modify the emotional characteristic parameters of the current sentence using the formula:
[0038]
[0039] By adjusting the index of the difference value, the sentiment parameters are optimized, the sentiment is adjusted, and the adjusted sentiment feature results are generated;
[0040] Among them, E old represents the original emotional feature value, which refers to the quantitative value of the emotional state before sentence analysis. ΔE represents the difference in emotional intensity, which measures the gap between the current emotional state and the target emotional state. α represents the main adjustment coefficient, which is used to amplify or reduce the impact of emotional adjustment. β represents the adjustment coefficient, which adjusts the impact of ΔE to make the emotional adjustment smoother and avoid mutations.
[0041] S414: Using the adjusted emotion feature results, recalculate and calibrate the emotion weight matrix of the content, integrate all related emotion data, and generate optimized emotion response content.
[0042] As a further solution of the present invention, the step of obtaining the recursive emotion generation response value is specifically as follows:
[0043] S511: Based on the optimized emotional response content, the progressive emotional change matrix is analyzed, the change of the emotional state after each round of dialogue is recorded, and the progressive value of the emotional intensity is obtained by calculation to generate the emotional progressive parameter;
[0044] S512: Compare the emotion progression parameter with the existing emotion weight distribution value, identify and quantify the difference between the two, calculate the difference index through comparison and analysis, and generate the emotion weight difference result;
[0045] S513: Reconstruct the emotion expression smooth curve according to the emotion weight difference result, using the formula:
[0046]
[0047] Adjust the emotional intensity of each point, make a natural transition of emotional expression, and generate a smooth curve of emotional expression;
[0048] Among them, S new represents the smooth curve of emotional expression, S old represents the original emotion expression curve, which represents the emotion output before adjustment, S target represents the target emotional state, α i is the coefficient adjusted based on the sentiment difference, k is the smoothing adjustment parameter, and n represents the number of sentiment points involved in the calculation;
[0049] S514: Utilizing the emotion expression smoothing curve, a dynamic smoothing operation is performed to continuously adjust the emotion response parameters in multiple rounds of dialogues to generate a recursive emotion generation response value.
[0050] An intelligent dialogue generation system based on multidimensional sentiment analysis, the intelligent dialogue generation system based on multidimensional sentiment analysis is used to execute the above-mentioned intelligent dialogue generation method based on multidimensional sentiment analysis, the system comprises:
[0051] The emotional feature extraction module evaluates the emotional effectiveness value, arousal value, and dominance value based on the text content input by the user, analyzes the semantic strength value of the text, combines the emotional preference parameters in the user portrait, analyzes the extraction results, calculates the offset variation range of the emotional features, and generates emotional offset features;
[0052] The sentiment weight distribution module compares the sentiment trend of the current input text based on the sentiment shift feature, establishes a sentiment change matrix, calculates the global sentiment change amplitude, performs smoothing, obtains the current round sentiment weight set, performs distribution analysis, and generates a sentiment dynamic weight distribution value;
[0053] The adaptation prompt generation module extracts the target intent classification and the target tone type based on the emotional dynamic weight distribution value, calculates the emotional weight of the prompt content, performs context consistency check, adjusts the adaptation weight, and generates an adaptation prompt weight distribution value;
[0054] The recursive emotion optimization module calculates the difference between the emotion feature value in the generated sentence and the target emotion intensity based on the adaptation prompt weight distribution value, adjusts the difference value, dynamically corrects the emotion feature parameters, recalibrates the emotion weight matrix, and generates a recursive emotion generation response value.
[0055] Compared with the prior art, the advantages and positive effects of the present invention are:
[0056] In the present invention, through the analysis and fusion of multi-dimensional emotional parameters, including the combination of emotional effectiveness value, arousal value, dominance value and semantic intensity, the emotional feature deviation is dynamically captured, making the emotional analysis more refined and adaptable. Based on the dynamic weight distribution of emotions, the relationship between the tone type and the content prompt is accurately analyzed to ensure the high consistency of the generated dialogue in emotional matching and tone expression. By correcting the differences in the emotional features of sentences and smoothing the emotional changes, the problem of incoherent emotional expression is solved, and a continuous response of multiple rounds of emotional progression is formed. In multiple rounds of interaction, the system realizes the natural progression and adjustment of emotional expression, which enhances the emotional fit and dynamic response ability of the interactive content. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of the workflow of the present invention;
[0058] Figure 2 A flowchart of steps for obtaining the emotion shift feature of the present invention;
[0059] Figure 3 This is a flow chart of the steps for obtaining the emotional dynamic weight distribution value of the present invention;
[0060] Figure 4 A flowchart of the steps for obtaining the weight distribution value of the adaptive prompt of the present invention;
[0061] Figure 5 A flow chart of the steps for obtaining the content of the emotional response optimized by the present invention;
[0062] Figure 6 A flow chart of the steps for obtaining the recursive emotion generation response value of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0064] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0065] Embodiment 1
[0066] See also Figure 1 The present invention provides a technical solution: an intelligent dialogue generation method based on multi-dimensional sentiment analysis, comprising the following steps:
[0067] S1: Evaluate the emotional effectiveness value, arousal value, and dominance value through user input, obtain the semantic strength value through semantic content analysis, merge the emotional preference parameters in the user portrait, calculate the offset change range of the emotional feature, and generate the emotional offset feature;
[0068] S2: Based on the emotion shift feature, compare the current emotion trend, construct the emotion change matrix, calculate the global emotion change amplitude, smooth the weight value to obtain the emotion weight set of the current round, and generate the emotion dynamic weight distribution value;
[0069] S3: Based on the dynamic emotional weight distribution value, extract the dialogue intent classification value, analyze the target tone type, calculate the prompt content weight, check the consistency weight with the dialogue context emotion, integrate the prompt content emotion and consistency distribution parameters, adjust the adaptation weight, and generate the adaptation prompt weight distribution value;
[0070] S4: Based on the weight distribution value of the adaptation prompt, analyze the difference between the emotional feature value in the generated sentence and the target emotional intensity, calculate the adjustment coefficient, dynamically correct the emotional feature parameters of the current sentence, recalibrate the emotional weight matrix of the content, and generate optimized emotional response content;
[0071] S5: Based on the optimization of emotional response content, the progressive emotional change matrix is analyzed, the difference between the progressive parameters and the emotional weight distribution value is compared, the emotional expression smooth curve is reconstructed, the dynamic smoothing operation generates continuous parameters of multiple rounds of emotional responses, and the recursive emotional generation response value is generated.
[0072] The characteristics of emotional offset include emotional effectiveness value offset, arousal value offset, dominance value offset, semantic intensity value change range, and emotional preference parameters. The dynamic emotional weight distribution values include the global emotional change amplitude, emotional change matrix, current round emotional weight set, and smoothing weight value. The adaptation prompt weight distribution values include dialogue intention classification value, target tone type, prompt content weight, emotional consistency distribution parameter, and adaptation weight. The optimized emotional response content includes emotional feature value, target emotional intensity difference, adjustment coefficient, and emotional weight matrix. The recursive emotional generation response value includes progressive emotional change matrix, emotional weight distribution value difference, emotional expression smoothing curve, and continuous parameters.
[0073] See also Figure 2 ,The specific steps for obtaining the sentiment shift feature are:
[0074] S111: Analyze user input, evaluate emotional effectiveness value, arousal value and dominance value, and obtain a comprehensive emotional index by calculating the weighted average of the indexes;
[0075] These values are weighted averaged through weight coefficients to obtain a comprehensive emotional index. The weight coefficients are adjusted according to previous emotional research and user feedback to ensure that each coefficient can reflect the importance of a specific emotional dimension. The weights are adjusted through real-time data monitoring and previous data comparison to ensure that the obtained comprehensive emotional index can truly reflect the user's current emotional state. This method can achieve accurate capture of the user's emotional state, thereby providing basic data for subsequent emotional analysis.
[0076] S112: Perform semantic analysis on the text input by the user, extract the semantic strength value, combine it with the comprehensive sentiment index, analyze the difference between it and the sentiment preference in the user portrait, and obtain the sentiment difference value;
[0077] This process uses natural language processing technology to accurately parse language elements, such as keywords and phrases, and match them with preset patterns in the sentiment database to ensure that the emotional tone of the text can be accurately captured. The difference analysis is mainly based on the comparison between semantic intensity and emotional preferences in user portraits. The sentiment difference value is calculated through an algorithm. This value reflects the deviation between the user's actual expression and his or her emotional preferences, thereby providing a reference for adjusting personalized content or recommendation systems.
[0078] S113: Based on the sentiment difference value and sentiment comprehensive index, the formula is:
[0079]
[0080] Calculate the sentiment shift feature;
[0081] Among them, E represents the sentiment shift feature, E sd Represents the sentiment difference value, E ci represents the comprehensive emotional index, a represents the adjustment coefficient of the emotional difference value, which is used to adjust the weight influence of the emotional offset feature on the emotional difference value, b represents the adjustment coefficient of the comprehensive emotional index, which is used to adjust the weight influence of the emotional offset feature on the comprehensive emotional index, and c represents the total adjustment parameter, which is used to normalize the calculation results of the entire formula.
[0082] formula:
[0083]
[0084] The benefit of the formula is that it combines the sentiment difference value E sd and emotional comprehensive index E ci The weighted sum of the factors makes it possible to adjust their respective influences, thereby more flexibly adapting to the emotional response patterns of different users. The formula can be adaptively adjusted according to the data analysis results by adjusting the weight parameters a, b and divisor c to reflect more personalized emotional shift characteristics.
[0085] Detailed explanation of the formula and the process of formula calculation and derivation:
[0086] Assumption E sd =0.3, E ci =0.7, weight parameters a=2, b=3, divisor c=5, the calculation process is:
[0087]
[0088] The result shows that by weighting the sentiment difference value and the sentiment comprehensive index, the sentiment shift feature is 0.54, which means that there is a certain degree of shift between the user's sentiment state and his personalized preference. This value can be used to analyze the changing trend of user sentiment and adjust the recommendation system's response strategy to his sentiment.
[0089] See also Figure 3 ,The specific steps for obtaining the emotional dynamic weight distribution value are:
[0090] S211: By comparing the current emotion trend with the emotion shift feature, an emotion change matrix is established, multi-unit element values in the matrix are normalized, an average change value of the normalized matrix is calculated, and an emotion change amplitude value is generated;
[0091] This process involves converting the raw data of emotional changes into a standard format that can be used for further analysis. Normalization is a necessary step to eliminate scale effects in the data and ensure the accuracy of subsequent processing. After normalization, data comparison and calculation will be more accurate, which provides an accurate data basis for calculating the overall emotional change amplitude. The calculated average change value reflects the average degree of change in the emotional state from one time point to another, providing a quantitative evaluation benchmark for subsequent emotional trend analysis.
[0092] S212: Based on the emotion change amplitude value, multiple emotion weight factors are processed by weight smoothing calculation, using the formula:
[0093]
[0094] Calculate the smoothed weight set to generate a sentiment weight set;
[0095] Among them, W i represents the smoothed sentiment weight value, C i represents the initial emotion weight factor, F represents the emotion change amplitude value, P i It represents the emotional preference weight factor associated with the current emotional trend, providing reverse adjustment to balance the intensity of preference, and k is the adjustment coefficient, which controls the amplitude of the overall weight adjustment;
[0096] formula:
[0097]
[0098] The benefit of the formula is that by adding the sentiment weight factor C i The square root and absolute value processing are performed to enhance the model's sensitivity to changes in sentiment weights. i The inverse form of adjustment increases the adaptability of the model to individual preference differences, and the overall normalization is performed through the k coefficient to make the weight distribution more refined.
[0099] Detailed explanation of the formula and the process of formula calculation and derivation:
[0100] Assume that in a specific case, C i =0.3, F=2.5, P i =0.8, k=3.
[0101] First calculate C i The square root of
[0102] Multiply it by F and you get 0.5477·2.5≈1.36925;
[0103] Take the absolute value and keep it unchanged, then calculate P i The reciprocal of
[0104] Add these two parts together to get 1.36925+1.25=2.61925;
[0105] Finally, divide by k to get
[0106] Therefore, the smoothed sentiment weight value W i ≈0.873.
[0107] The result shows that the sentiment weight value after smoothing is 0.873, which will be used for further sentiment analysis to help the system understand and predict the user's emotional state more accurately.
[0108] S213: Performing a normalization operation on the emotion weight set, integrating the dynamic relationship between multiple normalized weights and weight factors, and calculating the emotion dynamic weight distribution value.
[0109] Through standardization, we ensure that all emotional weight values are compared and analyzed on the same scale. This can eliminate the magnitude differences in the original data and make the comparison between weight factors more fair and reasonable. The dynamic relationship between weight factors is integrated by calculating the correlation and interactive influence of weight factors. This process requires accurate grasp of the contribution of each weight factor to the change in emotional state and calculates the emotional dynamic weight distribution value. This value provides a dynamically adjusted perspective for emotional state analysis, reflecting the dynamic distribution of emotional weights over time and context.
[0110] See also Figure 4 , the specific steps for obtaining the adaptation prompt weight distribution value are:
[0111] S311: Analyze the emotional dynamic weight distribution value, extract the conversation intention classification value, calculate the weight of the conversation intention and the emotional trend matching, and generate a conversation intention weight set;
[0112] This step is mainly based on existing sentiment data. The recognition of dialogue intent is carried out through natural language processing technology, which involves the analysis of sentence structure and the extraction of keywords. At the same time, it is combined with machine learning models, such as decision trees, to classify different dialogue intents, such as inquiries, commands, requests, etc. In addition, the classification of dialogue intent also needs to refer to contextual information to ensure the accuracy of classification. Through these methods, the dialogue intent can be accurately extracted from a large number of user dialogues, and the dialogue management strategy can be further adjusted according to the intent, thereby improving the user interaction experience. Through the above processing steps, a dialogue intention weight set is generated.
[0113] S312: Analyze the target tone type, integrate the conversation intention weight set, use quantitative analysis method to compare the consistency between the target tone and the context emotion, calculate the tone matching weight, and generate the tone adaptation weight set;
[0114] The analysis of the target tone type depends on the training of a deep learning model, which analyzes a large amount of corpus to learn language patterns of different tones, such as commands, requests, and inquiries. The calculation of the tone matching weight is based on the comparison of the analyzed target tone type with the tone actually used by the user. Statistical methods, such as frequency analysis, are used to determine the most common tone type, and consistency algorithms, such as cosine similarity, are used to compare the degree of match between the target tone and the contextual emotion. This method allows the system to more accurately evaluate and adjust the tone to adapt to the user's emotional state, improve the naturalness and fluency of the dialogue system, and generate a set of tone adaptation weights through this series of calculations and analyses.
[0115] S313: Based on the prompt content weight and the tone adaptation weight set, the formula is adopted:
[0116]
[0117] Calculate and generate the adaptation prompt weight distribution value;
[0118] Among them, W c It represents the weight obtained based on content analysis, reflecting the importance and influence of the content itself. t represents the tone matching weight, which shows the matching degree between the target tone and the current conversation emotion, W m Represents the inverse strength of context emotion matching, and adjusts the weight influence by calculating the inverse ratio of the matching degree. p Indicates the adaptation hint weight distribution value.
[0119] formula:
[0120]
[0121] The benefit of the formula is that by combining the difference between content weight and tone matching weight, adding the inverse strength of contextual sentiment matching, and using the square root and absolute value method, the dynamic responsiveness and adaptability of the calculation are increased, thereby making the prompt weight more in line with the actual dialogue situation.
[0122] Detailed explanation of the formula and the process of formula calculation and derivation:
[0123] Set content weight W c =0.6, tone matching weight W t =0.8, the reverse strength W of contextual sentiment matching m =0.5.
[0124]
[0125]
[0126] The results show that by adjusting the weights of tone and content, and considering feedback on emotional consistency, we can obtain an adaptation prompt weight distribution value that comprehensively considers multiple factors. This helps to improve the effectiveness of the dialogue system in practical applications and enables the system to more flexibly adapt to the emotional and contextual needs of different users.
[0127] See also Figure 5 , the specific steps for optimizing the acquisition of emotional response content are:
[0128] S411: Based on the adaptation prompt weight distribution value, the generated sentence is analyzed for emotional feature values, the emotional feature values are compared with the preset target emotional intensity, the difference between the two is identified, the difference index is calculated, and the emotional difference evaluation result is generated;
[0129] Through a detailed sentiment analysis process, the specific differences between the current emotional state and the expected emotional expression are determined. Calculating these differences will help determine the direction and intensity of the next adjustment, ensuring that the sentence expression is closer to the user's actual emotional state. The emotional labels involved in sentiment analysis include joy, anger, sorrow, and happiness. Through quantitative sentiment analysis models, such as sentiment intensity detection algorithms, accurate quantification of sentiment intensity is achieved. This process includes sentiment word weight allocation, sentiment intensity accumulation, etc. The generated sentiment difference evaluation results will directly affect the subsequent sentiment adjustment strategy.
[0130] S412: quantitatively calculating the required adjustment coefficients according to the emotion difference evaluation results, dynamically adjusting the emotion feature parameters of the current sentence, and generating an adjustment coefficient set;
[0131] This step involves complex mathematical calculations and adjustment of the emotion model. The calculation of the adjustment coefficient is based on multi-factor analysis, including the size of the emotion difference, user feedback and emotion trend analysis. The adjustment coefficient is determined through a series of optimization algorithms, such as the gradient descent method, to ensure that the adjusted emotion expression is as close to the user's true feelings as possible. The specific value of the adjustment coefficient is determined by the actual measurement value of the emotion difference. The parameters involved in this process include emotion difference measurement, user feedback sensitivity, etc. The generated adjustment coefficient set will be used for the next step of dynamic adjustment of emotion features.
[0132] S413: Apply the adjustment coefficient set to modify the emotional feature parameters of the current sentence using the formula:
[0133]
[0134] By adjusting the index of the difference value, the sentiment parameters are optimized, the sentiment is adjusted, and the adjusted sentiment feature results are generated;
[0135] Among them, E old represents the original emotional feature value, which refers to the quantitative value of the emotional state before sentence analysis. ΔE represents the difference in emotional intensity, which measures the gap between the current emotional state and the target emotional state. α represents the main adjustment coefficient, which is used to amplify or reduce the impact of emotional adjustment. β represents the adjustment coefficient, which adjusts the impact of ΔE to make the emotional adjustment smoother and avoid mutations.
[0136] formula:
[0137]
[0138] The benefit of the formula is that it allows for fine-grained control of the sensitivity of affective adjustment through the adjustment factors α and β, accommodating different degrees of affective differences, thereby achieving more refined adjustments in affective expression.
[0139] Detailed explanation of the formula and the process of formula calculation and derivation:
[0140] Assume that the original sentiment feature value E old =0.5, emotional difference ΔE=0.3, and adjustment factors α=2 and β=5.
[0141] 1. Calculate the exponential part: e -β·ΔE =e -5×0.3 =e -1.5 ≈0.2231;
[0142] 2. Calculate the denominator: 1 + 0.2231 = 1.2231;
[0143] 3. Calculate the total adjustment:
[0144] 4. Calculate E new =0.5+0.490=0.99;
[0145] The results show that by applying this formula, the emotional feature value is adjusted from 0.5 to close to 1, which significantly enhances the emotional expression intensity and makes it closer to the target emotional intensity, demonstrating the practicality and effectiveness of the formula in adjusting emotional feature parameters.
[0146] S414: Using the adjusted emotional feature results, recalculate and calibrate the emotional weight matrix of the content, integrate all related emotional data, and generate optimized emotional response content.
[0147] This process involves advanced data integration technology and sentiment analysis methods. The calibration of the sentiment weight matrix is based on the latest sentiment feature parameters, which are dynamically updated through advanced sentiment analysis models. The calibration process takes into account multiple factors, such as contextual relevance, coherence of language expression, and user interaction. Complex algorithms are used to ensure the rationality of the distribution of sentiment weights. These algorithms include linear regression analysis, classification algorithms in machine learning, etc. The adjusted sentiment weight matrix is used to generate highly targeted and responsive sentiment response content, so that it can more accurately reflect and respond to users' emotional needs. The generated optimized sentiment response content is closer to user expectations, which improves user satisfaction and the interaction efficiency of the system.
[0148] See also Figure 6 ,The specific steps for obtaining the recursive emotion generation response value are:
[0149] S511: Based on the optimized emotional response content, the progressive emotional change matrix is analyzed, the change of the emotional state after each round of dialogue is recorded, and the progressive value of the emotional intensity is obtained by calculation to generate the emotional progressive parameter;
[0150] The calculation process based on the emotional progression parameters involves extracting detailed data on changes in emotional states from continuous conversations. These data are processed by a specialized sentiment analysis tool, and the frequency and intensity of emotional words in the text are analyzed using natural language processing technology to construct a serialized representation of the emotional state. This method not only extracts the emotional component of each conversation, but also compares the gradual changes in emotions, thus laying a data foundation for the next step of calculating the emotional progression parameters. This process ensures the accuracy and continuity of the obtained data, so that the subsequent adjustment of the emotional weights more accurately reflects the actual emotional changes.
[0151] S512: Compare the sentiment progression parameter with the existing sentiment weight distribution value, identify and quantify the difference between the two, calculate the difference index through comparative analysis, and generate the sentiment weight difference result;
[0152] By comparing with the existing emotion weight distribution values, detailed comparison and analysis, especially by calculating the change value and standard deviation of emotion intensity, the specific degree and trend of emotion change can be quantified. The mathematical models used in this process include linear regression and standard deviation calculation, which are based on actual monitoring data. Through this method, a quantitative emotion weight difference result is obtained, which provides a quantitative basis for adjusting emotion expression.
[0153] S513: According to the emotion weight difference results, the emotion expression smooth curve is reconstructed using the formula:
[0154]
[0155] Adjust the emotional intensity of each point, make a natural transition of emotional expression, and generate a smooth curve of emotional expression;
[0156] Among them, S new represents the smooth curve of emotional expression, S old represents the original emotion expression curve, which represents the emotion output before adjustment, S target represents the target emotional state, α i is the coefficient adjusted based on the sentiment difference, k is the smoothing adjustment parameter, and n represents the number of sentiment points involved in the calculation;
[0157] formula:
[0158]
[0159] The benefit of the formula is that it allows for dynamic smoothing of emotional transitions by recursively calculating the emotional state at each point in time, achieving a natural flow of emotional expression regardless of the magnitude of the emotional change.
[0160] Detailed explanation of the formula and the process of formula calculation and derivation:
[0161] Assume that during a conversation the emotional state changes from neutral (0) to happy (1), the original emotional state S old =0, target emotional state S target =1, adjustment coefficient α = 0.5, smoothing parameter k = 0.1, and the formula is used for calculation:
[0162] First, evaluate each expression
[0163] Then add up all the items to get S new =0+0.452=0.452;
[0164] This approach allows us to see how the gradual adjustment of the affective state is achieved, and this result shows that the formula successfully simulates the gradual change of the affective state and provides a computational basis for refining the affective response.
[0165] S514: Using the emotion expression smoothing curve, a dynamic smoothing operation is performed to continuously adjust the emotion response parameters in multiple rounds of dialogues to generate a recursive emotion generation response value.
[0166] Through dynamic smoothing operations, continuous emotional response parameters are integrated into a multi-level emotional change matrix. In this process, the emotional response values of each round of dialogue are first collected, and these emotional data are smoothed by combining time series analysis techniques, such as moving average or exponential smoothing methods, to ensure the continuity and smoothness of emotions. In addition, by gradually adjusting the smoothing parameters, it is possible to observe how the emotional response curve changes under different parameter settings, so as to select the smoothing strategy that best suits the current dialogue scenario and ensure that the emotional expression is highly consistent with the actual emotional state. This method not only enhances the adaptability of the model, but also optimizes the naturalness of emotional interaction.
[0167] An intelligent dialogue generation system based on multidimensional sentiment analysis, the intelligent dialogue generation system based on multidimensional sentiment analysis is used to execute the above-mentioned intelligent dialogue generation method based on multidimensional sentiment analysis, the system includes:
[0168] The emotional feature extraction module evaluates the emotional effectiveness value, arousal value, and dominance value based on the text content input by the user, analyzes the semantic strength value of the text, combines the emotional preference parameters in the user portrait, analyzes the extraction results, calculates the offset variation range of the emotional features, and generates emotional offset features;
[0169] The sentiment weight distribution module compares the sentiment trend of the current input text based on the sentiment shift feature, establishes a sentiment change matrix, calculates the global sentiment change amplitude, performs smoothing, obtains the current round sentiment weight set, performs distribution analysis, and generates sentiment dynamic weight distribution values;
[0170] The adaptation prompt generation module extracts the target intent classification and target tone type based on the emotional dynamic weight distribution value, calculates the emotional weight of the prompt content, performs context consistency check, adjusts the adaptation weight, and generates the adaptation prompt weight distribution value;
[0171] The recursive emotion optimization module calculates the difference between the emotion feature value in the generated sentence and the target emotion intensity based on the adaptation prompt weight distribution value, adjusts the difference value, dynamically corrects the emotion feature parameters, recalibrates the emotion weight matrix, and generates the recursive emotion generation response value.
[0172] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. An intelligent dialogue generation method based on multi-dimensional sentiment analysis, characterized in that: The following steps are involved: Through user input, the emotional effectiveness value, arousal value, and dominance value are evaluated, the semantic intensity value is obtained through semantic content analysis, the emotional preference parameters in the user portrait are merged, the offset variation range of the emotional feature is calculated, and the emotional offset feature is generated; Based on the emotion shift feature, the current emotion trend is compared, an emotion change matrix is constructed, the global emotion change amplitude is calculated, the weight value is smoothed to obtain the emotion weight set of the current round, and an emotion dynamic weight distribution value is generated; Based on the emotional dynamic weight distribution value, extract the dialogue intention classification value, analyze the target tone type, calculate the prompt content weight, check the emotional consistency weight with the dialogue context, integrate the prompt content emotion and consistency distribution parameters, adjust the adaptation weight, and generate the adaptation prompt weight distribution value; Based on the adaptation prompt weight distribution value, the difference between the emotional feature value and the target emotional intensity in the generated sentence is analyzed, the adjustment coefficient is calculated, the emotional feature parameters of the current sentence are dynamically corrected, the emotional weight matrix of the content is recalibrated, and the optimized emotional response content is generated; Based on the optimized emotional response content, the progressive emotional change matrix is analyzed, the difference between the progressive parameters and the emotional weight distribution value is compared, the emotional expression smooth curve is reconstructed, the dynamic smoothing operation generates continuous parameters of multiple rounds of emotional responses, and the recursive emotional generation response value is generated.
2. The intelligent dialogue generation method based on multidimensional sentiment analysis according to claim 1 is characterized in that: The emotion shift characteristics include emotion effectiveness value shift, arousal value shift, dominance value shift, semantic intensity value change range, and emotion preference parameters; the emotion dynamic weight distribution value includes the global emotion change amplitude, emotion change matrix, current round emotion weight set, and smooth weight value; the adaptation prompt weight distribution value includes dialogue intention classification value, target tone type, prompt content weight, emotion consistency distribution parameter, and adaptation weight; the optimized emotion response content includes emotion feature value, target emotion intensity difference, adjustment coefficient, and emotion weight matrix; the recursive emotion generation response value includes progressive emotion change matrix, emotion weight distribution value difference, emotion expression smooth curve, and continuous parameter.
3. The intelligent dialogue generation method based on multidimensional sentiment analysis according to claim 2 is characterized in that: The steps for acquiring the emotion shift feature are specifically as follows: Analyze user input, evaluate emotional effectiveness value, arousal value and dominance value, and obtain the comprehensive emotional index by calculating the weighted average of the indicators; Performing semantic analysis on the text input by the user, extracting the semantic strength value, combining the comprehensive sentiment index, analyzing the difference between the sentiment preference in the user portrait, and obtaining the sentiment difference value; Based on the emotional difference value and the emotional comprehensive index, the formula is adopted: Calculate the sentiment shift feature; Among them, E represents the sentiment shift feature, E sd Represents the sentiment difference value, E ci represents the comprehensive emotional index, a represents the adjustment coefficient of the emotional difference value, which is used to adjust the weight influence of the emotional offset feature on the emotional difference value, b represents the adjustment coefficient of the comprehensive emotional index, which is used to adjust the weight influence of the emotional offset feature on the comprehensive emotional index, and c represents the total adjustment parameter, which is used to normalize the calculation results of the entire formula.
4. The intelligent dialogue generation method based on multidimensional sentiment analysis according to claim 3 is characterized in that: The steps for obtaining the emotional dynamic weight distribution value are specifically as follows: By comparing the current emotion trend with the emotion shift feature, an emotion change matrix is established, multi-unit element values in the matrix are normalized, an average change value of the normalized matrix is calculated, and an emotion change amplitude value is generated; Based on the emotion change amplitude value, the multi-emotion weight factor is processed by weight smoothing calculation, using the formula: Calculate the smoothed weight set to generate a sentiment weight set; Among them, W i represents the smoothed sentiment weight value, C i represents the initial emotion weight factor, F represents the emotion change amplitude value, P i It represents the emotional preference weight factor associated with the current emotional trend, providing reverse adjustment to balance the intensity of preference, and k is the adjustment coefficient, which controls the amplitude of the overall weight adjustment; The emotion weight set is subjected to a normalization operation, the dynamic relationship between multiple normalized weights and weight factors is integrated, and the emotion dynamic weight distribution value is calculated.
5. The intelligent dialogue generation method based on multidimensional sentiment analysis according to claim 4 is characterized in that: The steps for obtaining the adaptation prompt weight distribution value are specifically as follows: By analyzing the emotional dynamic weight distribution value, extracting the conversation intention classification value, calculating the weight of the conversation intention and the emotional trend matching, and generating a conversation intention weight set; Analyze the target tone type, synthesize the dialogue intention weight set, use a quantitative analysis method to compare the consistency of the target tone with the context emotion, calculate the tone matching weight, and generate a tone adaptation weight set; According to the prompt content weight, combined with the tone adaptation weight set, the formula is adopted: Calculate and generate the adaptation prompt weight distribution value; Among them, W c It represents the weight obtained based on content analysis, reflecting the importance and influence of the content itself. t represents the tone matching weight, which shows the matching degree between the target tone and the current conversation emotion, W m Represents the inverse strength of context emotion matching, and adjusts the weight influence by calculating the inverse ratio of the matching degree. p Indicates the adaptation hint weight distribution value.
6. The intelligent dialogue generation method based on multi-dimensional sentiment analysis according to claim 5 is characterized in that: The steps of obtaining the optimized emotional response content are specifically as follows: Based on the adaptation prompt weight distribution value, the generated sentence is analyzed for emotional feature values, the emotional feature values are compared with the preset target emotional intensity, the difference between the two is identified, the difference index is calculated, and the emotional difference evaluation result is generated; According to the emotion difference evaluation result, the required adjustment coefficient is quantitatively calculated, the emotion feature parameters of the current sentence are dynamically adjusted, and an adjustment coefficient set is generated; The adjustment coefficient set is applied to modify the emotional characteristic parameters of the current sentence using the formula: By adjusting the index of the difference value, the sentiment parameters are optimized, the sentiment is adjusted, and the adjusted sentiment feature results are generated; Among them, E old represents the original emotional feature value, which refers to the quantitative value of the emotional state before sentence analysis. ΔE represents the difference in emotional intensity, which measures the gap between the current emotional state and the target emotional state. α represents the main adjustment coefficient, which is used to amplify or reduce the impact of emotional adjustment. β represents the adjustment coefficient, which adjusts the impact of ΔE to make the emotional adjustment smoother and avoid mutations. The adjusted emotional feature results are used to recalculate and calibrate the emotional weight matrix of the content, integrate all related emotional data, and generate optimized emotional response content.
7. The intelligent dialogue generation method based on multi-dimensional sentiment analysis according to claim 6 is characterized in that: The steps for obtaining the recursive emotion generation response value are specifically as follows: Based on the optimized emotional response content, the progressive emotional change matrix is analyzed, the change of emotional state after each round of dialogue is recorded, and the progressive value of emotional intensity is obtained by calculation to generate emotional progressive parameters; Compare the emotion progression parameter with the existing emotion weight distribution value, identify and quantify the difference between the two, calculate the difference index through comparative analysis, and generate the emotion weight difference result; According to the emotion weight difference results, the emotion expression smooth curve is reconstructed using the formula: Adjust the emotional intensity of each point, make a natural transition of emotional expression, and generate a smooth curve of emotional expression; Among them, S new represents the smooth curve of emotional expression, S old represents the original emotion expression curve, which represents the emotion output before adjustment, S target represents the target emotional state, α i is the coefficient adjusted based on the sentiment difference, k is the smoothing adjustment parameter, and n represents the number of sentiment points involved in the calculation; The emotion expression smoothing curve is used to perform dynamic smoothing operations, continuously adjust emotion response parameters in multiple rounds of dialogue, and generate recursive emotion generation response values.
8. Intelligent dialogue generation system based on multi-dimensional sentiment analysis, characterized by: According to any one of claims 1 to 7, the intelligent dialogue generation method based on multidimensional sentiment analysis comprises: The emotional feature extraction module evaluates the emotional effectiveness value, arousal value, and dominance value based on the text content input by the user, analyzes the semantic strength value of the text, combines the emotional preference parameters in the user portrait, analyzes the extraction results, calculates the offset variation range of the emotional features, and generates emotional offset features; The sentiment weight distribution module compares the sentiment trend of the current input text based on the sentiment shift feature, establishes a sentiment change matrix, calculates the global sentiment change amplitude, performs smoothing, obtains the current round sentiment weight set, performs distribution analysis, and generates a sentiment dynamic weight distribution value; The adaptation prompt generation module extracts the target intent classification and the target tone type based on the emotional dynamic weight distribution value, calculates the emotional weight of the prompt content, performs context consistency check, adjusts the adaptation weight, and generates an adaptation prompt weight distribution value; The recursive emotion optimization module calculates the difference between the emotion feature value in the generated sentence and the target emotion intensity based on the adaptation prompt weight distribution value, adjusts the difference value, dynamically corrects the emotion feature parameters, recalibrates the emotion weight matrix, and generates a recursive emotion generation response value.
Citation Information
Patent Citations
Intelligent calling method based on large language model
CN117336410A
Emotion support dialogue generation method based on multi-clue prompt learning
CN118410131A
Agent system
JP2024159687A
Context-aware and persona-based generative ai interpretation device and method for controlling the same
KR102692549B1
Distributed active learning in natural language processing for determining resource metrics
US20240184812A1
Cited By
AI dialogue scene control method with emotion recognition function
CN120670594A
Story interactive active questioning method and system based on cognitive characteristics of children
CN121119146A
A story interactive active questioning method and system based on cognitive characteristics of children
CN121119146B