Emotion type analysis method and device, computer equipment and storage medium

By acquiring historical conversation texts, generating target prompt words and a three-jump thinking chain framework, and combining language models and fine-tuning algorithms to train sentiment classification models, the insufficient recognition of traditional models in implicit sentiment analysis is addressed, accurate prediction of the sentiment type of conversation texts is achieved, and service quality and efficiency are improved.

CN120706437APending Publication Date: 2025-09-26CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510653150.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Traditional sentiment analysis models have difficulty accurately identifying the types of emotions hidden in conversation texts when processing implicit emotional expressions. Especially in the fields of insurance and medical services, they are unable to effectively understand the complex and implicit emotional expressions of customers or patients, affecting service quality and efficiency.

Method used

The method obtains historical customer conversation texts, generates target prompt words based on the preset prompt word template library, constructs a target three-jump thinking chain framework, uses the preset language model for sentiment reasoning, and trains the sentiment classification model through fine-tuning algorithms to achieve sentiment type prediction of conversation texts.

Benefits of technology

It improves the accuracy of identifying implicit emotion types in conversation texts, enhances the systematization and structuring of emotion analysis, addresses the shortcomings of traditional models in implicit emotion analysis, and provides more accurate support for understanding customer or patient emotions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120706437A_ABST
    Figure CN120706437A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence, and relates to an emotion type analysis method, which comprises the following steps: acquiring a historical customer dialogue text, then generating a target cue word corresponding to the dialogue text according to a preset cue word template, and constructing a target three-jump thinking chain framework according to the target cue word and the dialogue text. And then, based on the target three-jump thinking chain framework and the dialogue text, performing emotion reasoning based on the framework dialogue text by utilizing a first language model. And then, based on the inference result, training a second language model according to a thinking chain framework by adopting a fine tuning algorithm to obtain an emotion classification model. And when a target dialogue text of a target client is received, performing emotion type prediction by using the emotion classification model, and accurately identifying an emotion type hidden in the target dialogue text. The invention further provides an emotion type analysis device, computer equipment and a storage medium. The method can be applied to business management program systems of financial insurance, medical treatment and the like, and the accuracy of emotion type analysis of the text can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and is applied to online processing business scenarios such as finance, insurance, and medical care, and in particular to a sentiment type analysis method, device, computer equipment, and storage medium. Background Art

[0002] Sentiment analysis is a key technology in natural language processing, widely used in various service industries, such as insurance and healthcare. Sentiment analysis is generally categorized into two main types: explicit sentiment analysis and implicit sentiment analysis. Explicit sentiment analysis processes text containing vocabulary with obvious emotional characteristics, while implicit sentiment analysis targets text that doesn't express direct emotion but contains underlying emotional undertones.

[0003] In the insurance sector, online interactions between customers and customer service representatives have become the norm. However, customer expressions in these conversations often consist solely of factual descriptions, lacking explicit opinions or sentimental vocabulary, which poses significant challenges for sentiment analysis. Implicit sentiment analysis technology is particularly important in this context, as it can discern implicit or ambiguous emotions expressed in text messages, enabling more precise responses and services. While traditional sentiment analysis models, particularly keyword-based approaches, excel at processing explicit sentiment, they face significant challenges in implicit sentiment analysis. These models often operate around specific key word signatures, such as "policy price," to determine sentiment. However, in the absence of explicit indicative vocabulary, these models struggle to capture subtle emotional undertones, significantly reducing the accuracy of their analysis results.

[0004] The healthcare sector faces similar challenges in sentiment analysis. Communication between patients and healthcare professionals, whether online or offline, can involve a significant amount of implicit emotion. Due to complex emotions such as physical discomfort or concerns about their condition, patients may not directly use explicit emotional terms when describing their condition or communicating with healthcare professionals, but instead use seemingly objective descriptions to convey their feelings. This implicit emotional expression is crucial for healthcare professionals to accurately understand patients' mental states and actual needs. However, traditional sentiment analysis models, which also rely on simple features such as keywords to determine emotional tendencies, struggle to effectively process these implicit emotions. When faced with such complex and implicit patient expressions, traditional models tend to overlook the underlying negative or positive sentiment, failing to provide healthcare professionals with comprehensive and accurate emotional information. This can impact the quality and efficiency of healthcare services, for example by failing to promptly detect patients' anxiety related to their condition and, consequently, providing inadequate psychological counseling.

[0005] Furthermore, traditional supervised learning methods often struggle with complex sentences containing deep meaning, especially when dealing with the noise and long-range semantic dependencies found in real conversations. These issues collectively constitute the core flaw of current implicit sentiment analysis technology: its inability to accurately identify the underlying sentiment within conversational text. Summary of the Invention

[0006] The purpose of the embodiments of the present application is to propose a sentiment type analysis method, apparatus, computer equipment and storage medium to solve the problem that current implicit sentiment analysis technology cannot accurately identify the sentiment type hidden between the lines in the dialogue text.

[0007] First, a sentiment type analysis method is provided, which adopts the following technical solutions:

[0008] Acquire historical customer conversation texts; generate target prompt words corresponding to the conversation texts based on prompt word templates in a preset prompt word template library; generate a target three-jump thinking chain framework based on the conversation texts and the target prompt words; based on the target three-jump thinking chain framework and the conversation texts, use a preset first language model to perform sentiment inference on the conversation texts to obtain sentiment inference results of the conversation texts; based on the sentiment inference results, use a preset fine-tuning algorithm to train the parameters of a preset second language model according to the preset thinking chain framework to obtain a sentiment classification model; when receiving the target conversation texts of the target customers, use the sentiment classification model to predict the sentiment type of the target conversation texts to determine the target sentiment type of the target conversation texts.

[0009] In a second aspect, a sentiment type analysis device is provided, which adopts the following technical solutions:

[0010] Acquisition module, used to obtain historical customer conversation texts;

[0011] A prompt word generation module, configured to generate target prompt words corresponding to the dialogue text based on prompt word templates in a preset prompt word template library;

[0012] The framework generation module is used to generate the target three-jump thought chain framework based on the dialogue text and the target prompt words;

[0013] The reasoning module is used to perform emotional reasoning on the dialogue text based on the target three-hop thinking chain framework and the dialogue text using a preset first language model to obtain the emotional reasoning result of the dialogue text;

[0014] The training module is used to train the parameters of the preset second language model based on the emotion reasoning results using a preset fine-tuning algorithm and a preset thought chain framework to obtain an emotion classification model;

[0015] The prediction module is used to use the sentiment classification model to predict the sentiment type of the target conversation text when receiving the target conversation text of the target customer, and determine the target sentiment type of the target conversation text.

[0016] In a third aspect, a computer device is provided, which adopts the following technical solution:

[0017] Acquire historical customer conversation texts; generate target prompt words corresponding to the conversation texts based on prompt word templates in a preset prompt word template library; generate a target three-jump thinking chain framework based on the conversation texts and the target prompt words; based on the target three-jump thinking chain framework and the conversation texts, use a preset first language model to perform sentiment inference on the conversation texts to obtain sentiment inference results of the conversation texts; based on the sentiment inference results, use a preset fine-tuning algorithm to train the parameters of a preset second language model according to the preset thinking chain framework to obtain a sentiment classification model; when receiving the target conversation texts of the target customers, use the sentiment classification model to predict the sentiment type of the target conversation texts to determine the target sentiment type of the target conversation texts.

[0018] In a fourth aspect, a computer-readable storage medium is provided, which adopts the following technical solution:

[0019] Acquire historical customer conversation texts; generate target prompt words corresponding to the conversation texts based on prompt word templates in a preset prompt word template library; generate a target three-jump thinking chain framework based on the conversation texts and the target prompt words; based on the target three-jump thinking chain framework and the conversation texts, use a preset first language model to perform sentiment inference on the conversation texts to obtain sentiment inference results of the conversation texts; based on the sentiment inference results, use a preset fine-tuning algorithm to train the parameters of a preset second language model according to the preset thinking chain framework to obtain a sentiment classification model; when receiving the target conversation texts of the target customers, use the sentiment classification model to predict the sentiment type of the target conversation texts to determine the target sentiment type of the target conversation texts.

[0020] Compared with the prior art, the embodiment of the present application has the following main beneficial effects: by obtaining the conversation text of historical customers and generating target prompt words based on the preset prompt word template library, it provides accurate guidance for subsequent sentiment analysis. Then, a target three-jump thinking chain framework is constructed. This framework effectively simulates the logical thinking process of human emotional reasoning, making sentiment analysis more systematic and structured. Based on the target three-jump thinking chain framework and the conversation text, the preset first language model is used for emotional reasoning, which can deeply explore the implicit emotional information in the conversation text and overcome the shortcomings of the traditional model in implicit sentiment analysis. Subsequently, according to the emotional reasoning results, the second language model is trained with parameters using the preset fine-tuning algorithm and the preset thinking chain framework to obtain a sentiment classification model for implicit sentiment analysis. Finally, when the target conversation text of the target customer is received, the sentiment classification model can accurately predict the emotional type of the target conversation text with its powerful emotion recognition ability, effectively solving the problem that traditional methods are difficult to capture the emotional type hidden between the lines in the conversation text, thereby improving the accuracy of the text's emotional type analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0023] Figure 2 A flowchart of an embodiment of a sentiment type analysis method according to the present application;

[0024] Figure 3 is a structural diagram of an embodiment of a sentiment type analysis device according to the present application;

[0025] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0027] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0029] like Figure 1 As shown, system architecture 100 may include a terminal device 101, a network 102, and a server 103. Terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. Network 102 is a medium for providing a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0030] The user can use the terminal device 101 to interact with the server 103 via the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0031] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer and a desktop computer, etc.

[0032] The server 103 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal device 101 .

[0033] It should be noted that the sentiment type analysis method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the sentiment type analysis device is generally set in the server / terminal device.

[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0035] Continue to refer Figure 2 , shows a flow chart of an embodiment of a service recommendation method according to the present application. The sentiment type analysis method includes the following steps:

[0036] Step S201: Obtain the historical customer conversation text.

[0037] In this embodiment, the electronic device on which the sentiment type analysis method is executed (eg Figure 1 The server / terminal device shown in the figure can obtain the historical customer conversation texts through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G / 5G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra wideband) connections, and other wireless connection methods currently known or to be developed in the future.

[0038] Historical customers refer to customers who have had interactions with insurance companies over the past period of time. For example, if a customer has communicated with insurance customer service multiple times regarding policy issues over the past year, this customer can be considered a historical customer. These communication records can be used as conversation text to analyze the customer's sentiment.

[0039] Conversational text refers to the text data generated during a conversation, typically including interactions between customers and customer service representatives, or between customers and systems. In the insurance sector, conversational text can include customer inquiries, complaints, and suggestions regarding insurance products. For example, historical customer inquiries about insurance product prices and questions about the claims process all fall under the category of conversational text.

[0040] Step S202: Generate target prompt words corresponding to the dialogue text according to prompt word templates in a preset prompt word template library.

[0041] The prompt word template library is a predefined collection of various prompt word templates used to guide sentiment analysis. These templates are designed to help the model better understand the emotional information in conversation text. Designed based on the needs of sentiment analysis, the prompt word template library covers prompt word combinations for different emotion types and contexts.

[0042] The prompt word template is a specific entry in the prompt word template library, used to provide additional contextual information or guidance to the first language model. It can be a sequence containing specific words or phrases, designed to activate the model's knowledge related to specific emotions or contexts.

[0043] Target prompts are generated based on the conversation text and a pre-set prompt template library. They are used for specific sentiment analysis tasks. They are the product of combining the prompt template with the conversation text content, aiming to more accurately guide the first language model in sentiment inference.

[0044] Step S203: Generate a target three-jump thinking chain framework based on the dialogue text and the target prompt words.

[0045] The target three-hop thought chain framework is a structured emotional reasoning framework designed to simulate the logical thinking process of humans in emotional reasoning. It can include three levels of prompts: emotional polarity prompts, initial emotional type prompts, and emotional type prompts. These prompts are integrated to form a complete thought chain. For example, in the insurance service field, the target three-hop thought chain framework might first identify the emotional polarity (positive / negative) in the conversation text, then determine the initial emotional type (such as anger, sadness, anxiety, happiness, or surprise), and finally refine and review it into a specific emotional type (such as anger).

[0046] Step S204: Based on the target three-jump thinking chain framework and the dialogue text, a preset first language model is used to perform sentiment reasoning on the dialogue text to obtain a sentiment reasoning result of the dialogue text.

[0047] The first language model is a pre-trained language model used for initial sentiment inference. It has strong language understanding and generation capabilities and can perform sentiment inference based on the conversation text and the target three-hop thought chain framework.

[0048] Sentiment inference refers to the process of using language models to determine the emotional tendency of conversational text. Based on the content of the conversational text and the prompt words in the target three-hop thinking chain framework, the model calculates and analyzes the emotional polarity and emotion type of the conversational text.

[0049] The sentiment inference result refers to the conclusion drawn by the first language model after performing sentiment inference based on the conversation text and the target three-hop thought chain framework. It can include sentiment polarity (e.g., positive or negative), initial sentiment type (e.g., angry, sad, anxious, happy, or surprised), and sentiment type (e.g., angry or happy).

[0050] Step S205 , based on the sentiment reasoning result, a preset fine-tuning algorithm is used to train the parameters of the preset second language model according to the preset thought chain framework to obtain a sentiment classification model.

[0051] A fine-tuning algorithm is a method used to adjust the parameters of a pre-trained language model to suit specific task requirements. In this embodiment, the fine-tuning algorithm is used to adjust the parameters of the second language model based on the sentiment inference results and the preset thought chain framework. Through fine-tuning, the second language model can be better adapted to the sentiment analysis task and the accuracy of sentiment classification can be improved.

[0052] The thought chain framework is a structured framework used to guide sentiment analysis models in reasoning and classification. It consists of a series of logically interconnected prompts and reasoning steps, designed to help second language models systematically understand the emotional information in conversational text. The thought chain framework can be tailored to specific task requirements to improve the accuracy and efficiency of sentiment analysis.

[0053] The second language model is a fine-tuned pre-trained language model for sentiment classification. It is trained based on the sentiment inference results of the first language model and a preset thought chain framework, and has stronger sentiment classification capabilities.

[0054] The sentiment classification model is a machine learning model used to classify the sentiment of conversation text. It is built on the second language model and can automatically identify the sentiment type in the conversation text.

[0055] Step S206: When the target conversation text of the target customer is received, the emotion classification model is used to predict the emotion type of the target conversation text to determine the target emotion type of the target conversation text.

[0056] Target customers are the specific customers whose sentiment types need to be predicted. In the insurance sector, these could be current customers interacting with the company. By performing sentiment analysis on target customers' conversations, we can understand their needs and expectations, providing support for subsequent personalized services.

