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

By constructing a domain-specific metaphor feature library and an attention-based long short-term memory network, the blind spots of existing sentiment analysis technologies in the fields of finance, healthcare, and elderly care have been solved, enabling accurate multi-dimensional sentiment analysis and structured output to meet real-time analysis needs.

CN121031604APending Publication Date: 2025-11-28CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510919255.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing sentiment analysis technologies struggle to understand the deep semantics implied by metaphors when processing complex texts, especially in the financial, healthcare, and elderly care sectors. They are unable to perform refined sentiment classification, leading to misjudgments of sentiment tendencies. Furthermore, they are inefficient in cross-domain text processing and cannot meet the needs for real-time analysis and rapid response.

Method used

By constructing a domain-specific metaphor feature library, using an attention-based long short-term memory network to process word vector sequences, we can identify metaphors and incorporate implicit meanings. By combining aspect terms, opinion words, and sentiment category sets, we can generate structured, multi-dimensional sentiment results.

Benefits of technology

It significantly improves the accuracy of capturing implicit sentiment, which can directly guide business improvements, meet the real-time analysis needs of the financial, healthcare and elderly care sectors, reduce the cost of repetitive modeling, and improve analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121031604A_ABST
    Figure CN121031604A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine learning, and provides an emotion analysis method and device, computer equipment and a readable storage medium, and the method comprises the steps: carrying out the data preprocessing of a to-be-analyzed input text, and obtaining a word vector sequence; obtaining a metaphor feature library; according to the metaphor feature library, processing the word vector sequence by utilizing a long-short-term memory network based on an attention mechanism to obtain a metaphor recognition result; if the metaphor identification result shows that the metaphor exists, fusing the implicit meaning corresponding to the metaphor identification result into the semantic representation of the input text; and converting the processed input text into a target sequence according to the aspect term set so as to finish sentiment analysis on the input text according to the target sequence. Aiming at complex text analysis pain points in the fields of finance, medical health, old-age care and the like, an efficient and accurate solution is provided for deep understanding fed back by cross-industry customers through an innovative architecture of'metaphor recognition-semantic fusion-structured generation '.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to a sentiment analysis method, apparatus, computer device, and readable storage medium. Background Technology

[0002] In financial services (such as insurance) and healthcare / elderly care sectors, customer feedback analysis is a core component for optimizing services and enhancing user experience. However, existing sentiment analysis technologies have significant limitations when processing complex text, making it difficult to meet actual business needs.

[0003] In the financial sector (taking insurance as an example), customer feedback often contains numerous metaphorical expressions (such as "claims processing is like squeezing toothpaste," implying a cumbersome process) and multi-dimensional evaluations (premiums, claims, customer service, etc.). Traditional sentiment analysis methods can only identify explicit sentiment words and lack the ability to understand the deeper semantics implied by metaphors (such as dissatisfaction with service efficiency indirectly expressed through metaphors), leading to misjudgments of sentiment. Furthermore, insurance business involves professional terminology such as "premium levels" and "claims processing speed," and existing technologies cannot perform refined sentiment classification for specific business dimensions, making it difficult to support product iteration and service improvement.

[0004] In healthcare and elderly care scenarios, user feedback may express needs through metaphors (such as comparing nursing services to "a warm sun in the cold winter," implying affirmation of care), or involve specific evaluation dimensions such as "convenience of the treatment process" and "professionalism of elderly care services." Existing technologies, lacking domain-adaptive metaphor feature libraries and structured analysis frameworks, cannot accurately identify the emotional connotations corresponding to professional terms. This makes it difficult for service providers to precisely pinpoint user pain points (such as misinterpreting neutral expressions implying dissatisfaction as positive evaluations), thereby affecting the efficiency of service quality improvement.

[0005] Existing technologies are limited by the domain-specificity and semantic diversity of metaphors in natural language. Traditional models (such as basic LSTM or rule matching) rely on training with general corpora and cannot capture specialized metaphors in fields such as finance and healthcare (e.g., "coverage is like a fishing net" in insurance, "health management is like a guardian" in elderly care), resulting in high rates of missed or false positives. Existing methods mostly focus on overall sentiment classification of text, lacking refined analysis of specific business dimensions (e.g., "drug prices" or "rehabilitation service attitude"), and cannot generate structured, multi-faceted sentiment results that can hardly directly guide business decisions. When processing large-scale cross-domain text, traditional models require repeated training and time-consuming inference, failing to meet the efficiency requirements of scenarios such as real-time analysis in financial customer service and rapid response in elderly care institutions.

[0006] Therefore, a method is urgently needed to solve at least one of the above problems. Summary of the Invention

[0007] This application provides a sentiment analysis method, apparatus, computer device, and readable storage medium, aiming to solve the problem that existing sentiment analysis technologies have significant shortcomings when processing complex text and are difficult to meet actual business needs.

[0008] Firstly, this application provides a sentiment analysis method, including: The input text to be analyzed is preprocessed to obtain a word vector sequence; a metaphor feature library is obtained; the metaphor feature library contains preset metaphorical expressions and their corresponding implicit meanings; Based on the metaphor feature library, the word vector sequence is processed using an attention-based long short-term memory network to obtain metaphor recognition results; if the metaphor recognition results indicate the existence of a metaphor, the implicit meaning corresponding to the metaphor recognition results is integrated into the semantic representation of the input text. Obtain a set of aspect terms, a set of opinion words corresponding to the aspect terms, and a set of sentiment categories; The processed input text is transformed into a target sequence based on the set of aspect terms, so as to complete the sentiment analysis of the input text based on the target sequence; the target sequence contains the sentiment category corresponding to each aspect term in the set of aspect terms, and the sentiment category is determined based on the set of opinion words and the set of sentiment categories.

[0009] In some embodiments, the step of processing the word vector sequence using an attention-based long short-term memory network according to the metaphor feature library to obtain metaphor recognition results includes: extracting context sequence features of the word vector sequence through the long short-term memory network; calculating the attention weight between the hidden state at each time step and the feature vector based on the feature vector in the metaphor feature library to obtain a text representation of the key parts of the metaphor; and outputting metaphor recognition results based on the text representation and the context sequence features, wherein the metaphor recognition results include whether there is a metaphor in the input text and the corresponding implicit meaning.

[0010] In some embodiments, the step of preprocessing the input text to be analyzed to obtain a word vector sequence includes: cleaning the input text to remove special symbols, noise data and invalid characters; segmenting the cleaned input text and removing stop words; and converting the segmented input text into a word vector sequence through a word embedding model, wherein the word vector sequence is used to represent the semantic information of the text.

[0011] In some embodiments, obtaining the metaphor feature library includes: extracting typical metaphorical expressions from domain-related corpora, historical text data, and professional literature for a target application domain; labeling each metaphorical expression with its corresponding implicit meaning to form a metaphor feature library containing the mapping relationship between metaphorical expressions and implicit meanings; wherein the metaphorical expressions include linguistic forms such as similes and metaphors, and the implicit meanings are used to characterize the deep semantics corresponding to the metaphorical expressions.

[0012] In some embodiments, integrating the implicit meaning corresponding to the metaphor recognition result into the semantic representation of the input text includes: when the metaphor recognition result indicates the existence of a metaphor, extracting the implicit meaning corresponding to the metaphor; converting the implicit meaning into a semantic feature vector and fusing it with the word vector sequence of the input text to form an enhanced semantic representation containing metaphorical semantics; wherein the fusion method includes vector concatenation, weighted summation, or feature mapping.

[0013] In some embodiments, obtaining the set of aspect terms, the set of opinion words corresponding to the aspect terms, and the set of sentiment categories includes: determining aspect terms that cover the user's focus based on the business scenario of the target application domain, wherein the aspect terms are used to characterize the specific object or dimension to be analyzed; for each aspect term, collecting and organizing the corresponding opinion words from historical text data, wherein the opinion words are used to characterize the evaluative expression of the aspect term; and dividing the sentiment categories into three categories: positive, negative, and neutral, wherein the sentiment categories are used to quantify the user's sentiment tendency towards the aspect terms.

