Integrated emotion metaphor recognition method and device based on multi-scale semantic knowledge acquisition, equipment and medium
By adopting multi-scale semantic knowledge acquisition and integrated dynamic evolution model in emotional metaphor recognition, the problem of insufficient accuracy in emotional metaphor recognition in the prior art is solved, and more efficient and reliable emotional metaphor recognition is achieved.
Patent Information
- Application Number
- CN202510457307.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-14
AI Technical Summary
Existing emotional metaphor recognition methods are difficult to accurately identify and analyze emotional metaphors in texts, especially in massive text data, and lack effective integration and utilization of multi-scale semantic knowledge, resulting in insufficient recognition accuracy and robustness.
The integrated emotional metaphor recognition method based on the acquisition of multi-scale semantic knowledge is adopted. By constructing an emotional metaphor corpus, multi-scale marking and feature extraction, the optimal scale semantic matrix is obtained, and the integrated dynamic evolution model is used to identify metaphors and emotions to achieve collaborative recognition of metaphors and emotions.
It improves the accuracy and robustness of emotional metaphor recognition, avoids information loss in single-scale analysis, makes full use of the complementarity of multi-scale semantic information, and significantly improves the overall performance of recognition.
Smart Images

Figure CN120012783A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to an integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition. Background Art
[0002] As a special form of language expression, emotional metaphor plays an important role in human communication and cultural inheritance. With the rapid development of Internet technology, social media and online communication platforms have generated a large amount of text content containing emotional metaphors. The emotional metaphor information contained in these text data has important application value in fields such as user emotion analysis and intelligent interaction.
[0003] However, due to the diversity and complexity of emotional metaphors, as well as their strong context-dependent characteristics, accurately identifying and analyzing emotional metaphors in texts still faces great challenges. Especially in the current context of highly fragmented information, how to accurately capture emotional metaphor features from massive text data has become a key issue that needs to be solved in the field of natural language processing.
[0004] Existing methods for identifying emotional metaphors often separate metaphor identification from emotional identification, ignoring the intrinsic connection and mutual influence between the two. Traditional single-scale analysis methods are difficult to fully grasp the semantic features of texts, while simple feature superposition easily leads to information redundancy and noise interference.
[0005] At the same time, due to the lack of effective integration and utilization of multi-scale semantic knowledge, existing methods often perform poorly when dealing with complex contexts and subtle emotional differences. These problems seriously restrict the practical application of emotional metaphor recognition technology. Summary of the invention
[0006] The present invention provides an integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition to improve at least one of the above technical problems.
[0007] In a first aspect, the present invention provides an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition, which comprises steps S1 to S5.
[0008] S1. Acquire text data, and construct an emotional metaphor corpus based on the text data.
[0009] S2. Perform multi-scale labeling on the emotional metaphor corpus according to the text data to obtain a multi-scale feature matrix.
[0010] S3. Extract multi-scale semantic features from the multi-scale feature matrix according to the decision set to obtain the optimal scale semantic matrix.
[0011] S4, separating the prototype pattern vector and the test pattern vector from the optimal scale semantic matrix, and constructing a metaphor order parameter and an emotional order parameter reflecting the similarity of the two vectors by the inner product method. Then, reconstructing the order parameter by the integrated dynamic evolution model, and selecting the emotional metaphor annotation pattern of the sentence to be identified from the reconstructed order parameter.
[0012] S5. Identify metaphor labels and emotion categories in the text according to the emotion metaphor annotation pattern to obtain an emotion metaphor recognition result.
[0013] In an optional implementation, step S3 includes steps S31 to S34.
[0014] S31. According to the decision set The dataset All samples in are divided into . The data set is a set in the text data.
[0015] S32, take feature set The dataset All samples in are divided into .like ,but is the optimal scale combination, terminates the multi-scale semantic knowledge acquisition process, and outputs the optimal scale semantic matrix. Indicates The semantic feature set of scales, Indicates The feature of The value of a scale.
[0016] S33, if , then take the feature set The dataset All samples in are divided into .like ,but is the optimal scale combination, terminates the multi-scale semantic knowledge acquisition process, and outputs the optimal scale semantic matrix. The first feature The value of a scale.
[0017] S34, and so on, until the finest scale feature set of all features is obtained , then the multi-scale semantic knowledge acquisition process is terminated, the optimal scale combination is obtained, and the optimal scale semantic matrix is output.
[0018] In an optional implementation, step S4 specifically includes steps S41 to S44.
[0019] S41. Extract the row vectors corresponding to the known metaphors and emotion categories of the training set samples from the optimal scale semantic matrix as the prototype pattern vector .in, Represents the prototype, Represents the number of row vectors in the prototype pattern vector.
[0020] S42. Extract the row vector of the test set samples from the optimal scale semantic matrix as the test pattern vector .in, Indicates test, Represents the number of row vectors in the test pattern vector.
[0021] S43. According to the prototype pattern vector and the test pattern vector, a metaphor order parameter and a sentiment order parameter reflecting the similarity between the prototype pattern vector and the test pattern vector are constructed by an inner product method.
[0022] S44. Based on the principle of synergetics, an integrated dynamic evolution model is constructed. According to the metaphor order parameter and the emotional order parameter, the order parameters are reconstructed through the integrated dynamic evolution model of the metaphor order parameter and the integrated dynamic evolution model of the emotional order parameter. The reconstructed order parameters are sorted, and the prototype pattern vector corresponding to the highest order parameter is selected to determine whether the sentence to be identified belongs to the prototype pattern, and the emotional metaphor annotation pattern of the sentence to be identified is obtained.
[0023] In an optional implementation, the calculation model of the metaphor order parameter is: .
[0024] In an optional implementation, the calculation model of the sentiment order parameter is: .
[0025] in, Metaphor, Express emotions, is the number of sentences in the test set, Represents the prototype, represents the number of row vectors in the prototype pattern vector, Indicates test, represents the number of row vectors in the test pattern vector, The vector representing the prototype pattern part corresponding to the metaphor-related features, The vector representing the part of the test pattern corresponding to the metaphor-related features, Represents the prototype pattern part vector corresponding to the emotion-related features, Represents the test pattern part vector corresponding to the emotion-related features.
[0026] In an optional implementation, the integrated dynamics evolution model of the metaphorical order parameter is: .
[0027] In an optional embodiment, the integrated dynamics evolution model of the emotional order parameter is: .
[0028] in, Represents metaphorical order parameter, The emotional order parameter, Represents the order parameter, Metaphor, Express emotions, is the number of sentences in the test set, To pay attention to the parameters, used to control the speed of the test mode change, is the lateral inhibition coefficient, is the self-inhibition coefficient, for the pattern index, is the excitation parameter.
[0029] In the integrated dynamic evolution model, the parameter combination Together they determine the recognition performance of collaborative pattern recognition. and is the self-motivation term, which represents the feedback motivation of the model to itself. and It is a self-inhibition term, reflecting the inhibition of the model on its own excessive growth. and It is a lateral inhibition term, reflecting the mutual inhibition between modes, which is equivalent to a penalty term.
[0030] In an optional implementation, step S2 specifically includes step S21 to step S22.
[0031] S21. Extract linguistic features according to the text data, wherein the linguistic features include word meaning, and / or semantic role, and / or emotion, and / or phonology.
[0032] S22. According to the linguistic features, the classification of different scales of each sentence is determined respectively, and marked to obtain a multi-scale feature matrix.
[0033] In an optional implementation, step S1 specifically includes steps S11 to S13.
[0034] S11. Obtain text data.
[0035] S12, annotating the text data to obtain an emotional metaphor corpus. The annotation content includes whether there is a metaphor and the metaphor emotion category. The metaphor emotion category includes: happiness, good, anger, sadness, fear, hatred and shock.
[0036] S13, preprocessing the emotional metaphor corpus, wherein the preprocessing includes: filtering expressions and special characters in the text data by a regular expression matching string method, and / or performing word segmentation, and / or removing stop words.
[0037] In a second aspect, the present invention provides an integrated emotion metaphor recognition device based on multi-scale semantic knowledge acquisition, which includes a corpus module, a multi-scale module, a feature extraction module, a reconstruction module and an output module.
[0038] The corpus module is used to obtain text data and construct an emotional metaphor corpus based on the text data.
[0039] The multi-scale module is used to perform multi-scale labeling on the emotional metaphor corpus according to the text data to obtain a multi-scale feature matrix.
[0040] The feature extraction module is used to extract multi-scale semantic features from the multi-scale feature matrix according to the decision set to obtain the optimal scale semantic matrix.
[0041] The reconstruction module is used to separate the prototype pattern vector and the test pattern vector from the optimal scale semantic matrix, and construct the metaphor order parameter and the emotional order parameter reflecting the similarity of the two vectors through the inner product method. Then, the order parameter is reconstructed through the integrated dynamic evolution model, and the emotional metaphor annotation pattern of the sentence to be identified is screened from the reconstructed order parameter.
[0042] The output module is used to identify metaphor labels and emotion categories in the text according to the emotion metaphor annotation mode to obtain the emotion metaphor recognition result.
[0043] In a third aspect, the present invention provides an integrated emotion metaphor recognition device based on multi-scale semantic knowledge acquisition, comprising a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition as described in any paragraph of the first aspect.
[0044] In a fourth aspect, the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition as described in any paragraph of the first aspect.
[0045] By adopting the above technical solution, the present invention can achieve the following technical effects: The embodiment of the present invention provides an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition. The method constructs an emotion metaphor corpus and performs preprocessing, performs multi-scale annotation on the corpus to obtain a multi-scale feature matrix, uses a multi-scale semantic knowledge acquisition method to extract the optimal scale combination to obtain an optimal scale semantic matrix, outputs a prototype pattern vector and a test pattern vector based on the optimal scale semantic matrix, constructs metaphor order parameters and emotion order parameters to perform integrated emotion metaphor recognition, and finally obtains an emotion metaphor annotation pattern and outputs metaphor labels and emotion categories.
[0046] Through such a technical solution, multi-scale knowledge acquisition and integrated recognition are innovatively combined, the synergistic interaction and mutual constraint relationship between metaphor recognition and emotion recognition are considered, and the accuracy and robustness of emotion metaphor recognition are effectively improved. Through the multi-scale analysis method, text information of different scales is analyzed more comprehensively, avoiding the information loss that may be caused by a single scale, and providing more accurate and reliable recognition results for emotion metaphor recognition. While ensuring the recognition accuracy, this method fully utilizes the complementarity of multi-scale semantic information, significantly improves the overall performance of emotion metaphor recognition, and provides new technical ideas and solutions for research in related fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the specific implementation methods of the present invention. It should be understood that the following drawings only show certain specific implementation methods of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 Flowchart of the integrated emotion metaphor identification method.
[0049] Figure 2 The logical framework diagram of the integrated emotion metaphor identification method.
[0050] Figure 3 Schematic diagram of multi-scale annotation and multi-scale semantic knowledge acquisition in the integrated emotional metaphor recognition method.
[0051] Figure 4 An example diagram of multi-scale semantic knowledge acquisition in the integrated emotion metaphor identification method.
[0052] Figure 5 Schematic diagram of integrated emotion metaphor recognition in the integrated emotion metaphor recognition method. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] The technical problem to be solved by the present invention is that when performing emotional metaphor recognition, the lack of effective acquisition and integration of multi-scale semantic knowledge leads to insufficient feature extraction, which affects the recognition accuracy. Existing methods often separate metaphor recognition and emotion recognition and handle them separately, ignoring the synergistic interaction between the two, and are unable to accurately grasp the overall semantic characteristics of emotional metaphors. When processing complex corpus data, the failure to fully utilize text information at different scales leads to redundancy and information loss in the feature matrix. Traditional recognition methods lack effective processing of multi-scale semantic knowledge acquisition, which affects the robustness of the system.
[0055] The purpose of the embodiment of the present invention is to provide an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition. By constructing a multi-scale feature matrix and performing multi-scale semantic knowledge acquisition, the integrated processing of metaphor recognition and emotion recognition is realized, thereby solving the technical problems of the prior art in emotion metaphor recognition, such as insufficient accuracy and insufficient feature extraction.
[0056] Example 1, please refer to Figures 1 to 5 The first embodiment of the present invention provides an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition, which can be performed by an integrated emotion metaphor recognition device based on multi-scale semantic knowledge acquisition (hereinafter referred to as: integrated emotion metaphor recognition device). In particular, it is performed by one or more processors in the integrated emotion metaphor recognition device to implement steps S1 to S5.
[0057] It is understandable that the integrated emotion metaphor recognition device may be an electronic device with computing capabilities, such as a portable notebook computer, a desktop computer, a server, a smart phone or a tablet computer.
[0058] S1, obtaining text data, and constructing an emotional metaphor corpus according to the text data. Preferably, step S1 specifically includes steps S11 to S13.
[0059] S11. Obtain text data. Specifically, by collecting corpus from various channels such as online platforms, literary works, and news media, we focus on selecting text content with rich emotional expressions, such as poetry, prose, film reviews, and social media comments.
[0060] S12, annotating the text data to obtain an emotional metaphor corpus. The annotation content includes whether there is a metaphor and the metaphor emotion category. The metaphor emotion category includes: happiness, good, anger, sadness, fear, hatred and shock.
[0061] Specifically, the collected original texts are manually annotated, including whether the text contains metaphorical expressions (yes - 0 / no - 1), and the seven basic emotion types (happy - 1 / good - 2 / anger - 3 / sad - 4 / fear - 5 / hate - 6 / shock - 7), so as to establish a corpus with dual annotations of emotion and metaphor.
[0062] S13, preprocessing the emotional metaphor corpus, wherein the preprocessing includes: filtering expressions and special characters in the text data by a regular expression matching string method, and / or performing word segmentation, and / or removing stop words.
[0063] Specifically, for the established emotional metaphor corpus, we first use the regular expression method to clean up the interference information such as special symbols and emoticons in the text, and then use the word segmentation component "jieba" to segment the text to obtain a sequence of several words, and remove stop words to finally obtain a standardized text sequence.
[0064] Then, the processed data set is divided into training set and validation set according to a certain ratio to prepare for subsequent model training and testing.
[0065] S2, based on the text data, perform multi-scale labeling on the emotional metaphor corpus to obtain a multi-scale feature matrix. Preferably, step S2 specifically includes steps S21 to S22.
[0066] S21. Extract linguistic features according to the text data, wherein the linguistic features include word meaning, and / or semantic role, and / or emotion, and / or phonology.
[0067] S22. According to the linguistic features, the classification of different scales of each sentence is determined respectively, and marked to obtain a multi-scale feature matrix.
[0068] Single-scale labeling means that each sample takes only one certain value on the attribute. However, for example, a student's grades can be divided into pass or fail. It can also be divided into three levels: high, medium and low. It can be further refined into five levels: excellent, good, medium, bad and unacceptable. In order to fully capture semantic information, multi-scale labeling is introduced. Multi-scale labeling means that each sample takes different values on the same attribute according to different scales, that is, each attribute is a multi-scale attribute.
[0069] The embodiment of the present invention extracts linguistic features such as word meaning, semantic role, emotion and phonology from the corpus, and then performs multi-scale labeling on the corpus based on these linguistic features to generate a multi-dimensional feature matrix space, in which each dimension represents a feature matrix corresponding to a different scale (i.e., a multi-scale semantic feature space).
[0070] The multi-scale semantic feature space is , Indicates that The dataset feature matrix at the layer scale, Indicates the number of scales. ,in, Indicates The sentence in The layer scale The rows in the matrix represent the values of the The sentence in The corresponding feature vector at the layer scale.
[0071] Below are examples of scales for word meaning, semantic role, sentiment, and phonology.
[0072] "Word meaning" is divided into abstract word meaning and concrete word meaning in terms of abstract and concrete scales. Among them, abstract word meaning refers to the word meaning that expresses abstract concepts, emotions, etc., such as "love" and "freedom". Concrete word meaning refers to the word meaning that expresses concrete things, actions, etc., such as "table" and "run".
[0073] "Word meaning" is divided into the following categories in the semantic domain: person, thing, action, state, etc. For example, "doctor" belongs to the person domain, "apple" belongs to the thing domain, "running" belongs to the action domain, and "happy" belongs to the state domain.
[0074] "Word meaning" is divided into synonymy, antonymy, hyponymy, etc. in the semantic relationship scale. For example, "big" and "small" are antonyms, and "animal" and "dog" are hyponyms.
[0075] "Semantic roles" are divided into action-related scales: action performers and action recipients. For example, action performers can be divided into autonomous performers and involuntary performers. Autonomous performers refer to roles that actively and consciously perform actions, such as "he" in "he voluntarily completes the task." Involuntary performers refer to roles that passively or unconsciously perform actions, such as "he" in "he was asked to do something." Action recipients can be divided into direct recipients and indirect recipients. Direct recipients are objects that are directly affected by the action, such as "the ball" in "the ball was kicked." Indirect recipients are objects that are indirectly affected by the action, such as "I" in "he told me a secret."
[0076] "Semantic roles" are divided into: time, place, and reason in the non-action-related scale. Among them, time can be divided into specific time points, time periods, time frequencies, etc. For example: "in the morning", "within a week", "every day". Places can be divided into starting points, end points, passing points, places, etc., such as "starting from Beijing", "to Shanghai", "through Nanjing", "in Beijing". Reasons can be divided into direct reasons, indirect reasons, subjective reasons, objective reasons, etc., such as "because he worked hard", "due to bad weather", "out of curiosity", "because of traffic jams".
[0077] "Emotion" is divided into strong emotion, medium emotion and weak emotion in the emotion intensity scale. Strong emotion includes "ecstasy" and "rage", medium emotion includes "happy" and "angry", and weak emotion includes "pleasure" and "dissatisfaction".
[0078] "Emotion" is divided into the following categories in the emotional dimension scale: valence dimension (positive, negative), arousal dimension (high arousal, low arousal), complexity dimension (simple emotion, mixed emotion), etc. For example, "excitement" belongs to positive, high arousal, simple emotion, and "jealousy" belongs to negative, medium arousal, mixed emotion.
[0079] "Emotion" is divided into basic emotion types such as joy, anger, sorrow, happiness, love, hate, fear, etc. on the emotion type scale, as well as other complex emotion types derived from this, such as "pride", "shame", "guilt", etc.
[0080] In other embodiments, those skilled in the art may also extract other linguistic features without being limited to the above four, and the present invention does not make any specific limitation on this.
[0081] S3, extracting multi-scale semantic features from the multi-scale feature matrix according to the decision set to obtain the optimal scale semantic matrix. Figure 3 and 4 As shown, step S3 includes steps S31 to S34.
[0082] Preferably, the number of linguistic features is Each feature has The same scale, then the multi-scale feature set is .Right now ,in, The larger the value, the coarser the scale. is the sequence number of the feature. For the A multi-scale feature set of linguistic features. For the The first linguistic feature The multi-scale feature matrix of scales.
[0083] The multi-scale semantic knowledge acquisition method refers to selecting the coarsest scale combination that best represents the semantic data features and satisfies a given decision task in the multi-scale semantic feature space. The multi-scale semantic knowledge acquisition method starts with selecting features from the coarsest scale. Figure 4 As shown, the process of semantic knowledge acquisition in a multi-scale semantic feature space of three scales is demonstrated.
[0084] S31. According to the decision set The dataset All samples in are divided into . The data set is the text data in step S1. The “decision set” refers to the classification basis or target label set used to guide the multi-scale semantic knowledge acquisition process. It contains the emotional metaphor annotation information of each sample in the corpus, namely the metaphor label (with metaphor or without metaphor) and the emotional category (happy, good, angry, sad, fearful, evil, and surprised).
[0085] S32, take feature set The dataset All samples in are divided into .like ,but is the optimal scale combination, terminates the multi-scale semantic knowledge acquisition process, and outputs the optimal scale semantic matrix. Indicates The semantic feature set of scales, Indicates The feature of The value of a scale.
[0086] S33, if , then take the feature set The dataset All samples in are divided into .like ,but is the optimal scale combination, terminates the multi-scale semantic knowledge acquisition process, and outputs the optimal scale semantic matrix. The first feature The value of a scale.
[0087] S34, and so on, until the finest scale feature set of all features is obtained , then the multi-scale semantic knowledge acquisition process is terminated, the optimal scale combination is obtained, and the optimal scale semantic matrix is output .
[0088] S4, separating the prototype pattern vector and the test pattern vector from the optimal scale semantic matrix, and constructing a metaphor order parameter and an emotional order parameter reflecting the similarity of the two vectors by the inner product method. Then reconstructing the order parameter by the integrated dynamic evolution model, and selecting the emotional metaphor annotation pattern of the sentence to be identified from the reconstructed order parameter. Preferably, as Figure 5 As shown, step S4 includes steps S41 to S44.
[0089] S41. From the optimal scale semantic matrix Extract the row vectors corresponding to the known metaphors and emotional categories of the training set samples as the prototype pattern vector .in, Represents the prototype, Represents the number of row vectors in the prototype pattern vector.
[0090] Specifically, the embodiment of the present invention extracts the row vectors corresponding to the known metaphors and emotion categories of the training set samples from the optimal scale semantic matrix as the prototype pattern vector. The prototype pattern vector represents the typical pattern of the known emotion and metaphor labels (such as the category center or all training instances such as "joy + metaphor" and "sorrow + non-metaphor".
[0091] The prototype pattern vector represents a typical set of features of a category and is a centralized representation of the category. For example, in the semantic prototype theory, "sparrow" is a bird prototype, and its feature vector contains high-frequency common features such as feathers and flying ability.
[0092] S42. From the optimal scale semantic matrix Separate test pattern vector .in, Indicates test, Represents the number of row vectors in the test pattern vector. The test pattern vector represents the feature vector of the object to be classified and is used to calculate the similarity with the prototype vector.
[0093] S43. According to the prototype pattern vector and the test pattern vector, a metaphor order parameter and a sentiment order parameter reflecting the similarity between the prototype pattern vector and the test pattern vector are constructed by an inner product method.
[0094] The calculation model of metaphor order parameter is: .
[0095] The calculation model of emotional order parameters is: .
[0096] in, Represents the order parameter, Metaphor, Express emotions, is the number of sentences in the test set, Represents the prototype, represents the number of row vectors in the prototype pattern vector, Indicates test, represents the number of row vectors in the test pattern vector, The vector representing the prototype pattern part corresponding to the metaphor-related features, The vector representing the part of the test pattern corresponding to the metaphor-related features, Represents the prototype pattern part vector corresponding to the emotion-related features, Represents the test pattern part vector corresponding to the emotion-related features.
[0097] S44. Based on the principle of synergetics, an integrated dynamic evolution model is constructed. According to the metaphor order parameter and the emotional order parameter, the order parameters are reconstructed through the integrated dynamic evolution model of the metaphor order parameter and the integrated dynamic evolution model of the emotional order parameter. The reconstructed order parameters are sorted, and the prototype pattern vector corresponding to the highest order parameter is selected to determine whether the sentence to be identified belongs to the prototype pattern, and the emotional metaphor annotation pattern of the sentence to be identified is obtained.
[0098] The integrated dynamic evolution model of metaphorical order parameters is: .
[0099] The integrated dynamic evolution model of emotional order parameters is: .
[0100] in, Represents metaphorical order parameter, The emotional order parameter, Represents the order parameter, Metaphor, Express emotions, is the number of sentences in the test set, To pay attention to the parameters, used to control the speed of the test mode change, is the lateral inhibition coefficient, is the self-inhibition coefficient, for the pattern index, is the excitation parameter.
[0101] In the integrated dynamic evolution model, the parameter combination Together they determine the recognition performance of collaborative pattern recognition. and is the self-motivation term, which represents the feedback motivation of the model to itself. and It is a self-inhibition term, reflecting the inhibition of the model on its own excessive growth. and It is a lateral inhibition term, reflecting the mutual inhibition between modes, which is equivalent to a penalty term.
[0102] By introducing According to the prior knowledge relationship between emotion and metaphor, it can stimulate or inhibit the recognition of metaphor and the determination of emotion, thus achieving the purpose of integrated labeling. B = C =1.2, Take 0.18, 0.36, 0.54 and 0.72 respectively.
[0103] In this embodiment, .in, Control parameters separately, To express sentiment annotation, Used to indicate metaphorical marking, The value range is [0,1]. Indicates the driving force of emotion on metaphor, Represents a feature vector containing sentiment prior knowledge. Indicates the relationship between metaphors. It represents the feature vector containing metaphor prior knowledge, and the relationship between metaphors is suitable for driving metaphor recognition. Refers to the guidance of metaphor on emotion, Represents the feature vector containing metaphor prior knowledge.
[0104] The calculation model is: .
[0105] .
[0106] .
[0107] in, is the number of words in the sentence, is the serial number of the positive example, is the serial number of the negative example, is the weighting coefficient of the number of positive examples, is the weighted coefficient of the number of negative examples, Is the natural base. and It is a connecting symbol used to connect the two formulas above and below. It can be eliminated by substituting the latter two equations into the first equation to make the formula more concise and clear, without any specific meaning.
[0108] In the prior knowledge, when the probability of the input selected emotional information appearing in a certain metaphor is greater than a certain threshold (taken as 0.9 in the experiment), the positive examples increase. When the input selected semantic information is unlikely to appear in a certain type of role or the probability of appearing in a certain type of role is less than a certain threshold (taken as 0.1 in the experiment), the negative examples increase.
[0109] Settings and Similarly, it mainly reflects the logical constraints between metaphors. There are some inherent soft and hard constraints between the metaphors of words in a sentence. In the prior knowledge, when the role of the input test vector meets the constraints, the positive examples increase. On the contrary, when the role of the input test vector violates the constraints, the negative examples increase.
[0110] Settings and Similarly, it mainly reflects the guiding role of metaphor on emotion. In the prior knowledge, when the probability of the input metaphor vector appearing in a certain type of emotion is greater than a certain threshold (taken as 0.9 in the experiment), the positive examples increase. When the role vector cannot appear in a certain type of emotion or the probability of appearing in a certain type of emotion is less than a certain threshold (taken as 0.1 in the experiment), the negative examples increase.
[0111] S5. Identify the metaphor labels and emotion categories in the text to be identified according to the emotion metaphor annotation pattern, and obtain the emotion metaphor recognition result. Specifically, the prototype pattern vector represents one label, for example: with metaphor, without metaphor, sad..., etc. It is determined that the sentence to be identified belongs to the prototype pattern vector corresponding to the highest order parameter, that is, the predicted label of the sentence to be identified is determined. Therefore, according to the emotion metaphor annotation pattern, the metaphor labels and emotion categories in the text to be identified can be directly obtained, thereby obtaining the emotion metaphor recognition result.
[0112] The embodiment of the present invention provides an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition. The method constructs an emotion metaphor corpus and performs preprocessing, performs multi-scale annotation on the corpus to obtain a multi-scale feature matrix, uses a multi-scale semantic knowledge acquisition method to extract the optimal scale combination to obtain an optimal scale semantic matrix, outputs a prototype pattern vector and a test pattern vector based on the optimal scale semantic matrix, constructs metaphor order parameters and emotion order parameters to perform integrated emotion metaphor recognition, and finally obtains an emotion metaphor annotation pattern and outputs metaphor labels and emotion categories.
[0113] Through such a technical solution, multi-scale knowledge acquisition and integrated recognition are innovatively combined, the synergistic interaction and mutual constraint relationship between metaphor recognition and emotion recognition are considered, and the accuracy and robustness of emotion metaphor recognition are effectively improved. Through the multi-scale analysis method, text information of different scales is analyzed more comprehensively, avoiding the information loss that may be caused by a single scale, and providing more accurate and reliable recognition results for emotion metaphor recognition. While ensuring the recognition accuracy, this method fully utilizes the complementarity of multi-scale semantic information, significantly improves the overall performance of emotion metaphor recognition, and provides new technical ideas and solutions for research in related fields.
[0114] The embodiments of the present invention provide an innovative combination of multi-scale knowledge acquisition and integrated recognition, taking into account the synergistic interaction and mutual constraint between metaphor recognition and emotion recognition, effectively improving the accuracy and robustness of emotion metaphor recognition, more comprehensively analyzing text information at different scales, and providing a more accurate emotion metaphor recognition method.
[0115] In several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0117] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk. It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0118] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0119] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0120] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0121] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0122] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition, characterized in that: Include: Acquiring text data, and constructing an emotional metaphor corpus based on the text data; According to the text data, multi-scale labeling is performed on the emotional metaphor corpus to obtain a multi-scale feature matrix; Extract multi-scale semantic features from the multi-scale feature matrix according to the decision set to obtain the optimal scale semantic matrix; Separating the prototype pattern vector and the test pattern vector from the optimal scale semantic matrix, and constructing a metaphor order parameter and an emotional order parameter reflecting the similarity of the two vectors by an inner product method; then reconstructing the order parameters by an integrated dynamic evolution model, and selecting the emotional metaphor annotation pattern of the sentence to be identified from the reconstructed order parameters; The metaphor labels and emotion categories in the text are identified according to the emotion metaphor annotation mode to obtain the emotion metaphor recognition result.
2. The integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to claim 1 is characterized in that: According to the decision set, multi-scale semantic features are extracted from the multi-scale feature matrix to obtain the optimal scale semantic matrix, which specifically includes: According to the decision set The dataset All samples in are divided into ; wherein the data set is a set in the text data; Get feature set The dataset All samples in are divided into ;like ,but is the optimal scale combination, terminates the multi-scale semantic knowledge acquisition process, and outputs the optimal scale semantic matrix; Indicates The semantic feature set of scales, Indicates The feature of The value of the scale; like , then take the feature set The dataset All samples in are divided into ;like ,but is the optimal scale combination, terminates the multi-scale semantic knowledge acquisition process, and outputs the optimal scale semantic matrix; The first feature The value of the scale; And so on, until the finest scale feature set of all features is obtained. , then the multi-scale semantic knowledge acquisition process is terminated, the optimal scale combination is obtained, and the optimal scale semantic matrix is output.
3. The integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to claim 1 is characterized in that: The prototype pattern vector and the test pattern vector are separated from the optimal scale semantic matrix, and a metaphor order parameter and an emotional order parameter reflecting the similarity of the two vectors are constructed by the inner product method; then the order parameter is reconstructed by the integrated dynamic evolution model, and the emotional metaphor annotation pattern of the sentence to be identified is screened out from the reconstructed order parameter, specifically including: Extract the row vectors corresponding to the known metaphors and emotion categories of the training set samples from the optimal scale semantic matrix as the prototype pattern vector ;in, Represents the prototype, represents the number of row vectors in the prototype pattern vector; Extract the row vector of the test set samples from the optimal scale semantic matrix as the test pattern vector ;in, Indicates test, represents the number of row vectors in the test pattern vector; According to the prototype pattern vector and the test pattern vector, a metaphor order parameter and an emotion order parameter reflecting the similarity between the prototype pattern vector and the test pattern vector are constructed by an inner product method; An integrated dynamic evolution model is constructed based on the principle of synergetics. According to the metaphor order parameters and the emotional order parameters, the order parameters are reconstructed through the integrated dynamic evolution model of the metaphor order parameters and the integrated dynamic evolution model of the emotional order parameters. The reconstructed order parameters are sorted, and the prototype pattern vector corresponding to the highest order parameter is selected to determine whether the sentence to be identified belongs to the prototype pattern, so as to obtain the emotional metaphor annotation pattern of the sentence to be identified.
4. The integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to claim 3 is characterized in that: The calculation model of metaphor order parameter is: ; The calculation model of emotional order parameters is: ; in, Metaphor, Express emotions, is the number of sentences in the test set, Represents the prototype, represents the number of row vectors in the prototype pattern vector, Indicates test, represents the number of row vectors in the test pattern vector, The vector representing the prototype pattern part corresponding to the metaphor-related features, The vector representing the part of the test pattern corresponding to the metaphor-related features, Represents the prototype pattern part vector corresponding to the emotion-related features, Represents the test pattern part vector corresponding to the emotion-related features.
5. The integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to claim 1 is characterized in that: The integrated dynamic evolution model of metaphorical order parameters is: ; The integrated dynamic evolution model of emotional order parameters is: ; in, Represents metaphorical order parameter, The emotional order parameter, Represents the order parameter, Metaphor, Express emotions, is the number of sentences in the test set, To pay attention to the parameters, used to control the speed of the test mode change, is the lateral inhibition coefficient, is the self-inhibition coefficient, for the pattern index, is the incentive parameter; In the integrated dynamic evolution model, the parameter combination Together they determine the recognition performance of collaborative pattern recognition; and is the self-motivation term, which represents the feedback motivation effect of the model on itself; and It is a self-inhibition term, reflecting the inhibition of the model on its own excessive growth; and It is a lateral inhibition term, reflecting the mutual inhibition between modes, which is equivalent to a penalty term.
6. The integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to any one of claims 1 to 5, characterized in that: According to the text data, the emotional metaphor corpus is multi-scale labeled to obtain a multi-scale feature matrix, which specifically includes: Extracting linguistic features according to the text data; wherein the linguistic features include word meaning, and / or semantic role, and / or emotion, and / or phonology; According to the linguistic features, the classification of different scales of each sentence is determined respectively, and marked to obtain a multi-scale feature matrix.
7. The integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to any one of claims 1 to 5, characterized in that: Acquiring text data and constructing an emotional metaphor corpus based on the text data, specifically including: Get text data; Annotating the text data to obtain an emotional metaphor corpus; wherein the annotation content includes whether there is a metaphor and the metaphor emotion category; the metaphor emotion category includes: happiness, good, anger, sadness, fear, hatred and shock; The emotional metaphor corpus is preprocessed; wherein the preprocessing includes: filtering expressions and special characters in the text data by a regular expression matching string method, and / or performing word segmentation, and / or removing stop words.
8. An integrated emotional metaphor recognition device based on multi-scale semantic knowledge acquisition, characterized in that: Include: A corpus module, used to obtain text data and construct an emotional metaphor corpus based on the text data; A multi-scale module, used to perform multi-scale labeling on the emotional metaphor corpus according to the text data to obtain a multi-scale feature matrix; A feature extraction module is used to extract multi-scale semantic features from the multi-scale feature matrix according to the decision set to obtain the optimal scale semantic matrix; A reconstruction module is used to separate the prototype pattern vector and the test pattern vector from the optimal scale semantic matrix, and construct a metaphor order parameter and an emotional order parameter reflecting the similarity of the two vectors through an inner product method; then reconstruct the order parameter through an integrated dynamic evolution model, and select the emotional metaphor annotation pattern of the sentence to be identified from the reconstructed order parameter; The output module is used to identify metaphor labels and emotion categories in the text according to the emotion metaphor annotation mode to obtain the emotion metaphor recognition result.
9. An integrated emotional metaphor recognition device based on multi-scale semantic knowledge acquisition, characterized in that: It includes a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to implement an integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the integrated emotion metaphor recognition method based on multi-scale semantic knowledge acquisition as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for extracting text semantic data based on implicit sentiment word analysis
CN112329472A
Emotion classification model construction method based on metaphor recognition
CN114942991A
Text-oriented metaphor recognition model and method
CN117669591A
Method for constructing sentiment classification model based on metaphor identification
US20230289528A1
Sentiment classification model construction method based on metaphor identification
WO2023168805A1
Cited By
Granule calculation-based multi-mode co-evolution anti-interference identification method and device
CN120892869A
Content marketing semantic analysis method and system based on natural language processing
CN121351824A
Content marketing semantic analysis method and system based on natural language processing
CN121351824B