General rhetorical identification method based on fusion of meta learning and course learning
By integrating meta-learning with course learning in the field of natural language processing, building a data set with course characteristics, and using the TapNet module to enhance tag knowledge, the problem of poor general rhetorical pattern recognition in the existing technology is solved, and the problem of poor performance is achieved Efficiently identify the effects of all rhetorical categories when the data size is limited.
Patent Information
- Application Number
- CN202411530902.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-18
AI Technical Summary
The existing technology is difficult to realize the recognition of general rhetorical patterns, mainly due to the large number of rhetorical patterns, similarities between categories, and limited data resources, which leads to the poor effectiveness of existing methods in general rhetorical recognition.
The method of integrating meta-learning and curriculum learning is adopted to construct data sets with course characteristics and general rhetorical recognition is performed through meta-learning models. Specific steps include: measuring the similarity between categories, dividing different difficulty metatasks based on the K-Means clustering algorithm, building a data set with course characteristics, and using the TapNet module to enhance tag knowledge to improve the recognition effect.
It is realized that when the data scale is limited, all rhetorical categories can be identified and confusing rhetorical categories can be effectively separated, improving the performance of general rhetorical recognition.
Smart Images

Figure CN119474386A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to a general rhetoric recognition method based on the integration of meta-learning and curriculum learning. Background Art
[0002] Machine reading comprehension is one of the hot tasks in the field of natural language processing, which aims to enable machines to understand the semantics of texts and accurately answer corresponding questions. At present, most machine reading comprehension systems can effectively process structured text information, such as clear arguments and evidence in academic papers, but there are still many challenges for machine reading comprehension of prose. This is because prose reading comprehension contains a lot of emotional expressions, with various expressions and a variety of rhetoric. Therefore, machine prose reading comprehension requires various basic technical modules as support, among which rhetoric recognition can help machines more accurately understand the overall semantics of the text and the author's emotional tendencies.
[0003] Rhetorical figure recognition is essentially a text classification problem in natural language processing. At present, most researchers have mainly built recognition models for a single rhetorical figure or a few specific rhetorical figures. For example, Gong et al. designed heuristic rules to capture syntactic information, for example, through punctuation information and repeated word discrimination, they realized the discrimination of parallelism and repetition rhetoric; Liu et al. also designed artificial templates to obtain sentences containing words such as "like" and "similar" to realize the recognition of simile rhetoric. Although these heuristic rules are simple and easy to implement, manually designed heuristic rules are time-consuming, laborious and incomplete, and cannot effectively identify rhetorical sentences. In contrast, deep neural networks have a strong ability to automatically extract features. Mu et al. combined convolutional neural networks (CNN) with LSC algorithms to extract semantic and structural information from texts for the identification of parallelism rhetoric; Wu et al. combined convolutional neural networks with long short-term memory networks to achieve metaphor discrimination by obtaining local information and global information, but these methods have single tasks. Zhao et al. designed a multi-task model for simile recognition and element extraction using BiLSTM and part-of-speech features. Although element extraction effectively improves simile recognition, this method only recognizes simile as a rhetorical device, and its generalization is poor. Chen et al. proposed a method based on multi-task learning, which uses syntactic and semantic information to jointly recognize several rhetorical devices and implicit emotions, but requires additional emotional information annotation and large-scale data support. The above models only consider the characteristics of specific rhetoric and do not recognize general rhetoric. The difficulty of general rhetorical device recognition lies in:
[0004] (1) Limited data volume. There are many types of rhetoric, and researchers in different periods have different classifications of them. Currently, rhetoric has evolved into 24 different forms. Rhetoric annotation is difficult and costly, and it is impossible to build a large-scale database. The existing methods for specific rhetoric are based on large-scale corpora and cannot achieve ideal results in general rhetoric recognition.
[0005] (2) Different rhetorical figures have different degrees of similarity. Different rhetorical figures may have the same iconicity. For example, parallelism and repetition both have quantitative iconicity, which makes different types of rhetoric similar. Metaphor, exaggeration, personification and anthropomorphism have syntactic relevance, but different semantic expressions. This makes it more difficult to identify common rhetoric.
[0006] In summary, due to the wide variety of rhetoric and the difficulty of annotation, the existing methods are difficult to complete the task of identifying universal rhetoric when the dataset is relatively small in annotation. Therefore, a new method is needed to overcome these defects and build a universal rhetoric recognition model with superior performance. Summary of the invention
[0007] The present invention relates to universal rhetoric recognition technology. Aiming at the problem that there are many rhetoric categories, similarities between categories, and limited data resources, the present invention introduces course learning into the training process of the low-resource multi-classification meta-learning model, and establishes a meta-learning universal rhetoric recognition model framework (CLML) that integrates course learning. The model framework is divided into two modules: data set construction with course characteristics and universal rhetoric recognition.
[0008] To achieve the above object, the present invention adopts the following technical solutions:
[0009] A general rhetoric recognition method based on the integration of meta-learning and curriculum learning includes the following steps:
[0010] The text to be recognized is input into a pre-trained meta-learning universal rhetoric recognition model, and the predicted probability of the rhetoric is output; the meta-learning universal rhetoric recognition model integrates course learning, including: a dataset construction module with course characteristics and a universal rhetoric recognition module.
[0011] Among them, the dataset building module with course characteristics:
[0012] In order to integrate course learning into meta-learning, this paper establishes a dataset with course characteristics. In meta-learning, the basic unit of training is meta-task (Episode), each meta-task contains N categories, each category contains K instance support sets, and the total support set is The query set is Among them, e is the text, y iis the label corresponding to e. In this stage, the support set S and query set Q in the meta-task are transferred to the MCGRI model, and the parameters are updated by minimizing the loss in the query set. The different similarities between rhetorical categories lead to inconsistent difficulty levels of meta-tasks in different categories. Essentially, the difficulty of the meta-task is consistent with the degree of similarity between different rhetorical categories. In order to construct a dataset with course characteristics, the present invention first measures the similarity between category representatives, then measures the similarity between categories based on K-means, and finally divides meta-tasks of different difficulty levels according to the similarity of categories, that is, the dataset construction module with course characteristics includes: similarity measurement between category representatives, similarity measurement between categories based on K-Means, and division of meta-tasks of different difficulty levels according to the similarity of categories.
[0013] General Rhetoric Identification Module:
[0014] In this stage, the present invention will perform general rhetoric recognition. By using the dataset with course characteristics constructed in the first stage, the meta-task gradually trains the model in a simple to difficult way. During the recognition process, the present invention will quickly learn how to distinguish these N categories using the N*K samples in the meta-task. This stage includes an encoder, a query-guided induction module, and a TapNet module enhanced with label knowledge.
[0015] Furthermore, the categories represent similarity measures between elements, specifically:
[0016] A sample is randomly selected from each category as the category representative element to form a representative element set in, Category is Category c i The representative element, c i ∈C={c1,...,c j ,...c l}, C is the label set of the training set;
[0017] Siamese BERT is used to measure the similarity between representatives. The formula is as follows:
[0018]
[0019] in, and Respectively represent category c a With category c b The representative element.
[0020] Furthermore, the similarity measure between categories based on K-Means is specifically:
[0021] The k-means clustering algorithm is used to group similar categories together to form clusters. The similarity between categories within a cluster is high, and the similarity between categories in different clusters is low. The center of the cluster is determined based on the dispersion of the representative element. The dispersion of the representative element is defined by the similarity between the representative element and the representatives of other categories. The formula is as follows:
[0022]
[0023] Among them, formula (2) calculates the representative element The sum of similarities with other category representatives, formula (3) calculates the representative element The dispersion of The larger the value, the more The greater the discreteness.
[0024] Select representative elements with higher discreteness to form set B:
[0025]
[0026] in, Represents a representative element with higher discreteness, N represents the number of categories in each meta-task, and each representative element in set B is regarded as the centroid of each cluster. Based on this, the K-Means clustering algorithm is used to obtain N clusters.
[0027] Furthermore, the meta-tasks of different difficulty levels are divided according to the similarity of the categories, specifically:
[0028] Among the N clusters, the example vectors in the same cluster are closer and have higher similarity. In contrast, the example vectors from different clusters are farther apart, so their similarity is lower. When the categories in the meta-task come from different clusters, the similarity between the categories is lower and easier to distinguish. For meta-tasks with higher difficulty, there are more categories from the same cluster, with higher similarity and difficult to distinguish. Therefore, based on the clustering results, meta-tasks of different course difficulties are defined, as shown in Table 1 below:
[0029] Table 1 Meta-tasks of different course difficulties
[0030] Course Difficulty definition Difficulty 1 The N categories of the meta-task all come from different clusters Difficulty 2 The two categories in the meta-task come from the same cluster, and the N categories come from different clusters ...... ...... Difficulty N The N categories of the meta-task all come from the same cluster
[0031] According to the defined meta-tasks of different difficulty levels, data are selected from the original data to construct meta-tasks, and the meta-tasks are sorted by difficulty to form a data set with course characteristics.
[0032] Furthermore, the dataset having course characteristics is specifically:
[0033] Guided by the definitions of meta-tasks of different difficulty levels, episodes of different difficulty levels are constructed. The categories of the lowest difficulty episodes all come from different clusters, and the similarity between categories is low. As the difficulty increases, the number of categories from the same cluster in the episode increases, and the similarity between categories increases. The constructed episodes are sorted from easy to difficult to form a dataset with course characteristics.
[0034] Further, the encoder is used to obtain a support set vector and a query set vector, specifically:
[0035] Given the query set and the support set examples as input, the pre-trained encoder BERT is used for encoding. The output of the encoder is the support set vector and the query set vector Where d1×K represents the dimension of the support vector, and d1 represents the dimension of the query vector.
[0036] Furthermore, the query-guided induction module uses the query set to guide the generation of the induction category-level representation, specifically:
[0037] The vectors obtained by the pre-trained encoder BERT are input into the query-guided induction module (QI). This module uses the query set to guide the generation of category-level representations:
[0038]
[0039] All samples are transformed from the example-level semantic space to the category-level semantic space, and the correlation between the support set and the query set is calculated by additive attention:
[0040]
[0041] Among them, W j ,m, W h and U are trainable parameters, squash(·) is a nonlinear compression function that scales the size of a vector without changing its direction, thereby achieving a nonlinear transformation of the vector, α ij is a routing parameter used as a reward or penalty;
[0042] Inductive class-level representation using dynamic routing:
[0043] d ij =softmax(b ij ) (8)
[0044]
[0045] Among them, b ij is the coupling coefficient, initialized to 0, and uses softmax(·) to ensure that ∑bij = 1, in each iteration, the consensus output of the underlying feature vector will be used as the category-level vector, and α will be introduced in the last step of each iteration ij Adjust routing weight b ij , in order to automatically encapsulate the category-level vectors related to the query, ensure that the routing process is guided by the query set, and enable the category-level vectors to focus on the most relevant information of the query set. The specific execution process is shown in Algorithm 1.
[0046] Algorithm 1 Query-guided Induction
[0047]
[0048]
[0049] Furthermore, the label knowledge enhanced TapNet module uses the label definition to construct a label enhanced reference vector for each category, guiding the effective separation of category-level representations, specifically:
[0050] The label definition vector is encoded by the encoder to obtain Then we get the reference vector, the formula is as follows:
[0051]
[0052] Among them, α is a hyperparameter and also a balancing factor, φ i is a learnable parameter;
[0053] A linear mapping is used to ensure that different label enhancement vectors are effectively separated:
[0054]
[0055] Among them, ψ l represents the reference vector of category l;
[0056] Compute the category-level vector and Deviation value:
[0057]
[0058] Among them, ||·|| represents the mean square L2 norm;
[0059] Construct a mapping function LK(·) so that the deviation value ε i The construction method is consistent with TapNet. The query set vector is mapped to the category-level vector using the mapping function LK(·) to optimize the category-level representation, aiming to optimize the category-level representation so that it can be effectively separated. At the same time, the mapped vector is dot-multiplied and the classification label is predicted using softmax(·):
[0060]
[0061] in, Represents the query set e Q For category c i The predicted probability of
[0062] Furthermore, it also includes training a meta-learning universal rhetoric recognition model. The specific process is as follows:
[0063] 1) In meta-learning, the basic unit of training is Episode. Each Episode contains a support set, a query set, and a label category definition. The support set S and query set e in Episode are Q Transfer to the MCGRI model and update the parameters by minimizing the loss in the query set;
[0064] 2) Use mean square error to train the model, and the loss function is as follows:
[0065]
[0066] Among them, y i ∈{0,1} represents the query set e Q The real label.
[0067] Compared with the prior art, the present invention has the following advantages:
[0068] 1. There are many types of rhetoric, similarities exist between categories, and data resources are limited. At present, researchers have mainly built rhetorical figure recognition models for single rhetoric or specific rhetoric, but these models only consider the characteristics of specific rhetoric and rely on large-scale annotated data, which cannot achieve ideal results in general rhetoric recognition. In view of the large number of rhetorical figure categories and limited data resources, a meta-learning learning mechanism is adopted; in view of the similarities between rhetorical categories, a mapping function is constructed using label definitions to improve the rhetorical category representation; in order to further improve the performance of the model, a data set with course characteristics is constructed using the similarities between rhetorical categories, and course learning is integrated into meta-learning to build a general rhetoric recognition model.
[0069] 2. The present invention can identify all rhetoric categories without being limited by the size of the data: Existing rhetoric methods design models for single or several common rhetorical characteristics. The present invention transforms universal rhetoric recognition into a text classification task with a small number of samples and multiple categories. It uses the commonalities between all rhetoric categories (categories have different degrees of similarity) to design meta-tasks of different difficulty levels to construct a dataset with course characteristics, introduces course learning into meta-learning, and enables our model to be not limited by the size of the data and quickly learn the characteristics of each rhetoric category using only a small number of samples.
[0070] 3. Better separation of easily confused rhetoric categories; the present invention uses label definition knowledge to enhance TapNet and constructs a label knowledge enhanced mapping function. Specifically, the present invention introduces label definition to construct a category reference vector and constructs a mapping function to eliminate the deviation between the reference vector and the category-level vector, guiding the category-level representation to be effectively separated, thereby completing the recognition of universal rhetoric. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a framework diagram of the meta-learning universal rhetoric recognition model of the present invention. DETAILED DESCRIPTION
[0072] In order to further illustrate the technical solution of the present invention, the present invention is further described below through embodiments.
[0073] A general rhetoric recognition method based on the integration of meta-learning and course learning in this embodiment includes the following steps:
[0074] The text to be recognized is input into a pre-trained meta-learning universal rhetoric recognition model, and the predicted probability of rhetoric is output; the meta-learning universal rhetoric recognition model integrates course learning, including: a dataset construction module with course characteristics and a universal rhetoric recognition module (such as Figure 1 shown).
[0075] The dataset construction module with course characteristics integrates course learning into meta-learning, including: similarity measurement between category representatives, similarity measurement between categories based on K-Means, and meta-tasks of different difficulty levels divided according to category similarity.
[0076] (1) Similarity measurement between category representatives: A sample is randomly selected from 24 rhetorical categories as the representative element of the category to form a representative element set. in, Category is Category c i The representative element, c i ∈C={c1,...,c j ,...c l}, C is the label set of the training set;
[0077] The representative elements are gradually input into Siamese BERT in pairs, and Siamese BERT is used to measure the similarity between the representative elements. The formula is as follows:
[0078]
[0079] in, and Respectively represent category c a With category c b The representative element.
[0080] (2) Similarity measurement between categories based on K-Means: The k-means clustering algorithm is used to group similar categories together to form clusters. The similarity between categories within a cluster is high, and the similarity between categories in different clusters is low. The center of the cluster is determined based on the dispersion of the representative element. The dispersion of the representative element is defined by the similarity between the representative element and the representatives of other categories. The formula is as follows:
[0081]
[0082] Among them, formula (2) calculates the representative element The sum of similarities with other category representatives, formula (3) calculates the representative element The discreteness of
[0083] The discreteness of the categories is calculated based on the similarity between the categories, and the representative elements with higher discreteness are selected to form set B:
[0084]
[0085] in, Represents a representative element with higher discreteness, N represents the number of categories in each meta-task, and each representative element in set B is regarded as the centroid of each cluster. Based on this, the K-Means clustering algorithm is used to obtain N clusters. The similarity between categories within a cluster is high, and the similarity between categories in different clusters is low.
[0086] (3) Divide meta-tasks of different difficulty levels according to the similarity of categories: In N clusters, the example vectors in the same cluster are closer and have higher similarity; the example vectors from different clusters are farther apart and have lower similarity; when the categories in the meta-task come from different clusters, the similarity between the categories is lower and easier to distinguish; while for meta-tasks with higher difficulty, there are more categories from the same cluster, with higher similarity and difficult to distinguish; thus, based on the clustering results, meta-tasks of different course difficulty levels are defined, as shown in Table 1 below:
[0087] Table 1 Meta-tasks of different course difficulties
[0088] Course Difficulty definition Difficulty 1 The N categories of the meta-task all come from different clusters Difficulty 2 The two categories in the meta-task come from the same cluster, and the N categories come from different clusters ...... ...... Difficulty N The N categories of the meta-task all come from the same cluster
[0089] According to the defined meta-tasks of different difficulty levels, data are selected from the original data to construct meta-tasks, and the meta-tasks are sorted by difficulty to form a data set with course characteristics.
[0090] A dataset with course characteristics is constructed. Specifically, under the guidance of meta-task definitions of different difficulty levels, episodes of different difficulty levels are constructed. The lowest difficulty episode categories all come from different clusters, and the similarity between categories is low. As the difficulty increases, the number of categories from the same cluster in the episode increases, and the similarity between categories increases. The constructed episodes are sorted from easy to difficult to form a dataset with course characteristics.
[0091] The general rhetoric identification module performs general rhetoric identification on the constructed dataset with course characteristics, including an encoder, a query-guided induction module, and a TapNet module enhanced with label knowledge.
[0092] After constructing a dataset with course characteristics, the model is trained step by step from easy to difficult episodes, as shown in Table 2.
[0093] Table 2Episode 1
[0094]
[0095]
[0096] 1) Encoder: used to obtain support set vectors and query set vectors.
[0097] Given the query set and the support set examples as input, the pre-trained encoder BERT is used for encoding. The output of the encoder is the support set vector and the query set vector Where d1×K represents the dimension of the support vector, and d1 represents the dimension of the query vector.
[0098] 2) The query-guided induction module: uses the query set to guide the generation of inductive category-level representations.
[0099] All samples are transformed from the example-level semantic space to the category-level semantic space, and the correlation between the support set and the query set is calculated by additive attention:
[0100]
[0101] Among them, W j ,m, W h and U are trainable parameters, squash(·) is a nonlinear compression function, α ijis a routing parameter used as a reward or penalty;
[0102] Inductive class-level representation using dynamic routing:
[0103] d ij =softmax(b ij ) (8)
[0104]
[0105] Among them, b ij is the coupling coefficient, initialized to 0, and uses softmax(·) to ensure that ∑b ij = 1, in each iteration, the consensus output of the underlying feature vector will be used as the category-level vector, and α will be introduced in the last step of each iteration ij Adjust routing weight b ij , in order to automatically encapsulate the category-level vectors related to the query, ensure that the routing process is guided by the query set, and enable the category-level vectors to focus on the most relevant information of the query set.
[0106] 3) Label-knowledge-enhanced TapNet module: The label definition is used to construct a label-enhanced reference vector for each category, guiding the effective separation of category-level representations.
[0107] The label definition vector is encoded by the encoder to obtain Then we get the reference vector, the formula is as follows:
[0108]
[0109] Among them, α is a hyperparameter and also a balancing factor, φ i is a learnable parameter;
[0110] A linear mapping is used to ensure that different label enhancement vectors are effectively separated:
[0111]
[0112] Among them, ψ l represents the reference vector of category l;
[0113] Compute the category-level vector and Deviation value:
[0114]
[0115] Among them, ||·|| represents the mean square L2 norm;
[0116] Construct a mapping function LK(·) so that the deviation value ε iThe query set vector is 0, and the mapping function LK(·) is used to map the query set vector to the category-level vector to optimize the category-level representation. At the same time, the mapped vector is dot-multiplied and the classification label is predicted using softmax(·):
[0117]
[0118] in, Represents the query set e Q For category c i The predicted probability of
[0119] This embodiment also includes training a meta-learning universal rhetoric recognition model, and the specific process is as follows:
[0120] 1) In meta-learning, the basic unit of training is Episode. Each Episode contains a support set, a query set, and a label category definition. The support set S and query set e in Episode are Q Transfer to the MCGRI model and update the parameters by minimizing the loss in the query set;
[0121] 2) Use mean square error to train the model, and the loss function is as follows:
[0122]
[0123] Among them, y i ∈{0,1} represents the query set e Q The real label.
[0124] Example 2
[0125] (1) Dataset
[0126] There is only one general rhetoric dataset available, which has 24 categories and contains 12642 rhetoric samples. To verify the effectiveness of the present invention, it is also evaluated on three small sample text classification datasets: IFLYTEK, 20Newsgroups and Amazon.
[0127] (2) Experimental setup
[0128] The implementation of the present invention is based on the PyTorch framework, the operating environment is Ubuntu 22.04, and the computing device is NVIDIATITAN RTX. The present invention uses the BERT model pre-trained by Google as the encoder. The number of routing iterations r is set to [5,3,5,4] in the rhetoric datasets IFLYTEK, 20Newsgroups and Amazon respectively. The present invention sets N=3(way)K=1(shot) and N=5(way)K=1(shot) few-sample scenarios for verification. The course difficulty setting n is consistent with N.
[0129] (3) Overall results
[0130] Existing rhetoric methods are aimed at a single rhetoric, or several special rhetoric, and there is no method for general rhetoric. Therefore, the present invention is horizontally compared with a series of small sample text classification methods (Induction, P-MAML, DS-FSL, MLADA, MemIML). This embodiment uses the accuracy rate (ACC) to evaluate the overall performance of the model, and the comparison results are shown in Table 3 below. From the experimental results, it is found that the present invention has a certain improvement on the four data sets.
[0131] Table 3 Overall results
[0132]
[0133]
[0134] (4) Ablation experiment
[0135] In order to evaluate the impact of different modules on the present invention, this embodiment conducted an ablation experiment, and the experimental results are shown in Table 4.
[0136] Table 4 Ablation experiment
[0137] Model IFLYTEK Rhetoric 20Newsgroups Amazon OURS 80.7 65.4 61.3 68.9 -CL 77.4 61.1 53.3 65.9 -LKT 76.3 62.3 55.6 64.6 CL-LKT 75.9 61.6 50.5 55.3
[0138] First, the performance of the four datasets was reduced by 4.6% on average by replacing the curriculum learning (CL) with randomly selected samples; then, the performance of the LKT (TapNet) with label knowledge enhancement was removed while the curriculum learning was retained; finally, the performance of the two modules was removed at the same time, and the performance was reduced by 8.2% on average. This result reflects that the two modules in the present invention can work together. CL enables the meta-task to gradually train the model in the order from simple to difficult, which can help LKT optimize the category-level representation and improve the performance of the model.
[0139] The above shows and describes the main features and advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present invention.
[0140] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A general rhetoric recognition method based on the integration of meta-learning and curriculum learning, characterized in that: The following steps are involved: Input the text to be recognized into the pre-trained meta-learning general rhetoric recognition model, and output the predicted probability of the rhetoric; The meta-learning universal rhetoric recognition model integrates course learning, including: a dataset construction module with course characteristics and a universal rhetoric recognition module. The dataset construction module with course characteristics integrates course learning into meta-learning, including: similarity measurement between category representative meta-tasks, similarity measurement between categories based on K-Means, and meta-tasks of different difficulty levels divided according to category similarity. The universal rhetoric recognition module performs universal rhetoric recognition on the constructed dataset with course characteristics, including an encoder, a query-guided induction module, and a TapNet module enhanced with label knowledge.
2. According to claim 1, a general rhetoric recognition method based on the integration of meta-learning and curriculum learning is characterized in that: The categories represent similarity measures between elements, specifically: A sample is randomly selected from each category as the category representative element to form a representative element set in, Category is Category c i The representative element, c i ∈C={c1,...,c j ,...c l }, C is the label set of the training set; Siamese BERT is used to measure the similarity between representatives. The formula is as follows: in, and Respectively represent category c a With category c b The representative element.
3. According to claim 2, a general rhetoric recognition method based on the integration of meta-learning and curriculum learning is characterized in that: The similarity measure between categories based on K-Means is specifically: The k-means clustering algorithm is used to group similar categories together to form clusters. The similarity between categories within a cluster is high, and the similarity between categories in different clusters is low. The center of the cluster is determined based on the dispersion of the representative element. The dispersion of the representative element is defined by the similarity between the representative element and the representatives of other categories. The formula is as follows: Among them, formula (2) calculates the representative element The sum of similarities with other category representatives, formula (3) calculates the representative element The discreteness of Select representative elements with higher discreteness to form set B: in, Represents a representative element with higher discreteness, N represents the number of categories in each meta-task, and each representative element in set B is regarded as the centroid of each cluster. Based on this, the K-Means clustering algorithm is used to obtain N clusters.
4. According to claim 3, a general rhetoric recognition method based on the integration of meta-learning and curriculum learning is characterized in that: The meta-tasks of different difficulty levels are divided according to the similarity of categories, specifically: Among the N clusters, the example vectors in the same cluster are close and have a higher similarity; the example vectors from different clusters are far apart and have a lower similarity; when the categories in the meta-task come from different clusters, the similarity between the categories is lower and easier to distinguish; while for meta-tasks with higher difficulty, there are more categories from the same cluster, with higher similarity and difficult to distinguish; therefore, based on the clustering results, meta-tasks of different course difficulties are defined, as shown in the following table: According to the defined meta-tasks of different difficulty levels, data are selected from the original data to construct meta-tasks, and the meta-tasks are sorted by difficulty to form a data set with course characteristics.
5. According to claim 4, a general rhetoric recognition method based on the integration of meta-learning and curriculum learning is characterized in that: The dataset having course characteristics is specifically: Guided by the definitions of meta-tasks of different difficulty levels, episodes of different difficulty levels are constructed. The categories of the lowest difficulty episodes all come from different clusters, and the similarity between categories is low. As the difficulty increases, the number of categories from the same cluster in the episode increases, and the similarity between categories increases. The constructed episodes are sorted from easy to difficult to form a dataset with course characteristics.
6. According to claim 5, a general rhetoric recognition method based on the integration of meta-learning and curriculum learning is characterized in that: The encoder is used to obtain the support set vector and the query set vector, specifically: Given the query set and the support set examples as input, the pre-trained encoder BERT is used for encoding. The output of the encoder is the support set vector and the query set vector Where d1×K represents the dimension of the support vector, and d1 represents the dimension of the query vector.
7. According to claim 6, a general rhetoric recognition method based on the integration of meta-learning and curriculum learning is characterized in that: The query-guided induction module uses the query set to guide the generation of the induction category-level representation, specifically: All samples are transformed from the example-level semantic space to the category-level semantic space, and the correlation between the support set and the query set is calculated by additive attention: Among them, W j ,m, W h and U are trainable parameters, squash(·) is a nonlinear compression function, α ij is a routing parameter used as a reward or penalty; Inductive class-level representation using dynamic routing: <h2 style=";text-align:left;direction:ltr">d<h2 style=";text-align:left;direction:ltr"> ij <h2 style=";text-align:left;direction:ltr"> =softmax(b<h2 style=";text-align:left;direction:ltr"> ij <h2 style=";text-align:left;direction:ltr"> ) (8) Among them, b ij is the coupling coefficient, initialized to 0, and uses softmax(·) to ensure that ∑b ij = 1, in each iteration, the consensus output of the underlying feature vector will be used as the category-level vector, and α will be introduced in the last step of each iteration ij Adjust routing weight b ij , in order to automatically encapsulate the category-level vectors related to the query, ensure that the routing process is guided by the query set, and enable the category-level vectors to focus on the most relevant information of the query set.
8. According to claim 7, a general rhetoric recognition method based on the integration of meta-learning and curriculum learning is characterized in that: The label knowledge enhanced TapNet module uses label definitions to construct label enhanced reference vectors for each category, guiding the effective separation of category-level representations, specifically: The label definition vector is encoded by the encoder to obtain Then we get the reference vector, the formula is as follows: Among them, α is a hyperparameter and also a balancing factor, φ i is a learnable parameter; A linear mapping is used to ensure that different label enhancement vectors are effectively separated: Among them, ψ l represents the reference vector of category l; Compute the category-level vector and Deviation value: Among them, ||·|| represents the mean square L2 norm; Construct a mapping function LK(·) so that the deviation value ε i The query set vector is 0, and the mapping function LK(·) is used to map the query set vector to the category-level vector to optimize the category-level representation. At the same time, the mapped vector is dot-multiplied and the classification label is predicted using softmax(·): in, Represents the query set e Q For category c i The predicted probability of 9. A general rhetoric recognition method based on the integration of meta-learning and curriculum learning according to any one of claims 1 to 8, characterized in that: It also includes training a meta-learning general rhetoric recognition model. The specific process is as follows: 1) In meta-learning, the basic unit of training is Episode. Each Episode contains a support set, a query set, and a label category definition. The support set S and query set e in Episode Q Transfer to the MCGRI model and update the parameters by minimizing the loss in the query set; 2) Use mean square error to train the model, and the loss function is as follows: Among them, y i ∈{0,1} represents the query set e Q The real label.