A dialogue sentiment recognition system based on a large language model

By combining a large language model-based dialogue sentiment recognition system with personality prediction and dialogue sentiment analysis modules, the problem of personality factors not being considered in existing technologies is solved, thereby improving the accuracy and robustness of dialogue sentiment recognition.

CN118394903BActive Publication Date: 2025-11-18SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410474906.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2025-11-18
Estimated Expiration
2044-04-19

AI Technical Summary

Technical Problem

Existing dialogue systems fail to effectively consider the personality factors of the speakers, resulting in insufficient accuracy and robustness in emotion recognition. Furthermore, the lack of a unified generative paradigm makes it difficult to improve the accuracy of emotion recognition in dialogues.

Method used

A dialogue sentiment recognition system based on a large language model is adopted, which combines a dialogue text module, a personality prediction module, and a dialogue sentiment analysis module. The dialogue sentiment recognition task is reconstructed in a Seq2seq manner. A sample retrieval module and in-context-learning are introduced. The accuracy of sentiment recognition is improved by joint fine-tuning training of the personality prediction sub-task and the main task.

Benefits of technology

By integrating dialogue context and personality information, the accuracy and robustness of dialogue emotion recognition are improved, achieving more precise emotion state recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394903B_ABST
    Figure CN118394903B_ABST
Patent Text Reader

Abstract

The application discloses a dialogue sentiment recognition system based on a large language model, comprising a dialogue text module, which is used for storing user historical dialogue information and user current dialogue information; a personality prediction module connected with the dialogue text module, the personality prediction module trains an LLM to capture personality characteristics of different individuals, for a given data set, a set of predefined speaker labels is provided, and instruction text input of the personality prediction module comprises instructions, historical dialogue information and label declaration; a dialogue sentiment analysis module connected with the dialogue text module and the personality prediction module, and a dialogue sentiment analysis module reconstructs a dialogue sentiment recognition task into a Seq2seq form. The application introduces a large language model to solve an ERC problem, and finally obtains an accurate sentiment recognition result through joint fine-tuning training of an ERC main task and a personality prediction subtask.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of dialogue robots and natural language processing, and particularly relates to a dialogue sentiment recognition system based on a large language model. BACKGROUND

[0002] In the fields of opinion mining, human resources, and medical care, dialogue sentiment recognition technology is gradually widely used and becomes an important part of many artificial intelligence applications. By analyzing and identifying the sentiment state of each sentence in the conversation, the machine can make feedback according to different emotions, thereby effectively assisting human work. This technology has far-reaching significance for the informatization and intelligent development of various fields.

[0003] At present, the accuracy of the emotional dialogue system in sentiment recognition still has a large room for improvement, and an important part of the reason is that the dialogue content involves a wide range, the dialogue does not revolve around a certain topic, or the answer does not take into account the real situation and concerns of the user, which will lead to different emotions of the same answer from different identities.

[0004] The existing dialogue system does not consider the personality factors of the dialogue participants, and it is difficult to achieve accuracy in targeted and emotional recognition, and previous work lacks a unified design-based generation paradigm, and LLMs (Large Language Model) unify the output and input of different tasks, and show significant performance improvement in NLP (Nature Language Processing) tasks. However, the existing sentiment recognition technology cannot improve the accuracy and robustness of dialogue sentiment recognition by comprehensively considering dialogue context information and personality factors. SUMMARY

[0005] In order to overcome the shortcomings of the prior art, the user's accurate emotional state is obtained through user information and dialogue text information comprehensive information fusion and emotion classification algorithm, and the present application proposes a dialogue sentiment recognition system based on a large language model.

[0006] The technical solution of the present application is as follows: a dialogue sentiment recognition system based on a large language model, comprising

[0007] A dialogue text module, the dialogue text module is used for storing user historical dialogue information and user current dialogue information;

[0008] A personality prediction module connected with the dialogue text module, the personality prediction module trains the LLM to capture the personality characteristics of different individuals, and provides a set of predefined speaker labels for a given data set, the instruction text input of the personality prediction module includes instructions, historical dialogue information and label declaration;