[0014] In some embodiments, the step of converting the processed input text into a target sequence based on the aspect term set includes: inputting the processed input text into a pre-trained unified generative framework model, the unified generative framework model being constrained by the aspect term set, opinion word set, and sentiment category set; generating a structured target sequence through the unified generative framework model, the target sequence containing each aspect term and its corresponding sentiment category; wherein, the training process of the unified generative framework model includes: training the model using historical text data labeled with aspect term sentiment categories, and optimizing the model parameters by minimizing the difference between the predicted results and the true labels.

[0015] Secondly, this application provides an emotion analysis device, comprising: The text processing unit is used to preprocess the input text to be analyzed to obtain a word vector sequence; and to acquire a metaphor feature library; the metaphor feature library contains preset metaphor expressions and their corresponding implicit meanings. The metaphor recognition unit is used to process the word vector sequence using an attention-based long short-term memory network according to the metaphor feature library to obtain the metaphor recognition result; if the metaphor recognition result shows that there is a metaphor, the implicit meaning corresponding to the metaphor recognition result is integrated into the semantic representation of the input text. The terminology acquisition unit is used to acquire a set of aspect terms, a set of opinion words corresponding to the aspect terms, and a set of sentiment categories. The analysis completion unit is used to transform the processed input text into a target sequence based on the aspect term set, so as to complete the sentiment analysis of the input text based on the target sequence; the target sequence includes the sentiment category corresponding to each aspect term in the aspect term set, and the sentiment category is determined based on the opinion word set and the sentiment category set.

[0016] Thirdly, this application also provides a computer device, comprising: Memory and processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the steps of the sentiment analysis method as described in the first aspect above.

[0017] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the steps of the sentiment analysis method described in the first aspect above.

[0018] This invention provides a sentiment analysis method that lays the foundation for subsequent analysis by cleaning the text and converting it into a word vector sequence. It constructs a feature library containing metaphorical expressions and implicit meanings, and enhances the capture of key metaphorical information by using an attention mechanism with LSTM, outputting accurate metaphor recognition results (whether a metaphor exists and its implicit meaning is present). If a metaphor exists, the implicit meaning is integrated into the text semantic representation, correcting the bias in understanding deep emotions in traditional analysis. It defines business-specific aspect terms, opinion words, and sentiment categories, and uses a unified generation framework to transform the text into a target sequence containing the corresponding sentiment categories of each aspect term, achieving a structured output of multi-dimensional sentiment.

[0019] By constructing domain-specific metaphor feature libraries (such as "premium cost-effectiveness is like a balance scale" in finance and "treatment process is like a maze" in healthcare), and combining them with attention mechanisms to focus on key metaphorical semantics, the blind spots of traditional technologies in identifying domain-specific metaphors are solved, significantly improving the accuracy of capturing implicit sentiment. Sentiment analysis is upgraded from "overall polarity judgment" to a structured output of "aspect terminology - sentiment category" (such as "claims processing speed - negative" in insurance and "nursing professionalism - positive" in elderly care), enabling analysis results to directly correspond to business improvement directions and support precise decision-making. The unified generation framework, through standardized terminology sets and model training mechanisms, is compatible with multiple domains such as finance and healthcare, reducing the cost of repetitive modeling; simultaneously, the combination of attention mechanisms and sequence generation improves model inference efficiency, meeting real-time analysis needs.

[0020] This invention addresses the pain points of complex text analysis in fields such as finance, healthcare, and elderly care. Through an innovative architecture of "metaphor recognition-semantic fusion-structured generation," it breaks through the bottleneck of existing technologies in domain-specific sentiment analysis, providing an efficient and accurate solution for in-depth understanding of cross-industry customer feedback.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic flowchart illustrating the steps of a sentiment analysis method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the architecture of an emotion analysis method provided in this application in the insurance field; Figure 3 This is a schematic diagram of the structure of an emotion analysis device provided in an embodiment of this application; Figure 4 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.

[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0027] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0028] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0029] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0030] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0031] In financial services (such as insurance) and healthcare / elderly care sectors, customer feedback analysis is a core component for optimizing services and enhancing user experience. However, existing sentiment analysis technologies have significant limitations when processing complex text, making it difficult to meet actual business needs.

[0032] In the financial sector (taking insurance as an example), customer feedback often contains numerous metaphorical expressions (such as "claims processing is like squeezing toothpaste," implying a cumbersome process) and multi-dimensional evaluations (premiums, claims, customer service, etc.). Traditional sentiment analysis methods can only identify explicit sentiment words and lack the ability to understand the deeper semantics implied by metaphors (such as dissatisfaction with service efficiency indirectly expressed through metaphors), leading to misjudgments of sentiment. Furthermore, insurance business involves professional terminology such as "premium levels" and "claims processing speed," and existing technologies cannot perform refined sentiment classification for specific business dimensions, making it difficult to support product iteration and service improvement.

[0033] In healthcare and elderly care scenarios, user feedback may express needs through metaphors (such as comparing nursing services to "a warm sun in the cold winter," implying affirmation of care), or involve specific evaluation dimensions such as "convenience of the treatment process" and "professionalism of elderly care services." Existing technologies, lacking domain-adaptive metaphor feature libraries and structured analysis frameworks, cannot accurately identify the emotional connotations corresponding to professional terms. This makes it difficult for service providers to precisely pinpoint user pain points (such as misinterpreting neutral expressions implying dissatisfaction as positive evaluations), thereby affecting the efficiency of service quality improvement.

[0034] Existing technologies are limited by the domain-specificity and semantic diversity of metaphors in natural language. Traditional models (such as basic LSTM or rule matching) rely on training with general corpora and cannot capture specialized metaphors in fields such as finance and healthcare (e.g., "coverage is like a fishing net" in insurance, "health management is like a guardian" in elderly care), resulting in high rates of missed or false positives. Existing methods mostly focus on overall sentiment classification of text, lacking refined analysis of specific business dimensions (e.g., "drug prices" or "rehabilitation service attitude"), and cannot generate structured, multi-faceted sentiment results that can hardly directly guide business decisions. When processing large-scale cross-domain text, traditional models require repeated training and time-consuming inference, failing to meet the efficiency requirements of scenarios such as real-time analysis in financial customer service and rapid response in elderly care institutions.

[0035] Therefore, a method is urgently needed to solve at least one of the above problems.

[0036] To resolve the above issues, please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic flowchart of a sentiment analysis method provided in one embodiment of this application. The sentiment analysis method can be implemented by a computer device, which can be deployed on a single server or a server cluster. It can also be deployed on a handheld terminal, laptop, wearable device, or robot, etc.

[0037] It should be noted that the acquisition of any information mentioned in the provided methods is in compliance with relevant regulations and is carried out with the user's consent, and will not infringe on the user's privacy or violate relevant laws and regulations.

[0038] To solve the above problem, please refer to Figure 1 Specifically, such as Figure 1 As shown, the provided sentiment analysis method includes steps S101 to S104. Details are as follows: Step S101. Perform data preprocessing on the input text to be analyzed to obtain a word vector sequence; obtain a metaphor feature library; the metaphor feature library contains preset metaphorical expressions and their corresponding implicit meanings.

[0039] Specifically, data preprocessing involves cleaning the input text (removing noisy characters), word segmentation, and stop word filtering. Then, word embedding models (such as Word2Vec and BERT) are used to transform the text into a sequence of word vectors, preserving semantic information. Metaphor feature library acquisition involves constructing a domain-specific metaphor feature library containing the mapping relationship between "metaphorical expression → implied meaning" (e.g., "claims processing is like squeezing toothpaste" → "cumbersome and inefficient process").

[0040] In financial scenarios (insurance business), data preprocessing includes content cleaning: removing irrelevant information such as policy numbers and formatting symbols, while retaining core customer feedback text (e.g., "Premiums are higher than competitors, but claims processing is slow as a toothpaste squeeze"). Word segmentation: professional word segmentation is performed on insurance terms ("premium," "deductible," "claims processing time") to avoid ambiguity in generic word segmentation. Word vector conversion: using pre-trained word embedding models in the insurance field ensures accurate semantic representation of terms such as "coverage scope" and "renewal process."

[0041] The construction of the metaphor feature library includes extracting metaphorical expressions from historical insurance complaint texts and customer service dialogue records (such as "coverage is like a fishing net" → "incomplete coverage" and "premium cost-effectiveness is like a balance scale" → "price and coverage are unbalanced"). Implicit meanings are annotated in conjunction with insurance business rules (such as "claims processing is like squeezing toothpaste" implying "cumbersome document submission and long review period").