[0057] The target conversation text refers to the conversation sentences obtained from target customers and used for sentiment type prediction. It can include customer inquiries, complaints, feedback, and other content, and is the primary input data for the sentiment classification model. By analyzing the target conversation text, the sentiment classification model can accurately predict the customer's sentiment type.

[0058] Sentiment type prediction refers to the process of using a sentiment classification model to determine the emotional tendency of the target conversation text. It outputs the customer's emotion type (such as satisfied, dissatisfied, neutral, etc.) based on the content of the target conversation text and the training results of the sentiment classification model.

[0059] The target sentiment type refers to the conclusion drawn by the sentiment classification model after predicting the sentiment type of the target conversation text. It represents the emotional tendency and attitude expressed by the target customer in the target conversation text.

[0060] The embodiment of the present application can provide precise guidance for subsequent sentiment analysis by obtaining the conversation text of historical customers and generating target prompt words based on a preset prompt word template library. Then, a target three-jump thinking chain framework is constructed. This framework effectively simulates the logical thinking process of humans in emotional reasoning, making sentiment analysis more systematic and structured. Based on the target three-jump thinking chain framework and the conversation text, the preset first language model is used for emotional reasoning, which can deeply explore the implicit emotional information in the conversation text and overcome the shortcomings of the traditional model in implicit sentiment analysis. Subsequently, according to the emotional reasoning results, the second language model is trained with parameters using the preset fine-tuning algorithm and the preset thinking chain framework to obtain a sentiment classification model for implicit sentiment analysis. Finally, when the target conversation text of the target customer is received, the sentiment classification model can accurately predict the emotional type of the target conversation text with its powerful emotion recognition ability, effectively solving the problem that traditional methods are difficult to capture the emotional type hidden between the lines in the conversation text, thereby improving the accuracy of the text's emotional type analysis.

[0061] In some optional implementations of this embodiment, step 202, generating a target prompt word corresponding to the dialogue text based on a prompt word template in a preset prompt word template library, specifically includes the following steps:

[0062] Extracting dialogue sentence features from the dialogue text; matching the dialogue sentence features with prompt word templates in a preset prompt word template library to obtain matching results; determining a target prompt word template from the prompt word template library based on the matching results; and generating a target prompt word corresponding to the dialogue text based on the dialogue text and the target prompt word template.

[0063] Among them, dialogue sentence features refer to the key information extracted from the dialogue text that can reflect the semantic and structural characteristics of the sentence.

[0064] The target prompt word template refers to a prompt word template that is determined from a template library based on the matching result between the features of the dialogue sentence and the prompt word templates in the preset prompt word template library and is highly relevant to the dialogue text content.

[0065] In one example, historical customer conversation texts can be extracted from a financial insurance company's customer service system or sales records. These texts may include customer inquiries, purchase intentions, complaints, and feedback regarding insurance products. Natural language processing techniques, such as lexical analysis, syntactic analysis, and semantic understanding, can then be used to extract key words, phrases, and sentence structures from the conversation texts. For example, key words such as "insurance premium," "claims process," and "service attitude" can be extracted. The extracted conversation sentence features are then matched against prompt word templates in a pre-set prompt word template library. The prompt word template library can include multiple prompt word templates for the financial and insurance sectors. Based on the matching results, a target prompt word template is determined from the prompt word template library. For example, if "insurance premium" is mentioned multiple times in the conversation text, prompt word templates related to "insurance premium" are retrieved from the prompt word template library as the target prompt word template. For example, the target prompt word template might read: Given a text, your goal is to determine which emotions, if any, are present in the text. Each emotion may be present or absent, or multiple emotions may appear in the same text, and the relationship between them and how they coexist or mutually exclude each other. Logical reasoning is used to determine the presence or absence of each emotion. Let's think about this step by step and do the following:

[0066] Polarity judgment: Starting from the "sentence", analyze the emotional polarity expressed in the sentence, is it positive, negative or neutral?

[0067] Possible categories: Based on the “sentence” and sentiment polarity, what initial sentiment types may exist;

[0068] Review: Based on the text "sentence", sentiment polarity, and possible initial sentiment types, review which sentiment types were obtained. Please provide a detailed explanation in your response and output instructions.

[0069] Finally, combine the dialogue text and the target prompt word template to generate the target prompt word corresponding to the dialogue text. For example, the content of the target prompt word can be: You are given a text: "Your reimbursement process is too troublesome." Your goal is to determine which emotions (if any) exist in the text. Each emotion may exist or not, or the relationship between multiple emotions may appear in the same text and how they coexist or exclude each other. Use logical reasoning to determine the presence or absence of each emotion. Let's think about and do the following step by step:

[0070] Polarity judgment: Starting with the sentence, analyze the emotional polarity of the sentence. Is it positive, negative, or neutral?

[0071] Possible categories: Based on the “sentence” and sentiment polarity, what initial sentiment types may exist;

[0072] Review: Based on the text "sentence", sentiment polarity, and possible initial sentiment types, review which sentiment types were obtained. Please provide a detailed explanation in your response and output instructions.

[0073] In one example, historical conversations between patients and medical staff can be extracted from channels such as the hospital's electronic medical record system, online consultation platforms, and patient satisfaction surveys. These conversations cover a wide range of topics, including descriptions of the patient's condition, consultations on treatment options, feedback on the medical staff's service attitude, evaluations of treatment effectiveness, and complaints and suggestions. For example, during an online consultation, a patient might describe, "I've had severe headaches these past few days and haven't been able to sleep well at night. My previous medications don't seem to be working, and I'm extremely anxious and don't know what to do." Natural language processing techniques, such as lexical analysis, syntactic analysis, and semantic understanding, are used to conduct in-depth analysis of the extracted conversations, extracting key words, phrases, and sentence structures. Key words and phrases such as "severe headache," "can't sleep well at night," "medicine isn't working," and "I'm extremely anxious" can be extracted from the patient's description. These features reflect the patient's physical condition and underlying emotional state. A library of pre-set prompt word templates for the medical field is constructed, containing a variety of prompt word templates relevant to different medical scenarios and emotional expressions. The extracted dialogue sentence features are matched with the templates in the prompt word template library. For example, when words related to physical discomfort (such as "headache", "insomnia", "pain", etc.) and emotional anxiety (such as "anxious", "worried", "afraid", etc.) frequently appear in the dialogue text, the system will perform accurate matching. Based on the matching results, the target prompt word template is determined from the prompt word template library. Assuming that the patient's physical pain and emotional anxiety are mentioned many times in the dialogue text, the system will obtain the prompt word template related to physical discomfort and anxiety from the template library as the target prompt word template. The content example of the target prompt word template is as follows:

[0074] Given a passage, your goal is to determine which emotions, if any, are present in the passage. Each emotion may be present or absent, or there may be multiple emotions in the same text, and how they coexist or exclude each other. Use logical reasoning to determine the presence or absence of each emotion. Let's think about it step by step and do the following:

[0075] Polarity judgment: Starting with the sentence, analyze the emotional polarity of the sentence. Is it positive (e.g., confidence in treatment effectiveness, satisfaction with the medical staff), negative (e.g., concern about the condition, dissatisfaction with the treatment), or neutral (e.g., simply stating the condition)?

[0076] Possible categories: Based on the sentence and emotional polarity, what initial emotional types may exist, such as anxiety (worry about the progression of the disease and the effectiveness of treatment), frustration (due to the long-term lack of improvement in the disease), trust (recognition of the professional ability of medical staff), etc.

[0077] Review: Based on the text "sentences", sentiment polarity, and possible initial sentiment types, review which sentiment types were determined. Please provide a detailed explanation in your response, stating the basis for your judgment, such as which words or expressions embody specific emotions, and whether there are correlations or conflicts between different emotions. Output an explanation.

