Sentiment Metaphor Recognition Method and Device Based on Knowledge Extraction and Co-Evolutionary Reasoning
By constructing an emotional metaphor corpus and performing feature vectorization, fuzzy multi-grained knowledge extraction and dynamic evolution reasoning are used to solve the accuracy and efficiency problems in emotional metaphor recognition, and efficient and accurate emotional metaphor recognition and emotional category annotation are achieved.
Patent Information
- Application Number
- CN202510480934.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-17
AI Technical Summary
The prior art has problems in the recognition of emotional metaphor, inefficient feature extraction, and difficulty in dealing with noise and redundant information in large-scale text data, especially in the fusion of multi-grained feature and collaborative reasoning.
Using a method based on knowledge extraction and collaborative evolution reasoning, we construct an emotional metaphor corpus and perform feature vectorization processing, and using fuzzy multi-grained knowledge extraction technology to extract multi-grained knowledge, combining matching networks and competitive networks for dynamic evolution processing to achieve accurate recognition of emotional metaphors.
It significantly improves the accuracy and robustness of emotional metaphor recognition, can effectively remove noise and redundant features, improve the accuracy of feature selection and the model's ability to capture the internal structure of the data, and provide more comprehensive and accurate technical support.
Smart Images

Figure CN120011864B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and particularly to a method and device for emotion metaphor recognition based on knowledge extraction and co-evolution reasoning. Background Art
[0002] In today's digital age, natural language processing (NLP), as a key area of artificial intelligence, is constantly evolving and widely applied in multiple scenarios such as information extraction, sentiment analysis, and intelligent customer service. Sentiment analysis, as an important branch among them, aims to identify and understand the sentiment tendency from text, and has extremely high application value in fields such as business decision-making, public opinion monitoring, and social governance. However, emotional expressions are not always direct and explicit. Metaphor, as a complex and common language phenomenon, is often used to convey emotional information. Emotional metaphors enhance the expressiveness of language by associating abstract emotions with concrete things or concepts, but also pose great challenges to automatic recognition.
[0003] The recognition of emotional metaphors not only requires understanding the literal meaning of the text, but also delving into the implicit meaning and emotional color behind it. This complexity stems from the polysemy, cultural dependence, and context sensitivity of metaphors. For example, the same metaphor may express different emotions in different contexts, and may even be misunderstood due to cultural differences. In addition, with the rise of social media and online platforms, a large amount of text data is mixed with a lot of noise and redundant information, which further interferes with the accurate recognition of emotional metaphors.
[0004] Traditional natural language processing methods often rely on rules or simple statistical models when dealing with emotional metaphors, but these methods are difficult to handle complex and ever-changing metaphorical expressions and semantic diversity. In recent years, although deep learning technologies have made remarkable progress in feature extraction and pattern recognition, there are still limitations in dealing with emotional metaphors. On the one hand, deep learning models usually require a large amount of labeled data for training, and the labeling work of emotional metaphors is both time-consuming and complex; on the other hand, these models lack the simulation of the human cognitive process and are difficult to effectively handle the dynamics and multi-granularity features of metaphors.
[0005] In addition, the recognition of emotional metaphors also faces multi-dimensional challenges. For example, the semantics of emotional metaphors may span multiple granularity levels, from word meaning to sentence structure, and then to discourse context, and each level may contain key information. However, existing technologies still have deficiencies in multi-granularity feature fusion and co-inference, and it is difficult to make full use of knowledge at different granularities to improve the recognition accuracy. At the same time, noise and redundant information in large-scale text data will also interfere with the training and inference processes of the model, resulting in low recognition efficiency and insufficient accuracy.
[0006] Therefore, in the current field of emotional metaphor recognition, there is an urgent need for a new method that can effectively process multi-granularity features, simulate the dynamics of the cognitive process, and have an efficient noise filtering ability. This method should be able to accurately identify emotional metaphors in complex contexts and output metaphor labels and emotional categories simultaneously, providing more comprehensive and accurate technical support for sentiment analysis.
[0007] In view of this, the present application is proposed. Summary of the Invention
[0008] The present invention provides a method and device for emotional metaphor recognition based on knowledge extraction and co-evolution reasoning, which can at least partially improve the above problems.
[0009] To achieve the above object, the present invention adopts the following technical solutions:
[0010] A method for emotional metaphor recognition based on knowledge extraction and co-evolution reasoning, comprising:
[0011] According to the preset public corpus data, construct an emotional metaphor corpus, divide the training corpus set and the test corpus set from the emotional metaphor corpus, and perform feature vectorization processing on the training corpus set and the test corpus set to obtain feature vectors;
[0012] Based on the fuzzy multi-granularity knowledge extraction technology, perform extraction processing on the feature vectors, extract multi-granularity knowledge, and obtain prototype pattern vectors and test pattern vectors;
[0013] Use a matching network to construct the prototype pattern vectors and the test pattern vectors to construct and generate emotional metaphor order parameters;
[0014] Input the emotional metaphor order parameters into a competitive network for dynamic evolution processing to obtain an emotional metaphor annotation pattern, and obtain an evolution result based on the emotional metaphor annotation pattern;
[0015] Annotate the evolution result to obtain an annotation result, and identify the metaphor label and emotional category in the text according to the annotation result to obtain an emotional metaphor recognition result.
[0016] The present invention also provides a device for emotional metaphor recognition based on knowledge extraction and co-evolution reasoning, comprising:
[0017] A corpus processing unit, configured to construct an emotional metaphor corpus according to the preset public corpus data, divide the training corpus set and the test corpus set from the emotional metaphor corpus, and perform feature vectorization processing on the training corpus set and the test corpus set to obtain feature vectors;
[0018] A knowledge extraction unit, which is used to perform extraction processing on the feature vectors based on the fuzzy multi-granularity knowledge extraction technology, extract multi-granularity knowledge, and obtain a prototype pattern vector and a test pattern vector;
[0019] A matching network unit, which is used to perform construction processing on the prototype pattern vector and the test pattern vector by using a matching network, and construct and generate an emotional metaphor order parameter;
[0020] An evolution inference unit, which is used to input the emotional metaphor order parameter into a competitive network for dynamic evolution processing to obtain an emotional metaphor annotation pattern, and obtain an evolution result based on the emotional metaphor annotation pattern;
[0021] An annotation recognition unit, which is used to annotate the evolution result to obtain an annotation result, and identify metaphor labels and emotional categories in the text according to the annotation result to obtain an emotional metaphor recognition result.
[0022] In summary, the emotional metaphor recognition method based on knowledge extraction and co-evolution inference aims to solve the problems of insufficient accuracy in emotional metaphor recognition, low efficiency in feature extraction, and difficulty in processing noise and redundant information in large-scale text data in the prior art. Its core lies in performing word embedding processing on text data, converting it into a vector representation and combining it into a matrix; through the fuzzy multi-granularity knowledge extraction technology, based on granule sphere calculation and purity threshold screening, constructing a list of granule spheres that meet the conditions, and using a variable-precision fuzzy dependence function to evaluate the importance of candidate features, and finally generating an optimized feature reduction matrix. This process effectively removes noise and redundant features, retains key features with strong discrimination ability, and significantly improves the efficiency and accuracy of feature selection.
[0023] Furthermore, a prototype pattern vector and a test pattern vector are separated from the feature reduction matrix, and numerical matrices of a training set and a test set are respectively constructed. An emotional metaphor order parameter is constructed through a matching network and input into a competitive network for a dynamic evolution process. This dynamic evolution mechanism can effectively identify the annotation pattern of emotional metaphors, and parallelly output metaphor labels and emotional categories through the annotation result, and finally realize the accurate recognition of emotional metaphors. By combining fuzzy multi-granularity knowledge extraction and co-evolution inference, this method not only improves the accuracy and robustness of emotional metaphor recognition, but also provides an efficient technical solution for emotional metaphor analysis. Its innovative technical path can effectively handle the complexity in high-dimensional text data, solve the limitations of traditional methods in processing large-scale text data, and provide a more accurate and efficient solution for the fields related to emotional metaphors, with important academic and application values. Description of the Drawings
[0024] Figure 1 is a schematic flowchart of an emotional metaphor recognition method based on knowledge extraction and co-evolution inference provided by the first embodiment of the present invention;
[0025] Figure 2 It is a flowchart of the emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning provided by the first embodiment of the present invention;
[0026] Figure 3 It is a flowchart of the fuzzy multi-granularity knowledge extraction part of the emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning provided by the first embodiment of the present invention;
[0027] Figure 4 It is a schematic diagram of the emotional metaphor recognition of the emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning provided by the first embodiment of the present invention;
[0028] Figure 5 It is a schematic diagram of the principle structure of the emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning provided by the first embodiment of the present invention;
[0029] Figure 6 It is a schematic diagram of the modules of the emotional metaphor recognition device based on knowledge extraction and co-evolution reasoning provided by the second embodiment of the present invention. Detailed implementation manners
[0030] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0031] In the prior art, there are problems that the accuracy and efficiency of emotional metaphor recognition are affected due to the noise and redundant information contained in high-dimensional text data; when dealing with large-scale text data, it is difficult to effectively cope with the recognition accuracy problems brought by semantic ambiguity and context interference; when the traditional recognition model faces multi-level semantic features, the system performance is limited due to the single knowledge representation and lack of dynamic evolution ability; when dealing with complex emotional metaphor expressions, the lack of multi-granularity understanding of the knowledge structure affects the recognition accuracy and efficiency. Based on this, the present invention provides an innovative solution to solve the technical problems such as insufficient recognition accuracy and limited reasoning ability faced by the prior art when dealing with large-scale emotional metaphor texts. Specifically:
[0032] Refer to Figure 1 、 Figure 2 、 Figure 5 As shown, the first embodiment of the present invention discloses an emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning, which can be executed by an emotional metaphor recognition device based on knowledge extraction and co-evolution reasoning (hereinafter referred to as the recognition device), and particularly, executed by one or more processors in the recognition device to implement the following method:
[0033] S1. Construct an emotional metaphor corpus according to the preset public corpus data, divide the training corpus set and the test corpus set from the emotional metaphor corpus, and perform feature vectorization processing on the training corpus set and the test corpus set to obtain feature vectors;
[0034] Specifically, step S1 includes: obtaining text data from the preset public corpus data, and performing annotation processing on each text data to construct an emotional metaphor corpus, where the annotation processing includes metaphor presence / absence annotation and emotional category annotation;
[0035] Perform division processing on the emotional metaphor corpus to obtain a training corpus set and a test corpus set, and perform text preprocessing on the training corpus set and the test corpus set, where the text preprocessing includes word segmentation processing and stop word removal processing;
[0036] Extract multiple linguistic features from the preprocessed training corpus set and test corpus set, where the linguistic features include: word meaning, semantic role, emotion, and phonology;
[0037] Based on the linguistic features, construct a feature dictionary, map each linguistic feature to an ID, and represent each sentence as a feature vector, where each dimension corresponds to a feature ID in the feature dictionary.
[0038] Preferably, the emotional category annotation includes joy, goodness, anger, sorrow, fear, disgust, and surprise.
[0039] In this embodiment, to obtain rich text data from the preset public corpus data, these text data can cover various types, such as text types rich in emotional colors like novels, dramas, lyrics, and microblog comments. They mainly come from the Internet, corpus, and book data documents to ensure the diversity and representativeness of the corpus. After obtaining the text data, perform detailed annotation processing on each text data to construct an emotional metaphor corpus. The annotation processing includes metaphor presence / absence annotation and emotional category annotation. The emotional categories can include joy, goodness, anger, sorrow, fear, disgust, surprise, etc. Through manual annotation, ensure the accuracy and reliability of the annotation. Simply put, after obtaining the text data, perform screening. For example: about 10,000 texts are collected in the first round, and about 2,000 remain after screening. Perform manual annotation on each piece of data: metaphor label (metaphor - 0 / no metaphor - 1), emotional category (joy - 1 / goodness - 2 / anger - 3 / sorrow - 4 / fear - 5 / disgust - 6 / surprise - 7), and construct an emotional metaphor corpus.
[0040] Next, the constructed emotional metaphor corpus is divided to obtain a training corpus and a test corpus. The division ratio can be set according to actual needs. For example, a common ratio is 80% for the training set and 20% for the test set. Then, text preprocessing is performed on the training corpus and the test corpus. Text preprocessing includes word segmentation and stop word removal. Word segmentation is to split the text data into individual words for subsequent feature extraction and analysis. Stop word removal is to remove common meaningless stop words in the text, such as "de", "shi", "zai", etc., to reduce the interference of noise information on the recognition results and improve the accuracy and efficiency of emotional metaphor recognition.
[0041] After completing the text preprocessing, multiple linguistic features are extracted from the preprocessed training corpus and test corpus. These linguistic features include word meaning, semantic role, emotion, and phonology, etc. The word meaning feature can reflect the basic meaning of a word; the semantic role feature can reveal the semantic role of a word in a sentence; the emotion feature can reflect the emotional tendency expressed by the text; the phonology feature can provide auxiliary information for the recognition of emotional metaphors from the phonetic level. By extracting these multi-dimensional linguistic features, the characteristics of the text can be described more comprehensively, laying a foundation for subsequent emotional metaphor recognition.
[0042] Based on the extracted linguistic features, a feature dictionary is constructed, and each linguistic feature is mapped to a unique ID. In this way, each sentence can be represented as a feature vector, where each dimension corresponds to a feature ID in the feature dictionary. Through this method, the text data is transformed into a numerical feature vector, which is convenient for subsequent calculation and processing. This feature vectorization processing method can not only effectively integrate multiple linguistic features, but also improve the processing efficiency and accuracy of the emotional metaphor recognition system, enabling it to better handle the processing requirements of large-scale text data.
[0043] Briefly speaking, in this embodiment, the training set and the test set are divided from the constructed emotional metaphor corpus. The text data is divided into a sequence of words using the word segmentation component "jieba", and stop words are removed to obtain the final word order. Linguistic features such as word meaning, semantic role, emotion, and phonology are extracted from the corpus, a feature dictionary is constructed, each feature is mapped to an ID, and each sentence is represented as a feature vector, where each dimension corresponds to a feature ID in the feature dictionary. Using a row vector x i to represent the feature vector corresponding to the i th sentence, then a corpus with p sentence numbers (including p sentences, and each sentence has q features), can be represented by the matrix as: .
[0044] Please refer to Figure 3 , S2, based on the fuzzy multi-granularity knowledge extraction technology, extract and process the feature vector to extract multi-granularity knowledge, and obtain a prototype pattern vector and a test pattern vector;
[0045] Specifically, step S2 includes: based on the feature vector, obtain a feature subset , and perform granule calculation processing on the feature subset according to the purity threshold p = 1.0, judge the purity of each granule of the sample data set U . When the purity of the granule does not reach the purity threshold, use 2-means clustering to divide it into 2 sub-granules. When the purity of all granules reaches the purity threshold, obtain a granule list , where l is the total number of granules, is the th granule, C is the feature set;
[0046] Calculate the fuzzy similarity of the sample x : , where is the th granule, , , is the fuzzy similarity, , representing the sample in the sample data set U ;
[0047] According to the parameter and the granule list , construct a fuzzy neighborhood in the form of a piecewise function. The membership degree of the granule fuzzy neighborhood of the sample x is: ;
[0048] According to the decision D of the sample, divide the sample data set U into r decision class sets , and obtain the membership degree of the granule fuzzy decision of the sample y : , where represents the cardinality of the set, is the granule fuzzy neighborhood of the sample y , which is a fuzzy set and contains all samples x and their corresponding membership degrees ;
[0049] Based on the accuracy t , obtain the decision setD Variable precision fuzzy dependence function with respect to the feature subset B : , , where is the decision set D Variable precision fuzzy positive region with respect to the feature subset B , is the union set is the k th decision class set Variable precision fuzzy lower approximation with respect to the feature subset B . The variable precision fuzzy dependence function represents the proportion of samples in the sample data set U that can be accurately classified under the feature subset B, and is used to quantify the classification ability of the feature subset for the decision set. The higher its value, the stronger the classification ability of the feature subset;
[0050] contains all samples x and their corresponding membership degrees , , where is the maximum operation is the minimum operation; This formula is divided into two parts. The first part is for the samples where the granular ball fuzzy decision membership degree does not exceed the precision . Calculate the maximum value of corresponding to each sample among these samples and , and take the minimum value of the maximum results corresponding to all samples that satisfy ; The second part is for the samples where the granular ball fuzzy decision membership degree y exceeds the precision . Calculate the maximum value of corresponding to each sample among these samples and , and take the minimum value of the maximum results corresponding to all samples that satisfy ; Finally, combine the minimum results of the two parts and then take the minimum value; ; y Determine whether the corresponding candidate attribute can be added to the optimal feature subset according to the variable precision importance. The variable precision importance of the candidate feature
[0051] with respect to the feature subset : B where is the difference set between the feature set and the feature subset , is the union set of the feature subset and the candidate feature B is a list of granular balls, is a parameter used to calculate the membership degree of the fuzzy neighborhood of granular balls, t is a precision parameter used to calculate the variable-precision fuzzy lower approximation, is the variable-precision fuzzy dependence function of the decision set D with respect to the union set ;
[0052] Initialize the feature reduction set to an empty set. Based on and each feature in the feature set , obtain the list of granular balls, and calculate the fuzzy similarity relationship and fuzzy neighborhood of granular balls according to the list of granular balls, and obtain the variable-precision fuzzy dependence degree and variable-precision importance corresponding to each feature ; Among them, the feature set C = (c1, c2,..., c ) is a set of linguistic features obtained through feature vectorization processing, specifically including features such as word meaning, semantic role, emotion, and phonology. The feature h (s = 1, 2,..., h) belongs to the feature set C, where h is the total number of features in C; (s = 1, 2,..., h) belongs to the feature set C, where h is the total number of features in C;
[0053] Select the feature corresponding to the maximum importance , , when it is judged that the maximum importance is greater than 0, remove the feature from the feature set and add it to the feature reduction set ;
[0054] Repeat the above steps until all features in the feature set are checked, end the feature selection process, obtain the feature selection result, generate a feature reduction matrix according to the feature selection result, and separate the prototype pattern vector and test pattern vector from the feature reduction matrix.
[0055] In this embodiment, each row of the matrix is regarded as a sample, then all row vectors of the matrix can form a sample set ; Each column of the matrix is a feature of the sample, then all column vectors of the matrix can form a feature set of the sample ; Denote the decision of the sample as , where respectively represent the metaphor label and emotion category of the sample. According to , the sample set U can be divided into r decision class sets For each feature calculate the fuzzy similarity x between sample y and sample , where , represents the normalized value of sample x on feature . Then calculate the fuzzy similarity C based on the feature set .
[0056] Specifically, in this embodiment, this step is one of the core links of the emotional metaphor recognition method. The feature vectors are processed through the fuzzy multi-granularity knowledge extraction technology to extract multi-granularity knowledge, and finally the prototype mode vector and the test mode vector are obtained. This process can not only effectively remove noise and redundant features, but also significantly improve the accuracy of feature selection and the model's ability to capture the internal structure of the data, providing high-quality feature representations for subsequent emotional metaphor recognition.
[0057] Specifically, a feature subset is obtained based on the text data processed by feature vectorization, and the feature subset is processed by granule sphere calculation according to the set purity threshold p = 1.0; where granule sphere calculation is a data grouping method that divides samples with small differences in feature values in the data set into the same granule sphere, and granule sphere purity is a quantitative index describing the quality of the granule sphere. The higher the purity, the better the quality of the granule sphere. The goal of this process is to divide the sample data set U into multiple granule spheres, and the samples within each granule sphere have high similarity in feature values. During the division process, the purity of each granule sphere is judged. If the purity of a certain granule sphere does not reach the set purity threshold, that is, the sample feature values within the granule sphere have large differences, then the 2-means clustering method is used to divide it into two sub-granule spheres. This operation can further refine the granule spheres and improve the purity and quality of the granule spheres. When the purity of all granule spheres reaches the purity threshold, a granule sphere list is finally obtained, which contains l granule spheres, and each granule sphere corresponds to a subset of the feature set C . Subsequently, calculate the fuzzy similarity of sample x . Fuzzy similarity is an important indicator to measure the similarity degree between samples.
[0058] Based on the parameters and the list of granules, a fuzzy neighborhood in the form of a piecewise function is constructed. The fuzzy neighborhood is used to describe the membership relationship of samples in the granules. The introduction of the fuzzy neighborhood enables the classification of samples not to be limited to the binary judgment of "yes" or "no", but allows the existence of a state of "possibly yes", that is, there is a range of [0, 1] to describe the membership degree of the sample to the category. This fuzzy processing method can better adapt to the complex semantic features and context dependence in emotional metaphor recognition. Further, according to the decision set D , the granule fuzzy decision membership degree of the sample y is obtained.
[0059] Immediately afterwards, in order to further optimize the feature selection process, the concept of precision t is introduced, and the variable-precision fuzzy dependence function of the decision set D with respect to the feature subset B is obtained. The dependence function represents the ratio of the samples that can be accurately classified under the feature subset B to the total samples. Therefore, the dependence function is an index to evaluate the ability of the feature subset B to discriminate samples, and it can be determined whether a certain candidate feature can be reduced by calculating the dependence function. Constructing the dependence function at multiple granularity levels will be able to obtain richer classification information. The introduction of the variable-precision fuzzy dependence function enables the feature selection process to dynamically adjust the granularity parameters, thereby obtaining richer classification information. By analyzing the influence of different granularities on the feature selection results, the granularity parameters can be dynamically adjusted to more flexibly optimize the selection of the feature subset, and thus optimize the selection of the attribute subset. This multi-granularity analysis method can not only improve the accuracy of feature selection, but also enhance the model's ability to capture the internal structure of the data.
[0060] Based on the above variable-precision fuzzy dependence function, calculate the variable-precision importance of the candidate feature with respect to the feature subset B. According to the calculation results of the variable-precision importance, it can be determined whether the corresponding candidate attribute can be added to the optimal feature subset. Among them, different parameters , precision t and feature subsets will generate different fuzzy positive regions. The goal of fuzzy multi-granularity knowledge extraction is to find an optimal feature subset to maximize the fuzzy positive region formed under this subset. As mentioned above, the result of knowledge extraction is the smallest feature subset with the same classification ability as the entire feature set C . When adding a new feature, the change in the fuzzy dependence degree reflects the change in the classification ability. This process realizes the dynamic optimization of the feature set by quantifying the importance of the features, ensuring that the finally selected feature subset has the strongest classification ability and emotional metaphor recognition ability.
[0061] In the specific implementation, the parameter and precision tSet within a certain range to obtain feature selection results with different granularities. For each combination of parameters and precision t For each combination, there are steps: Initialize the feature reduction set as an empty set. Then, based on the parameters and each feature in the feature set, obtain a list of granular balls, and calculate the granular ball fuzzy similarity relationship and granular ball fuzzy neighborhood according to the list of granular balls, and then obtain the variable-precision fuzzy dependence degree and variable-precision importance corresponding to each feature. Through this series of calculations, the feature corresponding to the maximum importance is selected. When it is determined that the maximum importance is greater than 0, this feature is removed from the feature set and added to the feature reduction set. This operation ensures that the feature reduction set only contains the features most valuable for sentiment metaphor recognition, thereby improving the efficiency and accuracy of the model.
[0062] Repeat the above steps until all features in the feature set are checked, and end the feature selection process. Finally, generate a feature reduction matrix according to the feature selection results and separate the prototype pattern vector and the test pattern vector from this feature reduction matrix. The prototype pattern vector is used for subsequent training of the sentiment metaphor recognition model, while the test pattern vector is used for model testing and verification. Through the fuzzy multi-granularity knowledge extraction technology, this method not only effectively removes noise and redundant features, but also significantly improves the accuracy of feature selection and the model's ability to capture the internal structure of data, provides high-quality feature representations for sentiment metaphor recognition, and thus lays a solid foundation for achieving high-precision sentiment metaphor recognition.
[0063] S3. Use a matching network to construct and process the prototype pattern vector and the test pattern vector to construct and generate sentiment metaphor order parameters;
[0064] Specifically, step S3 includes: Using the inner product method to construct a sentiment metaphor order parameter reflecting the similarity between the prototype pattern vector and the test pattern vector where d represents the number of sentences in the test set.
[0065] In this embodiment, after completing the fuzzy multi-granularity knowledge extraction in step S2, the optimized prototype pattern vector and test pattern vector have been obtained. These vectors respectively represent the emotional metaphor patterns in the training data and the patterns to be recognized in the test data. To further evaluate the similarity between the test pattern and the prototype pattern, a matching network is used for processing in step S3. Among them, the core idea of the matching network is to calculate the similarity between the prototype pattern vector and the test pattern vector through the inner product method. The inner product method is a simple and efficient mathematical tool that can directly reflect the linear correlation between two vectors. In specific operations, for each test pattern vector in the test set, its inner product operation with the prototype pattern vector is performed to obtain an emotional metaphor order parameter. This order parameter can quantitatively represent the similarity between the test pattern and the prototype pattern, providing key information for subsequent emotional metaphor recognition.
[0066] Through the inner product operation, an emotional metaphor order parameter matrix is obtained, and each element in the matrix corresponds to the similarity between a test pattern and a prototype pattern. This similarity calculation method based on the inner product method has significant beneficial effects. First of all, the inner product method is simple and efficient, and can quickly complete the similarity evaluation on a large-scale data set, greatly improving the operation efficiency of the emotional metaphor recognition system. Secondly, the emotional metaphor order parameter obtained through the inner product method can directly reflect the linear similarity between the test pattern and the prototype pattern, providing accurate input for the subsequent dynamic evolution process. This similarity evaluation method can not only effectively capture the semantic features of emotional metaphors, but also reduce the interference of noise and redundant information to a certain extent, further improving the accuracy and robustness of emotional metaphor recognition. The emotional metaphor order parameter constructed by the matching network provides an important intermediate result for emotional metaphor recognition. This order parameter can not only efficiently quantify the similarity between the prototype pattern and the test pattern, but also provide key input for the subsequent dynamic evolution of the competitive network, so as to achieve the accurate recognition of emotional metaphors and the accurate annotation of emotional categories.
[0067] Please refer to Figure 4 , S4, input the emotional metaphor order parameter into the competitive network for dynamic evolution processing to obtain the emotional metaphor annotation pattern, and obtain the evolution result based on the emotional metaphor annotation pattern;
[0068] Specifically, step S4 includes: The mathematical expression of the dynamic evolution processing is: , where is the attention parameter, is the self-excitation term, is the self-inhibition term, is the lateral inhibition term.
[0069] S5. Annotate the evolution result to obtain an annotation result, and identify the metaphor tags and sentiment categories in the text based on the annotation result to obtain a sentiment metaphor recognition result.
[0070] Specifically, step S5 includes: obtaining the reconstructed order parameter through dynamic evolution processing, sorting the order parameters, screening out the prototype mode vector corresponding to the highest order parameter, and determining that the sentence to be recognized belongs to this prototype mode to generate an annotation result.
[0071] In this embodiment, these order parameters are input into a competitive network for dynamic evolution processing. The core of this process is to simulate the evolution process of the sentiment metaphor pattern through a dynamic equation to obtain a sentiment metaphor annotation pattern. Among them, the attention parameter is used to control the change speed of the pattern to be tested; the parameter combination together determine the recognition performance of the cooperative pattern recognition. B = C = 1.2, successively takes 0.18, 0.36, 0.54, and 0.72; the self-excitation term represents the feedback excitation effect of the pattern on itself; the self-inhibition term reflects the inhibition of the pattern's excessive growth on itself; the lateral inhibition term reflects the mutual inhibition effect between patterns, which is equivalent to a penalty term to ensure the diversity and competitiveness of patterns during the evolution process.
[0072] Through the above dynamic evolution equation, the competitive network can dynamically adjust and optimize the input sentiment metaphor order parameters, and finally obtain the reconstructed order parameters. This process can effectively process complex semantic information, capture the dynamic characteristics of sentiment metaphors, and screen out the prototype mode vector that best conforms to the sentiment metaphor pattern through the evolution mechanism.
[0073] Next, the evolution results are labeled. The specific operation is to sort the reconstructed order parameters and select the prototype pattern vector corresponding to the highest order parameter. The prototype pattern vector corresponding to this highest order parameter is the emotional metaphor pattern of the sentence to be recognized. Based on this pattern, it can be determined that the sentence to be recognized belongs to this prototype pattern, and a labeling result is generated. Through this labeling result, the system can further identify the metaphor labels and emotional categories in the text, and finally obtain the emotional metaphor recognition result. This method based on dynamic evolution and labeling processing has significant beneficial effects. First of all, the dynamic evolution process can effectively process complex emotional metaphor patterns. Through self-excitation, self-inhibition and lateral inhibition mechanisms, it simulates the dynamic evolution characteristics in the human cognitive process, significantly improving the accuracy and robustness of the recognition system. Secondly, by sorting and selecting the prototype pattern vector corresponding to the highest order parameter, the system can efficiently identify the emotional metaphor pattern and label the metaphor label and emotional category for the text. This process can not only effectively reduce the interference of noise and redundant information, but also improve the operation efficiency of the system, enabling it to quickly and accurately process large-scale text data.
[0074] In summary, the emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning constructs an emotional metaphor corpus and performs feature vectorization processing. It uses fuzzy multi-granularity knowledge extraction technology to extract multi-granularity knowledge, generating prototype pattern vectors and test pattern vectors. Further, an emotional metaphor order parameter is constructed through a matching network and input into a competitive network for dynamic evolution processing, finally realizing the accurate labeling of emotional metaphors and the recognition of emotional categories. Specifically, first, the text data is subjected to word embedding processing, converted into vector representations and combined into a matrix. Through fuzzy multi-granularity knowledge extraction technology, based on granule sphere calculation and purity threshold screening, a list of granule spheres that meet the conditions is constructed, and the variable precision fuzzy dependence function is used to evaluate the importance of candidate features, generating an optimized feature reduction matrix. This process effectively removes noise and redundant features, retains key features with strong discrimination ability, and significantly improves the efficiency and accuracy of feature selection. Subsequently, an emotional metaphor order parameter is constructed through a matching network, and the cosine similarity method is used to calculate the similarity between the prototype pattern vector and the test pattern vector. This similarity evaluation method can not only efficiently quantify the relationship between the prototype pattern and the test pattern, but also provide an important basis for subsequent dynamic evolution. Through the dynamic evolution processing of the competitive network, the emotional metaphor order parameter can be dynamically adjusted, the prototype pattern vector that best matches the emotional metaphor pattern can be selected, and a labeling result can be generated based on this, realizing the accurate recognition of metaphor labels and emotional categories.
[0075] The beneficial effects are as follows. The fuzzy multi-granularity knowledge extraction technology can effectively remove noise and redundant features, improve the accuracy of feature selection, and enhance the model's ability to capture the internal structure of data. Meanwhile, the dynamic evolution process simulates the dynamic features in the human cognitive process, significantly improving the accuracy and robustness of emotional metaphor recognition. In addition, by parallelly outputting metaphor labels and emotional categories, the present invention not only improves the efficiency of emotional metaphor recognition but also provides a more comprehensive and accurate technical solution for the field of sentiment analysis. Briefly speaking, through an innovative technical path, this method solves many limitations of the prior art in emotional metaphor recognition (such as insufficient accuracy of emotional metaphor recognition, low efficiency of feature extraction, and difficulty in dealing with noise and redundant information in large-scale text data), provides more efficient and accurate technical support for the fields related to emotional metaphor, and has important academic value and broad application prospects.
[0076] Please refer to Figure 6 , the second embodiment of the present invention provides an emotional metaphor recognition device based on knowledge extraction and co-evolution reasoning, which includes:
[0077] A corpus processing unit 201, configured to construct an emotional metaphor corpus according to preset public corpus data, divide a training corpus set and a test corpus set from the emotional metaphor corpus, and perform feature vectorization processing on the training corpus set and the test corpus set to obtain feature vectors;
[0078] A knowledge extraction unit 202, configured to perform extraction processing on the feature vectors based on the fuzzy multi-granularity knowledge extraction technology, extract multi-granularity knowledge, and obtain a prototype pattern vector and a test pattern vector;
[0079] A matching network unit 203, configured to use a matching network to perform construction processing on the prototype pattern vector and the test pattern vector, and construct and generate an emotional metaphor order parameter;
[0080] An evolution reasoning unit 204, configured to input the emotional metaphor order parameter into a competitive network for dynamic evolution processing to obtain an emotional metaphor annotation pattern, and obtain an evolution result based on the emotional metaphor annotation pattern;
[0081] An annotation recognition unit 205, configured to perform annotation on the evolution result to obtain an annotation result, and identify metaphor labels and emotional categories in the text according to the annotation result to obtain an emotional metaphor recognition result.
[0082] The above is the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A method for identifying emotional metaphors based on knowledge extraction and co-evolutionary reasoning, characterized in that Including: Construct an emotional metaphor corpus according to preset publicly available corpus data, divide the training corpus set and the test corpus set from the emotional metaphor corpus, and perform feature vectorization processing on the training corpus set and the test corpus set to obtain feature vectors; Based on the fuzzy multi-granularity knowledge extraction technology, perform extraction processing on the feature vectors, extract multi-granularity knowledge, and obtain prototype pattern vectors and test pattern vectors; Use a matching network to perform construction processing on the prototype pattern vectors and the test pattern vectors to construct and generate emotional metaphor order parameters; Input the emotional metaphor order parameters into a competitive network for dynamic evolution processing to obtain an emotional metaphor annotation pattern, and obtain an evolution result based on the emotional metaphor annotation pattern; Annotate the evolution result to obtain an annotation result, and identify the metaphor label and emotional category in the text according to the annotation result to obtain an emotional metaphor recognition result; Based on the fuzzy multi-granularity knowledge extraction technology, perform extraction processing on the feature vectors, extract multi-granularity knowledge, and obtain prototype pattern vectors and test pattern vectors. Specifically: Based on the feature vector, a feature subset is obtained , and according to the purity threshold p =1.0, a granulocyte calculation process is performed on the feature subset, and the purity of each granulocyte in the sample data set U is judged. When the purity of the granulocyte does not reach the purity threshold, it is split into 2 sub-granulocytes using 2-means clustering. When the purity of all granulocytes reaches the purity threshold, a granulocyte list is obtained, where l is the total number of granulocytes, is the th granulocyte, C is the feature set; Calculated sample x The fuzzy similarity degree of: wherein, is the th granule ball, , , is the fuzzy similarity degree, , indicating the sample in the sample data set U ; According to the parameters and the granulocyte list , construct a fuzzy neighborhood in the form of a piecewise function. The membership degree of the granulocyte fuzzy neighborhood of the sample x is as follows: ; Decision based on samples D Divide the sample data set U into r decision class sets , and obtain the granular ball fuzzy decision membership degree of the sample y : , where represents the cardinality of the set, is the granular ball fuzzy neighborhood of the sample y , which is a fuzzy set containing all samples x and their corresponding membership degrees , is the k th decision class set; The matching network is used to construct and process the prototype pattern vector and the test pattern vector, and an emotional metaphor order parameter is constructed and generated. Specifically: the inner product method is used to construct a prototype pattern vector and the test pattern vector emotional metaphor order parameter reflecting the similarity , where d represents the number of sentences in the test set; The mathematical expression for the kinetic evolution process is as follows: , where is the attention parameter, is the self-excitation term, is the self-inhibition term, is the lateral inhibition term.
2. The emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning according to claim 1, characterized in that Construct an emotional metaphor corpus according to preset publicly available corpus data, divide the training corpus set and the test corpus set from the emotional metaphor corpus, and perform feature vectorization processing on the training corpus set and the test corpus set to obtain feature vectors. Specifically: Obtain text data from the preset publicly available corpus data, and perform annotation processing on each text data to construct an emotional metaphor corpus, where the annotation processing includes metaphor presence / absence annotation and emotional category annotation; Perform division processing on the emotional metaphor corpus to obtain a training corpus set and a test corpus set, and perform text preprocessing on the training corpus set and the test corpus set. The text preprocessing includes word segmentation processing and stop word removal processing; Extract multiple linguistic features from the corpus of the preprocessed training corpus set and test corpus set. The linguistic features include: word meaning, semantic role, emotion, and phonology; Based on the linguistic features, construct a feature dictionary, map each linguistic feature to an ID, and represent each sentence as a feature vector, where each dimension corresponds to a feature ID in the feature dictionary.
3. The method for identifying emotional metaphors based on knowledge extraction and co-evolution reasoning according to claim 2, wherein The emotional category annotation includes joy, goodness, anger, sorrow, fear, disgust, and surprise.
4. The emotional metaphor recognition method based on knowledge extraction and co-evolution reasoning according to claim 1, wherein Based on the fuzzy multi-granularity knowledge extraction technology, perform extraction processing on the feature vectors, extract multi-granularity knowledge, and obtain prototype pattern vectors and test pattern vectors. It is also specifically: Based on precision t , the decision set is obtained D Regarding the feature subset B The variable precision fuzzy dependence function is as follows: , , where is the variable precision fuzzy positive region of the decision set D regarding the feature subset B , is the union set is the k th decision class set regarding the feature subset B The variable precision fuzzy lower approximation. The variable precision fuzzy dependence function represents the proportion of samples in the sample data set U that can be accurately classified under the feature subset B, and is used to quantify the classification ability of the feature subset for the decision set. The higher its value, the stronger the classification ability of the feature subset; Include all samples x and their corresponding membership degrees , , where is the maximum operation is the minimum operation; Determine whether the corresponding candidate attribute can be added to the optimal feature subset according to the variable precision importance, the candidate feature with respect to the feature subset B variable precision importance: , where is the difference set of the feature set and the feature subset ; is the union of the feature subset B and the candidate feature ; is the granule list, is the parameter used to calculate the membership degree of the granule fuzzy neighborhood, t is the precision parameter used to calculate the variable precision fuzzy lower approximation, is the variable precision fuzzy dependence function of the decision set D with respect to the union ; Initialize the feature reduction set as an empty set, and based on and each linguistic feature in the feature set , obtain the granule list, and calculate the granule fuzzy similarity relationship and granule fuzzy neighborhood according to the granule list, so as to obtain the variable precision fuzzy dependence degree and variable precision importance corresponding to each linguistic feature ; Select the features corresponding to the maximum importance , , when it is determined that the maximum importance is greater than 0, the feature is removed from the feature set and added to the feature reduction set ; Repeat the above steps until all the features in the feature set are checked, end the feature selection process, obtain the feature selection result, generate a feature reduction matrix according to the feature selection result, and separate the prototype pattern vector and the test pattern vector from the feature reduction matrix. Among all the features, end the feature selection process, obtain the feature selection result, generate a feature reduction matrix according to the feature selection result, and separate the prototype pattern vector and the test pattern vector from the feature reduction matrix.
5. The method for identifying emotional metaphors based on knowledge extraction and co-evolution reasoning according to claim 4, wherein Annotate the evolution result to obtain an annotation result. Specifically: After dynamic evolution processing, obtain the reconstructed order parameter, perform sorting processing on the order parameter, select the prototype pattern vector corresponding to the highest order parameter, and determine that the sentence to be recognized belongs to this prototype pattern to generate an annotation result.
6. An emotional metaphor recognition device based on knowledge extraction and co-evolutionary reasoning, characterized in that, Including: A corpus processing unit, configured to construct an emotional metaphor corpus according to preset publicly available corpus data, divide the training corpus set and the test corpus set from the emotional metaphor corpus, and perform feature vectorization processing on the training corpus set and the test corpus set to obtain feature vectors; A knowledge extraction unit, which is used to perform extraction processing on the feature vector based on the fuzzy multi-granularity knowledge extraction technology, extract multi-granularity knowledge, and obtain a prototype pattern vector and a test pattern vector; A matching network unit, which is used to perform construction processing on the prototype pattern vector and the test pattern vector by using a matching network, and construct and generate an emotional metaphor order parameter; An evolutionary reasoning unit, which is used to input the emotional metaphor order parameter into a competitive network for dynamic evolutionary processing to obtain an emotional metaphor annotation pattern, and obtain an evolutionary result based on the emotional metaphor annotation pattern; A labeling recognition unit, which is used to label the evolutionary result to obtain a labeling result, and identify a metaphor label and an emotional category in the text according to the labeling result to obtain an emotional metaphor recognition result; Based on the fuzzy multi-granularity knowledge extraction technology, performing extraction processing on the feature vector, extracting multi-granularity knowledge, and obtaining a prototype pattern vector and a test pattern vector, specifically: Based on the feature vector, a feature subset is obtained , and according to the purity threshold p = 1.0, a granulocyte calculation process is performed on the feature subset, and the purity of each granulocyte in the sample data set U is judged. When the purity of the granulocyte does not reach the purity threshold, it is divided into two sub-granulocytes using 2-means clustering. When the purity of all granulocytes reaches the purity threshold, a granulocyte list is obtained, where l is the total number of granulocytes, is the -th granulocyte, C is the feature set; Calculate the sample x of fuzzy similarity: , where is the th granule ball, , , is the fuzzy similarity, , indicating the sample in the sample dataset U ; According to the parameters and the granulocyte list , construct a fuzzy neighborhood in the form of a piecewise function. The membership degree of the granulocyte fuzzy neighborhood of the sample x is as follows: ; Decision based on samples D The sample data set U is divided into r decision class sets , and the granular ball fuzzy decision membership degree of the sample y is obtained: , where represents the cardinality of the set, is the granular ball fuzzy neighborhood of the sample y , which is a fuzzy set containing all samples x and their corresponding membership degrees , is the k th decision class set; Construct the prototype pattern vector and the test pattern vector by using a matching network, and construct and generate an emotional metaphor order parameter, specifically: use the inner product method to construct a reflection prototype pattern vector and the test pattern vector The emotional metaphor order parameter of the similarity , where d represents the number of sentences in the test set; The mathematical expression for the kinetic evolution process is as follows: , where is the attention parameter, is the self-excitation term, is the self-inhibition term, is the lateral inhibition term.
Citation Information
Patent Citations
Scenic spot evaluation knowledge base construction method based on metaphor topic mining
CN111078894A
Emotion classification model construction method based on metaphor recognition
CN114942991A