[0042] In the healthcare and elderly care scenarios, data preprocessing includes content cleaning: removing medical record numbers and private information, while retaining nursing evaluation text (e.g., "The caregiver is as caring as family, but scheduling an appointment is like queuing to buy a train ticket"). Word segmentation: identifying medical terms ("treatment process," "rehabilitation training," "nursing level") and elderly care scenario vocabulary ("dietary nutrition," "emergency call response"). Word vector conversion: employing a medical-specific term embedding model to enhance the semantic representation of terms such as "postoperative recovery" and "medication guidance."

[0043] The metaphor feature library is constructed by extracting metaphors from patient satisfaction surveys and feedback from elderly care institutions (e.g., "health management is like a guardian" → "full-process professional support"; "treatment process is like a maze" → "complex procedures and insufficient guidance"). Implicit meaning annotation is combined with medical service standards (e.g., "nursing is like a warm sun in the cold winter" → "emotional care is in place").

[0044] By employing specialized data preprocessing and domain-specific word vectors, this approach addresses the semantic misjudgment issues of general-purpose models regarding financial and medical terms (e.g., "insurance premium" will not be misclassified as a general "fee"). The constructed domain metaphor feature library covers high-frequency metaphors in business scenarios, providing clear semantic mapping rules for subsequent recognition and avoiding the "semantic blind spots" of general-purpose models regarding industry-specific metaphors. Step S102. Based on the metaphor feature library, process the word vector sequence using a long short-term memory network based on an attention mechanism to obtain metaphor recognition results; if the metaphor recognition results indicate the existence of a metaphor, integrate the implicit meaning corresponding to the metaphor recognition results into the semantic representation of the input text.

[0045] Specifically, metaphor recognition utilizes an LSTM network with an attention mechanism to extract contextual features from word vector sequences. By calculating the attention weights between feature vectors in the metaphor feature library and the hidden states at each time step, it focuses on key parts of the metaphor (e.g., "squeezing toothpaste" corresponds to the "claims" process) and outputs whether a metaphor exists and its implied meaning. Semantic fusion involves, if a metaphor exists, converting the implied meaning into a feature vector (e.g., "cumbersome process" corresponds to a negative sentiment vector), concatenating or weighting it with the original word vector sequence to form an enhanced representation containing deeper semantics.

[0046] In the financial scenario (insurance business), metaphor recognition uses an LSTM network to input a sequence of word vectors related to the insurance domain. The attention mechanism prioritizes metaphorical expressions related to terms such as "claims" and "premiums" (e.g., in the input text "premiums are cheap but claims are like squeezing toothpaste," the model strengthens the semantic association between "squeezing toothpaste" and "claims" through attention weights). Example output: The metaphor "claims are like squeezing toothpaste" is identified, implying "cumbersome process," and the related term "claims speed" is labeled. Semantic fusion transforms "cumbersome process" into a negative semantic vector (e.g., [-0.8, 0.2, 0.1]), which is then concatenated with the word vector corresponding to "claims" to enhance the sentiment representation of this aspect of the term.

[0047] In the healthcare and elderly care context, metaphor recognition involves inputting feedback text about elderly care services (e.g., "The caregiver is like family, but scheduling checkups is too troublesome"). The model uses an attention mechanism to capture the metaphor "like family," linking it to the aspect term "nursing professionalism," with the implied meaning "meticulous care." Example output: The metaphor "like family" is identified, implying "emotional care is adequate," and linked to the aspect term "nursing service attitude." Semantic fusion transforms "emotional care is adequate" into a positive semantic vector (e.g., [0.9, -0.1, 0]), which is then weighted and summed with the word vector corresponding to "caregiver," correcting the neutral misjudgment caused by the lack of explicit sentiment words in the original text.

[0048] By combining attention mechanisms with a domain metaphor library, this approach addresses the problem of traditional models underestimating indirect emotional expressions (such as metaphors) (e.g., avoiding misjudging "claims processing is like squeezing toothpaste" as a neutral statement). Through implicit meaning fusion, it makes explicit the deep emotions conveyed by metaphors (e.g., dissatisfaction with insurance processes, or affirmation of services in elderly care), providing a more accurate semantic foundation for subsequent sentiment analysis and reducing the rate of sentiment misjudgment caused by metaphor misunderstanding biases.

[0049] Step S103. Obtain the set of aspect terms, the set of opinion words corresponding to the aspect terms, and the set of sentiment categories.

[0050] Specifically, the set of aspect terms defines the specific evaluation dimensions that the business focuses on (such as "premium value for money" and "customer service response speed" in the financial field, and "convenience of treatment process" and "environment of elderly care institution" in the medical field). The set of opinion words collects evaluation words corresponding to the aspect terms (such as "expensive" and "fast" corresponding to "premium value for money" and "customer service response speed"). The set of sentiment categories is divided into three categories: "positive," "negative," and "neutral," used to quantify the sentiment tendency of the aspect terms.

[0051] In the financial scenario (insurance business), the terminology set includes terms determined based on the core processes of insurance business: "premium level," "comprehensiveness of coverage," "complexity of claims materials," and "renewal service experience." The opinion word set collects opinions on "premium level": "too high," "low cost-effectiveness," and "value for money"; and on "complexity of claims materials": "cumbersome," "clear," and "redundant." The sentiment category set links sentiment labels to business impact: "positive" corresponds to "facilitating purchase decisions" (e.g., "fast claims processing"), and "negative" corresponds to "potentially leading to policy surrender" (e.g., "expensive premiums").

[0052] In the context of healthcare and elderly care, the following terminology sets are established: Based on the elderly care service evaluation system, terms include: "Professionalism of nursing staff," "Balance of dietary nutrition," "Emergency call response time," and "Completeness of rehabilitation equipment." Opinion sets are also established: For "Professionalism of nursing staff," terms include: "Patience," "Inexperience," and "Standardized operation"; for "Dietary nutrition," terms include: "Bland and palatable," "Monotonous," and "Excessive salt intake." Finally, a set of emotional categories is established: Emotional tags are associated with service quality: "Positive" corresponds to "Improved user satisfaction" (e.g., "Rapid emergency response"), while "Negative" corresponds to "Needs immediate improvement" (e.g., "Outdated rehabilitation equipment").

[0053] By using domain-specific aspect terminology, sentiment analysis is refined from "overall text polarity" to "specific business processes" (such as "claims" and "premiums" in insurance, and "nursing care" and "diet" in elderly care), thus solving the problem of "dimensional fragmentation" in traditional methods.

[0054] Standardization of the evaluation system: The correspondence between opinion words and sentiment categories provides clear rules for subsequent structured analysis and avoids ambiguity in human interpretation (e.g., "low cost-effectiveness" is uniformly corresponding to "premium level - negative").

[0055] Step S104. The processed input text is transformed into a target sequence according to the aspect term set, so as to complete the sentiment analysis of the input text according to the target sequence; the target sequence contains the sentiment category corresponding to each aspect term in the aspect term set, and the sentiment category is determined based on the opinion word set and the sentiment category set.

[0056] Specifically, the unified generation framework takes the processed enhanced semantic representation as input, combines aspect terms, opinion words and sentiment category sets, and outputs a structured target sequence through a sequence generation model (such as Transformer decoder), with the format "aspect term 1 - sentiment category 1; aspect term 2 - sentiment category 2".

[0057] In the financial scenario (insurance business), the model input includes a sequence of word vectors incorporating the implied meanings of metaphors (e.g., an enhanced representation containing the negative semantics of "cumbersome claims process"). The target sequence is generated from the input text: "Premiums are cheap, but claims are like squeezing toothpaste, requiring a lot of back-and-forth submitting materials." The output is: "Premium level - positive; Claims material complexity - negative; Claims speed - negative." Model training uses insurance feedback data labeled with aspect terms and their sentiment categories (e.g., 100,000 historical complaint / praise texts). Model parameters are optimized by minimizing cross-entropy loss to ensure the accuracy of the "metaphor → sentiment category" mapping.