[0078] Finally, the target prompt word corresponding to the conversation text is generated by combining the conversation text and the target prompt word template. For example, for the text described by the patient above, the generated target prompt word content is as follows:

[0079] You are given a text: "I've had a severe headache these past few days and haven't been able to sleep well at night. The medicine I took before doesn't seem to be working. I'm very anxious and don't know what to do." Your goal is to determine what emotions (if any) are present in the text. Each emotion may be present or absent, or there may be multiple emotions in the same text and the relationship between them and how they coexist or exclude each other. Use logical reasoning to determine the presence or absence of each emotion. Let's think step by step and do the following:

[0080] Polarity Judgment: Starting with the sentence, analyze the emotional polarity of the sentence. The sentence as a whole exhibits a negative emotional polarity, indicating that the patient is frustrated and anxious due to physical discomfort and poor treatment results.

[0081] Possible categories: Based on the sentence and the emotional polarity, what initial emotional types might be present? There might be anxiety, as the patient is worried about the persistent headache and the ineffectiveness of the medication; there might be depression, as the patient is depressed because the condition has not improved.

[0082] Review: Based on the text "sentence", sentiment polarity, and possible initial sentiment types, review which sentiment types were obtained. Please provide a detailed explanation in your response and output instructions.

[0083] By meticulously extracting conversational sentence features, the present embodiment can capture the subtle emotional undertones and underlying meanings within conversational text, effectively addressing the shortcomings of traditional models in implicit sentiment analysis. Furthermore, by matching against a pre-set library of prompt word templates, it can quickly locate prompt word templates relevant to the content of the conversational text, thereby generating accurate target prompt words, providing powerful guidance for subsequent sentiment reasoning.

[0084] In some optional implementations, step 203, generating a target three-jump thinking chain framework based on the dialogue text and the target prompt word, specifically includes the following steps:

[0085] Generate emotional polarity prompt words based on the dialogue text and target prompt words; generate initial emotional type prompt words based on the dialogue text and emotional polarity prompt words; generate emotional type prompt words based on the dialogue text and initial emotional type prompt words; integrate emotional polarity prompt words, initial emotional type prompt words, and emotional type prompt words to obtain the target three-jump thinking chain framework.

[0086] Among them, the emotional polarity prompt words are the first-level prompt words in the target three-jump thinking chain framework, which are used to preliminarily judge the emotional polarity of the dialogue text (e.g., positive or negative).

[0087] Among them, the initial emotion type prompt word is the second-level prompt word in the target three-jump thinking chain framework, which is used to further refine the emotion type based on the emotion polarity judgment.

[0088] Among them, the emotion type prompt word is the third-level prompt word in the target three-jump thinking chain framework, which is used to further refine the initial emotion type judgment into a specific emotion type.

[0089] In one example, suppose the conversation text is "Your reimbursement process is too troublesome," and the target prompt is: Given a text message, "Your reimbursement process is too troublesome," your goal is to determine which emotions (if any) are present in the text. Each emotion may be present or absent, or multiple emotions may appear in the same text, and the relationship between them and how they coexist or exclude each other. Use logical reasoning to determine the presence or absence of each emotion. Let's think about and do the following step by step: Polarity determination: Starting with the "sentence," analyze the emotional polarity expressed in the sentence—is it positive, negative, or neutral? Possible categories: Based on the "sentence" and emotional polarity, what initial emotional types may exist? Review: Based on the text "sentence," emotional polarity, and possible initial emotional types, review which emotional types are obtained. Please provide a detailed explanation in the response and output an explanation. This example explains this example. Based on the conversation text and the target prompt, the generated emotional polarity prompt word can be "negative." Then, based on the conversation text and the emotional polarity prompt word, the generated initial emotional type prompt word can be "dissatisfaction, complaint, boredom." Then, based on the conversation text and the initial emotion type prompt, the generated emotion type prompt might be "dissatisfaction with the reimbursement process." Finally, the resulting emotion polarity prompt, initial emotion type prompt, and emotion type prompt are integrated to create a target three-hop thought chain framework. For example, the target three-hop thought chain framework includes the following steps: First jump: emotion polarity is judged as dissatisfaction; Second jump: initial emotion type is inferred as dissatisfaction, complaint, or annoyance; Third jump: specific emotion type is determined as dissatisfaction with the reimbursement process.

[0090] The embodiment of the present application can achieve an effective breakthrough in the core problem of implicit sentiment analysis by gradually generating sentiment polarity prompt words, initial sentiment type prompt words and sentiment type prompt words based on the dialogue text and target prompt words, and integrating them to form a target three-jump thinking chain framework. Specifically, the framework first focuses on the overall sentiment tendency judgment of the dialogue text, and uses the target prompt words to capture the sentiment polarity from the text context, overcoming the limitation of traditional methods that rely on explicit sentiment words. Subsequently, based on the sentiment polarity prompt words, the initial sentiment type is further inferred, and the vague sentiment expression is refined into recognizable sentiment categories, such as dissatisfaction, complaint, etc., thereby enhancing the granularity of sentiment recognition. Finally, by combining the initial sentiment type with the details of the dialogue text, specific sentiment type prompt words are generated, such as "dissatisfaction with the reimbursement process", which achieves accurate positioning of deep emotional colors. The construction of this three-jump thinking chain framework not only improves the model's ability to understand complex and obscure emotional expressions, but also effectively reduces the impact of noise and long-range semantic dependencies on the accuracy of sentiment analysis through a structured reasoning process, significantly improving the accuracy and reliability of implicit sentiment analysis.

[0091] In some optional implementations, step 204, based on the target three-hop thought chain framework and the dialogue text, employing a preset first language model to perform sentiment inference on the dialogue text to obtain sentiment inference results of the dialogue text, specifically includes the following steps:

[0092] The target three-jump thinking chain framework and the dialogue text are input into a preset first language model to adjust the input processing flow of the first language model; based on the sentiment polarity prompt words and the dialogue text in the target three-jump thinking chain framework, the first language model is used for reasoning to output the text sentiment polarity of the dialogue text; based on the initial sentiment type prompt words, text sentiment polarity and the dialogue text in the target three-jump thinking chain framework, the first language model is used for reasoning to output the text initial sentiment type of the dialogue text; based on the sentiment type prompt words, the text initial sentiment type and the dialogue text, the first language model is used for reasoning to output the text sentiment type of the dialogue text; the text sentiment polarity, the text initial sentiment type and the dialogue text are determined as the sentiment reasoning result of the dialogue text.

[0093] Text sentiment polarity refers to the emotional tendency or attitude expressed in the conversation text, such as positive, negative, or neutral. Initial text sentiment type refers to the possible initial sentiment category inferred based on text sentiment polarity, such as dissatisfaction, complaint, and doubt. Text sentiment type refers to the specific sentiment category inferred from combining text sentiment polarity, initial text sentiment type, and the conversation text itself, such as "dissatisfaction with the claims process" or "complaints about service attitude."

