Text emotion recognition method and device

By constructing a multi-level emotional ontology and cross-cultural emotional mapping relationship, the accuracy and applicability of cross-cultural emotional recognition are solved, fine-grained emotional recognition and cross-cultural understanding are achieved, and the cost of manual construction is reduced.

CN120493942APending Publication Date: 2025-08-15SHENZHEN KUEST TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510612549.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Existing text emotion recognition technology cannot effectively capture the richness and diversity of cross-cultural emotional expressions, lacks cross-cultural understanding ability, and relies on manual labeling to consume time and effort, making it difficult to adapt to global application scenarios.

Method used

Based on the theory of cognitive psychology, multi-level emotional ontology is constructed, large-scale cultural corpus and vocabulary network analysis is used to establish cross-cultural emotion mapping relationships through the tensor product of cultural feature vectors and emotional concept vectors, and fine-grained emotion recognition and calibration are carried out in combination with context factors.

Benefits of technology

It improves the accuracy and applicability of cross-cultural emotional recognition, reduces the cost of manual construction, enhances the integrity and accuracy of emotional ontology, and realizes fine-grained emotional recognition and cross-cultural understanding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120493942A_ABST
    Figure CN120493942A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and discloses a text emotion recognition method and device.The text emotion recognition method comprises the following steps that a multi-layer emotion ontology is constructed based on the cognitive psychology theory, emotions are divided into a three-layer structure of basic emotions, composite emotions and context-related emotions, and an infrastructure of the emotion ontology is formed; a large-scale cultural corpus is utilized, specific emotion expression concepts under different cultural backgrounds are automatically extracted through vocabulary network analysis, and unified understanding of emotion expression under different cultural backgrounds is achieved; according to the method, the cross-culture emotion mapping relationship is established through the tensor product of the culture feature vector and the emotion concept vector, so that the system can understand the emotion expression difference under different culture backgrounds, the applicability under a global application scene is improved, the cross-culture emotion recognition accuracy is improved, and the system experience is improved. Therefore, the problem of emotion expression difference recognition under different culture backgrounds is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and more particularly, to a text emotion recognition method and device. Background Art

[0002] With the acceleration of globalization and the expansion of Internet applications, the demand for cross-cultural text sentiment analysis is growing. However, current text sentiment recognition technology has the following major problems: First, traditional sentiment analysis methods are mostly limited to simple positive / negative / neutral classification, failing to capture the richness and diversity of human emotional expression and performing poorly in applications requiring refined emotional understanding. Second, significant differences exist in emotional expression and understanding across different cultural backgrounds. For example, East Asian culture tends to be more implicit, while Western culture is more direct. Existing emotion recognition methods are typically developed for a single language or cultural context, lacking the ability to understand emotions in cross-cultural contexts and struggling to adapt to global applications. Third, traditional emotion ontologies and lexicon construction primarily rely on manual annotation, which is not only time-consuming and labor-intensive but also difficult to ensure completeness and accuracy across different cultural contexts. This results in poor performance of emotion recognition systems when encountering emerging or culturally specific emotional expressions. Finally, existing sentiment analysis methods are mostly based on statistical or neural network models, lacking theoretical support for the cognitive mechanisms of human emotions. This leads to a gap between emotion recognition results and human understanding, especially in complex emotional expressions and cross-cultural contexts.

[0003] Therefore, there is an urgent need for an emotion recognition method that can achieve fine-grained emotion recognition, has cross-cultural understanding capabilities, can automatically construct emotion ontology, and integrate cognitive psychology theory to meet the growing demand for global applications. Summary of the Invention

[0004] The present invention provides a text emotion recognition method and device to solve the technical problem that text emotion recognition in related technologies lacks the ability to understand emotions in a cross-cultural context.

[0005] The present invention provides a text emotion recognition method, comprising the following steps: Based on cognitive psychology theory, a multi-level emotion ontology is constructed, which divides emotions into three layers: basic emotions, complex emotions, and context-related emotions, forming the basic framework of the emotion ontology. Using a large-scale cultural corpus, we automatically extract specific emotion expression concepts from different cultural backgrounds through lexical network analysis, achieving a unified understanding of emotion expression in different cultural backgrounds. Based on the extracted emotional expression concepts, a cross-cultural emotional mapping relationship is established through the tensor product of cultural feature vectors and emotional concept vectors; Using the established mapping relationship, the semantic features of the input text are mapped to the nodes of the sentiment ontology. Through a hierarchical reasoning process, the fine-grained sentiment categories in the text are identified, and the sentiment understanding is adjusted by considering cultural background factors. According to the inference results, fine-grained sentiment classification is output, and the results are calibrated based on contextual information to improve the accuracy and adaptability of sentiment recognition.

[0006] As a further optimization solution of the present invention, the steps of constructing a multi-level emotion ontology include: Based on the basic emotion theory in cognitive psychology, a basic emotion set is determined, where each basic emotion includes an emotion label, an emotion intensity parameter, and an emotion description; Generate a set of composite emotions by weighted combination of basic emotions, where each composite emotion is defined as a weighted combination of basic emotions; Establish a context-related emotion set, modulate the composite emotion through context factors, and form a representation of the emotional expression in a specific context; Construct an emotion ontology graph structure and establish hierarchical relationships between emotion concepts.

