CN116304063A - Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method - Google Patents

Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method Download PDF

Info

Publication number
CN116304063A
CN116304063A CN202310564657.XA CN202310564657A CN116304063A CN 116304063 A CN116304063 A CN 116304063A CN 202310564657 A CN202310564657 A CN 202310564657A CN 116304063 A CN116304063 A CN 116304063A
Authority
CN
China
Prior art keywords
emotion
words
tag words
knowledge
tuning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310564657.XA
Other languages
Chinese (zh)
Other versions
CN116304063B (en
Inventor
徐昊
赵玉杰
谷雪
玄昶
宋瑞
石立达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jilin University
Original Assignee
Jilin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jilin University filed Critical Jilin University
Priority to CN202310564657.XA priority Critical patent/CN116304063B/en
Publication of CN116304063A publication Critical patent/CN116304063A/en
Application granted granted Critical
Publication of CN116304063B publication Critical patent/CN116304063B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3346Query execution using probabilistic model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Machine Translation (AREA)

Abstract

The invention discloses a simple emotion knowledge enhancement prompt optimization aspect-level emotion classification method, which belongs to the field of artificial intelligence natural language processing and comprises the following steps: constructing a prompt template, inputting the prompt template and the text to be classified into a pre-training language model for prediction, and obtaining the prediction probability of a plurality of words corresponding to the text to be classified; constructing an emotion knowledge mapping expression device, and optimizing a plurality of emotion tag words in the emotion knowledge mapping expression device to obtain optimized emotion tag words; based on the prediction probabilities of the words, obtaining the optimized prediction probability of the emotion tag words; and mapping the prediction probability of the optimized emotion tag words to category tags through the emotion knowledge mapping expressive machine to obtain the final prediction probability of the category tags. According to the invention, the semantic expression capability of the emotion tag words is improved by introducing the external emotion word library, and meanwhile, the deviation caused by single emotion tag words is reduced.

Description

Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method
Technical Field
The invention belongs to the field of artificial intelligence natural language processing, and particularly relates to a simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method.
Background
Aspect-level emotion classification is the current classification method with the finest granularity, and emotion information expressed by each aspect word can be determined according to each aspect object in a text, and emotion is generally classified into three categories, namely positive, negative and neutral. Aspect-level emotion classification has wide application in consumer public praise analysis, social media, event trend prediction, public opinion monitoring, and user interest mining.
In general, most solutions to aspect-level emotion classification can be divided into neural network and pre-trained language model based approaches. Neural network-based methods attempt to build a variety of complex feature extractors to extract semantic features of the data itself (e.g., convolutional neural networks, recurrent neural networks, and graphical convolutional networks). The graph-convolution network-based model extracts grammatical features (sentence structure information) in combination with sentence dependency trees in addition to semantic features. While these methods are effective, they take advantage of the characteristics of the dataset itself and require more supervised data to train. In contrast, pre-trained language model based methods can take full advantage of the knowledge that large-scale data sets are rich. The method has good effect by enabling the pre-training language model to perform fine adjustment on the target data set, but a certain gap exists between the pre-training target and the downstream task, a large amount of supervision data is needed for fine adjustment, and the cost is high. In many practical cases, accurate marking data is scarce and requires intensive human labor. Recently, hint tuning has received much attention and has shown great advantage in low data scenarios.
For classification tasks, the most critical step in applying the hint tuning method is to define a mapping expression for the mapping relationship between class labels and words of a specific class (labeled words).
Some existing efforts have attempted to improve hint tuning performance by building manual or automatic map expressive machines. The manual map expressive is to represent category labels using manually screened appropriate word(s) (tag word (s)). While the automatic mapping expressive machine learns the tag words by means of discrete search or gradient descent. In the case of sample scarcity, the automatic construction of the mapping expressive machine requires training samples to learn constantly, and the manual mapping expressive machine is still dominant. The method of integrating the external emotion knowledge into the mapping expressive machine to increase the coverage of the tag word achieves excellent effects. However, the currently available emotion words contain only positive and negative emotions, resulting in only two levels, lacking neutral emotion words for the aspect level tripolar emotion classification task. In addition, in-field emotion words related to downstream tasks are lacking to improve predictive performance.
In summary, the existing technical problems are: the current emotion classification method based on the aspect of prompt tuning lacks a comprehensive emotion word library suitable for tripolar classification to expand the coverage range of emotion tag words in prompt tuning, so that prediction has deviation. Therefore, it is highly desirable to provide a simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method.
Disclosure of Invention
The invention aims to provide a simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method, which integrates emotion knowledge into a frame of a mapping expression device enhancement prompt tuning so as to solve the problems in the prior art.
In order to achieve the above purpose, the invention provides a simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method, which comprises the following steps:
constructing a prompt template, inputting the prompt template and the text to be classified into a pre-training language model for prediction, and obtaining the prediction probability of a plurality of words corresponding to the text to be classified;
constructing an emotion knowledge mapping expression device, and optimizing a plurality of emotion tag words in the emotion knowledge mapping expression device to obtain optimized emotion tag words;
based on the prediction probabilities of the words, obtaining the optimized prediction probability of the emotion tag words;
and mapping the prediction probability of the optimized emotion tag words to category tags through the emotion knowledge mapping expressive machine to obtain the final prediction probability of the category tags.
Optionally, the process of constructing the emotion knowledge mapping expressive machine includes: extracting emotion tag words of positive emotion, neutral emotion and negative emotion from a data set for a triple emotion classification task, respectively acquiring word frequencies of the emotion tag words, and sequencing, and setting corresponding thresholds for different emotion tag words based on word frequency sequencing results to acquire emotion tag words in the field; and then continuously extracting emotion tag words of the positive emotion and the negative emotion from the binary emotion dictionary, obtaining the emotion tag words of the neutral emotion based on keyword search, further obtaining the emotion tag words outside the domain, and completing the construction of an emotion knowledge mapping expression device.
Optionally, the optimizing the plurality of emotion tag words in the emotion knowledge mapping expressive includes: and carrying out emotion tendentiousness optimization, learning vector quantization optimization, learnable weight optimization and small sample priori optimization on the emotion tag words.
Optionally, the process of optimizing emotion tendencies of the emotion tag words includes: and after the emotion tag words are subjected to de-duplication processing, acquiring categories of the emotion tag words based on a social media emotion analysis tool, and processing the emotion tag words without emotion tendency based on a part-of-speech recognition tool.
Optionally, the learning vector quantization optimization process for the emotion tag word includes: prototype vectors of different classes of emotion tag words are constructed based on learning vector quantization, and emotion tag words belonging to the same class are clustered.
Optionally, the process of performing learnable weight optimization on the emotion tag word includes: and distributing a learnable weight for each emotion label word, forming a vector by all the learnable weights, carrying out normalization processing, and optimizing the weight occupied by each emotion label word.
Optionally, the process of performing small sample prior optimization on the emotion tag word includes: presetting extraction proportion, acquiring a plurality of examples from a training set based on the extraction proportion, removing labels, acquiring a test set, acquiring prior probability of each emotion label word based on the test set, sequencing, and removing emotion label words which do not accord with the preset probability.
Optionally, the process of obtaining the final predicted probability of the category label includes: when in a zero sample scene, assuming that the contribution of the optimized emotion tag words to corresponding class prediction is the same, taking the average value of the optimized emotion tag words as the final prediction probability of the class tags; and taking the weighted average value of the optimized emotion label words as the final prediction probability of the class labels in the small sample scene.
The invention has the technical effects that:
the invention provides a method for improving emotion knowledge enhancement prompt and optimizing for aspect-level emotion classification, which improves semantic expression capacity of emotion tag words by introducing external knowledge and reduces deviation caused by single tag words.
The invention constructs a complete emotion word library suitable for the tripolar classification task of aspect level, and comprises active, passive and neutral emotion words inside and outside the field.
The invention provides a general optimization method for processing noise emotion knowledge, and the purpose of optimizing classification can be achieved by using rule combination.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and explain the application and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a flow chart of a simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method in an embodiment of the present invention;
FIG. 2 is a schematic diagram of an overall model for emotion classification in an embodiment of the present invention.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
Example 1
The current emotion classification method based on the aspect of prompt tuning lacks a comprehensive emotion word library suitable for tripolar classification tasks to expand the coverage range of emotion tag words in prompt tuning, so that prediction has deviation. To promote semantic expression of emotion tag words, a comprehensive word library containing three types of emotion needs to be constructed, but the current work does not have a summary about neutral emotion words, so that definition of neutral words and construction of the neutral emotion word library are difficult. In addition, the emotion tag words in the constructed emotion word library may contain noise, which affects the prediction result, so that a suitable optimization method is required to process the noise words. The optimized predictive probability of the emotion tag word needs to be mapped to the category to which the emotion tag word belongs, and the final score of each category is calculated. The calculation method for the mapping in different scenarios affects the final prediction and thus requires a suitable mapping method.
Therefore, as shown in fig. 1, the embodiment provides a simple aspect-level emotion classification method for emotion knowledge enhancement prompt tuning, which includes the following steps:
firstly, constructing a template and preprocessing texts to be classified. Because the prompt optimization is to add a prompt template in the sentence, the embodiment firstly constructs a template suitable for the aspect-level emotion classification task, then adds the template into the input sentence, and predicts the result by the pre-training language model.
Second, pre-training the language model preparation. This example compares two pre-trained language models of different scales, respectively: BERT, BERT-X (X: lap, res, refer to comment text through computer and restaurant respectively) (comments for electronic category in Amazon comment data, comments related to restaurant in yellow open dataset). The pre-trained language model needs to download pre-trained parameters and load them when in use.
And thirdly, constructing an emotion knowledge mapping expression device. That is, an external word stock is constructed that contains both positive, negative, neutral intra-domain and extra-domain emotion tag words.
And fourthly, optimizing the emotion knowledge mapping expressive machine. The embodiment provides an emotion knowledge optimization method to process noise words, reserve words with higher quality and improve semantic expression capacity of emotion tag words.
And fifthly, mapping the expressive machine by using emotion knowledge. Mapping the prediction of the emotion tag words to the category tags to obtain the final prediction probability of the category tags.
Firstly, constructing a prompt template suitable for an aspect-level emotion classification task, wherein the prompt template is as follows:
P 1 (s) = I felt the {aspect} was [MASK]. s
P 2 (s) = The {aspect} made me feel [MASK]. s
P 3 (s) = The {aspect} is [MASK]. s
P 4 (s) = It was a {MASK} {aspect}. s
where { aspect } represents the placeholder of the aspect word in the sentence, [ MASK ] is the position of the prediction result, and s is the input sentence.
Packaging the template and the input sentence, and sending the packaged template and the input sentence into a pre-training language model for prediction, wherein the pre-training language model gives the vocabulary of the pre-training language model
Figure SMS_1
Word filling in [ MASK ]]Is a probability of (2). The probability that each word may be filled in is:
Figure SMS_2
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_4
representing a pre-trained language model->
Figure SMS_7
Representation fill-in [ MASK ]]Word of->
Figure SMS_9
The sentence that is to be packaged is represented,
Figure SMS_5
representing a pre-trained language model->
Figure SMS_6
Predicting vocabulary +.>
Figure SMS_8
Every word->
Figure SMS_10
Filling in->
Figure SMS_3
Medium [ MASK]Is a probability of (2).
The embodiment defines that the emotion knowledge mapping expression device maps the probability of emotion label words to class labels
Figure SMS_11
Probability of = { positive, negative, neutral }. The set of these emotion tag words ++>
Figure SMS_12
Is->
Figure SMS_13
Is a subset of the set of (c). Set->
Figure SMS_14
And set->
Figure SMS_15
A mapping relationship ƒ is formed>
Figure SMS_16
→/>
Figure SMS_17
The predictive probability of a category label can be expressed as:
Figure SMS_18
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_21
representing category label->
Figure SMS_23
Representation mapping to specific class labels->
Figure SMS_25
Is>
Figure SMS_20
,/>
Figure SMS_24
Representing the emotion tag word->
Figure SMS_26
Is converted into class labels->
Figure SMS_27
Is a function of the probability of>
Figure SMS_19
Representing class label->
Figure SMS_22
Is used for the prediction probability of (1). Specifically, predictive probabilities for multiple emotion tag wordsThe probability of the contribution of a rate to a class label can be expressed as:
Figure SMS_28
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_29
representing emotion tag words->
Figure SMS_30
Belonging to category label->
Figure SMS_31
Probability of (e.g., [ MASK)]= "good", and
Figure SMS_32
= "active", thenp=1),/>
Figure SMS_33
Representing the probability of the contribution of the predictive probability of a plurality of emotion tag words to a class tag, i.e. class tag +.>
Figure SMS_34
Is used for the prediction probability of (1).
It should be noted that the external emotion word library is not completely matched to the vocabulary in the pre-trained language model, and that some emotion tag words may not be in the vocabulary of the pre-trained language model, and the segmenter may divide them into words. The predictive probabilities of these emotion tag words are averaged.
And secondly, inputting the word segmentation device and the processed text sequence into a pre-trained language model after loading parameters, and executing forward propagation of the language model.
Third, in order to better combine hint tuning with the mask language model, appropriate emotion tag words are required in addition to the design templates. However, predicting [ MASK ] by context does not have a definite answer, and a single emotion tag word may lack comprehensive information resulting in bias. Therefore, the emotion tag words need to have wide coverage and less subjective deviation, and the external emotion word stock can be introduced to well meet the requirements.
The tripolar emotion classification task aims to extend the scope of different classes of emotion to finer granularity and diversity aspects. However, existing studies do not summarize descriptions of neutral mood words, nor are mood words within this field. Therefore, the research of this embodiment focuses on expanding neutral emotion words and adding intra-domain emotion words. In particular, the embodiment extracts positive, negative and neutral emotion opinion words from a data set (SemEval 2016 Task 5: restaurant and notebook computer field data) suitable for the triple emotion classification Task, then calculates word frequencies of the words, and the number of collected words is very large (as shown in brackets in table 2). But too many words may instead introduce noise and many words occur less frequently, which may not contribute much to the predictive label. Therefore, in this embodiment, the words are sorted according to word frequency, and different thresholds are set for emotion words with different polarities in consideration of making the number of each word as balanced as possible, and the specific thresholds are shown in table 1.
TABLE 1
Figure SMS_35
To overcome the constraints of the domain, the present embodiment uses a previously researcher-summarized emotion dictionary, including both positive and negative emotion vocabularies. In addition, the embodiment also searches for "neutral emotion words in english" based on keywords, and collects more objective neutral emotion words from some documents (such as hundred degrees, diced beans, etc.) summarized by other people on the web page, as shown in table 2.
TABLE 2
Figure SMS_36
Table 3 lists the number of words from different sources:
TABLE 3 Table 3
Figure SMS_37
Fourth, although this embodiment has constructed a preliminary emotion knowledge map expressive machine, the sources of emotion knowledge are diverse, and the collected emotion tag words may contain noise and are not entirely suitable for pre-training language models. This embodiment requires processing of words containing noise, retaining words of higher quality, to improve the expressive power of emotional knowledge. The embodiment provides a general optimization method for processing noise-containing emotion words, which comprises four optimization rules.
Optimization rule 1: emotional tendency optimization
Since the construction of emotion tag words is completely unsupervised, a word may repeatedly appear in the same class or classes. For the first problem, the present embodiment performs a deduplication process on each type of word collected. For the second problem, this embodiment uses a social media emotion analysis tool, vader, to determine the category of the input word according to its composite score. The composite emotion score criteria for Vader are shown in Table 4.
TABLE 4 Table 4
Figure SMS_38
Through observation of the data, the present embodiment also finds that some nouns and verbs in the emotion word library have no obvious emotional tendency, which is inconsistent with the templates constructed in the present embodiment. Thus, the present embodiment uses a part-of-speech recognition tool, textblob, to handle non-adjectives in emotion word libraries that have no explicit emotion tendencies.
Optimization rule 2: learning vector quantization optimization
Although this embodiment initially optimizes emotion tag words in terms of emotion tendencies expressed by emotion words, this embodiment cannot intuitively measure differences of different classes and similarities of the same class. In order to create a more differential mapping space for emotion tag words, the present embodiment uses Learning Vector Quantization (LVQ) to construct prototype vectors of different classes to characterize the clustering structure of emotion words, i.e. to make words belonging to the same class closer and words of different classes farther. Since LVQ can use the true class-aided clustering algorithm of the samples, this is very suitable for the screening requirements of this embodiment.
The embodiment is expressed by emotion words
Figure SMS_39
And its corresponding category->
Figure SMS_40
As a set of emotions. First, randomly extracting a sample from each emotion class as a prototype vector +.>
Figure SMS_41
Samples are then selected from the emotion words and their (euclidean) distance from each prototype vector is calculated, namely:
Figure SMS_42
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_43
representation ofXIs a random sample of ∈,>
Figure SMS_44
representing prototype vector +.>
Figure SMS_45
Representation->
Figure SMS_46
To->
Figure SMS_47
(Euclidean) distance.
Then, select the distance
Figure SMS_48
The nearest prototype vector is used as a predicted class label and then is carried out with a real class labelAnd (5) comparing. If the partitioning result is correct, the corresponding prototype vector will be closer to this sample. Otherwise, the corresponding prototype vector is farther from the sample. The formula is as follows:
Figure SMS_49
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_51
indicating distance->
Figure SMS_53
Nearest prototype vector, ">
Figure SMS_55
Representing a real category label->
Figure SMS_52
Category label representing predictions->
Figure SMS_54
Is a hyper-parameter representing learning rate, +.>
Figure SMS_56
Representing the updated prototype vector (prototype vector +.>
Figure SMS_57
Updated to
Figure SMS_50
)。
After the prototype vector is determined, the embodiment retains those emotion words that are closer to the prototype vector of the class for subsequent steps.
Optimization rule 3: learnable weight optimization
In a small sample scenario, the weight of each word may be constantly learned for optimization during the training process. In the training process, this embodiment expects that the emotion tag words that contribute significantly to the result will be weighted more heavily, while the noisy emotion tag words will be weighted less heavily. Each emotion labelWords are assigned a learnable weight
Figure SMS_58
These weights form a vector +.>
Figure SMS_59
All initialized with zero vector, weights at each +.>
Figure SMS_60
And (3) normalization:
Figure SMS_61
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_62
representing the normalized weights.
Notably, this optimization rule is not applicable to cases where there is no training data.
Optimization rule 4: small sample prior optimization
Another problem is that the prior probability of emotion tag words is highly variable. Some works have shown that some words will never be predicted. In the embodiment, small sample data without labels is used as a training set, and emotion label words with low prediction probability are removed, namely small sample prior optimization is performed. The present embodiment uses the model framework itself of the aspect-level emotion classification task to optimize the emotion knowledge map expressive. Specifically, the sentence s is distributed in the corpusDMeaning that all sentences and templates in the distribution are packaged as a new sentence
Figure SMS_63
. Each->
Figure SMS_64
Is put into->
Figure SMS_65
[ MASK of (A)]To calculate the probability of prediction. The whole sentence distribution expectation in the corpus is then treated asIs the prior probability of the emotion tag word. The present embodiment randomly extracts 200 examples from the training dataset in proportion and removes the tags to form a test setC. Every word->
Figure SMS_66
The prior probability of (c) may be approximated as:
Figure SMS_67
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_68
is shown inDEvery word->
Figure SMS_69
Is a priori probability of (c).
The present embodiment then filters out the lower half of the prediction probability according to the ordering method. Since in the case of small samples the parameters are trained by a learnable weight optimization, the rule is only used in a zero sample environment.
Fifth, in this embodiment, a series of optimizations are performed on the emotion tag words in the emotion knowledge language expressive machine, but the optimized emotion tag word probability still needs to be mapped to the category tag probability.
In a zero sample scenario, no parameters are trained or updated. It is assumed that each signature number has the same contribution to the corresponding class prediction. Thus, use
Figure SMS_70
Average value of predictive emotion tag words on +.>
Figure SMS_71
Is a predictive score of (a):
Figure SMS_72
wherein the method comprises the steps of
Figure SMS_73
Representing the predicted final score.
In a small sample scenario, the present embodiment uses
Figure SMS_74
Weighted average of emotion tag words in ++as class tag>
Figure SMS_75
Is a predictive score of (a):
Figure SMS_76
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_77
the overall framework of the model for emotion classification provided in this embodiment is shown in fig. 2, which shows the complete process of emotion polarity prediction of the model on aspect words in sentences. The input sentences (restaurant field data from SemEval 2014 Task 4 Subtask 2) are packaged in templates, then are input into a pre-training language model BERT to obtain the prediction probability of each word filled in the MASK position, and then the emotion knowledge mapping expressive machine maps the prediction probability of the emotion label words to class labels to obtain the final prediction probability of each class. The process of constructing, optimizing and mapping the emotion knowledge mapping expression is shown in detail.
In the zero sample and small sample scenarios, the present embodiment verifies the effectiveness of the method proposed by the present invention on two common public data sets (SemEval 2014 Task 4 Subtask 2: restaurant and notebook data therein), as shown in tables 5 and 6:
in a zero sample scenario, the experimental results of the present embodiment model exceeded other baseline models. Specifically, using BERT as the two data sets of the pre-trained language model, the values of the prediction accuracy (Acc) were increased by 6.42% and 4.29% respectively, and the values of the macro average (MF 1) were increased by 12.01% and 9.99% respectively, as compared to the best results of the baseline model. Meanwhile, BERT-X is used as a pre-training language model, acc values are respectively increased by 1.78% and 4.32%, and macro average (MF 1) values are respectively increased by 10.81% and 7.88%. The accuracy and the value of the macro average are obviously improved, wherein the value of the macro average is increased more remarkably, the prediction variance is reduced, and the model generates more stable performance. This means that the additional emotion words broaden the semantics of the class labels, resulting in a more stable and accurate prediction in the initial state of the model. Thus, extending emotion tag words is effective in improving the performance of the model.
In small sample scenarios, the performance of hinting is in most cases superior to fine tuning. Particularly, the BERT model based on prompt tuning can be better than the BERT model based on fine tuning and learned through intra-domain knowledge, and the advantage of prompt tuning in a small sample scene is illustrated. In the prompt tuning method, the BERT-X-based model and the BERT-X-based model of the embodiment perform well under different training samples. Taking the BERT model as an example, when the number of training samples is 16, the accuracy rate is respectively increased by 3.1 percent and 3.76 percent on two data sets, and the macro average value is respectively increased by 2.91 percent and 5.48 percent; when the number of training samples is 1024, the accuracy rate is increased by 1.48% and 0.39% respectively on the two data sets, and the macro average value is increased by 1.57% and 1.13% respectively. Our model is superior to other prompt tuning based models, proving the effectiveness of the inclusion of external emotion tag words to improve the aspect-level emotion classification. However, as the number of training samples increases, the trend for improvement slows, which indicates that the method of the present embodiment is more competitive with only a small number of samples.
TABLE 5
Figure SMS_78
TABLE 6
Figure SMS_79
The foregoing is merely a preferred embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method is characterized by comprising the following steps:
constructing a prompt template, inputting the prompt template and the text to be classified into a pre-training language model for prediction, and obtaining the prediction probability of a plurality of words corresponding to the text to be classified;
constructing an emotion knowledge mapping expression device, and optimizing a plurality of emotion tag words in the emotion knowledge mapping expression device to obtain optimized emotion tag words;
based on the prediction probabilities of the words, obtaining the optimized prediction probability of the emotion tag words;
and mapping the prediction probability of the optimized emotion tag words to category tags through the emotion knowledge mapping expressive machine to obtain the final prediction probability of the category tags.
2. The simple emotion knowledge enhancement hint tuning aspect-level emotion classification method of claim 1, wherein,
the process for constructing the emotion knowledge mapping expressive machine comprises the following steps: extracting emotion tag words of positive emotion, neutral emotion and negative emotion from a data set for a triple emotion classification task, respectively acquiring word frequencies of the emotion tag words, and sequencing, and setting corresponding thresholds for different emotion tag words based on word frequency sequencing results to acquire emotion tag words in the field; and then continuously extracting emotion tag words of the positive emotion and the negative emotion from the binary emotion dictionary, obtaining the emotion tag words of the neutral emotion based on keyword search, further obtaining the emotion tag words outside the domain, and completing the construction of an emotion knowledge mapping expression device.
3. The simple emotion knowledge enhancement hint tuning aspect-level emotion classification method of claim 1, wherein,
the optimizing process of the emotion tag words in the emotion knowledge mapping expressive machine comprises the following steps: and carrying out emotion tendentiousness optimization, learning vector quantization optimization, learnable weight optimization and small sample priori optimization on the emotion tag words.
4. The method for classifying an aspect-level emotion of simple emotion knowledge enhancement hint tuning of claim 3,
the emotion tendentiousness optimization process for the emotion tag words comprises the following steps: and after the emotion tag words are subjected to de-duplication processing, acquiring categories of the emotion tag words based on a social media emotion analysis tool, and processing the emotion tag words without emotion tendency based on a part-of-speech recognition tool.
5. The method for classifying an aspect-level emotion of simple emotion knowledge enhancement hint tuning of claim 3,
the learning vector quantization optimization process for the emotion tag words comprises the following steps: prototype vectors of different classes of emotion tag words are constructed based on learning vector quantization, and emotion tag words belonging to the same class are clustered.
6. The method for classifying an aspect-level emotion of simple emotion knowledge enhancement hint tuning of claim 3,
the process for performing the learnable weight optimization on the emotion tag words comprises the following steps: and distributing a learnable weight for each emotion label word, forming a vector by all the learnable weights, carrying out normalization processing, and optimizing the weight occupied by each emotion label word.
7. The method for classifying an aspect-level emotion of simple emotion knowledge enhancement hint tuning of claim 3,
the process of carrying out small sample priori optimization on the emotion tag words comprises the following steps: presetting extraction proportion, acquiring a plurality of examples from a training set based on the extraction proportion, removing labels, acquiring a test set, acquiring prior probability of each emotion label word based on the test set, sequencing, and removing emotion label words which do not accord with the preset probability.
8. The simple emotion knowledge enhancement hint tuning aspect-level emotion classification method of claim 1, wherein,
the process of obtaining the final predicted probability of the category label includes: when in a zero sample scene, assuming that the contribution of the optimized emotion tag words to corresponding class prediction is the same, taking the average value of the optimized emotion tag words as the final prediction probability of the class tags; and taking the weighted average value of the optimized emotion label words as the final prediction probability of the class labels in the small sample scene.
CN202310564657.XA 2023-05-19 2023-05-19 Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method Active CN116304063B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310564657.XA CN116304063B (en) 2023-05-19 2023-05-19 Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310564657.XA CN116304063B (en) 2023-05-19 2023-05-19 Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method