[0094] In one example, this embodiment is explained using a target three-hop thought chain framework: first hop: emotional polarity judged as dissatisfaction; second hop: initial emotional type inferred as dissatisfaction, complaint, and annoyance; third hop: specific emotional type determined as dissatisfaction with the reimbursement process; and the conversation text "Your reimbursement process is too troublesome." The target three-hop thought chain framework and the conversation text "Your reimbursement process is too troublesome" can be input into the preset first language model to adjust the input processing flow of the first language model. Based on the sentiment polarity prompt words "dissatisfaction" and "your reimbursement process is too troublesome" in the target three-jump thinking chain framework, the first language model is used for reasoning, and the text sentiment polarity of "your reimbursement process is too troublesome" is output as "dissatisfaction"; based on the initial sentiment type prompt words "dissatisfaction, complaint, boredom" in the target three-jump thinking chain framework, the text sentiment polarity "dissatisfaction" and the dialogue text "your reimbursement process is too troublesome", the first language model is used for reasoning, and the text initial sentiment types of "dissatisfaction" and "complaint" of the dialogue text "your reimbursement process is too troublesome" are output; based on the sentiment type prompt words "dissatisfaction with reimbursement process", the text initial sentiment types "dissatisfaction" and "complaint" and the dialogue text "your reimbursement process is too troublesome", the first language model is used for reasoning, and the text sentiment type of "dissatisfaction with reimbursement process" of the dialogue text "your reimbursement process is too troublesome" is output; the text sentiment polarity, the text initial sentiment type, and the text sentiment type are determined as the sentiment reasoning results of the dialogue text.

[0095] The present embodiment significantly improves implicit sentiment analysis technology by inputting the target three-hop thought chain framework and the conversation text into the first language model and performing step-by-step reasoning based on this framework. Specifically, the process first uses sentiment polarity cues to guide the model to capture the overall sentiment tendency from the conversation text, effectively overcoming the limitations of traditional methods that rely on explicit sentiment words, allowing the model to more accurately identify the sentiment polarity in the text, such as positive, negative, or neutral. Next, combining the initial sentiment type cues and the determined sentiment polarity, the model further infers the initial sentiment type that may be contained in the conversation text, such as dissatisfaction and complaint, thereby enhancing the granularity of sentiment recognition. Finally, through a comprehensive analysis of the sentiment type cues, initial sentiment type, and conversation text, the model can accurately locate specific sentiment types, such as "dissatisfaction with the reimbursement process." This reasoning process not only improves the model's ability to understand complex and implicit emotional expressions, but also effectively reduces the impact of noise and long-range semantic dependencies on the accuracy of sentiment analysis through the structured thought chain framework, significantly improving the precision and reliability of implicit sentiment analysis.

[0096] In some optional implementations, step 205, based on the sentiment inference result, employing a preset fine-tuning algorithm, and training the parameters of a preset second language model according to a preset thought chain framework to obtain a sentiment classification model, specifically includes the following steps:

[0097] Based on the results of emotional reasoning, a reasoning sample data set is generated; based on the reasoning sample data set, the preset thinking chain framework is filled to obtain the filled target thinking chain framework; based on the target thinking chain framework and the reasoning sample data set, the preset fine-tuning algorithm is used to train the preset second language model to obtain the emotional classification model.

[0098] The inference sample dataset refers to a data set constructed based on historical customer conversation texts and their corresponding emotional inference results. The target thought chain framework refers to a structured inference framework generated based on the conversation texts and target prompt words.

[0099] In one example, based on the results of sentiment inference, a dataset of inference samples can be generated. Each sample contains the conversation text, sentiment polarity, initial sentiment type, and specific sentiment type. The preset thought chain framework is a structured template used to guide the training of the sentiment classification model. Based on the inference sample dataset, the preset thought chain framework can be populated, mapping the conversation text, sentiment polarity, and sentiment type information in each sample to the corresponding positions in the framework. Through this process, the system obtains a populated target thought chain framework, which not only retains the structure of the preset framework but also incorporates the sentiment information from the actual conversation text. Based on the target thought chain framework and the inference sample dataset, a preset fine-tuning algorithm is used to train the second language model. The fine-tuning algorithm adjusts the model parameters to better suit the implicit sentiment analysis task. During the training process, the system uses the target thought chain framework as a guide and the conversation text and sentiment type information in the inference sample dataset to iteratively optimize the second language model. After multiple iterations of training, the system obtains a sentiment classification model. This model can accurately identify sentiment types in conversation text, such as dissatisfaction with the claims process and complaints about service attitude.

[0100] The embodiment of the present application can achieve a significant breakthrough in implicit sentiment analysis technology by generating a reasoning sample dataset based on the sentiment reasoning results, filling in the preset thought chain framework accordingly, and then training the second language model in combination with the fine-tuning algorithm. Specifically, the sentiment reasoning results, as an accurate mapping of the sentiment type of the dialogue text, provide a high-quality data foundation for the construction of the reasoning sample dataset. The dataset not only contains the dialogue text itself, but also incorporates its corresponding sentiment polarity, initial sentiment type and specific sentiment type, providing rich supervision information for model training. By filling in the preset thought chain framework, the system constructs a structured knowledge representation, makes the logical process of sentiment reasoning explicit, and effectively guides the training direction of subsequent models. On this basis, the fine-tuning algorithm is used to train the second language model, so that the model can fully learn the implicit sentiment features in the dialogue text, overcoming the limitations of traditional models in implicit sentiment analysis. The final sentiment classification model can accurately identify the sentiment types hidden between the lines in the dialogue text.

[0101] In some optional implementations, the step of "based on the target thought chain framework and the reasoning sample dataset, using a preset fine-tuning algorithm to train a preset second language model to obtain a sentiment classification model" specifically includes the following steps:

[0102] Based on the preset fine-tuning algorithm, the low-rank matrix corresponding to the preset second language model is obtained; the low-rank matrix is ​​added to the second language model, the inference sample dataset is used as input, and the parameters of the low-rank matrix in the second language model are trained based on the target thinking chain framework to obtain the sentiment classification model.

[0103] The low-rank matrix is ​​a key parameter matrix used to fine-tune the second language model. This matrix represents the low-rank structure of the model parameters and is used to reduce the number of parameters while maintaining model performance, thereby improving training efficiency.

[0104] In one example, a pre-set fine-tuning algorithm can be used to obtain a low-rank matrix corresponding to the second language model. As a compact representation of model parameters, the low-rank matrix can significantly reduce the number of parameters while maintaining model performance, improving training efficiency. The low-rank matrix is ​​then added to the second language model. This not only preserves the basic structure and functionality of the original model but also introduces the flexibility of the low-rank matrix, enabling the model to more quickly adapt to new data distributions and characteristics during subsequent training. Next, the low-rank matrix parameters in the second language model are trained using the previously generated inference sample dataset as input, combined with the target thought chain framework. The inference sample dataset contains historical customer conversations and their corresponding sentiment inference results. This data provides the model with rich supervision information, helping it learn the implicit sentiment features in the conversations. The target thought chain framework serves as a guiding framework for training, clarifying the logical steps and key nodes of sentiment inference. This allows the model to more specifically adjust the low-rank matrix parameters during training, thereby optimizing model performance. After multiple iterations of training, a sentiment classification model is obtained. This model can accurately identify the sentiment types in conversations.

[0105] The embodiment of the present application can obtain the low-rank matrix corresponding to the second language model through a fine-tuning algorithm, add it to the second language model, and then combine it with the reasoning sample data set and the target thinking chain framework for training, thereby significantly improving the performance of the sentiment classification model. Specifically, the introduction of the low-rank matrix effectively compresses the scale of the model parameters while retaining key information, so that the model can adapt more flexibly to the implicit sentiment analysis task while maintaining high efficiency. The fine-tuning algorithm further optimizes the parameters of the low-rank matrix, enabling it to accurately capture the implicit emotional features in the dialogue text. During the training process, the reasoning sample data set provides the model with rich supervision information, while the target thinking chain framework clarifies the logical steps of emotional reasoning, guiding the model to gradually delve into the text and tap into deep-level emotional information. This combination enables the model to demonstrate greater robustness and accuracy when dealing with complex and obscure emotional expressions. The resulting sentiment classification model not only overcomes the limitations of traditional models in implicit sentiment analysis, but also significantly improves the accuracy of emotion type recognition.