[0058] In the healthcare and elderly care scenario, the model input is a word vector sequence incorporating the positive semantics of "caregivers are like family" (e.g., "caregivers are as caring as family, but appointments for checkups take too long"). The target sequence is generated from the input text: "The caregivers are very professional, like family, but appointments for checkups always take a long time." The output is: "Professionalism of caregivers - positive; Convenience of treatment process - negative." Model training utilizes labeled data collected from elderly care institutions (e.g., 50,000 nursing service reviews) to strengthen the generation logic of "metaphorical implied meaning → aspect term sentiment category" (e.g., "like family" corresponds to "professionalism of caregivers - positive").

[0059] The target sequences directly correspond to business improvement directions (e.g., in insurance, "complexity of claims materials - negative" can drive process simplification; in elderly care, "convenience of medical treatment - negative" can optimize the appointment system), solving the problem of "difficulty in implementing results" in traditional unstructured analysis. The unified generation framework can quickly adapt to scenarios such as finance and healthcare by replacing domain-specific terminology sets and metaphor feature libraries, avoiding redundant modeling costs and meeting the real-time analysis needs of multiple industries (e.g., insurance customer service systems and elderly care institution management systems share the underlying model architecture).

[0060] In some embodiments, the step of processing the word vector sequence using an attention-based long short-term memory network according to the metaphor feature library to obtain metaphor recognition results includes: extracting context sequence features of the word vector sequence through the long short-term memory network; calculating the attention weight between the hidden state at each time step and the feature vector based on the feature vector in the metaphor feature library to obtain a text representation of the key parts of the metaphor; and outputting metaphor recognition results based on the text representation and the context sequence features, wherein the metaphor recognition results include whether there is a metaphor in the input text and the corresponding implicit meaning.

[0061] This method extracts context-dependent features from word vector sequences using a Long Short-Term Memory (LSTM) network. Combined with feature vectors from a metaphor feature library, an attention mechanism is used to calculate the attention given to key metaphorical parts at each time step. The final output determines whether a metaphor exists and its corresponding implicit meaning. Specifically, the process includes: Context feature extraction: The LSTM processes the word vector sequence layer by layer, capturing the contextual dependencies between words in the text (e.g., the association between "claims" and "squeezing toothpaste"). Attention weight calculation: Feature vectors from the metaphor feature library (e.g., the vector representation of "squeezing toothpaste") are compared with the hidden states of the LSTM at each time step, and weights are calculated to focus on key metaphorical words. Output: Based on the weighted text representation, the existence of a metaphor is determined and mapped to its corresponding implicit meaning (e.g., "squeezing toothpaste" → "cumbersome process").

[0062] In a financial scenario (insurance), the input text is: "The claims process is like squeezing toothpaste; you have to keep urging me." The process involves using LSTM to extract contextual features from "claims," ​​"squeezing toothpaste," and "keep urging," identifying "squeezing toothpaste" as a metaphorical keyword. By comparing the feature vectors of "squeezing toothpaste → cumbersome process" in the metaphor feature library, attention weights are calculated to reinforce the hidden state corresponding to "squeezing toothpaste." The output is: A metaphor exists, implying "the claims process is cumbersome and inefficient."

[0063] In the healthcare scenario (elderly care), the input text is: "The care provided by the caregiver is like the warm sun in winter, making us feel very warm." Process: LSTM extracts the context features of "caregiver", "warm sun in winter", and "warmth", and locates "warm sun in winter" as a metaphorical expression. Matches the mapping relationship of "warm sun in winter → meticulous care" in the metaphor feature library, and focuses on this metaphorical part through the attention mechanism. Output result: There is a metaphor, and the implied meaning is "the care service is full of care". Through the attention mechanism, it avoids the semantic dilution of metaphorical words by traditional LSTM, such as accurately capturing the connection between "squeezing toothpaste" and "claim settlement" in insurance texts instead of analyzing words in isolation. Through the domain-specific metaphor feature library, the model can adapt to the specific metaphors in scenarios such as finance and healthcare (such as the process metaphor in insurance and the emotional metaphor in elderly care), and the recognition accuracy is improved compared to the general model.

[0064] In some embodiments, preprocessing the input text to be analyzed to obtain a sequence of word vectors includes: cleaning the input text to remove special symbols, noisy data, and invalid characters; performing word segmentation on the cleaned input text and removing stop words; converting the word-segmented input text into a sequence of word vectors through a word embedding model, and the sequence of word vectors is used to represent the semantic information of the text.

[0065] Through three-level preprocessing of the input text: Text cleaning: Remove special symbols (such as garbled characters, emoticons), noisy data (such as duplicate text), and invalid characters (such as redundant punctuation). Word segmentation and stop word removal: Use a domain-specific word segmentation tool to split words and filter out stop words without actual semantic meaning such as "de" (的) and "le" (了). Word embedding transformation: Convert the word-segmented text into a sequence of word vectors through a domain-pre-trained word embedding model (such as Insurance BERT, Medical Word2Vec), and retain the semantic information of professional terms.

[0066] In the financial scenario (insurance), the cleaning rule: For insurance feedback texts, remove privacy information such as policy numbers and phone numbers, and retain core terms such as "premium", "deductible", and "claim settlement time limit".

[0067] Word segmentation tool: Use a word segmentation tool customized for the insurance industry (such as correcting the incorrect word segmentation of "premium cost performance" into "premium" + "cost performance"), and avoid common word segmentation errors (such as "renewal insurance" not being split into "renew" + "insurance"). Word embedding model: Adopt a pre-trained Word2Vec model in the insurance domain to make the word vectors of "coverage" different from those in the general context of "scope".

[0068] In the healthcare context (elderly care), the cleaning rules are as follows: remove private information such as medical record numbers and addresses, and retain professional terms such as "nursing level," "rehabilitation training," and "dietary nutrition." Word segmentation tools: use a medical and elderly care-specific word segmenter (e.g., correctly split "emergency call response" into "emergency call" + "response") to avoid misinterpreting "caregiver" as "caregiver" + "caregiver." Word embedding model: adopt a BERT model for the medical field to strengthen the semantic representation of terms such as "postoperative recovery" and "medication guidance."

[0069] By using customized word segmentation and domain-specific word embedding, the problem of ambiguous segmentation of professional terms in general preprocessing is solved (e.g., insurance "deductible" and elderly care "level of care" will not be incorrectly segmented). The cleaned text reduces interference from invalid characters, improving the computational efficiency of subsequent metaphor recognition and sentiment analysis by more than 20%, and reducing semantic representation error by 15%.

[0070] In some embodiments, obtaining the metaphor feature library includes: extracting typical metaphorical expressions from domain-related corpora, historical text data, and professional literature for a target application domain; labeling each metaphorical expression with its corresponding implicit meaning to form a metaphor feature library containing the mapping relationship between metaphorical expressions and implicit meanings; wherein the metaphorical expressions include linguistic forms such as similes and metaphors, and the implicit meanings are used to characterize the deep semantics corresponding to the metaphorical expressions.

[0071] For the target domain, typical metaphors are extracted from multi-source data and their implicit meanings are labeled to form a mapping library of "metaphorical expression → implicit meaning": Data sources: domain corpora (such as insurance complaint corpora, elderly care feedback reports), historical text data (customer service dialogues, user reviews), and professional literature (industry service standards). Metaphor extraction: Identify linguistic forms such as similes (such as "like XX") and metaphors (such as "XX is XX"), and extract core metaphorical expressions (such as "fishing net → incomplete coverage"). Implicit meaning labeling: Combined with domain business logic, each metaphor is labeled with deep semantics (such as "fishing net" in insurance metaphorically representing incomplete coverage, and "maze" in elderly care metaphorically representing complex diagnosis and treatment processes).

[0072] In the financial scenario (insurance), data sources include: insurance customer complaint work orders, customer service chat logs, and industry service quality reports. Metaphor extraction examples: Simile: "Premiums are like a roller coaster" → extract "roller coaster," implying "large fluctuations in premiums." Implied metaphor: "Claims processing is a marathon" → extract "marathon," implying "long processing time." Labeling logic: Based on the insurance service process, associate "marathon" with the "claims processing time" dimension, implying "excessively long processing cycle."

[0073] In the healthcare context (elderly care), data sources include: feedback from nursing home residents, hospital satisfaction surveys, and nursing service standards documents. Metaphorical extraction examples: Simile: "Health management is like a compass" → Extract "compass," implying "clear direction and professional guidance." Metaphor: "Medication procedures are a tangled mess" → Extract "tangled mess," implying "complex steps and prone to errors." Labeling logic: Based on elderly care service standards, "tangled mess" is associated with the "medication guidance" dimension, implying "lack of clear process guidance."

[0074] The constructed feature library contains high-frequency metaphors from financial and medical scenarios (e.g., metaphorical expressions in insurance complaints cover more than 80% of the text), solving the problem of general models failing to recognize industry jargon. Through manual annotation combined with business rules, it ensures that the implied meaning of metaphors is directly related to domain pain points (e.g., insurance metaphors directly correspond to improvement directions such as "premium" and "claims"), avoiding analytical biases caused by semantic ambiguity.

[0075] In some embodiments, integrating the implicit meaning corresponding to the metaphor recognition result into the semantic representation of the input text includes: when the metaphor recognition result indicates the existence of a metaphor, extracting the implicit meaning corresponding to the metaphor; converting the implicit meaning into a semantic feature vector and fusing it with the word vector sequence of the input text to form an enhanced semantic representation containing metaphorical semantics; wherein the fusion method includes vector concatenation, weighted summation, or feature mapping.

[0076] When a metaphor is identified, its implicit meaning is transformed into a semantic feature vector and integrated into the original text's semantic representation: Implicit meaning extraction: The corresponding deep semantic meaning (e.g., "cumbersome process") is obtained from the metaphor identification results. Vector transformation: The implicit meaning is transformed into a feature vector through predefined mapping rules (e.g., a "positive / negative / neutral" sentiment dictionary) or a trained encoder. Fusion method: Vector concatenation (increasing dimensionality), weighted summation (adjusting weights), or feature mapping (non-linear transformation) are used to form an enhanced representation containing metaphorical semantics.

[0077] In a financial scenario (insurance), the input text is: "The claims process is like squeezing toothpaste, which is very frustrating" (the metaphor "squeezing toothpaste" → cumbersome process has been identified). The process involves: extracting the implicit meaning "cumbersome process" and mapping it to a negative sentiment vector (e.g., [-0.7, 0.2, 0.1]). This vector is then concatenated with the position corresponding to "claims" in the original word vector sequence to form an enhanced word vector (e.g., original dimension 768 → concatenated 768+3=771). The fusion effect is that the semantic representation of "claims" now includes the negative information of "cumbersome," strengthening the subsequent sentiment analysis's negative judgment on this terminology.

[0078] In a healthcare scenario (elderly care), the input text is: "The caregiver's service was like a timely rain, solving our big problem" (the metaphor "timely rain → rapid response" has been identified). The process involves: extracting the implicit meaning "rapid response" and mapping it to a positive sentiment vector (e.g., [0.8, -0.1, 0.1]). The vectors of related words such as "caregiver" and "service" in the original word vector sequence are then weighted and summed (weight 0.6 for the implicit meaning vector + 0.4 for the original vector). The fusion result corrects the neutral misjudgment caused by the lack of explicit sentiment words (e.g., "good" or "satisfied"), enabling the model to identify it as a positive sentiment.

[0079] This approach transforms the implicit emotions of metaphors (such as dissatisfaction with insurance processes or positive feelings about elderly care services) into computable vector features, overcoming the limitations of traditional models that rely solely on explicit sentiment words (e.g., they can still capture negative emotions even without words like "bad" or "slow"). Through fusion operations, the input for subsequent sentiment analysis incorporates more complete semantic information; for example, in insurance scenarios, the accuracy of sentiment judgment for the "claims" dimension increases from 65% to 85%.

[0080] In some embodiments, obtaining the set of aspect terms, the set of opinion words corresponding to the aspect terms, and the set of sentiment categories includes: determining aspect terms that cover the user's focus based on the business scenario of the target application domain, wherein the aspect terms are used to characterize the specific object or dimension to be analyzed; for each aspect term, collecting and organizing the corresponding opinion words from historical text data, wherein the opinion words are used to characterize the evaluative expression of the aspect term; and dividing the sentiment categories into three categories: positive, negative, and neutral, wherein the sentiment categories are used to quantify the user's sentiment tendency towards the aspect terms.

[0081] Based on the business scenarios of the domain, a three-layer analysis system is constructed: Aspect Terminology Set: Defines the specific evaluation dimensions that users focus on (e.g., "premium cost-effectiveness" in finance, "nursing professionalism" in healthcare). Opinion Word Set: Collects evaluation words corresponding to the aspect terms (e.g., "expensive" corresponds to "premium cost-effectiveness," "patient" corresponds to "nursing professionalism"). Emotion Category Set: Divided into "positive," "negative," and "neutral," quantifying emotional tendencies (e.g., "high cost-effectiveness" → positive, "complex process" → negative).

[0082] In the financial context (insurance), the following terms are used to determine the "premium level," "comprehensiveness of coverage," "complexity of claims materials," and "customer service response speed" based on the core insurance business.

[0083] Opinion words collected: "Premium level": "Too high", "Affordable", "Inflated"; "Complexity of claims materials": "Cumbersome", "Clear", "Redundant". Emotional category labeling: "Affordable" → Positive, "Redundant" → Negative, No specific evaluation word → Neutral.

[0084] In the healthcare setting (elderly care), the following terminology is used: "Professionalism of nursing staff," "Balance of dietary nutrition," "Emergency call response time," and "Completeness of rehabilitation equipment" are determined according to elderly care service standards. Opinion words collected: "Professionalism of nursing staff": "Skilled," "Unskilled," "Standardized"; "Balance of dietary nutrition": "Bland," "Oily," "Monotonous." Emotional category labeling: "Skilled" → positive, "Oily" → negative, "Monotonous" → negative (due to nutritional imbalance).

[0085] The terminology directly corresponds to the core pain points of the field (such as "claim materials" in insurance and "emergency response" in elderly care), enabling the analysis results to directly pinpoint business improvement points and avoid the "dimensional ambiguity" problem of traditional analysis. The mapping relationship between opinion words and sentiment categories provides clear rules for the model (such as "redundancy" necessarily corresponding to negativity), reducing manual annotation costs and improving the consistency of cross-text analysis results by more than 40%.

[0086] In some embodiments, the step of converting the processed input text into a target sequence based on the aspect term set includes: inputting the processed input text into a pre-trained unified generative framework model, the unified generative framework model being constrained by the aspect term set, opinion word set, and sentiment category set; generating a structured target sequence through the unified generative framework model, the target sequence containing each aspect term and its corresponding sentiment category; wherein, the training process of the unified generative framework model includes: training the model using historical text data labeled with aspect term sentiment categories, and optimizing the model parameters by minimizing the difference between the predicted results and the true labels.

[0087] Based on a unified generative framework model, and constrained by domain terminology and sentiment categories, the processed text is transformed into a structured target sequence. Model input: an enhanced word vector sequence incorporating metaphorical semantics. Constraints: a set of aspect terms (determining the generation dimension), a set of opinion words (restricting evaluative vocabulary), and a set of sentiment categories (limiting output labels). Training process: The model is trained using labeled data (e.g., "premium level - positive; claims processing speed - negative"), and parameters are optimized by minimizing cross-entropy loss to ensure the generation of target sequences that conform to business logic.

[0088] In a financial scenario (insurance), the input text is: "The premium is lower than expected, but the claim process requires submitting over a dozen documents, which is too troublesome." The generation process involves the model identifying the terms "premium level" and "claim document complexity." Combining the sentiment words "lower than expected" (positive) and "too troublesome" (negative), the target sequence is generated: "Premium level - positive; Claim document complexity - negative." Training data uses 100,000 labeled insurance feedback data entries, each containing manually labeled sentiment tags for the relevant terms.

[0089] In a healthcare setting (elderly care), the input text reads: "The caregiver patiently explains the medication steps each time, but there is never enough rehabilitation equipment."

[0090] Generation Process: The model identifies the terms "professionalism of nursing staff" and "completeness of rehabilitation equipment." Combining these with the opinion words "patient explanation" (positive) and "insufficient" (negative), the target sequence is generated: "Professionalism of nursing staff - positive; Completeness of rehabilitation equipment - negative." Training Data: 50,000 feedback data points from elderly care institutions are used to label the sentiment category of each term.

[0091] The target sequence is output in the form of "aspect terminology-sentiment category", which can be directly imported into business systems (such as insurance claims optimization systems and elderly care equipment procurement systems) to achieve seamless integration of "analysis results → decision-making actions". By replacing the domain-specific terminology set and metaphor feature library, the same model can be quickly applied to scenarios such as finance and healthcare (such as adapting an insurance model to an elderly care scenario within 3 days), saving more than 70% of development costs compared to traditional independent modeling.

[0092] In some embodiments, the insurance sector serves as an example. Accurately understanding customer feedback is crucial in the insurance business. Customer opinions and emotional expressions often determine the direction of insurance product improvement and service quality enhancement. However, the current insurance business faces the following pain points: Complex and diverse customer feedback: Customer evaluations, inquiries, and complaints cover multiple aspects and are expressed in various ways, including direct emotional expressions and indirect expressions such as metaphors. This makes it difficult for sales personnel to quickly and accurately grasp the true emotional tendencies of customers. Difficulty in understanding metaphors: Metaphorical expressions often appear in insurance customer dialogues, such as "insurance is like a protective umbrella." These metaphors not only increase the difficulty of understanding but may also lead to misjudgments of customer emotions. If metaphors cannot be correctly identified and understood, it is impossible to accurately analyze customer satisfaction with various aspects of insurance products and services. Lack of efficient analytical tools: Existing sentiment analysis methods have limited effectiveness in processing complex texts in the insurance business. They cannot comprehensively and accurately analyze the various aspects of emotion in customer feedback, nor can they effectively identify metaphors, failing to meet the requirements of rapid response to customer needs and continuous improvement in the insurance business.

[0093] Metaphors in natural language are diverse and complex, and existing metaphor recognition technologies fall short in terms of accuracy and generalization ability. Traditional methods struggle to accurately identify metaphorical expressions specific to the insurance business domain, often resulting in missed or false positives. Effectively integrating metaphorical meanings into the analysis process to accurately determine customers' emotional tendencies towards different aspects is a significant technical challenge in sentiment analysis. Current methods often fail to adequately handle the impact of metaphors on sentiment analysis, leading to inaccurate results. Existing sentiment analysis models may suffer from performance bottlenecks and inefficiencies when processing large-scale insurance customer dialogue data. Furthermore, the long training and inference times of these models make them unsuitable for real-time analysis.

[0094] This invention provides a sentiment analysis and metaphor recognition system and method for insurance business that integrates attention mechanisms. It combines the advantages of attention-based long short-term memory networks (LSTM) and a unified generative framework to improve the accuracy of customer feedback analysis in insurance business, especially when dealing with customer dialogues containing metaphors.

[0095] like Figure 2 As shown, the system includes a data preprocessing module, a metaphor recognition module, an aspect sentiment analysis module, and a result output module.

[0096] Step 1: Data Preprocessing: The data acquisition module collects customer dialogue data from insurance business, including telephone recordings, online chat logs, customer reviews, and other texts that may contain metaphors. The collected text is cleaned to remove noise, special symbols, etc., and preprocessed by word segmentation and stop word removal, transforming the text into a format suitable for model processing.

[0097] II. Step Two: Metaphor Recognition Module: 1. Building a Metaphor Feature Library: For the insurance business field, common metaphorical expressions are collected and organized. A metaphor feature library is built through manual compilation and extraction from insurance-related literature, customer feedback, and industry corpora. The library contains typical expressions of metaphors and their corresponding implied meanings. For example, metaphors such as "insurance is a protective umbrella" and "claims processing is like timely rain" are included in the feature library, and their meanings of representing the insurance protection function and fast claims processing are clearly defined.

[0098] 2. Construction of an Attention-Based Long Short-Term Memory Network: Input Layer: The preprocessed insurance customer dialogue text data is represented as a sequence of word vectors and input into the model. LSTM Layer: Utilizes a Long Short-Term Memory network to automatically learn the sequence features of the text and capture contextual information. When processing customer dialogues, the LSTM can remember historical information in the text, better understanding the meaning and context of the entire sentence. Attention Layer: Calculates the attention weights between the hidden state at each time step and metaphor-related features in the metaphor feature library. Specifically, the similarity between the hidden state output by the LSTM layer at each time step and the feature vectors in the metaphor feature library is calculated. For parts similar to metaphor features, higher attention weights are given, making the model pay more attention to key parts that may contain metaphors. Output Layer: The hidden states are weighted and summed according to the attention weights to obtain a text representation that focuses more on metaphorical parts, and the metaphor recognition result is output to determine whether there is a metaphor in the text and the specific metaphorical content.

[0099] III. Step Three: Aspect Sentiment Analysis Module: 1. Element Definition: Aspect Terminology Definition: Combining the characteristics of insurance business and the focus of customer attention, carefully determine a series of representative aspect terms. For example, for the insurance product itself, aspect terms may include "premium level," "coverage amount," "scope of coverage," etc.; for claims service, aspect terms may include "claims speed," "convenience of claims process," "strictness of claims review," etc.; for customer service, aspect terms may include "customer service response time," "customer service professionalism," "customer service attitude friendliness," etc. By deeply analyzing each link of the insurance business and the key areas of customer feedback, ensure that aspect terms can comprehensively cover all aspects that customers may be concerned about. Opinion Word Definition: For each aspect term, collect and organize related opinion words. For the aspect term "premium level," opinion words may include "too high," "moderate," "low," etc.; for "claims speed," opinion words may include "extremely fast," "relatively fast," "slow," etc.; for "customer service attitude friendliness," opinion words may include "very friendly," "relatively friendly," "not very friendly," etc. By analyzing a large number of insurance customer conversations and evaluations, we have summarized opinion words that accurately express customers' evaluations of different aspects, providing specific judgment criteria for sentiment analysis. Sentiment category definition: Sentiments are clearly divided into three categories: positive, negative, and neutral. For example, statements expressing high approval and satisfaction with insurance products or services, such as "The premium is very reasonable, and the cost-effectiveness is extremely high," are classified as positive sentiment; statements expressing clear criticism and dissatisfaction with insurance products or services, such as "The claims processing speed is too slow, which is unacceptable," are classified as negative sentiment; while some relatively objective expressions with no obvious emotional bias, such as "The premium is at the market average level," are classified as neutral sentiment.

[0100] 2. Input Processing: Upon receiving customer dialogue text processed by the metaphor recognition module, the text undergoes further analysis and processing. If a metaphor is identified in the text, the metaphor information output by the metaphor recognition module is passed to the aspect sentiment analysis module. For example, if a customer says, "The claims process for this insurance is like a long marathon," the metaphor recognition module will identify this metaphor and pass on the implied meanings of "long" and "difficult" to the aspect sentiment analysis module. The aspect sentiment analysis module will then adjust the input text based on these metaphorical meanings. Specifically, when understanding the aspect term "claims processing speed," the impact of the metaphor is considered, recognizing that the customer may be implying a slow claims processing speed, thus adjusting the sentiment analysis for this aspect to a negative bias. For text without metaphors, the normal processing flow is followed directly. First, the text is segmented and converted into word vectors. Then, based on the defined aspect terms and opinion words, the evaluations of various aspects in the text are analyzed. For example, in the text "The premium for this insurance is a bit high, but the service is pretty good," the analysis of "the premium is a bit high" determines that the sentiment towards "premium level" is negative; the analysis of "the service is pretty good" determines that the sentiment towards "customer service" is positive.

[0101] 3. Application of a Unified Generation Framework: Target Sequence Generation: Based on defined aspect terms, opinion words, and sentiment categories, the aspect sentiment analysis task of insurance customer dialogues is transformed into a target sequence generation problem. For each input customer dialogue text, a structured target sequence is generated, containing aspect terms and their corresponding sentiment categories. For example, for a customer's statement, "This insurance has a high coverage amount and fast claims processing, but customer service is sometimes slow to respond," the target sequence might be [Aspect term: Coverage amount, Sentiment category: Positive; Aspect term: Claims processing speed, Sentiment category: Positive; Aspect term: Customer service response time, Sentiment category: Negative]. In this way, the different aspects and their sentiment tendencies in the text are represented in a clear and structured form, facilitating subsequent analysis and decision-making.

[0102] Model Training and Optimization: The unified generative framework model was trained using a training dataset of insurance customer dialogues labeled with sentiment tendencies. During training, the model parameters were continuously adjusted to minimize the difference between the predicted results and the true labels. Optimization objectives such as the negative log-likelihood loss function were employed, and model parameters were updated using optimization algorithms such as gradient descent. Simultaneously, regularization techniques, such as L1 or L2 regularization, were introduced to prevent overfitting and improve the model's generalization ability. Specifically, a large amount of customer dialogue data labeled with sentiment tendencies in various aspects was input into the model, allowing it to learn how to accurately determine the sentiment category of each aspect based on the text content. By continuously adjusting the model parameters, the prediction accuracy on the training set was continuously improved, while maintaining good performance on the validation set, avoiding overfitting to the training data.

[0103] Inference and Sentiment Determination: Based on the trained model, inference is performed on new insurance customer dialogue texts. After preprocessing and metaphor recognition, the new customer dialogue text is input into the trained unified generative framework model. Through model calculation, target sequences are generated, thereby determining the sentiment tendencies of various aspects of the text. For example, for a new customer feedback, "The coverage of this insurance is a bit narrow, and the customer service attitude is also average," the model will output [Aspect term: Coverage, Sentiment Category: Negative; Aspect term: Customer Service Attitude Friendliness, Sentiment Category: Negative]. In this way, new customer feedback can be analyzed quickly and accurately, providing insurance agents with timely sentiment analysis results.

[0104] 4. Output and Interpretation: The insurance claim process is like a long marathon; Metaphor: A metaphor exists; the project's difficulty is compared to a marathon. Terminology: Project difficulty; Sentiment: Negative.

[0105] As mentioned above, the results of sentiment analysis are presented to insurance agents in a clear and easy-to-understand manner. Visual representations such as tables and charts can be used to display different sentiment tendencies, allowing agents to quickly understand the overall emotional state of clients. For example, a dashboard can be created using different colored bars to represent the distribution of sentiment tendencies in different areas. Red bars represent areas with negative sentiment tendencies, green bars represent areas with positive sentiment tendencies, and yellow bars represent areas with neutral sentiment tendencies. Agents can immediately see which areas have high customer satisfaction and which areas need improvement.

[0106] For complex customer dialogues containing metaphors, provide detailed explanations to help business personnel understand how the model performs sentiment analysis based on metaphors. For example, For the sentence, "The claims process for this insurance policy is like a long marathon," the explanation could point out that the model identifies the metaphor of a "long marathon" to represent slow claims processing, thus adjusting the emotional bias towards "claims speed" to negative. The explanation could also include analysis of other aspects, such as whether this metaphor affects other areas (e.g., the ease of the claims process, customer service), and why it hasn't. In this way, sales personnel can better understand customer feedback and take targeted measures to improve insurance products and services.

[0107] Please see Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of the sentiment analysis device 200 provided in the embodiments of this application. The sentiment analysis device 200 is used to perform the steps of the sentiment analysis method shown in the above embodiments. The sentiment analysis device 200 can be a single server or a server cluster, or the sentiment analysis device 200 can be a terminal, such as a handheld terminal, a laptop computer, a wearable device, or a robot.

[0108] like Figure 3 As shown, the sentiment analysis device 200 includes: The text processing unit 201 is used to perform data preprocessing on the input text to be analyzed to obtain a word vector sequence; and to obtain a metaphor feature library; the metaphor feature library contains preset metaphor expressions and their corresponding implicit meanings; The metaphor recognition unit 202 is used to process the word vector sequence using an attention-based long short-term memory network according to the metaphor feature library to obtain the metaphor recognition result; if the metaphor recognition result shows that there is a metaphor, the implicit meaning corresponding to the metaphor recognition result is integrated into the semantic representation of the input text. The terminology acquisition unit 203 is used to acquire a set of aspect terms, a set of opinion words corresponding to the aspect terms, and a set of sentiment categories. The analysis completion unit 204 is used to convert the processed input text into a target sequence according to the aspect term set, so as to complete the sentiment analysis of the input text according to the target sequence; the target sequence includes the sentiment category corresponding to each aspect term in the aspect term set, and the sentiment category is determined based on the opinion word set and the sentiment category set.

[0109] In some embodiments, the step of processing the word vector sequence using an attention-based long short-term memory network according to the metaphor feature library to obtain metaphor recognition results includes: extracting context sequence features of the word vector sequence through the long short-term memory network; calculating the attention weight between the hidden state at each time step and the feature vector based on the feature vector in the metaphor feature library to obtain a text representation of the key parts of the metaphor; and outputting metaphor recognition results based on the text representation and the context sequence features, wherein the metaphor recognition results include whether there is a metaphor in the input text and the corresponding implicit meaning.

[0110] In some embodiments, the step of preprocessing the input text to be analyzed to obtain a word vector sequence includes: cleaning the input text to remove special symbols, noise data and invalid characters; segmenting the cleaned input text and removing stop words; and converting the segmented input text into a word vector sequence through a word embedding model, wherein the word vector sequence is used to represent the semantic information of the text.

[0111] In some embodiments, obtaining the metaphor feature library includes: extracting typical metaphorical expressions from domain-related corpora, historical text data, and professional literature for a target application domain; labeling each metaphorical expression with its corresponding implicit meaning to form a metaphor feature library containing the mapping relationship between metaphorical expressions and implicit meanings; wherein the metaphorical expressions include linguistic forms such as similes and metaphors, and the implicit meanings are used to characterize the deep semantics corresponding to the metaphorical expressions.

[0112] In some embodiments, integrating the implicit meaning corresponding to the metaphor recognition result into the semantic representation of the input text includes: when the metaphor recognition result indicates the existence of a metaphor, extracting the implicit meaning corresponding to the metaphor; converting the implicit meaning into a semantic feature vector and fusing it with the word vector sequence of the input text to form an enhanced semantic representation containing metaphorical semantics; wherein the fusion method includes vector concatenation, weighted summation, or feature mapping.

[0113] In some embodiments, obtaining the set of aspect terms, the set of opinion words corresponding to the aspect terms, and the set of sentiment categories includes: determining aspect terms that cover the user's focus based on the business scenario of the target application domain, wherein the aspect terms are used to characterize the specific object or dimension to be analyzed; for each aspect term, collecting and organizing the corresponding opinion words from historical text data, wherein the opinion words are used to characterize the evaluative expression of the aspect term; and dividing the sentiment categories into three categories: positive, negative, and neutral, wherein the sentiment categories are used to quantify the user's sentiment tendency towards the aspect terms.

[0114] In some embodiments, the step of converting the processed input text into a target sequence based on the aspect term set includes: inputting the processed input text into a pre-trained unified generative framework model, the unified generative framework model being constrained by the aspect term set, opinion word set, and sentiment category set; generating a structured target sequence through the unified generative framework model, the target sequence containing each aspect term and its corresponding sentiment category; wherein, the training process of the unified generative framework model includes: training the model using historical text data labeled with aspect term sentiment categories, and optimizing the model parameters by minimizing the difference between the predicted results and the true labels.

[0115] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the sentiment analysis device and its modules described above can be referred to the corresponding processes in the sentiment analysis method embodiments described above, and will not be repeated here.

[0116] The aforementioned sentiment analysis method can be implemented as a computer program, which can be used in, for example... Figure 3 It runs on the device shown.

[0117] Please see Figure 4 , Figure 4 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application. The computer device includes a processor, a memory, and a network interface connected via a device bus, wherein the memory may include a storage medium and internal memory.

[0118] The storage medium can store operating devices and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any sentiment analysis method.

[0119] The processor provides computing and control capabilities, supporting the operation of the entire computer device.

[0120] Internal memory provides an environment for the execution of computer programs stored in non-volatile storage media. When these programs are executed by a processor, the processor can perform any sentiment analysis method.

[0121] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0122] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0123] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: The input text to be analyzed is preprocessed to obtain a word vector sequence; a metaphor feature library is obtained; the metaphor feature library contains preset metaphorical expressions and their corresponding implicit meanings; Based on the metaphor feature library, the word vector sequence is processed using an attention-based long short-term memory network to obtain metaphor recognition results; if the metaphor recognition results indicate the existence of a metaphor, the implicit meaning corresponding to the metaphor recognition results is integrated into the semantic representation of the input text. Obtain a set of aspect terms, a set of opinion words corresponding to the aspect terms, and a set of sentiment categories; The processed input text is transformed into a target sequence based on the set of aspect terms, so as to complete the sentiment analysis of the input text based on the target sequence; the target sequence contains the sentiment category corresponding to each aspect term in the set of aspect terms, and the sentiment category is determined based on the set of opinion words and the set of sentiment categories.

[0124] In some embodiments, the step of processing the word vector sequence using an attention-based long short-term memory network according to the metaphor feature library to obtain metaphor recognition results includes: extracting context sequence features of the word vector sequence through the long short-term memory network; calculating the attention weight between the hidden state at each time step and the feature vector based on the feature vector in the metaphor feature library to obtain a text representation of the key parts of the metaphor; and outputting metaphor recognition results based on the text representation and the context sequence features, wherein the metaphor recognition results include whether there is a metaphor in the input text and the corresponding implicit meaning.

[0125] In some embodiments, the step of preprocessing the input text to be analyzed to obtain a word vector sequence includes: cleaning the input text to remove special symbols, noise data and invalid characters; segmenting the cleaned input text and removing stop words; and converting the segmented input text into a word vector sequence through a word embedding model, wherein the word vector sequence is used to represent the semantic information of the text.

[0126] In some embodiments, obtaining the metaphor feature library includes: extracting typical metaphorical expressions from domain-related corpora, historical text data, and professional literature for a target application domain; labeling each metaphorical expression with its corresponding implicit meaning to form a metaphor feature library containing the mapping relationship between metaphorical expressions and implicit meanings; wherein the metaphorical expressions include linguistic forms such as similes and metaphors, and the implicit meanings are used to characterize the deep semantics corresponding to the metaphorical expressions.

[0127] In some embodiments, integrating the implicit meaning corresponding to the metaphor recognition result into the semantic representation of the input text includes: when the metaphor recognition result indicates the existence of a metaphor, extracting the implicit meaning corresponding to the metaphor; converting the implicit meaning into a semantic feature vector and fusing it with the word vector sequence of the input text to form an enhanced semantic representation containing metaphorical semantics; wherein the fusion method includes vector concatenation, weighted summation, or feature mapping.

[0128] In some embodiments, obtaining the set of aspect terms, the set of opinion words corresponding to the aspect terms, and the set of sentiment categories includes: determining aspect terms that cover the user's focus based on the business scenario of the target application domain, wherein the aspect terms are used to characterize the specific object or dimension to be analyzed; for each aspect term, collecting and organizing the corresponding opinion words from historical text data, wherein the opinion words are used to characterize the evaluative expression of the aspect term; and dividing the sentiment categories into three categories: positive, negative, and neutral, wherein the sentiment categories are used to quantify the user's sentiment tendency towards the aspect terms.

[0129] In some embodiments, the step of converting the processed input text into a target sequence based on the aspect term set includes: inputting the processed input text into a pre-trained unified generative framework model, the unified generative framework model being constrained by the aspect term set, opinion word set, and sentiment category set; generating a structured target sequence through the unified generative framework model, the target sequence containing each aspect term and its corresponding sentiment category; wherein, the training process of the unified generative framework model includes: training the model using historical text data labeled with aspect term sentiment categories, and optimizing the model parameters by minimizing the difference between the predicted results and the true labels.

[0130] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method provided in any embodiment of this application.

[0131] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.

[0132] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A sentiment analysis method, characterized in that, include: The input text to be analyzed is preprocessed to obtain a word vector sequence; a metaphor feature library is then obtained. The metaphor feature library contains preset metaphorical expressions and their corresponding implied meanings; Based on the metaphor feature library, the word vector sequence is processed using an attention-based long short-term memory network to obtain metaphor recognition results; If the metaphor recognition result indicates the existence of a metaphor, the implicit meaning corresponding to the metaphor recognition result is incorporated into the semantic representation of the input text; Obtain a set of aspect terms, a set of opinion words corresponding to the aspect terms, and a set of sentiment categories; The processed input text is transformed into a target sequence based on the set of aspect terms, so as to complete the sentiment analysis of the input text based on the target sequence; the target sequence contains the sentiment category corresponding to each aspect term in the set of aspect terms, and the sentiment category is determined based on the set of opinion words and the set of sentiment categories.

2. The method according to claim 1, characterized in that, The step of processing the word vector sequence using an attention-based long short-term memory network based on the metaphor feature library to obtain metaphor recognition results includes: The context sequence features of the word vector sequence are extracted using the Long Short-Term Memory network. Based on the feature vectors in the metaphor feature library, the attention weight between the hidden state at each time step and the feature vector is calculated to obtain the text representation that focuses on the key parts of the metaphor. The metaphor recognition result is output based on the text representation and the context sequence features. The metaphor recognition result includes whether there is a metaphor in the input text and the corresponding implicit meaning.

3. The method according to claim 1, characterized in that, The input text to be analyzed undergoes data preprocessing to obtain a word vector sequence, including: The input text is cleaned to remove special symbols, noisy data, and invalid characters; The cleaned input text is segmented into words and stop words are removed. The segmented input text is transformed into a word vector sequence through a word embedding model, and the word vector sequence is used to represent the semantic information of the text.

4. The method according to claim 1, characterized in that, The acquisition of the metaphor feature library includes: For the target application domain, typical metaphorical expressions are extracted from domain-related corpora, historical text data and professional literature; Each metaphorical expression is labeled with its corresponding implicit meaning, forming a metaphor feature library containing the mapping relationship between metaphorical expressions and implicit meanings; The metaphorical expression includes linguistic forms such as simile and metaphor, and the implied meaning is used to characterize the deeper semantics corresponding to the metaphorical expression.

5. The method according to claim 1, characterized in that, The step of integrating the implicit meaning corresponding to the metaphor recognition result into the semantic representation of the input text includes: When the metaphor recognition result indicates the existence of a metaphor, the implicit meaning corresponding to the metaphor is extracted; The implicit meaning is transformed into a semantic feature vector and fused with the word vector sequence of the input text to form an enhanced semantic representation containing metaphorical semantics; The fusion methods include vector concatenation, weighted summation, or feature mapping.

6. The method according to claim 1, characterized in that, The acquisition of the aspect term set, the opinion word set corresponding to the aspect term, and the sentiment category set includes: Based on the business scenarios of the target application domain, determine the aspect terms that cover the user's focus. These aspect terms are used to characterize the specific objects or dimensions to be analyzed. For each of the aforementioned aspect terms, corresponding opinion terms are collected and organized from historical text data. These opinion terms are used to characterize evaluative statements about the aforementioned aspect terms. The emotional categories are divided into three categories: positive, negative, and neutral. These emotional categories are used to quantify users' emotional inclination towards the terms in question.

7. The method according to claim 1, characterized in that, The step of converting the processed input text into a target sequence based on the aforementioned set of aspect terms includes: The processed input text is fed into a pre-trained unified generative framework model, which is constrained by the set of aspect terms, the set of opinion words, and the set of sentiment categories. The unified generative framework model generates a structured target sequence, which contains terms for each aspect and their corresponding sentiment categories. The training process of the unified generative framework model includes: training the model using historical text data labeled with aspect terms and sentiment categories, and optimizing the model parameters by minimizing the difference between the predicted results and the true labels.

8. An emotion analysis device, characterized in that, include: The text processing unit is used to preprocess the input text to be analyzed, obtain word vector sequences, and acquire a metaphor feature library. The metaphor feature library contains preset metaphorical expressions and their corresponding implied meanings; The metaphor recognition unit is used to process the word vector sequence using an attention-based long short-term memory network according to the metaphor feature library to obtain the metaphor recognition result; if the metaphor recognition result shows that there is a metaphor, the implicit meaning corresponding to the metaphor recognition result is integrated into the semantic representation of the input text. The terminology acquisition unit is used to acquire a set of aspect terms, a set of opinion words corresponding to the aspect terms, and a set of sentiment categories. The analysis completion unit is used to transform the processed input text into a target sequence based on the aspect term set, so as to complete the sentiment analysis of the input text based on the target sequence; the target sequence includes the sentiment category corresponding to each aspect term in the aspect term set, and the sentiment category is determined based on the opinion word set and the sentiment category set.

9. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • User demand analysis and quantification method and system based on concept metaphor analysis

    CN122335348A