Publications (2)

Publication Number Publication Date
CN116304063A true CN116304063A (en) 2023-06-23
CN116304063B CN116304063B (en) 2023-07-21

Family

ID=86794511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310564657.XA Active CN116304063B (en) 2023-05-19 2023-05-19 Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method

Country Status (1)

Country Link
CN (1) CN116304063B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932853A (en) * 2023-07-25 2023-10-24 重庆邮电大学 User demand acquisition method based on APP comment data
CN117407527A (en) * 2023-10-19 2024-01-16 重庆邮电大学 Education field public opinion big data classification method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113657123A (en) * 2021-07-14 2021-11-16 内蒙古工业大学 Mongolian aspect level emotion analysis method based on target template guidance and relation head coding
US20220092267A1 (en) * 2020-09-23 2022-03-24 Jingdong Digits Technology Holding Co., Ltd. Method and system for aspect-level sentiment classification by graph diffusion transformer
CN115526171A (en) * 2022-09-28 2022-12-27 上海销氪信息科技有限公司 Intention identification method, device, equipment and computer readable storage medium
CN115630156A (en) * 2022-09-21 2023-01-20 内蒙古工业大学 Mongolian emotion analysis method and system fusing Prompt and SRU

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220092267A1 (en) * 2020-09-23 2022-03-24 Jingdong Digits Technology Holding Co., Ltd. Method and system for aspect-level sentiment classification by graph diffusion transformer
CN113657123A (en) * 2021-07-14 2021-11-16 内蒙古工业大学 Mongolian aspect level emotion analysis method based on target template guidance and relation head coding
CN115630156A (en) * 2022-09-21 2023-01-20 内蒙古工业大学 Mongolian emotion analysis method and system fusing Prompt and SRU
CN115526171A (en) * 2022-09-28 2022-12-27 上海销氪信息科技有限公司 Intention identification method, device, equipment and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FEI WANG, LONG CHEN, FEI XIE,ET AL: "Few-Shot Text Classification via Semi-Supervised Contrastive Learning", 《2022 4TH INTERNATIONAL CONFERENCE ON NATURAL LANGUAGE PROCESSING (ICNLP)》 *
李佳洲: "面向文本的方面级情感分类研究及系统实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932853A (en) * 2023-07-25 2023-10-24 重庆邮电大学 User demand acquisition method based on APP comment data
CN117407527A (en) * 2023-10-19 2024-01-16 重庆邮电大学 Education field public opinion big data classification method