[0106] In some optional implementations, step S206, using a sentiment classification model to predict the sentiment type of the target dialogue text to determine the target sentiment type of the target dialogue text, specifically includes the following steps:

[0107] The target dialogue text is preprocessed to obtain a preprocessed target dialogue text; the preprocessed target dialogue text is input into a sentiment classification model to output a sentiment prediction result of the target dialogue text; and based on the sentiment prediction result, the sentiment type of the target dialogue text is determined.

[0108] Preprocessing refers to a series of processing operations performed on the target customer's target conversation text. This can include steps such as text cleaning (such as removing noise and special characters), word segmentation, part-of-speech tagging, and named entity recognition to convert the original target conversation text into a format acceptable to the sentiment classification model.

[0109] Among them, the sentiment prediction result refers to the result output by the sentiment classification model after predicting the sentiment type of the preprocessed target dialogue text.

[0110] In one example, when the target conversation text of the target customer is received, the system first preprocesses it. The preprocessing steps may include: removing irrelevant characters in the text (such as punctuation marks, special symbols, etc.), converting to a unified uppercase and lowercase format, performing word segmentation, and removing stop words. These preprocessing operations are intended to improve the quality of the text and reduce the impact of noise on sentiment analysis. The preprocessed target conversation text is input into the previously trained sentiment classification model. This model is built based on the target thought chain framework and the second language model. The model parameters are optimized through fine-tuning algorithms, and it can accurately identify the emotion type in the conversation text. After the target conversation text is input, the sentiment classification model will perform a series of analysis and predictions, and finally output the emotion prediction results. Based on the emotion prediction results, the emotion type of the target conversation text can be determined.

[0111] The embodiment of the present application can pre-process the target conversation text of the target customer and input the pre-processed text into the sentiment classification model to output the sentiment prediction result, thereby determining the sentiment type, thereby significantly improving the accuracy and practicality of implicit sentiment analysis. Specifically, the pre-processing step effectively removes noise and irrelevant information in the conversation text, making the text purer, which is conducive to the model capturing deep-level emotional features. At the same time, the sentiment classification model is constructed based on a preset thinking chain framework and a second language model, and the model parameters are optimized through fine-tuning algorithms, which can more accurately identify the implicit emotional color in the conversation text. In actual applications, when the target conversation text of the target customer is received, the system can quickly pre-process it and input the processed text into the sentiment classification model to output accurate sentiment prediction results. Based on this result, the sentiment type of the target conversation text can be determined, effectively overcoming the limitations of traditional sentiment analysis models in the field of implicit sentiment analysis, and significantly improving the accuracy and efficiency of sentiment analysis.

[0112] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned dialogue text, prompt word template, target prompt word, emotional reasoning results and target dialogue text, the above-mentioned dialogue text, prompt word template, target prompt word, emotional reasoning results and target dialogue text can also be stored in a node of a blockchain.

[0113] The blockchain referred to in this application is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0114] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.

[0115] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0116] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware via computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0117] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0118] Further references Figure 3, as a response to the above Figure 2 The present application provides an embodiment of a sentiment type analysis device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0119] like Figure 4 As shown, the sentiment type analysis device 400 of this embodiment includes: an acquisition module 401, a prompt word generation module 402, a framework generation module 403, an inference module 404, a training module 405 and a prediction module 406. Among them:

[0120] Acquisition module 401, used to obtain historical customer conversation texts;

[0121] The prompt word generation module 402 is used to generate a target prompt word corresponding to the dialogue text based on a prompt word template in a preset prompt word template library;

[0122] A framework generation module 403 is used to generate a target three-jump thinking chain framework based on the dialogue text and the target prompt words;

[0123] The reasoning module 404 is configured to perform sentiment reasoning on the dialogue text using a preset first language model based on the target three-hop thought chain framework and the dialogue text, thereby obtaining a sentiment reasoning result of the dialogue text;

[0124] The training module 405 is used to train the parameters of the preset second language model according to the preset thought chain framework based on the sentiment inference result using a preset fine-tuning algorithm to obtain a sentiment classification model;

[0125] The prediction module 406 is configured to, upon receiving a target conversation text from a target customer, use a sentiment classification model to predict the sentiment type of the target conversation text and determine a target sentiment type of the target conversation text.

[0126] In this embodiment, historical customer conversation texts are obtained and target prompt words are generated based on a preset prompt word template library, providing precise guidance for subsequent sentiment analysis. Next, a target three-hop thought chain framework is constructed. This framework effectively simulates the logical thinking process of human emotional reasoning, making sentiment analysis more systematic and structured. Based on the target three-hop thought chain framework and the conversation text, a preset first language model is used for sentiment reasoning, which can deeply explore the implicit emotional information in the conversation text and overcome the shortcomings of traditional models in implicit sentiment analysis. Subsequently, based on the sentiment reasoning results, the second language model is trained using a preset fine-tuning algorithm and the preset thought chain framework to obtain a sentiment classification model for implicit sentiment analysis. Finally, when the target customer's target conversation text is received, the sentiment classification model, with its powerful emotion recognition capabilities, can accurately predict the target conversation text's emotion type. This effectively solves the problem that traditional methods have difficulty in capturing the emotions hidden between the lines of the conversation text, thereby improving the accuracy of text sentiment type analysis.

[0127] In one embodiment, the prompt word generation module 402 includes:

[0128] The extraction submodule is used to extract the features of the dialogue sentences in the dialogue text;

[0129] A matching submodule is used to match the features of the dialogue sentence with the prompt word templates in the preset prompt word template library to obtain a matching result;

[0130] A determination submodule, configured to determine a target prompt word template from a prompt word template library based on the matching result;

[0131] The first generation submodule is used to generate a target prompt word corresponding to the dialogue text based on the dialogue text and the target prompt word template.

[0132] By meticulously extracting conversational sentence features, the present embodiment can capture the subtle emotional undertones and underlying meanings within conversational text, effectively addressing the shortcomings of traditional models in implicit sentiment analysis. Furthermore, by matching against a pre-set library of prompt word templates, it can quickly locate prompt word templates relevant to the content of the conversational text, thereby generating accurate target prompt words, providing powerful guidance for subsequent sentiment reasoning.

[0133] In one embodiment, the framework generation module 403 includes:

[0134] The second generation submodule is used to generate emotional polarity prompt words based on the dialogue text and the target prompt words;

[0135] The third generation submodule is used to generate initial emotion type prompt words based on the dialogue text and the emotion polarity prompt words;

[0136] The fourth generation submodule is used to generate emotion type prompt words according to the dialogue text and the initial emotion type prompt words;

[0137] The integration submodule is used to integrate the emotion polarity prompt words, the initial emotion type prompt words, and the emotion type prompt words to obtain the target three-jump thinking chain framework.

[0138] The embodiment of the present application can achieve an effective breakthrough in the core problem of implicit sentiment analysis by gradually generating sentiment polarity prompt words, initial sentiment type prompt words and sentiment type prompt words based on the dialogue text and target prompt words, and integrating them to form a target three-jump thinking chain framework. Specifically, the framework first focuses on the overall sentiment tendency judgment of the dialogue text, and uses the target prompt words to capture the sentiment polarity from the text context, overcoming the limitation of traditional methods that rely on explicit sentiment words. Subsequently, based on the sentiment polarity prompt words, the initial sentiment type is further inferred, and the vague sentiment expression is refined into recognizable sentiment categories, such as dissatisfaction, complaint, etc., thereby enhancing the granularity of sentiment recognition. Finally, by combining the initial sentiment type with the details of the dialogue text, specific sentiment type prompt words are generated, such as "dissatisfaction with the reimbursement process", which achieves accurate positioning of deep emotional colors. The construction of this three-jump thinking chain framework not only improves the model's ability to understand complex and obscure emotional expressions, but also effectively reduces the impact of noise and long-range semantic dependencies on the accuracy of sentiment analysis through a structured reasoning process, significantly improving the accuracy and reliability of implicit sentiment analysis.

[0139] In one embodiment, the reasoning module 404 includes:

[0140] An input submodule, configured to input the target three-hop thought chain framework and the dialogue text into a preset first language model to adjust the input processing flow of the first language model;

[0141] The first output submodule is used to use the first language model to perform reasoning based on the sentiment polarity prompt words and the dialogue text in the target three-hop thought chain framework, and output the text sentiment polarity of the dialogue text;

[0142] The second output submodule is used to use the first language model to perform reasoning based on the initial emotion type prompt words, text emotion polarity, and dialogue text in the target three-hop thinking chain framework, and output the initial emotion type of the dialogue text;

[0143] The third output submodule is configured to use the first language model to perform inference based on the emotion type prompt word, the initial emotion type of the text, and the conversation text, and output the text emotion type of the conversation text;

[0144] The determination submodule is used to determine the text sentiment polarity, the text initial sentiment type, and the text sentiment type as the sentiment inference result of the dialogue text.

[0145] The present embodiment significantly improves implicit sentiment analysis technology by inputting the target three-hop thought chain framework and the conversation text into the first language model and performing step-by-step reasoning based on this framework. Specifically, the process first uses sentiment polarity cues to guide the model to capture the overall sentiment tendency from the conversation text, effectively overcoming the limitations of traditional methods that rely on explicit sentiment words, allowing the model to more accurately identify the sentiment polarity in the text, such as positive, negative, or neutral. Next, combining the initial sentiment type cues and the determined sentiment polarity, the model further infers the initial sentiment type that may be contained in the conversation text, such as dissatisfaction and complaint, thereby enhancing the granularity of sentiment recognition. Finally, through a comprehensive analysis of the sentiment type cues, initial sentiment type, and conversation text, the model can accurately locate specific sentiment types, such as "dissatisfaction with the reimbursement process." This reasoning process not only improves the model's ability to understand complex and implicit emotional expressions, but also effectively reduces the impact of noise and long-range semantic dependencies on the accuracy of sentiment analysis through the structured thought chain framework, significantly improving the precision and reliability of implicit sentiment analysis.

[0146] In one embodiment, the training module 405 includes:

[0147] The dataset generation submodule is used to generate an inference sample dataset based on the sentiment inference results;

[0148] The filling submodule is used to fill the preset thinking chain framework according to the reasoning sample data set to obtain the filled target thinking chain framework;

[0149] The training submodule is used to train the preset second language model based on the target thought chain framework and the reasoning sample data set, using the preset fine-tuning algorithm to obtain the sentiment classification model.

[0150] The embodiment of the present application can achieve a significant breakthrough in implicit sentiment analysis technology by generating a reasoning sample dataset based on the sentiment reasoning results, filling in the preset thought chain framework accordingly, and then training the second language model in combination with the fine-tuning algorithm. Specifically, the sentiment reasoning results, as an accurate mapping of the sentiment type of the dialogue text, provide a high-quality data foundation for the construction of the reasoning sample dataset. The dataset not only contains the dialogue text itself, but also incorporates its corresponding sentiment polarity, initial sentiment type and specific sentiment type, providing rich supervision information for model training. By filling in the preset thought chain framework, the system constructs a structured knowledge representation, makes the logical process of sentiment reasoning explicit, and effectively guides the training direction of subsequent models. On this basis, the fine-tuning algorithm is used to train the second language model, so that the model can fully learn the implicit sentiment features in the dialogue text, overcoming the limitations of traditional models in implicit sentiment analysis. The final sentiment classification model can accurately identify the sentiment types hidden between the lines in the dialogue text.

[0151] In one embodiment, the training submodule is further used to obtain a low-rank matrix corresponding to a preset second language model based on a preset fine-tuning algorithm; add the low-rank matrix to the second language model, take the inference sample data set as input, train the parameters of the low-rank matrix in the second language model based on the target thinking chain framework, and obtain a sentiment classification model.

[0152] The embodiment of the present application can obtain the low-rank matrix corresponding to the second language model through a fine-tuning algorithm, add it to the second language model, and then combine it with the reasoning sample data set and the target thinking chain framework for training, thereby significantly improving the performance of the sentiment classification model. Specifically, the introduction of the low-rank matrix effectively compresses the scale of the model parameters while retaining key information, so that the model can adapt more flexibly to the implicit sentiment analysis task while maintaining high efficiency. The fine-tuning algorithm further optimizes the parameters of the low-rank matrix, enabling it to accurately capture the implicit emotional features in the dialogue text. During the training process, the reasoning sample data set provides the model with rich supervision information, while the target thinking chain framework clarifies the logical steps of emotional reasoning, guiding the model to gradually delve into the text and tap into deep-level emotional information. This combination enables the model to demonstrate greater robustness and accuracy when dealing with complex and obscure emotional expressions. The resulting sentiment classification model not only overcomes the limitations of traditional models in implicit sentiment analysis, but also significantly improves the accuracy of emotion type recognition.

[0153] In one embodiment, the prediction module 406 includes:

[0154] A preprocessing submodule is used to preprocess the target dialogue text to obtain the preprocessed target dialogue text;

[0155] The fourth output submodule is used to input the preprocessed target dialogue text into the sentiment classification model and output the sentiment prediction result of the target dialogue text;

[0156] The determination submodule is used to determine the emotion type of the target dialogue text based on the emotion prediction results.

[0157] The embodiment of the present application can pre-process the target conversation text of the target customer and input the pre-processed text into the sentiment classification model to output the sentiment prediction result, thereby determining the sentiment type, thereby significantly improving the accuracy and practicality of implicit sentiment analysis. Specifically, the pre-processing step effectively removes noise and irrelevant information in the conversation text, making the text purer, which is conducive to the model capturing deep-level emotional features. At the same time, the sentiment classification model is constructed based on a preset thinking chain framework and a second language model, and the model parameters are optimized through fine-tuning algorithms, which can more accurately identify the implicit emotional color in the conversation text. In actual applications, when the target conversation text of the target customer is received, the system can quickly pre-process it and input the processed text into the sentiment classification model to output accurate sentiment prediction results. Based on this result, the sentiment type of the target conversation text can be determined, effectively overcoming the limitations of traditional sentiment analysis models in the field of implicit sentiment analysis, and significantly improving the accuracy and efficiency of sentiment analysis.

[0158] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0159] The computer device 4 includes a memory 61, a processor 62, and a network interface 63 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 6 having a memory 61, a processor 62, and a network interface 63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0160] Computer devices can be desktop computers, laptops, PDAs, cloud servers, etc. Computer devices can interact with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.

[0161] The memory 61 includes at least one type of readable storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as the hard disk or memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a flash memory card, and the like equipped on the computer device 6. Of course, the memory 61 may also include both the internal storage unit and the external storage device of the computer device 6. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions for the sentiment type analysis method. In addition, the memory 61 may also be used to temporarily store various types of data that have been output or are about to be output.