[0009] The dialogue sentiment analysis module, connected to the dialogue text module and the personality prediction module, reconstructs the dialogue sentiment recognition task into a Seq2seq format. This module includes a sample retrieval module, which constructs a sample domain E from the training dataset. domain E domain The speaker's personality information was added, but the speaker's identity information was removed. That is, when retrieving reference examples, only specific utterances and personality information are considered; for a given utterance u to be identified... i Based on personality information and u i From E domain To demonstrate retrieving the most relevant examples, AngIE is used to find the top few examples with the highest semantic similarity. rvl If there are samples with the same personality information, the sample with the same personality information is selected; otherwise, the sample with the highest semantic similarity is selected directly. The input of the dialogue sentiment analysis module includes instructions, historical dialogue information, speaker personality predicted by the personality prediction module, tagged sentences, and demonstration samples.

[0010] Furthermore, the instructions in the personality prediction module and the dialogue sentiment analysis module are used to provide the large language model with well-defined roles, precise details of tasks, and a standardized format for the input dialogue text.

[0011] Furthermore, the historical dialogue information in the personality prediction module and the dialogue sentiment analysis module uses hyperparameters, namely dialogue windows, to indicate specific rounds of the historical dialogue and the corresponding speaker information.

[0012] Furthermore, the label declaration in the personality prediction module is used to restrict the output of the large language model to a limited range of labels, and its input is... Where u i,I The instruction is as follows; the loss calculation formula for the personality prediction module is... Where c i Indicates the speaker i Corresponding personality tags, θ is the input to the subtask, and θ represents the parameters of the large language model.