Also Published As

Publication number Publication date
CN116304063B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN107066553B (en) Short text classification method based on convolutional neural network and random forest
Shivaprasad et al. Sentiment analysis of product reviews: A review
US20190294925A1 (en) Systems and methods for intelligently curating machine learning training data and improving machine learning model performance
Ge et al. Improving text classification with word embedding
CN108717408B (en) Sensitive word real-time monitoring method, electronic equipment, storage medium and system
CN116304063B (en) Simple emotion knowledge enhancement prompt tuning aspect-level emotion classification method
Sundararajan et al. Multi-rule based ensemble feature selection model for sarcasm type detection in twitter
Quispe et al. Using virtual edges to improve the discriminability of co-occurrence text networks
KR20200007713A (en) Method and Apparatus for determining a topic based on sentiment analysis
CN110543564A (en) Method for acquiring domain label based on topic model
CN113255340B (en) Theme extraction method and device for scientific and technological requirements and storage medium
Subramanian et al. A survey on sentiment analysis
CN108038106B (en) Fine-grained domain term self-learning method based on context semantics
CN110688479A (en) Evaluation method and sequencing network for generating abstract
CN111581364B (en) Chinese intelligent question-answer short text similarity calculation method oriented to medical field
Jeyakarthic et al. Optimal bidirectional long short term memory based sentiment analysis with sarcasm detection and classification on twitter data
CN113486670A (en) Text classification method, device and equipment based on target semantics and storage medium
CN116757195A (en) Implicit emotion recognition method based on prompt learning
CN111581984A (en) Statement representation method based on task contribution degree
Sheng et al. A paper quality and comment consistency detection model based on feature dimensionality reduction
Siji George Genetic Algorithm Based Hybrid Model Of Convolutional Neural Network And Random Forest Classifier For Sentiment Classification
KR20070118154A (en) Information processing device and method, and program recording medium
CN113761123A (en) Keyword acquisition method and device, computing equipment and storage medium
CN114662488A (en) Word vector generation method and device, computing device and computer-readable storage medium
Wang et al. Content-based weibo user interest recognition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant