Integrated Sentiment Metaphor Recognition Method, Device, Equipment and Medium Based on Multi-Scale Semantic Knowledge Acquisition
By constructing an emotional metaphor corpus and performing multi-scale marking and feature extraction, combined with an integrated dynamic evolution model, the problem of separation between metaphor recognition and emotional recognition in the existing technology is solved, and more accurate and reliable emotional metaphor recognition is achieved.
Patent Information
- Application Number
- CN202510457307.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-04-14
AI Technical Summary
The existing emotional metaphor recognition methods ignore the intrinsic connection between metaphor recognition and emotional recognition, resulting in poor recognition effectiveness in complex contexts and subtle emotional differences processing, lack of effective integration of multi-scale semantic knowledge, affecting the accuracy and robustness of recognition.
By constructing an emotional metaphor corpus, multi-scale marking and feature extraction, using multi-scale semantic knowledge acquisition methods, combining integrated dynamic evolution model, metaphor order parameters and emotional order parameters are constructed to achieve coordinated recognition of metaphor and emotion.
It improves the accuracy and robustness of emotional metaphor recognition, makes full use of the complementarity of multi-scale semantic information, and significantly improves the overall performance of recognition.
Smart Images

Figure CN120012783B_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. Separate the prototype pattern vector and the test pattern vector from the optimal scale semantic matrix, and construct a metaphor order parameter and an emotion order parameter reflecting the similarity of the two vectors through the inner product method. Then, reconstruct the order parameters through the integrated dynamics evolution model, and screen out the emotion metaphor annotation pattern of the sentence to be recognized from the reconstructed order parameters.
[0012] S5. Identify the metaphor label and emotion category in the text according to the emotion metaphor annotation pattern to obtain the emotion metaphor recognition result.
[0013] In an alternative embodiment, step S3 includes steps S31 to S34.
[0014] S31. According to the decision set Partition all the samples in the data set , denoted as partition . Among them, the data set is the set in the text data.
[0015] S32. Take the feature set Partition all the samples in the data set , denoted as partition . If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix. Among them, represents the semantic feature set of the th scale, represents the value of the th feature at the th scale.
[0016] S33. If , then take the feature set Partition all the samples in the data set , denoted as partition . If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix. Among them, represents the value of the th scale of the first feature.
[0017] S34. And so on, until the feature set of the finest scale of all features is taken, then terminate the multi-scale semantic knowledge acquisition process, obtain the optimal scale combination, and output the optimal scale semantic matrix.
[0018] In an alternative embodiment, step S4 specifically includes steps S41 to S44.
[0019] S41. Extract the corresponding row vectors that match the known metaphors and sentiment categories of the training set samples from the optimal scale semantic matrix as the prototype pattern vectors . Among them, represents the prototype, represents the number of row vectors in the prototype pattern vector.
[0020] S42. Extract the row vectors of the test set samples from the optimal scale semantic matrix as the test pattern vectors . Among them, represents the 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, construct metaphor order parameters and sentiment order parameters that reflect the similarity between the prototype pattern vector and the test pattern vector through the inner product method.
[0022] S44. Build an integrated dynamic evolution model based on the synergetics principle. According to the metaphor order parameter and the sentiment order parameter, reconstruct the order parameters through the integrated dynamic evolution model of the metaphor order parameter and the integrated dynamic evolution model of the sentiment order parameter. And sort the reconstructed order parameters, select the prototype pattern vector corresponding to the highest order parameter, determine that the sentence to be recognized belongs to this prototype pattern, and obtain the emotional metaphor annotation pattern of the sentence to be recognized.
[0023] In an optional embodiment, the calculation model of the metaphor order parameter is:[[]] .
[0024] In an optional embodiment, the calculation model of the sentiment order parameter is:[[]] .
[0025] Among them, represents the metaphor, represents the sentiment, is the number of sentences in the test set, represents the prototype, represents the number of row vectors in the prototype pattern vector, represents the test, represents the number of row vectors in the test pattern vector, represents the partial vector of the prototype pattern corresponding to the metaphor-related feature, represents the partial vector of the test pattern corresponding to the metaphor-related feature, represents the partial vector of the prototype pattern corresponding to the sentiment-related feature, represents the partial vector of the test pattern corresponding to the sentiment-related feature.
[0026] In an alternative embodiment, the integrated dynamic evolution model of the metaphor order parameter is as follows:
[0027] 。
[0028] In an alternative embodiment, the integrated dynamic evolution model of the emotion order parameter is as follows:
[0029] 。
[0030] Wherein, represents the metaphor order parameter, represents the emotion order parameter, represents the order parameter, represents the metaphor, represents the emotion, is the number of sentences in the test set, is the attention parameter used to control the speed of change of the pattern to be tested, is the lateral inhibition coefficient, is the self-inhibition coefficient, is the pattern index, is the excitation parameter.
[0031] In the integrated dynamic evolution model, the parameter combination jointly determines the recognition performance of the cooperative pattern recognition. and are self-excitation terms, representing the feedback excitation effect of the pattern on itself. and are self-inhibition terms, reflecting the inhibition of the pattern's excessive growth. and are lateral inhibition terms, reflecting the mutual inhibition effect between patterns, equivalent to a penalty term.
[0032] In an alternative embodiment, step S2 specifically includes steps S21 to S22.
[0033] S21. Extract linguistic features according to the text data. Among them, the linguistic features include word meaning, and / or semantic role, and / or emotion, and / or phonology.
[0034] S22. According to the linguistic features, respectively judge the classifications of each sentence at different scales and perform marking to obtain a multi-scale feature matrix.
[0035] In an alternative embodiment, step S1 specifically includes steps S11 to S13.
[0036] S11. Obtain text data.
[0037] S12. Annotate the text data to obtain an emotional metaphor corpus. Among them, the annotation content includes whether there is a metaphor and the metaphor emotional category. The metaphor emotional category includes: happiness, goodness, anger, sadness, fear, disgust, and surprise.
[0038] S13. Preprocess the emotional metaphor corpus. Among them, the preprocessing includes: filtering out expressions and special characters in the text data by means of regular expression matching strings, and / or performing word segmentation, and / or removing stop words.
[0039] In a second aspect, the present invention provides an integrated emotional 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.
[0040] The corpus module is used to obtain text data and construct an emotional metaphor corpus according to the text data.
[0041] The multi-scale module is used to perform multi-scale marking on the emotional metaphor corpus according to the text data to obtain a multi-scale feature matrix.
[0042] The feature extraction module is used to perform multi-scale semantic feature extraction on the multi-scale feature matrix according to the decision set to obtain an optimal scale semantic matrix.
[0043] The 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 by the inner product method. Then, the order parameter is reconstructed through an integrated dynamics evolution model, and an emotional metaphor annotation pattern of the sentence to be recognized is screened out from the reconstructed order parameter.
[0044] The output module is used to recognize the metaphor label and emotional category in the text according to the emotional metaphor annotation pattern to obtain an emotional metaphor recognition result.
[0045] In a third aspect, the present invention provides an integrated emotional metaphor recognition device based on multi-scale semantic knowledge acquisition, which 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 emotional metaphor recognition method as described in any paragraph of the first aspect.
[0046] In a fourth aspect, the present invention provides a computer-readable storage medium, which includes a stored computer program. Among them, when the computer program runs, it controls the device where the computer-readable storage medium is located to execute an integrated emotional metaphor recognition method as described in any paragraph of the first aspect.
[0047] By adopting the above technical solutions, the present invention can achieve the following technical effects:
[0048] An integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition provided by an embodiment of the present invention preprocesses by constructing an emotional metaphor corpus, performs multi-scale annotation on the corpus to obtain a multi-scale feature matrix, extracts an optimal scale combination by using a multi-scale semantic knowledge acquisition method 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 emotional order parameters for integrated emotional metaphor recognition, and finally obtains an emotional metaphor annotation pattern and outputs a metaphor label and an emotional category.
[0049] Through such a technical solution, the combination of multi-scale knowledge acquisition and integrated recognition is innovatively realized, the synergistic interaction and mutual restriction relationship between metaphor recognition and emotional recognition are considered, and the accuracy and robustness of emotional metaphor recognition are effectively improved. Through the multi-scale analysis method, the text information at different scales is analyzed more comprehensively, avoiding the information loss that may be brought by a single scale, and providing a more accurate and reliable recognition result for emotional metaphor recognition. While ensuring the recognition accuracy rate, this method makes full use of the complementarity of multi-scale semantic information, significantly improves the overall performance of emotional metaphor recognition, and provides new technical ideas and solutions for the research in related fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for use in the specific embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some specific embodiments of the present invention, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0051] Figure 1 It is a flowchart of the integrated emotional metaphor recognition method.
[0052] Figure 2 It is a logic block diagram of the integrated emotional metaphor recognition method.
[0053] Figure 3 It is a schematic diagram of multi-scale annotation and multi-scale semantic knowledge acquisition in the integrated emotional metaphor recognition method.
[0054] Figure 4 It is an example diagram of multi-scale semantic knowledge acquisition in the integrated emotional metaphor recognition method.
[0055] Figure 5 It is a schematic diagram of integrated recognition of emotional metaphors in the integrated emotional metaphor recognition method. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] Next, with reference to the accompanying drawings in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0057] The technical problems to be solved by the present invention are that in the process of emotional metaphor recognition, due to the lack of effective acquisition and integration of multi-scale semantic knowledge, the feature extraction is insufficient, affecting the recognition accuracy. Existing methods often separate metaphor recognition and emotion recognition for separate processing, ignoring the synergistic interaction relationship between the two, and being unable to accurately grasp the overall semantic features of emotional metaphors. When dealing with complex corpus data, due to the failure to fully utilize text information at different scales, there are problems of redundancy and information loss in the feature matrix. Traditional recognition methods lack effective processing of multi-scale semantic knowledge acquisition, affecting the robustness of the system.
[0058] The purpose of the embodiments of the present invention is to provide an integrated emotional 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, solving technical problems such as insufficient accuracy and insufficient feature extraction in the existing technology for emotional metaphor recognition.
[0059] Embodiment 1. Please refer to Figures 1 to 5 , the first embodiment of the present invention provides an integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition, which can be executed by an integrated emotional metaphor recognition device based on multi-scale semantic knowledge acquisition (hereinafter referred to as: integrated emotional metaphor recognition device). Specifically, it is executed by one or more processors in the integrated emotional metaphor recognition device to implement steps S1 to S5.
[0060] It can be understood that the integrated emotional metaphor recognition device can be an electronic device with computing performance such as a portable notebook computer, a desktop computer, a server, a smart phone, or a tablet computer.
[0061] S1. Obtain text data and construct an emotional metaphor corpus according to the text data. Preferably, step S1 specifically includes steps S11 to S13.
[0062] S11. Obtain text data. Specifically, corpus collection is carried out through diversified channels such as network platforms, literary works, and news media, and text content rich in emotional expressions such as poems, essays, film reviews, and social media comments is mainly selected.
[0063] S12. Annotate the text data to obtain an emotional metaphor corpus. The annotation content includes whether there is a metaphor and the metaphor emotional category. The metaphor emotional categories include: happiness, goodness, anger, sadness, fear, disgust, and surprise.
[0064] Specifically, perform manual annotation on the collected original text. The annotation content includes whether the text contains metaphorical expressions (yes - 0 / no - 1) and the seven basic emotional types it belongs to (happiness - 1 / goodness - 2 / anger - 3 / sadness - 4 / fear - 5 / disgust - 6 / surprise - 7), so as to establish a corpus with double annotation of emotion and metaphor.
[0065] S13. Preprocess the emotional metaphor corpus. The preprocessing includes: filtering the emoticons and special characters in the text data by the method of matching strings with regular expressions, and / or performing word segmentation, and / or removing stop words.
[0066] Specifically, for the established emotional metaphor corpus, first clean the interference information such as special symbols and emoticons in the text by the regular expression method, then use the word segmentation component "jieba" to perform word segmentation on the text to obtain a sequence of several words, and remove the stop words, and finally obtain a normalized text sequence.
[0067] Then, divide the processed data set into a training set and a validation set according to a certain ratio to prepare for subsequent model training and testing.
[0068] S2. Perform multi - scale marking on the emotional metaphor corpus according to the text data to obtain a multi - scale feature matrix. Preferably, step S2 specifically includes steps S21 to S22.
[0069] S21. Extract linguistic features according to the text data. The linguistic features include word meaning, and / or semantic role, and / or emotion, and / or phonology.
[0070] S22. According to the linguistic features, respectively judge the classifications of different scales of each sentence and perform marking to obtain a multi - scale feature matrix.
[0071] Single - scale marking means that each sample only takes a definite value in terms of attributes. However, for example, a student's grade can be divided into pass or fail. It can also be divided into three levels: high, medium, and low. Further, it can be refined into five levels: excellent, good, medium, bad, and unacceptable. In order to comprehensively capture semantic information, multi - scale marking is introduced. Multi - scale marking means that each sample takes different values according to different scales on the same attribute, that is, each attribute is a multi - scale attribute.
[0072] In the embodiments of the present invention, linguistic features such as word meaning, semantic roles, sentiment, and phonology are extracted from the corpus, and then the corpus is multi-scale labeled based on these linguistic features to generate a multi-dimensional feature matrix space, where each dimension represents a feature matrix corresponding to a different scale (i.e., a multi-scale semantic feature space).
[0073] The multi-scale semantic feature space is , which represents the dataset feature matrix at the -th layer scale, and represents the number of scales. , where represents the -th sentence's value of the -th degree classification at the -th layer scale. The rows in the matrix represent the feature vectors corresponding to the -th sentence at the -th layer scale.
[0074] The following are examples of the scales of word meaning, semantic roles, sentiment, and phonology.
[0075] "Word meaning" is divided into abstract and concrete scales: abstract word meaning and concrete word meaning. Among them, abstract word meaning refers to word meanings representing abstract concepts, emotions, etc., such as "love", "freedom", etc. Concrete word meaning refers to word meanings representing specific things, actions, etc., such as "table", "run", etc.
[0076] "Word meaning" is divided in the semantic domain scale into: person, thing, action, state, etc. For example, "doctor" belongs to the person domain, "apple" belongs to the thing domain, "run" belongs to the action domain, and "happy" belongs to the state domain.
[0077] "Word meaning" is divided in the semantic relationship scale into: synonymy, antonymy, hyponymy, etc. For example, "big" and "small" are in an antonymous relationship, and "animal" and "dog" are in a hyponymous relationship.
[0078] "Semantic role" is divided in the action-related scale into: action executor and action recipient. For example, action executors can be divided into autonomous executors and non-autonomous executors. An autonomous executor is a role that actively and consciously executes an action, such as "he" in "he voluntarily completed the task". A non-autonomous executor is a role that executes an action passively or unconsciously, such as "he" in "he was required to do something". Action recipients can be divided into direct recipients and indirect recipients. A direct recipient is the object directly affected by the action, such as "the ball" in "the ball was kicked". An indirect recipient is the object indirectly affected by the action, such as "me" in "he told me a secret".
[0079] "Semantic roles" are classified on a non-action-related scale into: time, place, and cause. 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". Place can be divided into starting point, ending point, passing point, location, etc., such as "departing from Beijing", "arriving in Shanghai", "passing through Nanjing", "in Beijing". Cause can be divided into direct cause, indirect cause, subjective cause, objective cause, etc., such as "because he worked hard", "due to bad weather", "out of curiosity", "because of traffic congestion".
[0080] "Emotion" is classified on an emotional intensity scale into: strong emotion, medium emotion, and weak emotion. Strong emotions such as "ecstasy", "rage", etc., medium emotions such as "happy", "angry", etc., and weak emotions such as "pleasure", "dissatisfaction", etc.
[0081] "Emotion" is classified on an emotional dimension scale into: 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.
[0082] "Emotion" is classified on an emotional type scale into: basic emotion types such as joy, anger, sorrow, happiness, love, hatred, fear, etc., and other complex emotion types derived therefrom, such as "pride", "shame", "guilt", etc.
[0083] In other embodiments, those skilled in the art can also extract other linguistic features without being limited to the above four, and the present invention does not make specific limitations thereto.
[0084] S3. Perform multi-scale semantic feature extraction on the multi-scale feature matrix according to the decision set to obtain the optimal scale semantic matrix. Preferably, as Figure 3 and 4 shown, step S3 includes steps S31 to S34.
[0085] Preferably, the number of linguistic features is . Each feature has identical scales, then the multi-scale feature set is . That is , where the larger it is, the coarser the corresponding scale. is the serial number of the feature. Among them, is the multi-scale feature set of the th linguistic feature. is the th scale multi-scale feature matrix of the th linguistic feature.
[0086] The multi-scale semantic knowledge acquisition method refers to selecting the coarsest scale combination in the multi-scale semantic feature space that can best represent the semantic data features and meet the given decision task. The multi-scale semantic knowledge acquisition method starts selecting features from the coarsest granularity scale. As Figure 4 shown, it demonstrates the process of semantic knowledge acquisition in the multi-scale semantic feature space of three scales.
[0087] S31. Divide all samples in the data set according to the decision set , and denote it as division . Among them, the data set is the text data in step S1. The "decision set" refers to the classification basis or target label set for guiding the multi-scale semantic knowledge acquisition process. It contains the emotional metaphor annotation information of each sample in the corpus, that is, the metaphor label (with metaphor or without metaphor) and the emotional category (happy, good, angry, sad, fearful, disgusted, surprised).
[0088] S32. Take the feature set and divide all samples in the data set , and denote it as division . If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix. Among them, represents the semantic feature set of the th scale, represents the value of the th feature at the th scale.
[0089] S33. If , then take the feature set and divide all samples in the data set , and denote it as division . If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix. Among them, represents the value of the th scale of the first feature.
[0090] S34. And so on, until the feature set of the finest scale of all features is taken, then terminate the multi-scale semantic knowledge acquisition process, obtain the optimal scale combination, and output the optimal scale semantic matrix .
[0091] S4. Separate the prototype pattern vector and the test pattern vector from the optimal scale semantic matrix, and construct a metaphor order parameter and an emotion order parameter reflecting the similarity of the two vectors through the inner product method. Then, reconstruct the order parameters through the integrated dynamics evolution model, and screen out the emotional metaphor annotation patterns of the sentences to be recognized from the reconstructed order parameters. Preferably, as Figure 5 shown, step S4 includes steps S41 to S44.
[0092] S41. Extract the corresponding row vectors that conform to the known metaphors and emotion categories of the training set samples from the optimal scale semantic matrix as the prototype pattern vector . Among them, represents the prototype, represents the number of row vectors in the prototype pattern vector.
[0093] Specifically, in the embodiment of the present invention, the corresponding row vectors that conform to the known metaphors and emotion categories of the training set samples are extracted from the optimal scale semantic matrix as the prototype pattern vector. The prototype pattern vector represents the typical patterns of known emotions and metaphor labels (such as the category centers or all training instances of "happy + metaphor", "sad + non - metaphor", etc.).
[0094] The prototype pattern vector represents the set of typical example features of a certain category and is the centralized representation of this category. For example, in the semantic prototype theory, "sparrow" is the prototype of birds, and its feature vector contains high - frequency common features such as feathers and flying ability.
[0095] S42. Separate the test pattern vector from the optimal scale semantic matrix . Among them, represents the 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 for calculating the similarity with the prototype vector.
[0096] S43. According to the prototype pattern vector and the test pattern vector, construct a metaphor order parameter and an emotion order parameter reflecting the similarity between the prototype pattern vector and the test pattern vector through the inner product method.
[0097] The calculation model of the metaphor order parameter is: .
[0098] The calculation model of the emotion order parameter is: .
[0099] Among them, represents the order parameter, represents the metaphor, represents the emotion, is the number of sentences in the test set, denotes the prototype, denotes the number of row vectors in the prototype mode vector, denotes the test, denotes the number of row vectors in the test mode vector, denotes the partial vector of the prototype mode corresponding to the metaphor-related feature, denotes the partial vector of the test mode corresponding to the metaphor-related feature, denotes the partial vector of the prototype mode corresponding to the emotion-related feature, denotes the partial vector of the test mode corresponding to the emotion-related feature.
[0100] S44. Construct an integrated dynamic evolution model based on the principle of synergetics. According to the metaphor order parameter and the emotion order parameter, reconstruct the order parameters through the integrated dynamic evolution model of the metaphor order parameter and the integrated dynamic evolution model of the emotion order parameter. Then sort the reconstructed order parameters, select the prototype mode vector corresponding to the highest order parameter, determine that the sentence to be recognized belongs to this prototype mode, and obtain the emotional metaphor annotation mode of the sentence to be recognized.
[0101] The integrated dynamic evolution model of the metaphor order parameter is:
[0102] .
[0103] The integrated dynamic evolution model of the emotion order parameter is:
[0104] .
[0105] Among them, denotes the metaphor order parameter, denotes the emotion order parameter, denotes the order parameter, denotes the metaphor, denotes the emotion, is the number of sentences in the test set, is the attention parameter, used to control the speed of change of the mode to be tested, is the lateral inhibition coefficient, is the self-inhibition coefficient, is the mode index, is the excitation parameter.
[0106] In the integrated dynamic evolution model, the parameter combination jointly determines the recognition performance of the cooperative pattern recognition. and are self-excitation terms, representing the feedback excitation effect of the mode on itself. and are self-inhibition terms, reflecting the inhibition of the mode's excessive growth on itself. and is the lateral inhibition term, which reflects the mutual inhibition between patterns and is equivalent to a penalty term.
[0107] By introducing , according to the prior knowledge relationship between emotion and metaphor, it plays an incentive or inhibitory role in the recognition of metaphor and the determination of emotion, achieving the purpose of integrated annotation. In the formula, take B = C =1.2, and take 0.18, 0.36, 0.54, and 0.72 in turn.
[0108] In this embodiment, . Among them, respectively control the parameters, is used to represent emotion annotation, is used to represent metaphor annotation, The value range of is [0,1]. represents the drive of emotion to metaphor, represents the feature vector containing emotion prior knowledge. represents the relationship between metaphors, represents the feature vector containing metaphor prior knowledge, and the relationship between metaphors is suitable for driving the recognition of metaphor. refers to the guidance of metaphor to emotion, represents the feature vector containing metaphor prior knowledge.
[0109] The calculation model of is:
[0110] .
[0111] .
[0112] .
[0113] Among them, is the number of words in the sentence, is the serial number of the positive example item, is the serial number of the negative example item, is the weighted coefficient of the number of items of the positive example item, is the weighted coefficient of the number of items of the negative example item, is the natural base. and are connection symbols used to connect the upper and lower two formulas. Substituting the latter two equalities into the first equality can eliminate it to make the formula more concise and clear, and it has no specific meaning.
[0114] In prior knowledge, when the probability that the selected sentiment information in the input appears in a certain metaphor is greater than a certain threshold (set to 0.9 in the experiment), the number of positive example items increases. When the probability that the selected semantic information in the input cannot appear in a certain role or appears in a certain role is less than a certain threshold (set to 0.1 in the experiment), the number of negative example items increases.
[0115] The setting of and is similar, which mainly reflects the logical constraint conditions between metaphors. There are some inherent soft and hard constraints between the metaphors of words in a sentence. In prior knowledge, when the role of the input test vector satisfies the constraint conditions, the number of positive example items increases. Conversely, when the role of the input test vector violates the constraint conditions, the number of negative example items increases.
[0116] The setting of and is similar, which mainly reflects the guiding role of metaphor on sentiment. In prior knowledge, when the probability that the input metaphor vector appears in a certain sentiment is greater than a certain threshold (set to 0.9 in the experiment), the number of positive example items increases. When the role vector cannot appear in a certain sentiment or the probability of appearing in a certain sentiment is less than a certain threshold (set to 0.1 in the experiment), the number of negative example items increases.
[0117] S5. Identify the metaphor label and sentiment category in the text to be identified according to the sentiment metaphor annotation pattern, and obtain the sentiment metaphor recognition result. Specifically, the prototype pattern vector represents one kind of label, for example: one of the labels such as having metaphor, no metaphor, sad... etc. Determine that the sentence to be identified belongs to the prototype pattern vector corresponding to the highest order parameter, that is, determine the prediction label of the sentence to be identified. Therefore, according to the sentiment metaphor annotation pattern, the metaphor label and sentiment category in the text to be identified can be directly obtained, so as to obtain the sentiment metaphor recognition result.
[0118] An integrated sentiment metaphor recognition method based on multi-scale semantic knowledge acquisition provided by an embodiment of the present invention constructs a sentiment 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 a metaphor order parameter and a sentiment order parameter for integrated sentiment metaphor recognition, finally obtains a sentiment metaphor annotation pattern and outputs a metaphor label and a sentiment category.
[0119] Through such a technical solution, the multi-scale knowledge acquisition is innovatively combined with the integrated recognition, taking into account the synergistic interaction and mutual restriction relationship between metaphor recognition and sentiment recognition, effectively improving the accuracy and robustness of sentiment metaphor recognition. Through the multi-scale analysis method, the text information at different scales is analyzed more comprehensively, avoiding the information loss that may be caused by a single scale, and providing a more accurate and reliable recognition result for sentiment metaphor recognition. While ensuring the recognition accuracy, this method makes full use of the complementarity of multi-scale semantic information, significantly improving the overall performance of sentiment metaphor recognition and providing new technical ideas and solutions for the research in related fields.
[0120] The embodiment of the present invention innovatively combines multi-scale knowledge acquisition with integrated recognition, takes into account the synergistic interaction and mutual restriction relationship between metaphor recognition and sentiment recognition, effectively improves the accuracy and robustness of sentiment metaphor recognition, analyzes the text information at different scales more comprehensively, and provides a more accurate method for sentiment metaphor recognition.
[0121] In several embodiments provided by the embodiment of the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device and method embodiments described above are only illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of 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 blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0122] In addition, the functional modules in each embodiment of the present invention can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.
[0123] When the above-mentioned function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical discs that can store program codes. 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 not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
[0124] 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", "the" and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0125] It should be understood that the term "and / or" used herein 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 simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0126] Depending on the context, the word "if" as used herein can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detected (stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".
[0127] The "first / second" mentioned in the embodiments is only used to distinguish similar objects and does not represent a specific order for the objects. It can be understood that the "first / second" can be interchanged in a specific order or sequence under allowable circumstances. It should be understood that the objects distinguished by the "first / second" can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0128] The foregoing are only preferred embodiments of the present invention and are 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 within 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, Comprising: Obtain text data and construct an emotional metaphor corpus according to the text data; Perform multi-scale labeling on the emotional metaphor corpus according to the text data to obtain a multi-scale feature matrix; Perform multi-scale semantic feature extraction on the multi-scale feature matrix according to the decision set to obtain an optimal-scale semantic matrix; According to the decision set Partition all samples in the data set , denoted as partition ; among them, the data set is the set in the text data; Obtain the feature set Divide all samples in the dataset , denoted as division ; If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix; where represents the semantic feature set of the -th scale, represents the value of the -th feature at the -th scale; If , then take the feature set and partition all samples in the data set , denoted as partition ; If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix; where represents the value of the -th scale of the first feature; And so on until the feature set of the finest scale 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; 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 the inner product method; then reconstruct the order parameter through an integrated dynamics evolution model, and screen out the emotional metaphor annotation pattern of the sentence to be recognized from the reconstructed order parameter; Extract the corresponding row vectors that match the known metaphors and sentiment categories of the training set samples from the optimal scale semantic matrix as prototype pattern vectors ; where represents the prototype, represents the number of row vectors in the prototype pattern vector; Extract the row vectors of the test set samples from the optimal scale semantic matrix as test pattern vectors ; where represents testing, represents the number of row vectors in the test pattern vector; According to the prototype pattern vector and the test pattern vector, construct a metaphor order parameter and an emotional order parameter reflecting the similarity between the prototype pattern vector and the test pattern vector through the inner product method; Construct an integrated dynamics evolution model based on the synergetics principle. According to the metaphor order parameter and the emotional order parameter, reconstruct the order parameter through the integrated dynamics evolution model of the metaphor order parameter and the integrated dynamics evolution model of the emotional order parameter; and sort the reconstructed order parameter, select the prototype pattern vector corresponding to the highest order parameter, determine that the sentence to be recognized belongs to this prototype pattern, and obtain the emotional metaphor annotation pattern of the sentence to be recognized; Identify the metaphor label and emotional category in the text according to the emotional metaphor annotation pattern to obtain an emotional metaphor recognition result.
2. The integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to claim 1, wherein The calculation model of the metaphor order parameter is as follows: ; The calculation model of the emotional order parameter is as follows: ; Among them, represents metaphor, represents emotion, is the number of sentences in the test set, represents prototype, represents the number of row vectors in the prototype pattern vector, represents test, represents the number of row vectors in the test pattern vector, represents the partial vector of the prototype pattern corresponding to the metaphor-related feature, represents the partial vector of the test pattern corresponding to the metaphor-related feature, represents the partial vector of the prototype pattern corresponding to the emotion-related feature, represents the partial vector of the test pattern corresponding to the emotion-related feature.
3. An integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to claim 1, characterized in that The integrated dynamics evolution model of the metaphor order parameter is: ; The integrated dynamics evolution model of the emotional order parameter is: ; Among them, represents the metaphorical order parameter, represents the emotional order parameter, represents the order parameter, represents the metaphor, represents the emotion, is the number of sentences in the test set, is the attention parameter used to control the speed of change of the pattern to be tested, is the lateral inhibition coefficient, is the self-inhibition coefficient, is the pattern index, is the excitation parameter; In the integrated kinetic evolution model, the parameter combination jointly determines the recognition performance of collaborative pattern recognition; and are self-excitation terms, representing the feedback excitation of the pattern on itself; and are self-inhibition terms, reflecting the inhibition of the pattern's excessive growth on itself; and are lateral inhibition terms, reflecting the mutual inhibition between patterns, equivalent to a penalty term.
4. An integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to any one of claims 1 to 3, characterized in that Perform multi-scale labeling on the emotional metaphor corpus according to the text data to obtain a multi-scale feature matrix, specifically including: 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; According to the linguistic features, respectively judge the classification of each sentence at different scales and perform labeling to obtain a multi-scale feature matrix.
5. An integrated emotional metaphor recognition method based on multi-scale semantic knowledge acquisition according to any one of claims 1 to 3, characterized in that Obtain text data and construct an emotional metaphor corpus according to the text data, specifically including: Obtain text data; Perform annotation on the text data to obtain an emotional metaphor corpus; wherein, the annotation content includes whether there is a metaphor and the metaphor emotional category; the metaphor emotional categories include: joy, goodness, anger, sorrow, fear, disgust, and surprise; Perform preprocessing on the emotional metaphor corpus; wherein, the preprocessing includes: filtering out emojis and special characters in the text data by using the method of regular expression matching strings, and / or performing word segmentation, and / or removing stop words.
6. An integrated emotion metaphor recognition device based on multi-scale semantic knowledge acquisition, characterized in that Comprising: A corpus module for obtaining text data and constructing an emotional metaphor corpus according to the text data; A multi-scale module for performing multi-scale labeling on the emotional metaphor corpus according to the text data to obtain a multi-scale feature matrix; A feature extraction module for performing multi-scale semantic feature extraction on the multi-scale feature matrix according to the decision set to obtain an optimal-scale semantic matrix; According to the decision set divide all samples in the data set , denoted as partition ; among them, the data set is the set in the text data; Extract the feature set Partition all samples in the data set and denote it as partition ; If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix; where represents the semantic feature set of the th scale, represents the value of the th feature at the th scale; If , then take the feature set and partition all samples in the data set , denoted as partition ; If , then is the optimal scale combination, terminate the multi-scale semantic knowledge acquisition process, and output the optimal scale semantic matrix; where represents the value of the -th scale of the first feature; And so on until the feature set at the finest scale 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. A reconstruction module, which 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 emotion order parameter reflecting the similarity of the two vectors through the inner product method; then reconstruct the order parameters through an integrated dynamics evolution model, and screen out the emotional metaphor annotation pattern of the sentence to be recognized from the reconstructed order parameters; Extract the corresponding row vectors that match the known metaphors and sentiment categories of the training set samples from the optimal scale semantic matrix as prototype pattern vectors ; among them, represents the prototype, represents the number of row vectors in the prototype pattern vector; Extract the row vectors of the test set samples from the optimal scale semantic matrix as test pattern vectors ; where represents testing represents the number of row vectors in the test pattern vector; According to the prototype pattern vector and the test pattern vector, construct a metaphor order parameter and an emotion order parameter reflecting the similarity of the prototype pattern vector and the test pattern vector through the inner product method; Build an integrated dynamics evolution model based on the synergetics principle. According to the metaphor order parameter and the emotion order parameter, reconstruct the order parameters through the integrated dynamics evolution model of the metaphor order parameter and the integrated dynamics evolution model of the emotion order parameter; and sort the reconstructed order parameters, select the prototype pattern vector corresponding to the highest order parameter, determine that the sentence to be recognized belongs to this prototype pattern, and obtain the emotional metaphor annotation pattern of the sentence to be recognized; An output module, which is used to identify the metaphor label and the emotion category in the text according to the emotional metaphor annotation pattern, and obtain the emotional metaphor recognition result.
7. An integrated emotion 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 emotional metaphor recognition method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute an integrated emotional metaphor recognition method according to any one of claims 1 to 5.
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