[0007] As a further optimization solution of the present invention, the calculation formula of the composite emotion is: ; in, Indicates the Basic emotion categories, Indicates the A complex emotion, Expressing basic emotions In compound emotions The weight in Indicates that all The sum of the basic emotions; The calculation formula for context-related sentiment is: ; in, Indicates the context-dependent emotions; represents the context modulation function, which is used to map the composite emotion and context factors to context-related emotions; represents the set of context factors; Represents the continuous multiplication symbol, indicating that multiple factors are multiplied; Indicates that from Start with a contextual factor; represents the total number of contextual factors; Indicates the The influence function of contextual factors; Indicates the contextual factors; Represents the multiplication operator.

[0008] As a further optimization solution of the present invention, the steps of extracting culturally specific emotional concepts include: Targeting the target culture, collect text materials in the cultural context; Apply sentiment word extraction algorithms to each cultural corpus to identify potential sets of sentiment expression words; Applying a hierarchical clustering algorithm to the extracted sentiment vocabulary set to form sentiment concept clusters; A culture-specific emotion map is constructed based on emotion concept clusters, and edges are established based on emotion co-occurrence statistics.

[0009] As a further optimization solution of the present invention, the calculation formula for sentiment vocabulary extraction is: ; in, Expressing vocabulary The sentiment score, Expressing vocabulary The inverse document frequency value of the term frequency, Expressing vocabulary and sentiment seed word set The semantic similarity is calculated as follows: ; in, Represents the maximum value operator, express Seed word set An element in represents the word vector representation, represents the cosine similarity function, Expressing vocabulary The word vector representation of Indicates seed word The word vector representation of .

[0010] As a further optimization solution of the present invention, the steps of constructing a cross-cultural emotion mapping model include: For each target culture, a cultural feature vector is constructed, where the feature dimensions include language system characteristics, social and historical background, and quantitative representation of value orientation; For each sentiment concept, generate its vector representation; Through the tensor product of cultural feature vectors and emotional concept vectors, the mapping relationship between culture and emotional concepts is established; Based on the mapping tensor, the equivalence probability between emotional concepts in different cultural backgrounds is calculated, and a set of cross-cultural emotional equivalence mappings is established.

[0011] As a further optimization solution of the present invention, the calculation formula of the cross-cultural emotion mapping tensor is: ; in, represents the tensor product of the cultural feature vector and the emotional concept vector, Indicates the The characteristic vector of a culture, represents the tensor product operation, Indicates the Vector representation of emotion concepts.

[0012] As a further optimization solution of the present invention, the steps of performing fine-grained sentiment reasoning include: Perform word segmentation, part-of-speech tagging, and syntactic analysis preprocessing on the input text to obtain a standardized text representation; Use pre-trained language models to extract semantic feature vectors of text; Analyze the contextual factors in the text, including the subject background, communication occasion, and emotional subject, and extract the contextual feature set; Identify the cultural context of the text based on text features or other relevant metadata; Match text feature vectors with sentiment concepts in sentiment ontology to identify sentiment expressions in texts; Based on the matching scores, emotion recognition is performed at different granularity levels.

[0013] As a further optimization solution of the present invention, the steps of result output and calibration include: For each identified emotion, calculate its expression intensity in the text; Integrate emotion recognition results at different levels to form a hierarchical emotion representation; When there is conflict in the identified emotion set, conflict resolution is performed; Format and output the final emotion recognition results.

[0014] A text emotion recognition device, used to perform the above-mentioned text emotion recognition method, comprises: Multi-level emotion ontology construction module, used to construct multi-level emotion ontology based on cognitive psychology theory; Culturally specific emotion concept extraction module, used to extract specific emotion expression concepts in different cultural backgrounds; Cross-cultural emotion mapping model building module, used to establish cross-cultural emotion mapping relationships; A fine-grained sentiment reasoning execution module for identifying fine-grained sentiment categories in text; Result output and calibration module, used to output fine-grained sentiment classification and perform calibration The beneficial effects of the present invention are: this method establishes a cross-cultural emotion mapping relationship through the tensor product of cultural feature vectors and emotion concept vectors, enabling the system to understand the differences in emotion expression under different cultural backgrounds, improving the applicability in global application scenarios, and improving the accuracy of cross-cultural emotion recognition, thereby solving the problem of identifying differences in emotion expression under different cultural backgrounds. At the same time, based on the automatic analysis of large-scale cultural corpora, a culturally specific emotion ontology is constructed, which not only reduces the cost of manual construction, but also improves the integrity and accuracy of the emotion ontology. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a flow chart of the text emotion recognition method of the present invention; Figure 2 It is a detailed flow chart of the basic architecture for forming the emotion ontology of the present invention; Figure 3 is a detailed flow chart of the present invention for extracting the concept of emotional expression; Figure 4 It is a detailed flow chart of establishing a cross-cultural emotion mapping relationship of the present invention; Figure 5 is a detailed flowchart of the invention's inference of fine-grained emotion categories; Figure 6 It is a detailed flow chart of the result calibration of the present invention. DETAILED DESCRIPTION

[0016] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that these embodiments are discussed solely to enable those skilled in the art to better understand and implement the subject matter described herein, and that the functions and arrangements of the elements discussed may be varied without departing from the scope of this specification. Various examples may omit, substitute, or add various processes or components as needed. Furthermore, features described in some examples may be combined in other examples.

[0017] At least one embodiment of the present invention discloses a text emotion recognition method, such as Figures 1 to 6 As shown, the following steps are included: Step 1: Based on cognitive psychology theory, a multi-level emotion ontology is constructed, which divides emotions into three layers: basic emotions, complex emotions, and context-related emotions, forming the basic structure of the emotion ontology. The specific steps are as follows: Step 1.1: Construction of basic emotional layer; Based on the basic emotion theories in cognitive psychology (such as Ekman's six basic emotion theories and Plutchik's eight basic emotion theories), the basic emotion set is determined: ; in, 、 、 Respectively represent 、 、 Basic emotion categories, Indicates the total number of basic emotions. Each basic emotion Contains emotional tags , emotional intensity parameters and emotional descriptions .

[0018] Step 1.2: Construction of composite emotion layer; Generate a composite emotion set by combining basic emotions: ; in, 、 、 Respectively represent 、 、 A complex emotion, Indicates the total number of compound emotions. Each compound emotion Defined as a weighted combination of basic emotions: ; in, Indicates the Basic emotion categories, Indicates the A complex emotion, Expressing basic emotions In compound emotions The weight in Indicates that all The sum of the basic emotions.

[0019] In the specific implementation, the weights are determined by combining psychological expert annotation with data-driven methods. For example, the complex emotion of disappointment can be expressed as a weighted combination of sadness and surprise. The weights can be obtained by analyzing a large amount of text data with emotion annotations. In actual applications, these weights are stored in the weight matrix , used for the calculation and recognition of compound emotions, where is the weight matrix, represents the set of real numbers, Indicates the number of basic emotions, Indicates the number of compound emotions.

[0020] Step 1.3: Constructing the context-related emotional layer; Create context-dependent sentiment sets: ; in, 、 、 Respectively represent 、 、 context-dependent emotions, is the total number of context-related emotions; The complex emotion is modulated by context factors. : ; in, 、 、 Respectively represent 、 、 contextual factors, is the total number of contextual factors, forming an expression of emotional expression in a specific context: ; in, Indicates the context-dependent emotions; represents the context modulation function, which is used to map the composite emotion and context factors to context-related emotions; represents the set of context factors; Represents the continuous multiplication symbol, indicating that multiple factors are multiplied; Indicates that from Start with a contextual factor; represents the total number of contextual factors; Indicates the The influence function of contextual factors; Indicates the contextual factors; Represents the multiplication operator.

[0021] In the specific implementation, the context modulation function Implemented through a neural network, it receives a composite sentiment vector and a contextual feature vector as input and outputs a modulated sentiment representation. For example, for text on social media platforms, the platform type (such as Weibo, forums), user relationship network characteristics, and topic attributes can be used as contextual factors to construct a corresponding influence function to adjust the understanding of emotional expression.

[0022] Step 1.4, establish the hierarchical relationship of emotional ontology; Construct the emotion ontology graph structure: , in, represents a vertex set, represents the edge set, represents the weight set; Vertex Set Represents all emotion concepts; in, 、 、 Respectively represent the basic emotion set, compound emotion set, and context-related emotion set; Edge Set Represents the association between emotional concepts; Weight Set Indicates the strength of association.

[0023] For any two emotion concepts , if they have semantic association, then establish an edge , and assign association strength .

[0024] In practical applications, the sentiment ontology graph structure is stored in graph databases such as Neo4j or TigerGraph, facilitating efficient query and traversal. The relationship types between sentiment concepts include is_a (hypernym / hypernym), part_of (part-whole), similar_to (similarity), and opposite_to (opposite). These relationship types are used to construct a rich sentiment ontology knowledge graph.

[0025] Step 2: Using a large-scale cultural corpus, we automatically extract specific emotion expression concepts from different cultural backgrounds through lexical network analysis to achieve a unified understanding of emotion expression in different cultural backgrounds. The specific steps are as follows: Step 2.1: Cultural corpus construction; Target culture , collect text corpus in this cultural context: ; in, 、 、 Respectively represent 、 、 documents, Indicates the total number of documents.

[0026] The corpus sources include diverse texts such as literary works, news reports, social media content, etc. of the culture.

[0027] In practical applications, when building a corpus for Chinese culture, data sources such as classical Chinese literature, modern literature, news reports, Weibo, and Douban comments can be collected. When building a corpus for English culture, data sources such as British and American literature and user content from platforms such as Twitter and Reddit can be collected. After preprocessing steps such as cleaning, deduplication, and sentence segmentation, the collected corpus is stored in a distributed document database such as MongoDB or Elasticsearch to support subsequent efficient analysis and retrieval.

[0028] Step 2.2, emotional vocabulary extraction; For each cultural corpus Apply the sentiment vocabulary extraction algorithm to identify potential sentiment expression vocabulary sets: ; in, 、 、 Respectively 、 、 Emotional vocabulary, Represents the total number of sentiment words.

[0029] The extraction process uses a statistical method based on term frequency-inverse document frequency (TF-IDF) combined with a sentiment seed word expansion algorithm: ; in, Expressing vocabulary The sentiment score, Expressing vocabulary The inverse document frequency value of the term frequency, Expressing vocabulary and sentiment seed word set The semantic similarity is calculated as follows: ; in, Represents the maximum value operator, express Seed word set An element in represents the word vector representation, represents the cosine similarity function, Expressing vocabulary The word vector representation of Indicates seed word The word vector representation of .

[0030] In practice, word embeddings can be generated using pre-trained word embedding models (such as Word2Vec, GloVe, or FastText). A set of sentiment seed words can be predefined for each culture as a starting point. For example, for Chinese, basic sentiment words such as happy, angry, and sad can be selected as seed words; for English, words such as happy, angry, and sad can be selected as seed words. Based on these seed words, the sentiment vocabulary set is then iteratively expanded using a combination of TF-IDF values and semantic similarity.

[0031] Step 2.3, sentiment concept clustering; Extracted sentiment vocabulary set Apply the hierarchical clustering algorithm to form sentiment concept clusters: ; in, 、 、 Respectively 、 、 A cluster of emotional concepts, Represents the total number of sentiment concept clusters, each sentiment concept cluster Contains sentiment words with similar semantics: ; in, Indicates the A cluster of emotional concepts, Represents a word in the sentiment vocabulary, Expressing vocabulary With the Cluster centers The semantic distance between Indicates the The center point of the cluster, represents the clustering threshold; Indicates the A collection of emotion words from different cultures.

[0032] In actual implementation, hierarchical clustering algorithms (such as agglomerative hierarchical clustering) are used to form emotion concept clusters. For example, the Chinese words "xinxi", "huanxin", and "huankuai" may be clustered into the same emotion concept cluster, while the English words "delighted", "joyful", and "pleased" may also form a cluster. The distance function used in the clustering process is calculated based on the Euclidean distance or cosine distance in the word vector space, and the clustering threshold is adjusted based on performance on the validation set.

[0033] Step 2.4: Construction of culturally specific emotion maps; Based on sentiment concept cluster Constructing culturally specific emotion maps: ; Among them, the vertex set Represents sentiment concepts, edge sets Represents the association relationship between concepts, weight set Indicates the strength of association.

[0034] The establishment of edges is based on sentiment co-occurrence statistics: ; in, Expressing the concept of connection emotion and The edge, Representing culturally specific emotional maps The edge set in Expressing emotional concepts and co-occurrence frequency in the corpus, represents the co-occurrence threshold, Represents two different emotion concept clusters.

[0035] In practice, different window sizes (such as sentence, paragraph, or document) can be used to calculate the co-occurrence frequency of emotional concepts. For example, in Chinese culture, surprise and joy may often co-occur to form a specific emotional expression, while in English culture, the co-occurrence of surprise and fear may be more common. By counting these co-occurrence patterns, a culture-specific emotional map can be formed.

[0036] Step 3: Based on the extracted emotion expression concepts, a cross-cultural emotion mapping relationship is established through the tensor product of the cultural feature vector and the emotion concept vector; The specific steps are as follows: Step 3.1, cultural feature vector extraction; For each target culture , construct cultural feature vector: ; in, 、 、 Respectively represent The first 、 、 feature dimensions, Indicates the total number of feature dimensions.

[0037] The characteristic dimensions include quantitative representations of language system characteristics, social and historical background, and values and ideas. The cultural characteristic vector is calculated as follows: ; in, Indicates the The characteristic vector of a culture, represents the cultural feature encoder, a corpus representing that culture, Represents the knowledge base of the culture.

[0038] In its implementation, the cultural feature encoder uses a multi-layer perceptron (MLP) architecture. The input layer receives cultural features extracted from the corpus and knowledge base, such as grammatical structure, vocabulary usage preferences, and emotional expression intensity preferences. After processing by the hidden layer, the encoder outputs a cultural feature vector. For example, the encoding of Chinese cultural features might include expressions that emphasize collectivism, while the encoding of English cultural features might include more individualistic expressions.

[0039] Step 3.2: Generate emotional concept vector; For each emotion concept , generating its vector representation: ; in, 、 、 Represents the sentiment concept vector 、 、 feature components, Represents the total number of feature components. The sentiment concept vector is calculated as follows: ; in, Indicates the The vector representation of the emotional concept, Expressing emotional concepts The word collection, Expressive words The vector representation of Represents a set The sum of the word vectors of all words in , Representing a collection A word in .

[0040] In practice, we use pre-trained models like Word2Vec or BERT to generate word vectors. We then average all word vectors within a sentiment concept cluster to create a vector representation for the sentiment concept. For complex sentiment concepts, we can also use a weighted averaging strategy, assigning higher weights to core words. For example, the sentiment concept vector for sadness can be derived by taking the weighted average of the word vectors for sadness, heartbreak, and sadness.

[0041] Step 3.3: Construction of cross-cultural emotion mapping tensor; Through cultural feature vector With emotion concept vector tensor product of , establish a mapping relationship between cultural and emotional concepts: ; in, represents the tensor product of the cultural feature vector and the emotional concept vector, Represents a tensor product operation.

[0042] Tensor Elements Representing cultural characteristics and emotional concept characteristics The interaction intensity.

[0043] In practice, the tensor product operation can be implemented using a bilinear layer in a deep neural network. This layer takes a cultural feature vector and an emotion concept vector as input and outputs a mapping relationship between them. For example, it can capture the unique interaction between implicit features and sadness in Chinese culture, or the interaction between direct expression features and anger in English culture.

[0044] Step 3.4: Establish cross-cultural emotional equivalence; Mapped Tensor-Based , calculate the equivalence probability between emotional concepts in different cultural backgrounds: ; in, Representation Culture The concept of emotion in and culture The concept of emotion in The equivalent probability between Representation Culture The concept of emotion in Representation Culture The concept of emotion in , represents the tensor similarity function, represents the normalization factor, Representation Culture and emotion concept The mapping tensor of ; Representation Culture and emotion concept The mapping tensor.