[0162] In some embodiments, the processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to execute computer-readable instructions stored in the memory 61 or process data, such as computer-readable instructions for executing the sentiment type analysis method.

[0163] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.

[0164] The embodiment of the present application can provide precise guidance for subsequent sentiment analysis by obtaining the conversation text of historical customers and generating target prompt words based on a preset prompt word template library. Then, a target three-jump thinking chain framework is constructed. This framework effectively simulates the logical thinking process of humans in emotional reasoning, making sentiment analysis more systematic and structured. Based on the target three-jump thinking chain framework and the conversation text, the preset first language model is used for emotional reasoning, which can deeply explore the implicit emotional information in the conversation text and overcome the shortcomings of the traditional model in implicit sentiment analysis. Subsequently, according to the emotional reasoning results, the second language model is trained with parameters using the preset fine-tuning algorithm and the preset thinking chain framework to obtain a sentiment classification model for implicit sentiment analysis. Finally, when the target conversation text of the target customer is received, the sentiment classification model can accurately predict the emotional type of the target conversation text with its powerful emotion recognition ability, effectively solving the problem that traditional methods are difficult to capture the emotional type hidden between the lines in the conversation text, thereby improving the accuracy of the text's emotional type analysis.

[0165] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions. The computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the sentiment type analysis method as described above.

[0166] The embodiment of the present application can provide precise guidance for subsequent sentiment analysis by obtaining the conversation text of historical customers and generating target prompt words based on a preset prompt word template library. Then, a target three-jump thinking chain framework is constructed. This framework effectively simulates the logical thinking process of humans in emotional reasoning, making sentiment analysis more systematic and structured. Based on the target three-jump thinking chain framework and the conversation text, the preset first language model is used for emotional reasoning, which can deeply explore the implicit emotional information in the conversation text and overcome the shortcomings of the traditional model in implicit sentiment analysis. Subsequently, according to the emotional reasoning results, the second language model is trained with parameters using the preset fine-tuning algorithm and the preset thinking chain framework to obtain a sentiment classification model for implicit sentiment analysis. Finally, when the target conversation text of the target customer is received, the sentiment classification model can accurately predict the emotional type of the target conversation text with its powerful emotion recognition ability, effectively solving the problem that traditional methods are difficult to capture the emotional type hidden between the lines in the conversation text, thereby improving the accuracy of the text's emotional type analysis.

[0167] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.

[0168] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.

[0169] The non-Company software tools or components appearing in the embodiments of this application are merely examples and do not represent actual use.

Claims

1. A sentiment type analysis method, characterized in that: The steps include: Get the conversation text of historical customers; Generating a target prompt word corresponding to the dialogue text according to a prompt word template in a preset prompt word template library; Generate a target three-jump thinking chain framework based on the dialogue text and the target prompt word; Based on the target three-jump thinking chain framework and the dialogue text, using a preset first language model to perform sentiment reasoning on the dialogue text to obtain a sentiment reasoning result of the dialogue text; Based on the emotion reasoning result, a preset fine-tuning algorithm is used to train the parameters of the preset second language model according to the preset thought chain framework to obtain an emotion classification model; When a target conversation text of a target customer is received, the emotion classification model is used to predict the emotion type of the target conversation text to determine the target emotion type of the target conversation text.

2. The method according to claim 1, characterized in that The step of generating a target prompt word corresponding to the dialogue text based on a prompt word template in a preset prompt word template library specifically includes: extracting dialogue sentence features of the dialogue text; Matching the dialogue sentence features with prompt word templates in a preset prompt word template library to obtain a matching result; Based on the matching result, determining a target prompt word template from the prompt word template library; Based on the dialogue text and the target prompt word template, a target prompt word corresponding to the dialogue text is generated.

3. The method according to claim 1, characterized in that The step of generating a target three-jump thinking chain framework based on the dialogue text and the target prompt word specifically includes: generating an emotional polarity prompt word according to the dialogue text and the target prompt word; generating an initial emotion type prompt word according to the conversation text and the emotion polarity prompt word; Generate emotion type prompt words according to the dialogue text and the initial emotion type prompt words; The emotion polarity prompt words, the initial emotion type prompt words, and the emotion type prompt words are integrated to obtain a target three-jump thinking chain framework.

4. The method according to claim 3, characterized in that The step of performing sentiment inference on the dialogue text using a preset first language model based on the target three-jump thinking chain framework and the dialogue text to obtain a sentiment inference result of the dialogue text specifically includes: Inputting the target three-jump thinking chain framework and the dialogue text into a preset first language model to adjust the input processing flow of the first language model; Based on the sentiment polarity prompt words in the target three-hop thinking chain framework and the dialogue text, the first language model is used for reasoning to output the text sentiment polarity of the dialogue text; Based on the initial emotion type prompt words in the target three-jump thinking chain framework, the text emotion polarity, and the dialogue text, the first language model is used for reasoning to output the text initial emotion type of the dialogue text; Based on the emotion type prompt word, the initial emotion type of the text, and the dialogue text, the first language model is used for reasoning to output the text emotion type of the dialogue text; The text sentiment polarity, the text initial sentiment type, and the text sentiment type are determined as the sentiment inference result of the dialogue text.

5. The method according to claim 1, wherein The step of using a preset fine-tuning algorithm based on the sentiment inference result to train the parameters of the preset second language model according to a preset thought chain framework to obtain the sentiment classification model specifically includes: generating a reasoning sample data set based on the sentiment reasoning result; According to the reasoning sample data set, the preset thinking chain framework is filled to obtain the filled target thinking chain framework; Based on the target thought chain framework and the reasoning sample data set, a preset fine-tuning algorithm is used to train the preset second language model to obtain a sentiment classification model.

6. The method according to claim 5, characterized in that The step of training a preset second language model based on the target thought chain framework and the reasoning sample data set using a preset fine-tuning algorithm to obtain a sentiment classification model specifically includes: Based on a preset fine-tuning algorithm, obtain a low-rank matrix corresponding to a preset second language model; The low-rank matrix is ​​added to the second language model, the reasoning sample data set is used as input, and the parameters of the low-rank matrix in the second language model are trained based on the target thought chain framework to obtain a sentiment classification model.

7. The method according to claim 1, characterized in that The step of using the sentiment classification model to predict the sentiment type of the target dialogue text and determining the target sentiment type of the target dialogue text specifically includes: Preprocessing the target dialogue text to obtain a preprocessed target dialogue text; Inputting the preprocessed target dialogue text into the sentiment classification model, and outputting a sentiment prediction result of the target dialogue text; Based on the emotion prediction result, the emotion type of the target dialogue text is determined.

8. A sentiment type analysis device, characterized in that: include: Acquisition module, used to obtain historical customer conversation texts; a prompt word generation module, configured to generate a target prompt word corresponding to the dialogue text based on a prompt word template in a preset prompt word template library; A framework generation module, configured to generate a target three-jump thinking chain framework based on the dialogue text and the target prompt word; an inference module, configured to perform sentiment inference on the dialogue text using a preset first language model based on the target three-jump thinking chain framework and the dialogue text, to obtain a sentiment inference result of the dialogue text; A training module is used to train the parameters of a preset second language model according to a preset thought chain framework based on the sentiment inference result using a preset fine-tuning algorithm to obtain a sentiment classification model; The prediction module is used to, when receiving a target conversation text of a target customer, use the sentiment classification model to predict the sentiment type of the target conversation text and determine the target sentiment type of the target conversation text.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the sentiment type analysis method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the sentiment type analysis method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Training method and system of medical dialogue model

    CN121351970A