[0013] Furthermore, the input to the dialogue sentiment analysis module is x. i =[u i,I ;u i,H ;u i,C ;u i,L ;u i,D The token prediction loss is used to measure the model's output error, and its loss calculation formula is as follows:

[0014] The application has the beneficial effect that, compared with the prior art, the application introduces a large language model to solve the ERC problem, and finally obtains an accurate emotion recognition result through joint fine-tuning training of the ERC main task and the personality prediction subtask. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is a large language model-based dialogue emotion recognition system framework structure diagram of the application;

[0016] Figure 2 is a personality prediction prompt schematic diagram of the personality analysis module in the application;

[0017] Figure 3 is an emotion prediction prompt schematic diagram in the application;

[0018] Figure 4 is a large language model-based dialogue emotion recognition flowchart of the application. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the application.

[0020] Please refer to Figure 1 The purpose of the application is dialogue emotion recognition, which labels the corresponding emotion category for the sentence in the conversation. The application uses LLM to reformulate the dialogue emotion recognition task, and designs an effective instruction template that can adapt to different dialogue scenarios. Specifically, the model framework of the application includes an ERC dialogue emotion prediction main task and a personality prediction subtask, and an example retrieval module is added in the main task to improve the model performance through In-Context-Learning. The Prompt of the main task is composed of instructions, historical dialogue information, label sentences, and example retrieval, which predicts the emotion in the dialogue. The Prompt of the personality prediction subtask is composed of instructions, historical dialogue information, and label sentences, which predicts the emotion of the target sentence in the dialogue to assist the main task in judgment.

[0021] A dialogue emotion recognition system based on a large language model, comprising

[0022] The dialogue text module, the personality prediction module connected with the dialogue text module, and the dialogue emotion analysis module connected with the dialogue text module and the personality prediction module.

[0023] The dialogue text module is used to store user historical dialogue information and user current dialogue information.

[0024] The personality analysis module is used for the speaker personality analysis task. Different speakers have different personalities, and their emotional expressions are also different when facing the same situation. In order to more accurately predict the emotions expressed by the relevant sentences, the personality analysis module needs to train the LLM to capture the personality characteristics of different individuals. For a given dataset, a set of predefined speaker labels is provided.

[0025] See Figure 2 , the task of the personality analysis module is consistent with the main task, and the instruction text input x i is composed of three parts: instruction, historical dialogue information, and label declaration.

[0026] Among them, the instruction aims to provide the model with a clear definition of the role, accurate details of the task, and standardized format of the input dialogue text. For the personality recognition task, the instruction u i,I is as follows:

[0027] <“Now you are a personality analysis expert, please select the personality label of the speaker <Speaker n > from the historical dialogue information <u1, u2,..., u i >.”>

[0028] In order to model the context in real dialogue scenarios, the historical dialogue information method adopts a hyperparameter, namely the dialogue window (denoted as W character ), to indicate the specific round of historical dialogue (including the current utterance) and the corresponding speaker information. For the personality recognition of the target speaker Speaker i , its historical dialogue information u i,H is as follows.

[0029] <Speaker i : “...”, Speakerj: “...”,..., Speaker i : “...”, Speaker j : “...”>

[0030] In order to limit the output of the model within a limited range of labels and enable the model to focus on the utterance currently being identified, the label declaration u i,L is as follows.

[0031] <Please select the personality label of the speaker <Speaker j > from the personality labels <Optimistic, Depressed, Neurotic, Irritable, Passionate, Cautious>

[0032] In summary, the input of the personality analysis module subtask is as follows:

[0033]

[0034] The loss calculation of the personality analysis task is as follows:

[0035]

[0036] Where c i represents the personality label corresponding to the speaker Speaker i , i.e. the input of the subtask, and θ is the large model parameter.

[0037] The most important component in the dialogue sentiment analysis module is the example retrieval module, which uses AngIE to find similar sentences from the dataset as demonstration examples.

[0038] A common challenge faced by existing text embedding models is the gradient vanishing problem, which is mainly due to their dependence on the cosine function in the optimization objective, which has a saturation zone. To solve this problem, AnglE introduces angle optimization in complex space. This novel approach effectively mitigates the adverse effects of the saturation zone in the cosine function, which can hinder gradients and hinder the optimization process.

[0039] In the present application, the example retrieval module first divides the text embedding into real and imaginary parts in complex space. Then, it follows the division rules in complex space to calculate the angle difference between two text embeddings. After normalization, the angle difference becomes the target to be optimized. Optimizing the normalized angle difference is intuitive because if the normalized angle difference between two text embeddings is small, it means that the two text embeddings are closer to each other in complex space, i.e. they are more similar.

[0040] In order to better transfer and utilize the reasoning ability of the pre-trained large language model, in the present application, the dialogue sentiment analysis module reconstructs the dialogue sentiment recognition into Seq2seq form and solves it by fine-tuning the LLM. Moreover, the example retrieval module is supplemented, and In-Context Learning is used to improve the model performance to make up for the gap when applying LLM to specific NLP subtasks.

[0041] Please refer to Figure 3 The task of the dialogue sentiment analysis module, its input consists of four parts: instructions, historical dialogue information, speaker personality, label sentences and example retrieval. Among them, the historical dialogue information has the same content structure as in the personality analysis module.

[0042] For the dialogue sentiment recognition task, the instruction u i,I As follows:

[0043] ​<“Now you are an emotion expert, please identify the emotion expressed by the given utterance according to the history dialogue information and the speaker’s personality entered next.”

[0044] The speaker’s personality is the output of the personality analysis module, and different speakers have different personalities. The same situation can be expressed differently. The speaker’s personality obtained by the subtask is used as part of the input, so that the model can better predict the emotion of the dialogue according to the speaker’s personality. The label declaration u i,C is as follows:

[0045] The personality of <Speaker i > is <Character j >

[0046] In order to limit the output of the model within a limited range of labels, and enable the model to focus on the emotion expressed by the utterance being identified at present, the label declaration u i,L is as follows.

[0047] Please choose the emotion expressed by the utterance <Speaker i : u i > from the emotion labels <Happy, Sad, Anxious, Angry, Excited, Confused>

[0048] Please refer to Figure 4 , in order to further integrate emotional information to assist reasoning, the example retrieval module supplements the example prompt module based on semantic similarity. Specifically, the example retrieval module constructs an example domain E domain from the training data set domain , E i adds the speaker’s personality information, but removes the speaker’s identity information, that is, only the specific utterance and personality information are considered when retrieving reference examples. For a given utterance u i , the most relevant ERC example is retrieved from E domain as a demonstration according to the personality information and u rvl . In order to perform retrieval, the present invention uses AngIE to find the top few examples with the highest semantic similarity d i , if there is the same personality information in the example, select the example with the same personality information, otherwise directly select the example with the highest semantic similarity.

[0049] Therefore, the input of the dialogue emotion analysis module task is: x i,I = [u i,H ; u i,C ; u i,L ; u i,D], according to the original training method of LLM, the next token prediction loss is used to measure the output error of the model. Therefore, the loss calculation of the dialogue sentiment recognition task is denoted as is defined as:

[0050] The application provides a dialogue sentiment recognition method based on a large language model. The large language model is introduced to solve the ERC problem. The application reconstructs the dialogue sentiment recognition into a Seq2seq form. The method is composed of an ERC main task and a personality prediction subtask. An efficient retrieval module is designed using AngIE. The input in the main task is composed of an instruction, historical dialogue information, a label sentence, and a demonstration example. The demonstration example is output by a retrieval template module. Through In-Context-Learning, the model learns by analogy to improve the performance of the model. The input of the personality prediction subtask is composed of an instruction, historical dialogue information, and a label sentence, which is used to capture the influence of historical dialogue information on the current speech emotion. Through joint fine-tuning training of the ERC main task and the personality prediction subtask, an accurate sentiment recognition result is finally obtained.

[0051] The above is the preferred embodiment of the application. It should be pointed out that for ordinary skilled persons in the technical field, several improvements and refinements can be made without departing from the principles of the application. These improvements and refinements are also considered within the protection scope of the application.

Claims

1. A dialogue sentiment recognition system based on a large language model, characterized in that, include A dialogue text module, which stores the user's historical dialogue information and the user's current dialogue information; A personality prediction module connected to the dialogue text module trains a large language model to capture the personality characteristics of different individuals. For a given dataset, a set of predefined speaker labels is provided. The instruction text input of the personality prediction module includes instructions, historical dialogue information, and label declarations. A dialogue sentiment analysis module, connected to the dialogue text module and the personality prediction module, reconstructs the dialogue sentiment recognition task into a Seq2seq format. This module includes a sample retrieval module, which constructs a sample domain from the training dataset. , The speaker's personality information was added, but the speaker's identity information was removed. This means that when retrieving reference examples, only specific utterances and personality information are considered, and for a given utterance to be identified... Based on personality information and given words ,from To demonstrate the search, the most relevant examples are retrieved. AngIE is used to find the top few examples with the highest semantic similarity. If there are samples with the same personality information, the sample with the same personality information is selected; otherwise, the sample with the highest semantic similarity is selected directly. The input of the dialogue sentiment analysis module includes instructions, historical dialogue information, speaker personality predicted by the personality prediction module, tagged sentences, and demonstration samples. The label declaration in the personality prediction module is used to limit the output of the large language model to a limited range of labels. The input to the personality prediction module is... ,in For instructions, For historical dialogue information, This indicates a label declaration; the loss calculation formula for the personality prediction module is... ,in Indicates the speaker Corresponding personality tags, This is the input for the personality prediction module. For large language model parameters; The input to the dialogue sentiment analysis module is ,in For instructions, For historical dialogue information, This indicates the acquisition of personality traits information of the interlocutor. This indicates a label declaration. This represents sample information; the token prediction loss is used to measure the model's output error, and the loss calculation formula for the dialogue sentiment analysis module is as follows: .

2. The dialogue sentiment recognition system based on a large language model as described in claim 1, characterized in that, The instructions in the personality prediction module and the dialogue sentiment analysis module are used to provide the large language model with well-defined roles, precise details of tasks, and a standardized format for the input dialogue text.

3. The dialogue sentiment recognition system based on a large language model as described in claim 1, characterized in that, The personality prediction module and the dialogue sentiment analysis module use hyperparameters, namely dialogue windows, to indicate the turn of the historical dialogue and the corresponding speaker information.

Citation Information

Patent Citations

  • Conversation emotion recognition method based on common sense perception and hierarchical multi-task learning

    CN114722838A

  • Dialogue sentiment classification and dialogue behavior recognition method combined with multi-task learning

    CN115221301A