[0045] Based on this probability, a set of cross-cultural emotional equivalence mappings is established: ; in, represents equivalent probability.

[0046] In specific application scenarios, this mapping relationship can be used for cross-language sentiment translation. For example, the Chinese concept of face doesn't have a fully corresponding emotional concept in Western culture. However, this step can establish a mapping relationship and strength between face and English concepts such as dignity, reputation, and self-respect, enabling more accurate cross-cultural sentiment understanding. The mapping results are stored in a knowledge graph database, supporting rapid retrieval and updating.

[0047] Step 4: Using the established mapping relationship, the semantic features of the input text are mapped to the emotion ontology nodes. Through the hierarchical reasoning process, the fine-grained emotion categories in the text are identified, and the emotion understanding and adjustment are made by considering the cultural background factors. Step 4.1: Text preprocessing; For input text Perform preprocessing operations such as word segmentation, part-of-speech tagging, and syntactic analysis to obtain a standardized text representation: ; in, 、 、 Represents the first 、 、 A token, Indicates the total number of tags.

[0048] In the actual system, the preprocessing module selects the appropriate word segmentation tool for each language, such as the Jieba word segmenter for Chinese and the NLTK or spaCy word segmenters for English. For complex language structures, syntactic analysis tools are also applied to construct dependency syntax trees to capture the structural relationships between sentence components. For example, for a transitional sentence like "Although the result is not ideal, I am not depressed," syntactic analysis can identify that the sentiment weight of the second half of the sentence should be greater than that of the first half.

[0049] Step 4.2: Text feature extraction; Use the pre-trained language model to extract the semantic feature vector of the text: ; in, 、 、 Respectively represent 、 、 The feature values on the semantic dimension, Represents the total number of feature values in the semantic dimension, and its formula is: ; in, represents the extracted text feature vector, Represents a text encoder, which can be a pre-trained language model such as BERT or RoBERTa. Represents the preprocessed normalized text representation.

[0050] In specific implementations, for short texts (such as microblogs and comments), the [CLS] tag output of models like BERT can be directly used as the overall feature representation. For long texts, attention pooling after segmented encoding can be used to synthesize the overall features. For different languages and domains, appropriate pre-trained models can be selected. For example, for Chinese text, the Harbin Institute of Technology's RoBERTa-wwm-ext or Alibaba's MacBERT model can be used, while for English text, the RoBERTa or DeBERTa models can be used.

[0051] Step 4.3, identification of contextual factors; Analyze the contextual factors in the text, including the subject background, communication occasion, emotional subject, etc., and extract the context feature set: ; in, 、 、 Respectively represent 、 、 contextual features, Represents the total number of contextual features. Contextual factors are identified by: ; in, Represents the extracted context feature set, which includes multiple context factors. Represents a context analyzer, which is used to extract various contextual factors in the text.

[0052] The context analyzer is implemented using a multi-task learning framework, encompassing subtasks such as topic classification, scene recognition, and entity extraction, all sharing underlying feature representations. For example, for social media text, it can identify contextual information such as the publishing platform (e.g., Weibo, Zhihu), discussion topics (e.g., politics, sports), and communication partners (e.g., private communications, public speeches). For literary works, it can identify contextual features such as genre (e.g., prose, novel) and writing style (e.g., formal, humorous).

[0053] Step 4.4, cultural background identification; Based on text features or other relevant metadata to identify the cultural context to which the text belongs : ; in, Indicates the cultural category to which the recognized text belongs. Indicates that given the text features and metadata, the text belongs to a culture The probability of Indicates that across all possible cultural categories Choose the one with the highest probability.

[0054] In practical applications, the cultural background recognition module can be based on a variety of features, such as linguistic features (language used, dialect characteristics), expression patterns (direct / indirect expression), and culturally specific references (idioms, allusions). For example, an English text containing "Tallpoppy syndrome" can be identified as a specific expression of Australian English culture; a Chinese text containing "cultivating oneself, maintaining order, and bringing peace" can be identified as an expression characteristic of Chinese Confucian culture.

[0055] Step 4.5, emotion matching and reasoning; The text feature vector Match the emotion concepts in the emotion ontology to identify the emotion expressions in the text:

[0056]

[0057] ; in, Indicates that given a text feature vector , contextual features and cultural background Under the condition, the concept of emotion The matching score, Indicates the semantic similarity between text features and sentiment concepts, Indicates the relevance of sentiment concepts to context, Indicates cultural adaptation of emotion concepts.

[0058] In its implementation, the sentiment matching and reasoning module uses a graph neural network (GNN) architecture, embedding text features as initial nodes and performing reasoning on the sentiment ontology graph through a multi-round message passing mechanism. For example, for a text containing "I didn't do well on the exam, but I'm not sad," the system first identifies the concept of sadness. However, through analysis of negation and transition words, combined with contextual reasoning, it concludes that the text actually expresses relief. The reasoning process also considers contextual factors and cultural background adjustments, such as differences in the expression of emotional intensity across cultures.

[0059] Step 4.6, multi-granularity emotion recognition; Based on the matching scores in step 4.5, emotion recognition is performed at different granularity levels:

[0060] ; in, Represents the final identified multi-granularity emotion set; Indicates a specific emotion category; Represents emotion category The recognition threshold of Represents a set of basic emotions; Represents a composite emotion set, Represents a set of context-dependent emotions.

[0061] In practical applications, the threshold The threshold can be dynamically adjusted based on the specific application scenario, with higher thresholds set for scenarios requiring high precision and lower thresholds for scenarios requiring high recall. For example, when analyzing customer service reviews, one might be more concerned with accurately capturing negative emotions, so a lower threshold would be set for emotions like anger and disappointment. On the other hand, when analyzing literary works, a more balanced threshold strategy would be adopted to capture a wide range of subtle emotions.

[0062] Step 5: Output fine-grained sentiment classification based on the inference results, and calibrate the results based on contextual information to improve the accuracy and adaptability of sentiment recognition.

[0063] Step 5.1, calculation of emotional expression intensity; For each emotion identified , calculate its expression strength in the text:

[0064] ; in, Expressing emotions The final expression intensity, Expressing emotions The basic strength, represents the moderating factor of context on emotion intensity, Represents the moderating factor of cultural background on emotion intensity.

[0065] In its implementation, the baseline intensity is determined using a sentiment word intensity dictionary and a sentiment intensity classifier. For example, anger is generally a stronger negative emotion than dissatisfaction. Contextual modifiers consider intensity markers like adverbs (such as "very" and "slightly") and repetition. Cultural modifiers consider cultural preferences for intensity, such as the relative subtlety of emotional expression in East Asian cultures and the directness and intensity of emotional expression in Latinx cultures. The system dynamically adjusts the sentiment intensity assessment based on these factors.

[0066] Step 5.2, emotional level integration; Integrate the emotion recognition results at different levels (basic, complex, and context-related) to form a hierarchical emotion representation:

[0067] ; in, represents a hierarchical set of sentiment representations, Expressing emotions the level to which it belongs (basic, complex or context-dependent), Expressing emotions the level to which it belongs (basic, complex or context-dependent), Expressing emotions expression intensity.

[0068] In practical applications, hierarchical representation can meet analysis requirements at varying levels of sophistication. For example, for sentiment overview analysis, only the results at the basic sentiment level (e.g., positive / negative) can be displayed; for fine-grained analysis, all sentiment levels can be displayed. In mental health analysis applications, identifying complex emotions (e.g., nostalgia and melancholy) is particularly important for understanding a user's emotional state.

[0069] Step 5.3: Emotional conflict resolution; When there is a conflict in the identified emotion set (such as identifying happiness and sadness at the same time), conflict resolution is performed:

[0070] ; in, represents the consistent emotion set after conflict resolution, Represents an emotional conflict resolution algorithm that resolves conflicts based on emotional intensity, contextual importance, and cultural specificity.

[0071] In its implementation, the emotion conflict resolution algorithm uses a combination of rules and learning. For clearly conflicting basic emotions (such as happiness and sadness), the stronger emotion is retained, prioritizing intensity. For complex emotions that can coexist (such as surprise and fear, which can combine to form panic), the combination is retained and labeled. For emotional combinations unique to specific cultural contexts (such as the mixed feelings of sadness and joy in Chinese culture), the culturally specific expressions are retained. For example, for a text message like "I am both happy and worried," the system retains both the happy and worried emotions and labels their coexistence.

[0072] Step 5.4: Format the output result; Format and output the final emotion recognition results: ; in, Indicates the final output result after formatting; Represents a result formatting function.

[0073] The output results include the following: identified emotion categories and their levels, emotion expression intensity, specific trigger points (sentences or phrases) of emotions in the text, description of the cultural background adaptability of emotions, etc.

[0074] In practical applications, the formatted output module can generate output in different formats based on different application scenarios. For example, for sentiment analysis APIs, it outputs structured JSON data; for visualization analysis systems, it generates data in a format that supports visualization; and for cross-language sentiment understanding systems, it provides cross-cultural mapping and explanation of sentiment concepts. In social media sentiment monitoring applications, the system can output sentiment trends and outlier detection results to support public opinion analysis and early warning.

[0075] This implementation, based on cognitive psychology theory and culture-specific emotion ontology construction technology, achieves fine-grained emotion recognition in a cross-cultural context, with the following technical effects: High-precision fine-grained emotion recognition: Compared with traditional methods, it can identify more fine-grained emotion categories, expand the granularity of emotion recognition, improve accuracy, and significantly enhance the refinement of emotion analysis.

[0076] Cross-cultural emotion understanding: This solves the problem of identifying differences in emotional expression across different cultural backgrounds. By establishing a cross-cultural emotion mapping relationship through the tensor product of cultural feature vectors and emotional concept vectors, the system can understand the differences in emotional expression across different cultural backgrounds, improving its applicability in global application scenarios and enhancing the accuracy of cross-cultural emotion recognition.

[0077] Automated emotion ontology construction: Based on the automatic analysis of large-scale cultural corpora, culturally specific emotion ontologies are constructed, which reduces the cost of manual construction while improving the completeness and accuracy of the emotion ontology.

[0078] Theoretical support for sentiment analysis: Integrating cognitive psychology theory with emotion ontology technology provides a solid theoretical foundation for emotion recognition, making the emotion recognition results more consistent with human cognitive laws and improving the interpretability and credibility of the system.

[0079] Hierarchical emotion expression: Through a three-layer structure of basic emotion, compound emotion, and context-related emotion, hierarchical emotion expression is achieved. It can capture the rich emotional nuances in the text and provide more accurate emotional insights for applications such as content analysis and user experience optimization.

[0080] Application Example 1: Cross-cultural Social Media Sentiment Analysis System Application scenarios: With the development of the global internet, social media platforms are flooded with multilingual content from users of diverse cultural backgrounds. Traditional sentiment analysis systems struggle to accurately understand the differences in emotional expression across cultures, resulting in low cross-cultural analysis accuracy. This example demonstrates a specific implementation of this patented method for cross-cultural social media sentiment analysis.

[0081] System implementation: 1) Data Collection and Preprocessing: The system collects multilingual text data from major global social media platforms such as Twitter, Weibo, and Facebook, including user comments, posts, and replies in English, Chinese, Japanese, Arabic, and other languages. The collected text is cleaned, segmented, and standardized to form an initial corpus.

[0082] 2) Emotional ontology construction: Basic emotion layer: Using Plutchik's eight basic emotion theory, define the basic emotion set:

[0083] ; Compound emotion layer: 28 compound emotions are generated by combining basic emotions. For example, love is defined as a combination of joy and trust. The calculation formula is: ; Context-related sentiment layer: defines contextual sentiment for specific social media scenarios, such as online satire and interactive humor.

[0084] 3) Culture-specific emotion extraction: English Cultural Corpus: collects foreign social media texts, totaling 50 million; Chinese cultural corpus: Collect domestic social media texts, with a total of 30 million pieces; Apply an algorithm that combines TF-IDF and word vector similarity to extract culture-specific emotional vocabulary. For example, in Chinese culture, "suan le" is identified as a specific expression of jealousy, and in English culture, "salty" is identified as a slang expression of anger.

[0085] 4) Cross-cultural mapping establishment: Chinese-English cultural feature vectors: Define 100-dimensional cultural feature vectors, including language structure features, social value features, etc.; Emotional concept vectors: Generate 300-dimensional vector representations for each emotional concept; Establish mappings of emotional expressions in different cultures through the tensor product. For example, map "ai yu mian zi" in Chinese to "reluctant due to social pressure" in English.

[0086] 5) Practical application effects: Test on a 100,000-piece cross-cultural social media test data set. The overall emotional recognition accuracy rate reaches 81.5%, which is 23.7% higher than the traditional method; In identifying culture-specific emotional expressions, the accuracy rate improvement is more significant, reaching 76.3%, which is 35.2% higher than the traditional method; The system can identify different expressions of similar emotions in different cultures. For example, it can identify that "da ka" in Chinese actually expresses a similar sense of relaxed satisfaction as "checking in" in English.

[0087] The following table shows the technical index data of this application example:

[0088] Application example 2: Cross-language emotional translation system Application scenario: With the acceleration of the globalization process, the demand for cross-language communication is increasing day by day. However, traditional machine translation systems often only focus on semantic-level conversion and are difficult to accurately convey the emotional color in the original text, especially culture-specific emotional expressions. This example demonstrates the specific implementation plan of applying the method of this patent to cross-language emotional translation.

[0089] System implementation: 1) System architecture design: Construct a three-stage pipeline architecture of emotion recognition - translation - emotion reconstruction, and combine emotion recognition with traditional machine translation systems.

[0090] 2) Emotion-preserving translation strategy: Emotion marker extraction: Use the method of this patent to identify the fine-grained emotional expressions and their intensities in the source language text; Cross - cultural Emotion Mapping: Mapping the emotional expressions in the source language to equivalent expressions in the target - language culture; Emotion - enhanced Translation: Based on the traditional translation results, adjusting the expression according to the emotion - mapping results to retain the original emotional color.

[0091] 3) Examples of Emotional Translation in Chinese and English Literary Works: Take the fragment of Lin Daiyu burying flowers in "Dream of the Red Chamber" as an example: Original text: Now I bury these flowers, and people laugh at my folly. Who will bury me when my time comes?; Traditional translation: Today I bury these flowers, and people laugh at my foolishness. In future years, who will bury me?; Translation of this system: Today I bury these flowers, and people mock my melancholy devotion. In future years, who will lay me to rest with such tender sorrow?; In the translation of this system, through cross - cultural emotion mapping, the complex emotions of infatuation, persistence, and sadness contained in the word "痴" in the original text are identified, and the expression "melancholy devotion" which is closer to this complex emotion is selected in English. At the same time, the emotional intensity in the last sentence is enhanced, and "tender sorrow" is used to convey the sad atmosphere of the original text.

[0092] 4) Practical Application Effects: In professional translation evaluation, compared with traditional translation systems, the accuracy of emotional expression has increased by 42.3%; in the user satisfaction survey, 94.6% of native speakers believe that the translation of this system can better convey the emotional color of the original text; in the translation test of literary works, the system can accurately identify and convey more than 90% of the culture - specific emotional expressions.

[0093] The following table shows the technical - index data of this application example:

[0094] The above describes the embodiments of the present invention. However, these embodiments are not limited to the above - mentioned specific implementation manners. The above - mentioned specific implementation manners are merely illustrative, not restrictive. Under the inspiration of this embodiment, those of ordinary skill in the art can also make more forms of equivalent embodiments, all of which fall within the protection scope of this embodiment.

Claims

1. A text emotion recognition method, characterized in that: The following steps are involved: Based on cognitive psychology theory, a multi-level emotion ontology is constructed, which divides emotions into three layers: basic emotions, complex emotions, and context-related emotions, forming the basic framework of the emotion ontology. Using a large-scale cultural corpus, we automatically extract specific emotion expression concepts from different cultural backgrounds through lexical network analysis, achieving a unified understanding of emotion expression in different cultural backgrounds. Based on the extracted emotional expression concepts, a cross-cultural emotional mapping relationship is established through the tensor product of cultural feature vectors and emotional concept vectors; Using the established mapping relationship, the semantic features of the input text are mapped to the nodes of the sentiment ontology. Through a hierarchical reasoning process, the fine-grained sentiment categories in the text are identified, and the sentiment understanding is adjusted by considering cultural background factors. According to the inference results, fine-grained sentiment classification is output, and the results are calibrated based on contextual information to improve the accuracy and adaptability of sentiment recognition.

2. The text emotion recognition method according to claim 1, characterized in that The steps to construct a multi-level emotion ontology include: Based on the basic emotion theory in cognitive psychology, a basic emotion set is determined, where each basic emotion includes an emotion label, an emotion intensity parameter, and an emotion description; Generate a set of composite emotions by weighted combination of basic emotions, where each composite emotion is defined as a weighted combination of basic emotions; Establish a context-related emotion set, modulate the composite emotion through context factors, and form a representation of the emotion expression in a specific context; Construct an emotion ontology graph structure and establish hierarchical relationships between emotion concepts.

3. The text emotion recognition method according to claim 2, characterized in that The calculation formula for composite emotion is: ; in, Indicates the Basic emotion categories, Indicates the A complex emotion, Expressing basic emotions In compound emotions The weight in Indicates that all The sum of the basic emotions; The calculation formula for context-related sentiment is: ; in, Indicates the context-dependent emotions; represents the context modulation function, which is used to map the composite emotion and context factors to context-related emotions; represents the set of context factors; Represents the continuous multiplication symbol, indicating that multiple factors are multiplied; Indicates that from Start with a contextual factor; represents the total number of contextual factors; Indicates the The influence function of contextual factors; Indicates the contextual factors; Represents the multiplication operator.

4. The text emotion recognition method according to claim 1, characterized in that The steps of culturally specific emotion concept extraction include: Targeting the target culture, collect text materials in the cultural context; Apply sentiment word extraction algorithms to each cultural corpus to identify potential sets of sentiment expression words; Applying a hierarchical clustering algorithm to the extracted sentiment vocabulary set to form sentiment concept clusters; A culture-specific emotion map is constructed based on emotion concept clusters, and edges are established based on emotion co-occurrence statistics.

5. The text emotion recognition method according to claim 4, characterized in that The calculation formula for sentiment vocabulary extraction is: ; in, Expressing vocabulary The sentiment score, Expressing vocabulary The inverse document frequency value of the term frequency, Expressing vocabulary and sentiment seed word set The semantic similarity is calculated as follows: ; in, Represents the maximum value operator, express Seed word set An element in represents the word vector representation, represents the cosine similarity function, Expressing vocabulary The word vector representation of Indicates seed word The word vector representation of .

6. The text emotion recognition method according to claim 1, characterized in that The steps of constructing a cross-cultural emotion mapping model include: For each target culture, a cultural feature vector is constructed, where the feature dimensions include language system characteristics, social and historical background, and quantitative representation of value orientation; For each sentiment concept, generate its vector representation; Through the tensor product of cultural feature vectors and emotional concept vectors, the mapping relationship between culture and emotional concepts is established; Based on the mapping tensor, the equivalence probability between emotional concepts in different cultural backgrounds is calculated, and a set of cross-cultural emotional equivalence mappings is established.

7. The text emotion recognition method according to claim 6, characterized in that The calculation formula of the cross-cultural sentiment mapping tensor is: ; in, represents the tensor product of the cultural feature vector and the emotional concept vector, Indicates the The characteristic vector of a culture, represents the tensor product operation, Indicates the Vector representation of emotion concepts.

8. The text emotion recognition method according to claim 1, characterized in that The steps performed by fine-grained sentiment reasoning include: Perform word segmentation, part-of-speech tagging, and syntactic analysis preprocessing on the input text to obtain a standardized text representation; Use pre-trained language models to extract semantic feature vectors of text; Analyze the contextual factors in the text, including the subject background, communication occasion, and emotional subject, and extract the contextual feature set; Identify the cultural context of the text based on text features or other relevant metadata; Match text feature vectors with sentiment concepts in sentiment ontology to identify sentiment expressions in texts; Based on the matching scores, emotion recognition is performed at different granularity levels.

9. The text emotion recognition method according to claim 1, characterized in that The steps for result output and calibration include: For each identified emotion, calculate its expression intensity in the text; Integrate emotion recognition results at different levels to form a hierarchical emotion representation; When there is conflict in the identified emotion set, conflict resolution is performed; Format and output the final emotion recognition results.

10. A text emotion recognition device, configured to execute the text emotion recognition method according to any one of claims 1 to 9, characterized in that: include: Multi-level emotion ontology construction module, used to construct multi-level emotion ontology based on cognitive psychology theory; Culturally specific emotion concept extraction module, used to extract specific emotion expression concepts in different cultural backgrounds; Cross-cultural emotion mapping model building module, used to establish cross-cultural emotion mapping relationships; A fine-grained sentiment reasoning execution module for identifying fine-grained sentiment categories in text; The result output and calibration module is used to output fine-grained sentiment classification and perform calibration.