Sentiment classification and model training method and device, medium, product and equipment

By fusing multiple models, including generative and classification models, and combining them with a long short-term memory network, the problem of insufficient accuracy in sentiment classification models is solved, achieving high accuracy and robust sentiment prediction in attribute-level sentiment classification tasks.

CN121614950APending Publication Date: 2026-03-06CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512028735.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of sentiment classification models is relatively low, mainly due to the lack of finely labeled corpus resources, which leads to insufficient accuracy of the trained models in attribute-level sentiment classification tasks.

Method used

A multi-model fusion approach is adopted, in which semantic and contextual features of text information are extracted by generative and classification models respectively, and sentiment prediction is performed by combining long short-term memory networks. By utilizing the zero-shot reasoning ability of generative models and the bidirectional semantic understanding ability of classification models, high-quality features are generated to improve the accuracy of sentiment prediction.

Benefits of technology

By fusing multiple models, the accuracy and robustness of sentiment classification are significantly improved, especially in attribute-level sentiment classification tasks, which can more accurately determine the sentiment polarity of different attributes in text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121614950A_ABST
    Figure CN121614950A_ABST
Patent Text Reader

Abstract

The invention discloses an emotion classification and model training method and device, a medium, a product and equipment, and the method comprises the steps: independently converting obtained text information into first prompt information corresponding to a generation model and second prompt information corresponding to a classification model, the first prompt information is input into a first model containing a generative model to obtain a first feature, so that the first feature can contain rich semantic and context information learned by the generative model, and the second prompt information is input into a second model containing a classification model to obtain a second feature; according to the method, the first feature and the second feature are combined, so that the second feature can contain the preliminary classification information learned by the classification model, and the third feature with richer information content can be obtained through the first feature and the second feature, so that the richness of the feature information received by the prediction model is improved, and the accuracy of an emotion prediction result output by the prediction model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to an emotion classification and its model training method, apparatus, medium, product and equipment. Background Technology

[0002] Sentiment classification is generally used to determine the emotions expressed in a text.

[0003] In related technologies, artificial intelligence models are typically trained to learn the relationship between sample texts and the emotions expressed in those texts. When it is necessary to classify the emotions of a text, the artificial intelligence model is then invoked to complete the emotion classification.

[0004] However, the accuracy of sentiment classification in artificial intelligence models generally depends on using a large amount of finely annotated sentiment classification task corpus during training. For example, corpus obtained by finely annotating specific text information in the corpus with sentiment classification as a relation. However, such corpus resources are scarce, which leads to low sentiment classification accuracy of the trained artificial intelligence models. Summary of the Invention

[0005] To address the aforementioned technical problems, embodiments of this application propose an emotion classification method, apparatus, medium, product, and equipment for training its model, which can improve the accuracy of emotion classification.

[0006] In a first aspect, embodiments of this application provide an emotion classification method, including: Retrieve text information; The text information is converted into a first prompt information, and the first prompt information is input into a first model to obtain a first feature output by the first model, wherein the first model includes a generation model, and the first prompt information corresponds to the generation model; The text information is converted into a second prompt information, and the second prompt information is input into a second model to obtain a second feature output by the second model, wherein the second model includes a classification model, and the second prompt information corresponds to the classification model; Based on the first feature and the second feature, the third feature is obtained; The third feature is input into the prediction model to obtain the sentiment prediction result of the prediction model for the text information.

[0007] Optionally, the text information includes the target text and the attribute information corresponding to the target text; The step of converting the text information into a first prompt message includes: The target text and the attribute information are filled into the first prompt template corresponding to the generated model to obtain the first prompt information.

[0008] Optionally, the first prompt template includes at least two sentiment tags, and the first prompt information is used to prompt the generation model to select a target sentiment tag from the at least two sentiment tags; The first feature includes first probability information, which is adapted to indicate the probability that each of the at least two sentiment tags is selected by the generation model.

[0009] Optionally, the first model further includes a first mapping layer; The step of inputting the first prompt information into the first model to obtain the first feature output by the first model includes: The first prompt information is input into the generation model to obtain the probability distribution output by the generation model, wherein the probability distribution is adapted to indicate the probability distribution of each of the at least two sentiment tags being selected by the generation model; The probability distribution is input into the first mapping layer to obtain the first feature output by the first mapping layer.

[0010] Optionally, the text information includes the target text and the attribute information corresponding to the target text; The step of converting the text information into a second prompt message includes: The target text and the attribute information are filled into the second prompt template corresponding to the classification model to obtain the second prompt information.

[0011] Optionally, the second prompt template includes blank spaces to be filled, and the second prompt information is used to prompt the classification model to determine the filling information to fill the blank spaces based on the target text and the attribute information; The second feature includes second probability information, which is adapted to indicate the category probability of the blank to be filled on different classification task labels.

[0012] Optionally, the second model further includes a second mapping layer; The step of inputting the second prompt information into the second model to obtain the second feature output by the second model includes: The second prompt information is input into the classification model to obtain the label score output by the classification model, wherein the label score is suitable for indicating the score of the blank to be filled on different classification task labels; The label score is input into the second mapping layer to obtain the second feature output by the second mapping layer.

[0013] Optionally, the prediction model includes a Long Short-Term Memory (LSTM) network model and a third mapping layer; The step of inputting the third feature into the prediction model to obtain the sentiment prediction result for the text information output by the prediction model includes: The third feature is input into the LSTM model to obtain the LSTM output feature output by the LSTM model; The LSTM output features are input into the third mapping layer to obtain the sentiment prediction result output by the third mapping layer.

[0014] Secondly, embodiments of this application provide a method for training an emotion classification model, including: Obtain sample text information and its corresponding real labels; The sample text information is converted into first sample prompt information, and the first sample prompt information is input into a first model to obtain the first sample feature output by the first model. The first model includes a generation model, and the first sample prompt information corresponds to the generation model. The sample text information is converted into second sample prompt information, and the second sample prompt information is input into the second model to obtain the second sample features output by the second model. The second model includes a classification model, and the second sample prompt information corresponds to the classification model. Based on the first sample features and the second sample features, the third sample features are obtained; The third sample features are input into the prediction model to obtain the sentiment sample prediction result of the prediction model for the sample text information. Based on the first sample features, the second sample features, the sentiment sample prediction results, and the true labels, a comprehensive loss is determined, and the sentiment classification model to be trained is trained according to the comprehensive loss, wherein the sentiment classification model to be trained includes the first model, the second model, and the prediction model.

[0015] Thirdly, embodiments of this application provide an emotion classification device, including: The text acquisition module is used to acquire text information; A first text processing module is used to convert the text information into first prompt information, and input the first prompt information into a first model to obtain a first feature output by the first model, wherein the first model includes a generation model, and the first prompt information corresponds to the generation model; The second text processing module is used to convert the text information into second prompt information, and input the second prompt information into the second model to obtain the second feature output by the second model, wherein the second model includes a classification model, and the second prompt information corresponds to the classification model; The feature processing module is used to obtain a third feature based on the first feature and the second feature; The prediction module is used to input the third feature into the prediction model to obtain the sentiment prediction result of the prediction model for the text information.

[0016] Fourthly, embodiments of this application provide an emotion classification model training apparatus, comprising: The sample acquisition module is used to acquire sample text information and its corresponding real labels; The first sample processing module is used to convert the sample text information into first sample prompt information, and input the first sample prompt information into the first model to obtain the first sample feature output by the first model, wherein the first model includes a generation model, and the first sample prompt information corresponds to the generation model; The second sample processing module is used to convert the sample text information into second sample prompt information, and input the second sample prompt information into the second model to obtain the second sample features output by the second model, wherein the second model includes a classification model, and the second sample prompt information corresponds to the classification model; The sample feature processing module is used to obtain a third sample feature based on the first sample feature and the second sample feature; The sample prediction module is used to input the features of the third sample into the prediction model to obtain the sentiment sample prediction result of the prediction model for the sample text information. The training module is used to determine a comprehensive loss based on the first sample features, the second sample features, the sentiment sample prediction results, and the true labels, and to train the sentiment classification model to be trained according to the comprehensive loss, wherein the sentiment classification model to be trained includes the first model, the second model, and the prediction model.

[0017] Fifthly, embodiments of this application provide a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.

[0018] Sixthly, embodiments of this application provide a computer program product, including computer instructions that, when executed by a processor, implement the steps of the method described in any of the preceding claims.

[0019] In a seventh aspect, embodiments of this application provide a computer device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the steps of the method described in any of the preceding claims.

[0020] In summary, the embodiments of this application have at least the following beneficial effects: In this embodiment, after obtaining text information, the text information is independently converted into a first prompt message corresponding to the generative model and a second prompt message corresponding to the classification model. The first prompt message is then input into a first model containing the generative model to obtain a first feature output by the first model, so that the first feature can contain rich semantic and contextual information learned by the generative model. The second prompt message is then input into a second model containing the classification model to obtain a second feature output by the second model, so that the second feature can contain preliminary classification information learned by the classification model. This is equivalent to extracting different information from the text information by different models according to their own characteristics. In this way, a third feature with richer information content can be obtained through the first and second features, so as to improve the richness of feature information received by the prediction model and thus improve the accuracy of the sentiment prediction result output by the prediction model. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the emotion classification method provided in an embodiment of this application; Figure 2 This is a schematic diagram of emotion classification provided in an embodiment of this application; Figure 3 This is a flowchart illustrating the emotion classification model training method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the emotion classification device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the emotion classification model training device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments / examples are only a part of the embodiments / examples of this application, and not all of the embodiments / examples. Based on the embodiments / examples in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0023] In the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "multiple" means two or more. In the description of this application, the term "comprising" and its variations are open-ended, meaning "including but not limited to." The term "based on" means "at least partially based on." The term "according to" means "at least partially according to." The term "one embodiment / example" means "at least one embodiment / example"; the term "another embodiment / example" means "at least one additional embodiment / example"; the term "some embodiments / examples" means "at least some embodiments / examples."

[0024] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0025] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing specific embodiments only and is not intended to limit the application. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0026] In some exemplary scenarios, sentiment classification is a fundamental research area in sentiment analysis, aiming to determine the sentiment expressed in text, such as positive or negative sentiment. Sentiment classification is gradually shifting from coarse-grained to fine-grained. Coarse-grained sentiment classification tasks mainly determine the overall sentiment tendency of document-level or sentence-level texts, while fine-grained attribute-level sentiment classification tasks require precise sentiment polarity judgment for each specific attribute of the evaluated object in the text. For example, if a user's review of a restaurant is "The food tastes good, but the service is bad," the food attribute is judged as positive sentiment, while the service attribute is judged as negative sentiment.

[0027] In related technologies, attribute-level sentiment classification can utilize deep learning and other related solutions to semantically align each attribute with the sentence in order to learn the sentence representation related to the attribute. However, this requires fine-grained annotation of the sentiment polarity of the text and its specific attributes. However, such finely annotated sample corpora are not easy to collect and are relatively scarce, making it difficult to train a model with high sentiment classification accuracy.

[0028] Furthermore, to address the scarcity of labeled sample resources, data augmentation of the sample text can be used to alleviate this problem by introducing additional information into the sample text. For example: (1) A text-level evaluation text can be introduced, and two auxiliary tasks (text-level sentiment classification and sentence-to-sentence sentiment coherence judgment) can be designed. Through joint learning of the main task and auxiliary tasks, the sentiment information in the text-level text can be mined and applied to the attribute-level sentiment classification task.

[0029] However, due to the scarcity of corpus resources for attribute-level sentiment classification tasks, a significant problem with data augmentation schemes in related technologies is the inevitable introduction of samples where the text and labels are inconsistent, which in turn impairs the model's learning.

[0030] (2) First, obtain the fusion feature information of each word in the target sentence of the text to be classified and the word embedding information of the attribute words. The fusion feature information of each word in the target sentence is obtained by integrating its word embedding information, local distance embedding information and global distance embedding information. Then, process the fusion feature information of each word in the target sentence and the word embedding information of the attribute words to obtain the sentence representation information of the target sentence. Finally, obtain the sentiment classification of the target sentence based on the sentence representation information of the target sentence.

[0031] However, classification models generally have limitations. Attribute-level sentiment classification corpora usually contain different sentiments for different attributes. Therefore, complex semantics pose challenges to text understanding and information extraction. Simple classification models also find it difficult to fully explore the sentiment meaning of a particular attribute.

[0032] It is evident that the aforementioned solutions all have their own unresolved problems. Therefore, this application provides an emotion classification scheme to at least partially address the shortcomings of the aforementioned solutions.

[0033] Firstly, see [the following] Figure 1 The diagram shows a flowchart of an emotion classification method provided in an embodiment of this application. This emotion classification method can be applied to a computer device with data processing capabilities. The method includes S101-S105, as detailed below.

[0034] S101, retrieve text information.

[0035] In some examples, the acquired text information may include target text and corresponding attribute information. The target text can be text in different languages, such as English, Chinese, and / or other languages. The attribute information can be used to describe the relevant attributes of specific words with specific meanings in the text. This attribute information may include words extracted from the target text that are related to the specified attributes. For example, in Chinese, if a user's review of a restaurant is "The food tastes good, but the service is poor," then "food taste" and "service" can be words related to the specified attributes. In other examples, the attribute information may also include conjunctions related to the semantics indicated by the target text. For example, in the English sentence "Excellent food, although the interior could use some help," the conjunction may include "ambience," which is related to "although the interior could use some help." Thus, the attribute information may include at least one of the following: words extracted from the target text that are related to the specified attributes, and conjunctions related to the semantics indicated by the target text.

[0036] S102, the text information is converted into first prompt information, and the first prompt information is input into a first model to obtain a first feature output by the first model, wherein the first model includes a generation model, and the first prompt information corresponds to the generation model.

[0037] In some examples, the text information can be transformed according to the first prompt template corresponding to the generating model to obtain the first prompt information.

[0038] In some examples, the first prompt information can be directly input into the generative model included in the first model. In this way, the first feature can be the output of the generative model, or it can be a feature output by other models / networks obtained by further inputting the output of the generative model into other models and / or networks included in the first model.

[0039] In other examples, the first prompt information can be input into other models and / or networks included in the first model (e.g., models and / or networks used to preprocess the prompt information), and then the features output by the other models and / or networks can be further input into the generative model to obtain the output of the generative model. Here, the output of the generative model can be referred to the description of the previous example, and will not be repeated here.

[0040] It is understood that the above model and / or network may include at least one model and / or at least one network. When the total number of models and networks is greater than 1, the model and / or network may be used to construct a larger model, and the larger model may be electrically connected to the generated model.

[0041] S103, the text information is converted into second prompt information, and the second prompt information is input into the second model to obtain the second feature output by the second model, wherein the second model includes a classification model, and the second prompt information corresponds to the classification model.

[0042] In some examples, the text information can be transformed according to the second prompt template corresponding to the classification model to obtain the second prompt information.

[0043] In some examples, the second prompt information can be directly input into the classification model included in the second model. In this way, the second feature can be the output of the classification model, or it can be a feature output by other models / networks obtained by further inputting the output of the classification model into other models and / or networks included in the second model.

[0044] In other examples, the second prompt information can also be input into other models and / or networks included in the second model (e.g., models and / or networks used to preprocess the prompt information), and then the features output by the other models and / or networks can be further input into the classification model to obtain the output of the classification model. Here, the output of the classification model can be referred to the description of the previous example, and will not be repeated here.

[0045] It is understood that the above model and / or network may include at least one model and / or at least one network. When the total number of models and networks is greater than 1, the model and / or network may be used to construct a larger model, and the larger model may be electrically connected to the classification model.

[0046] In some examples, the classification model can be built based on the BERT (Bidirectional Encoder Representations from Transformers) masked language model.

[0047] S104, based on the first feature and the second feature, a third feature is obtained.

[0048] In some examples, the first feature and the second feature can be combined to form a third feature.

[0049] In some examples, a third feature can be obtained by fusing the first feature and the second feature.

[0050] S105, the third feature is input into the prediction model to obtain the sentiment prediction result of the prediction model for the text information.

[0051] In some examples, the prediction model can be a pre-trained attribute-level sentiment prediction model, and the sentiment prediction result can be an attribute-level sentiment prediction result. The attribute-level sentiment prediction result can include the prediction result of at least one attribute. For example, suppose a user's evaluation of a restaurant is "The food tastes good, but the service is bad". Then the attribute-level sentiment prediction result corresponding to this text can be the prediction result for the food attribute and / or the service attribute. The prediction result of a single attribute can be a binary classification of positive sentiment result and negative sentiment result, or it can be a sentiment result in the form of multiple levels representing different degrees. This is not specifically / uniquely limited here.

[0052] In one optional implementation, the text information includes the target text and the attribute information corresponding to the target text; The step of converting the text information into a first prompt message includes: The target text and the attribute information are filled into the first prompt template corresponding to the generated model to obtain the first prompt information.

[0053] In this embodiment, the first prompt information can be constructed by filling the target text and attribute information into the first prompt template. After it is input into the first model, the generative model in the first model can more accurately understand the processing task to be performed, stimulate its zero-shot reasoning ability, so that the first model can finally output high-quality, interpretable, semantically confident first features, providing strong support for subsequent multi-model fusion.

[0054] In some examples, the generative model can be used to mine rich semantic and contextual information based on the target text and attribute information. It is easy to understand that the first prompt information can be used to prompt the generative model to mine the semantic and contextual information. For example, the first prompt information can be used to prompt the generative model to use the attribute information as the mining basis to mine semantic and contextual information from the target text. At this time, the first prompt template can be constructed with a mining basis space and a mining object space. In this way, the attribute information can be filled into the mining basis space and the target text can be filled into the mining object space to form the first prompt information.

[0055] In one optional implementation, the first prompt template includes at least two sentiment tags, and the first prompt information is used to prompt the generation model to select a target sentiment tag from the at least two sentiment tags; The first feature includes first probability information, which is adapted to indicate the probability that each of the at least two sentiment tags is selected by the generation model.

[0056] In some examples, where the prediction result for a single attribute is a binary classification of positive and negative sentiment, the at least two sentiment labels can include positive sentiment labels (e.g., "good") and negative sentiment labels (e.g., "bad," "inferior," "terrible"). Taking English as an example, suppose the target text is x, and the attribute information is a. k Then the first prompt information obtained through the first prompt template can be represented as Q(x, a k )=x What do you think of the a k The statement "You can only answer terrible or great" limits the generative model to choose one of the two sentiment labels, "terrible" or "great," as its output. In this way, this embodiment allows the generative model to perform classification tasks, thus leveraging its powerful semantic and contextual information mining capabilities.

[0057] In some examples, the first prompt can be used to prompt the generative model to determine the probability of each of the at least two sentiment tags being selected by the generative model based on the first prompt, and to select the top N sentiment tags with the highest probabilities from the at least two sentiment tags as target sentiment tags, where N is a positive integer, and for example, N can be 1.

[0058] In some examples, where the prediction result of a single attribute is used to characterize a sentiment outcome in multiple levels of different degrees (e.g., the first-level sentiment outcome represents the highest degree of positivity and the last-level sentiment outcome represents the highest degree of negativity), the at least two sentiment tags may include multi-level sentiment tags, such as the first-level sentiment tag representing the highest degree of positivity and the last-level sentiment tag representing the highest degree of negativity.

[0059] In one alternative implementation, the first model further includes a first mapping layer; The step of inputting the first prompt information into the first model to obtain the first feature output by the first model includes: The first prompt information is input into the generation model to obtain the probability distribution output by the generation model, wherein the probability distribution is adapted to indicate the probability distribution of each of the at least two sentiment tags being selected by the generation model; The probability distribution is input into the first mapping layer to obtain the first feature output by the first mapping layer.

[0060] In some examples, this initial cue information can be used to prompt the generative model to determine the probability distribution of each of the at least two sentiment tags being selected by the generative model, where the target text is x and the attribute information is a. k Then the first prompt information obtained through the first prompt template can be represented as Q(x, a k What do you think of the a? k You can only answer "terrible" or "great." Therefore, this probability distribution can be expressed by the following formula:

[0061] in, Let M1 represent the probability distribution, v represent the sentiment tag, and position t represent the location of the target sentiment tag in the output answer of the generative model. t This represents the predicted character at position t in the response output by the generative model (i.e., the predicted position of each sentiment tag at position t).

[0062] In some examples, the first mapping layer may include an activation function layer (e.g., a Softmax layer). Thus, by inputting the probability distribution into the activation function layer, the first feature m1_logit output by the activation function layer can be obtained, which can be expressed by the following formula.

[0063]

[0064] In one optional implementation, the text information includes the target text and the attribute information corresponding to the target text; The step of converting the text information into a second prompt message includes: The target text and the attribute information are filled into the second prompt template corresponding to the classification model to obtain the second prompt information.

[0065] In this embodiment, the second prompt information can be constructed by filling the target text and attribute information into the second prompt template. After it is input into the second model, the classification model in the second model can more accurately understand the processing task to be performed. It can guide the classification model to focus on the sentiment polarity judgment of specific attributes, make full use of the bidirectional semantic understanding and mask prediction capabilities of the classification model (such as BERT model), generate high-precision, structured second features, thereby significantly improving the accuracy and robustness of attribute-level sentiment analysis.

[0066] In some examples, the classification model can be used to perform classification based on target text and attribute information. For instance, the second prompt can prompt the classification model to use the attribute information as the classification basis to perform preliminary attribute-level sentiment classification of the target text, thus obtaining a preliminary attribute-level sentiment classification result. In this case, the second prompt template can be constructed with a classification basis space and a classified object space, so that attribute information can be filled into the classification basis space and target text can be filled into the classified object space to form the second prompt.

[0067] In one optional implementation, the second prompt template includes blank spaces to be filled, and the second prompt information is used to prompt the classification model to determine the filling information to fill the blank spaces based on the target text and the attribute information. The second feature includes second probability information, which is adapted to indicate the category probability of the blank to be filled on different classification task labels.

[0068] In some examples, taking English as an example, let's assume the target text is x and the attribute information is a. k Then the second prompt information obtained through the second prompt template can be represented as P(x, a k =[CLS] xa k is [MASK]. [SEP], where [MASK] is the blank to be filled. At this time, the second prompt information can be used to prompt the classification model to decide the filling information (such as the filling word) at "[MASK]". In this way, this embodiment can convert the classification task into a cloze test task, so as to improve the targeting of the classification model in the attribute-level sentiment classification task.

[0069] In some cases, L can be set as the classification task label set, which includes different classification task labels l (l∈L), and V as the label word set (vocabulary). A label mapping function v: L—>V is constructed to map the classification task labels to one or more label words in the pre-defined vocabulary V in the classification model M2. For example, in the sentiment binary classification task, label 0 corresponds to the word "terrible" in the vocabulary, and label 1 corresponds to the word "great" in the vocabulary. P(x, a k The input of the MASK symbol is used as the input to the classification model M2, which then yields the scores for the corresponding position of "[MASK]" on different classification task labels l. :

[0070] in, This represents the encoding of the i-th tag word corresponding to tag l (assuming the length of the tag word |v(l)|=d, v(l)=v1(l)v2(l)...v d (l)), where a is the total number of tag words corresponding to tag l.

[0071] In one alternative implementation, the second model further includes a second mapping layer; The step of inputting the second prompt information into the second model to obtain the second feature output by the second model includes: The second prompt information is input into the classification model to obtain the label score output by the classification model, wherein the label score is suitable for indicating the score of the blank to be filled on different classification task labels; The label score is input into the second mapping layer to obtain the second feature output by the second mapping layer.

[0072] In some examples, the second mapping layer may include an activation function layer (e.g., a softmax layer). Thus, by inputting the label score into the activation function layer, the second feature m2_logit output by that activation function layer can be obtained, which can be represented by the following formula: .

[0073] In some examples, the third feature p can be obtained by concatenating the first and second features, which can be represented by the following formula: Thus, the concatenated third feature p can be used as input to the LSTM model.

[0074] In one optional implementation, the prediction model includes a Long Short-Term Memory (LSTM) network model and a third mapping layer; The step of inputting the third feature into the prediction model to obtain the sentiment prediction result for the text information output by the prediction model includes: The third feature is input into the LSTM model to obtain the LSTM output feature output by the LSTM model; The LSTM output features are input into the third mapping layer to obtain the sentiment prediction result output by the third mapping layer.

[0075] In some examples, the LSTM model may include at least one LSTM layer electrically connected in sequence. The third feature can be used as input to the first LSTM layer. Thus, the output of the last LSTM layer can be used as the LSTM output feature of the LSTM model. In this embodiment, the LSTM layer can be used to capture the relationship between the outputs of the first model and the second model, and the fused third feature p can be further processed to extract a more complex and advanced feature representation (i.e., the LSTM output feature). Specifically, this can be expressed by the following formula: .

[0076] In some examples, the third mapping layer may include a linear layer. In this way, the LSTM output features of the LSTM model can be input into the linear layer and processed by the linear layer to obtain the label fusion prediction result generated by the linear layer, which can be used as the sentiment prediction result and output. This can be expressed by the following formula.

[0077]

[0078]

[0079] Where W is the weight matrix to be learned in the linear layer, and H represents the output features of the LSTM.

[0080] See Figure 2 The following is combined with Figure 2 Provide a specific example.

[0081] First, obtain text information. For example, using the English sentence "Excellent food, although the interior could use some help (Translation: Delicious food, although the interior decoration needs improvement)" as the text information, convert this text information into a first prompt (i.e., Excellent food, although the interior could use some help. What do you think of the ambience? You can only answer terrible or great.) and a second prompt (i.e., Excellent food, although the interior could use some help. The ambience is [MASK]). Then input them into the generative model (e.g., ...). Figure 2 Generative language models and classification models (e.g.) Figure 2 In the masked language model, and to make the probability distribution output by the generative model... The input to the Softmax layer and the scores of the blanks to be filled in the classification model on different classification task labels. Input into the Softmax layer.

[0082] Then, the first and second features output by the two Softmax layers are concatenated to obtain the third feature, which is then input into the LSTM model to obtain the LSTM output features.

[0083] Finally, the LSTM output features are input into a linear layer (e.g., Figure 2 In the FC (Fully Connected Layer) of the linear layer, the sentiment prediction result output by the linear layer is obtained, which corresponds to the "terrible or great" of the first prompt information mentioned above.

[0084] Secondly, see Figure 3 The diagram shows a flowchart of a sentiment classification model training method provided in an embodiment of this application. This sentiment classification model training method can be applied to a computer device with data processing capabilities. The method includes steps S301-S306, as detailed below.

[0085] S301, Obtain sample text information and its corresponding real labels; S302, the sample text information is converted into first sample prompt information, and the first sample prompt information is input into the first model to obtain the first sample feature output by the first model, wherein the first model includes a generation model, and the first sample prompt information corresponds to the generation model; S303, the sample text information is converted into second sample prompt information, and the second sample prompt information is input into the second model to obtain the second sample features output by the second model, wherein the second model includes a classification model, and the second sample prompt information corresponds to the classification model; S304, Based on the first sample features and the second sample features, obtain the third sample features; S305, input the third sample features into the prediction model to obtain the sentiment sample prediction result for the sample text information output by the prediction model; S306, based on the first sample features, the second sample features, the sentiment sample prediction results and the true labels, a comprehensive loss is determined, and the sentiment classification model to be trained is trained according to the comprehensive loss, wherein the sentiment classification model to be trained includes the first model, the second model and the prediction model.

[0086] In one optional implementation, the sample text information includes the sample target text and the sample attribute information corresponding to the sample target text; The step of converting the sample text information into first sample prompt information includes: The sample target text and the sample attribute information are filled into the first prompt template corresponding to the generation model to obtain the first sample prompt information.

[0087] In one optional implementation, the first prompt template includes at least two sentiment tags, and the first sample prompt information is used to prompt the generation model to select a target sentiment tag from the at least two sentiment tags; The first sample feature includes first sample probability information, which is adapted to indicate the probability that each of the at least two sentiment tags is selected by the generation model.

[0088] In one alternative implementation, the first model further includes a first mapping layer; The step of inputting the first sample prompt information into the first model to obtain the first sample feature output by the first model includes: The first sample prompt information is input into the generation model to obtain the sample probability distribution output by the generation model, wherein the sample probability distribution is adapted to indicate the probability distribution of each of the at least two sentiment tags being selected by the generation model; The sample probability distribution is input into the first mapping layer to obtain the first sample feature output by the first mapping layer.

[0089] In one optional implementation, the sample text information includes the sample target text and the sample attribute information corresponding to the sample target text; The step of converting the sample text information into second sample prompt information includes: The sample target text and the sample attribute information are filled into the second prompt template corresponding to the classification model to obtain the second sample prompt information.

[0090] In one optional implementation, the second prompt template includes blank spaces to be filled, and the second sample prompt information is used to prompt the classification model to determine the filling information to fill the blank spaces based on the sample target text and the sample attribute information. The second sample feature includes second sample probability information, which is adapted to indicate the category probability of the blank to be filled on different classification task labels.

[0091] In one alternative implementation, the second model further includes a second mapping layer; The step of inputting the second sample prompt information into the second model to obtain the second sample features output by the second model includes: The second sample prompt information is input into the classification model to obtain the label score output by the classification model, wherein the label score is suitable for indicating the score of the blank to be filled on different classification task labels; The label score is input into the second mapping layer to obtain the second sample feature output by the second mapping layer.

[0092] In one optional implementation, the prediction model includes a Long Short-Term Memory (LSTM) network model and a third mapping layer; The step of inputting the third sample features into the prediction model to obtain the sentiment sample prediction result for the sample text information output by the prediction model includes: The third sample feature is input into the LSTM model to obtain the LSTM output feature output by the LSTM model; The LSTM output features are input into the third mapping layer to obtain the sentiment sample prediction result output by the third mapping layer.

[0093] In one optional implementation, determining the comprehensive loss based on the first sample features, the second sample features, the sentiment sample prediction result, and the true label includes: Based on the difference between the real feature information associated with the first model in the real label and the features of the first sample, a first loss is determined. Based on the difference between the real feature information associated with the second model in the real label and the features of the second sample, a second loss is determined. Based on the difference between the real feature information associated with the prediction model in the real labels and the prediction results of the sentiment samples, a third loss is determined. The first loss, the second loss, and the third loss are weighted and calculated to obtain the comprehensive loss.

[0094] In some examples, the first loss and / or the second loss and / or the third loss can be calculated using the cross-entropy loss function.

[0095] In some examples, the formalized expression of the above-mentioned comprehensive loss may include:

[0096] Where m1_logit represents the first sample feature, m2_logit represents the second sample feature, lstm_logit represents the sentiment sample prediction result, label represents the true label, α, β, and γ are the coefficients of the first loss, the second loss, and the third loss, respectively. For example, α=0.5, β=0.5, and γ=1 can be taken, and L() represents the cross-entropy loss function.

[0097] Thirdly, correspondingly, this application also provides an emotion classification device that can implement all the processes of the emotion classification method provided in the above embodiments.

[0098] See Figure 4 The diagram shows a schematic representation of the structure of an emotion classification device 400 provided in an embodiment of this application. The emotion classification device 400 includes: Text acquisition module 401 is used to acquire text information; The first text processing module 402 is used to convert the text information into first prompt information, and input the first prompt information into a first model to obtain a first feature output by the first model, wherein the first model includes a generation model, and the first prompt information corresponds to the generation model; The second text processing module 403 is used to convert the text information into second prompt information, and input the second prompt information into the second model to obtain the second feature output by the second model, wherein the second model includes a classification model, and the second prompt information corresponds to the classification model; The feature processing module 404 is used to obtain a third feature based on the first feature and the second feature; The prediction module 405 is used to input the third feature into the prediction model to obtain the sentiment prediction result of the prediction model for the text information.

[0099] In one optional implementation, the text information includes the target text and the attribute information corresponding to the target text; The step of converting the text information into a first prompt message includes: The target text and the attribute information are filled into the first prompt template corresponding to the generated model to obtain the first prompt information.

[0100] In one optional implementation, the first prompt template includes at least two sentiment tags, and the first prompt information is used to prompt the generation model to select a target sentiment tag from the at least two sentiment tags; The first feature includes first probability information, which is adapted to indicate the probability that each of the at least two sentiment tags is selected by the generation model.

[0101] In one alternative implementation, the first model further includes a first mapping layer; The step of inputting the first prompt information into the first model to obtain the first feature output by the first model includes: The first prompt information is input into the generation model to obtain the probability distribution output by the generation model, wherein the probability distribution is adapted to indicate the probability distribution of each of the at least two sentiment tags being selected by the generation model; The probability distribution is input into the first mapping layer to obtain the first feature output by the first mapping layer.

[0102] In one optional implementation, the text information includes the target text and the attribute information corresponding to the target text; The step of converting the text information into a second prompt message includes: The target text and the attribute information are filled into the second prompt template corresponding to the classification model to obtain the second prompt information.

[0103] In one optional implementation, the second prompt template includes blank spaces to be filled, and the second prompt information is used to prompt the classification model to determine the filling information to fill the blank spaces based on the target text and the attribute information. The second feature includes second probability information, which is adapted to indicate the category probability of the blank to be filled on different classification task labels.

[0104] In one alternative implementation, the second model further includes a second mapping layer; The step of inputting the second prompt information into the second model to obtain the second feature output by the second model includes: The second prompt information is input into the classification model to obtain the label score output by the classification model, wherein the label score is suitable for indicating the score of the blank to be filled on different classification task labels; The label score is input into the second mapping layer to obtain the second feature output by the second mapping layer.

[0105] In one optional implementation, the prediction model includes a Long Short-Term Memory (LSTM) network model and a third mapping layer; The step of inputting the third feature into the prediction model to obtain the sentiment prediction result for the text information output by the prediction model includes: The third feature is input into the LSTM model to obtain the LSTM output feature output by the LSTM model; The LSTM output features are input into the third mapping layer to obtain the sentiment prediction result output by the third mapping layer.

[0106] Fourthly, correspondingly, this application also provides an emotion classification model training device that can implement all the processes of the emotion classification model training method provided in the above embodiments.

[0107] See Figure 5 The diagram shows a schematic of the structure of the emotion classification model training device 500 provided in an embodiment of this application. The emotion classification model training device 500 includes: The sample acquisition module 501 is used to acquire sample text information and its corresponding real labels; The first sample processing module 502 is used to convert the sample text information into first sample prompt information, and input the first sample prompt information into a first model to obtain the first sample feature output by the first model, wherein the first model includes a generation model, and the first sample prompt information corresponds to the generation model; The second sample processing module 503 is used to convert the sample text information into second sample prompt information, and input the second sample prompt information into the second model to obtain the second sample features output by the second model, wherein the second model includes a classification model, and the second sample prompt information corresponds to the classification model; The sample feature processing module 504 is used to obtain a third sample feature based on the first sample feature and the second sample feature; The sample prediction module 505 is used to input the features of the third sample into the prediction model to obtain the sentiment sample prediction result of the prediction model for the sample text information. The training module 506 is used to determine a comprehensive loss based on the first sample features, the second sample features, the sentiment sample prediction results, and the true labels, and to train the sentiment classification model to be trained according to the comprehensive loss, wherein the sentiment classification model to be trained includes the first model, the second model, and the prediction model.

[0108] In one optional implementation, the sample text information includes the sample target text and the sample attribute information corresponding to the sample target text; The step of converting the sample text information into first sample prompt information includes: The sample target text and the sample attribute information are filled into the first prompt template corresponding to the generation model to obtain the first sample prompt information.

[0109] In one optional implementation, the first prompt template includes at least two sentiment tags, and the first sample prompt information is used to prompt the generation model to select a target sentiment tag from the at least two sentiment tags; The first sample feature includes first sample probability information, which is adapted to indicate the probability that each of the at least two sentiment tags is selected by the generation model.

[0110] In one alternative implementation, the first model further includes a first mapping layer; The step of inputting the first sample prompt information into the first model to obtain the first sample feature output by the first model includes: The first sample prompt information is input into the generation model to obtain the sample probability distribution output by the generation model, wherein the sample probability distribution is adapted to indicate the probability distribution of each of the at least two sentiment tags being selected by the generation model; The sample probability distribution is input into the first mapping layer to obtain the first sample feature output by the first mapping layer.

[0111] In one optional implementation, the sample text information includes the sample target text and the sample attribute information corresponding to the sample target text; The step of converting the sample text information into second sample prompt information includes: The sample target text and the sample attribute information are filled into the second prompt template corresponding to the classification model to obtain the second sample prompt information.

[0112] In one optional implementation, the second prompt template includes blank spaces to be filled, and the second sample prompt information is used to prompt the classification model to determine the filling information to fill the blank spaces based on the sample target text and the sample attribute information. The second sample feature includes second sample probability information, which is adapted to indicate the category probability of the blank to be filled on different classification task labels.

[0113] In one alternative implementation, the second model further includes a second mapping layer; The step of inputting the second sample prompt information into the second model to obtain the second sample features output by the second model includes: The second sample prompt information is input into the classification model to obtain the label score output by the classification model, wherein the label score is suitable for indicating the score of the blank to be filled on different classification task labels; The label score is input into the second mapping layer to obtain the second sample feature output by the second mapping layer.

[0114] In one optional implementation, the prediction model includes a Long Short-Term Memory (LSTM) network model and a third mapping layer; The step of inputting the third sample features into the prediction model to obtain the sentiment sample prediction result for the sample text information output by the prediction model includes: The third sample feature is input into the LSTM model to obtain the LSTM output feature output by the LSTM model; The LSTM output features are input into the third mapping layer to obtain the sentiment sample prediction result output by the third mapping layer.

[0115] In one optional implementation, determining the comprehensive loss based on the first sample features, the second sample features, the sentiment sample prediction result, and the true label includes: Based on the difference between the real feature information associated with the first model in the real label and the features of the first sample, a first loss is determined. Based on the difference between the real feature information associated with the second model in the real label and the features of the second sample, a second loss is determined. Based on the difference between the real feature information associated with the prediction model in the real labels and the prediction results of the sentiment samples, a third loss is determined. The first loss, the second loss, and the third loss are weighted and calculated to obtain the comprehensive loss.

[0116] Fifthly, embodiments of this application provide a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.

[0117] Sixthly, embodiments of this application provide a computer program product, including computer instructions that, when executed by a processor, implement the steps of the method described in any of the preceding claims.

[0118] In a seventh aspect, embodiments of this application provide a computer device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the steps of the method described in any of the preceding claims.

[0119] See Figure 6 The computer device in this embodiment includes a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the processor 601 executes the computer program, it implements the steps in the various emotion classification method embodiments and / or emotion classification model training method embodiments described above.

[0120] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 602 and executed by the processor 601 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.

[0121] The computer device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device may include, but is not limited to, a processor 601 and a memory 602. Those skilled in the art will understand that the schematic diagram is merely an example of a computer device and does not constitute a limitation on the computer device. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.

[0122] The processor 601 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or processor 601 can be any conventional processor. The processor 601 is the control center of the computer device, connecting various parts of the entire computer device through various interfaces and lines.

[0123] The memory 602 can be used to store the computer programs and / or modules. The processor 601 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 602 and calling the data stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0124] Wherein, if the modules / units integrated into the computer device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a non-transitory computer-readable storage medium. When the computer program is executed by the processor 601, it can implement the steps of the various method embodiments described above. Wherein, the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0125] In summary, the embodiments of this application have at least the following beneficial effects: In this embodiment, after obtaining text information, the text information is independently converted into a first prompt message corresponding to the generative model and a second prompt message corresponding to the classification model. The first prompt message is then input into a first model containing the generative model to obtain a first feature, which contains rich semantic and contextual information learned by the generative model. The second prompt message is then input into a second model containing the classification model to obtain a second feature, which contains preliminary classification information learned by the classification model. This is equivalent to extracting information with different focuses from the text information through different models according to their own characteristics. Furthermore, a third feature with richer information content can be obtained through the first and second features, thereby improving the richness of feature information received by the prediction model and thus improving the accuracy of the sentiment prediction results output by the prediction model.

[0126] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary hardware platforms, or it can be implemented entirely by hardware. Based on this understanding, all or part of the technical solutions of this application that contribute to the background technology can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0127] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.

Claims

1. A method of sentiment classification, characterized by, The method comprises: obtaining text information; converting the text information into first prompt information, inputting the first prompt information into a first model to obtain first features output by the first model, wherein the first model comprises a generative model, and the first prompt information corresponds to the generative model; converting the text information into second prompt information, inputting the second prompt information into a second model to obtain second features output by the second model, wherein the second model comprises a classification model, and the second prompt information corresponds to the classification model; obtaining third features based on the first features and the second features; inputting the third features into a prediction model to obtain a sentiment prediction result for the text information output by the prediction model.

2. The method of claim 1, wherein, The text information comprises target text and attribute information corresponding to the target text; The conversion of the text information into the first prompt information comprises: filling the target text and the attribute information into a first prompt template corresponding to the generative model to obtain the first prompt information.

3. The method of claim 2, wherein: the first prompt template comprises at least two sentiment label words, and the first prompt information is used to prompt the generative model to select a target sentiment label word from the at least two sentiment label words; the first features comprise first probability information, and the first probability information is used to indicate probabilities of the at least two sentiment label words being selected by the generative model.

4. The method of claim 3, wherein, The first model further comprises a first mapping layer. The inputting of the first prompt information into the first model to obtain the first features output by the first model comprises: inputting the first prompt information into the generative model to obtain a probability distribution output by the generative model, wherein the probability distribution is used to indicate probability distributions of the at least two sentiment label words being selected by the generative model; inputting the probability distribution into the first mapping layer to obtain the first features output by the first mapping layer.

5. The method according to any one of claims 1 to 4, characterized in that, The text information comprises target text and attribute information corresponding to the target text; The conversion of the text information into the second prompt information comprises: filling the target text and the attribute information into a second prompt template corresponding to the classification model to obtain the second prompt information.

6. The method of claim 5, wherein: the second prompt template comprises a to-be-filled blank, and the second prompt information is used to prompt the classification model to determine filling information for filling the to-be-filled blank according to the target text and the attribute information; the second features comprise second probability information, and the second probability information is used to indicate class probabilities of the to-be-filled blank on different classification task labels.

7. The method of claim 6, wherein, The second model further comprises a second mapping layer. The inputting of the second prompt information into the second model to obtain the second features output by the second model comprises: inputting the second prompt information into the classification model to obtain a label score output by the classification model, wherein the label score is suitable for indicating a score of the to-be-filled blank on different classification task labels; inputting the label score into the second mapping layer to obtain the second feature output by the second mapping layer.

8. The method according to any one of claims 1 to 4, characterized in that, The prediction model comprises a long short-term memory (LSTM) model and a third mapping layer. The method comprises: inputting the third feature into the LSTM model to obtain an LSTM output feature output by the LSTM model; inputting the LSTM output feature into the third mapping layer to obtain the sentiment prediction result output by the third mapping layer. 9.A method for training an emotion classification model, the method comprising: The method comprises: obtaining sample text information and a corresponding real label thereof; converting the sample text information into first sample prompt information, and inputting the first sample prompt information into a first model to obtain first sample features output by the first model, wherein the first model comprises a generation model, and the first sample prompt information corresponds to the generation model; converting the sample text information into second sample prompt information, and inputting the second sample prompt information into a second model to obtain second sample features output by the second model, wherein the second model comprises a classification model, and the second sample prompt information corresponds to the classification model; obtaining third sample features based on the first sample features and the second sample features; inputting the third sample features into a prediction model to obtain a sentiment sample prediction result of the sample text information output by the prediction model; based on the first sample features, the second sample features, the sentiment sample prediction result, and the real label, determining a comprehensive loss, and training a to-be-trained sentiment classification model according to the comprehensive loss, wherein the to-be-trained sentiment classification model comprises the first model, the second model, and the prediction model.

10. An emotion classification apparatus characterized by comprising: The method comprises: a text acquisition module configured to acquire text information; a first text processing module configured to convert the text information into first prompt information, and input the first prompt information into a first model to obtain first features output by the first model, wherein the first model comprises a generation model, and the first prompt information corresponds to the generation model; a second text processing module configured to convert the text information into second prompt information, and input the second prompt information into a second model to obtain second features output by the second model, wherein the second model comprises a classification model, and the second prompt information corresponds to the classification model; a feature processing module configured to obtain third features based on the first features and the second features; a prediction module configured to input the third features into a prediction model to obtain a sentiment prediction result of the text information output by the prediction model.

11. A training device for an emotion classification model, characterized in that, The method comprises: a sample acquisition module configured to acquire sample text information and a corresponding real label thereof; The first sample processing module is configured to convert the sample text information into first sample prompt information, and input the first sample prompt information into a first model to obtain first sample features output by the first model, wherein the first model comprises a generation model, and the first sample prompt information corresponds to the generation model. The second sample processing module is configured to convert the sample text information into second sample prompt information, and input the second sample prompt information into a second model to obtain second sample features output by the second model, wherein the second model comprises a classification model, and the second sample prompt information corresponds to the classification model. The sample feature processing module is configured to obtain third sample features based on the first sample features and the second sample features. The sample prediction module is configured to input the third sample features into a prediction model to obtain a sentiment sample prediction result for the sample text information output by the prediction model. The training module is configured to determine a comprehensive loss based on the first sample features, the second sample features, the sentiment sample prediction result and the true label, and train a to-be-trained sentiment classification model according to the comprehensive loss, wherein the to-be-trained sentiment classification model comprises the first model, the second model and the prediction model.

12. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1-9.

13. A computer program product comprising computer instructions, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1-9.

14. A computer device, comprising: The computer program is executed by the processor to implement the method of any one of claims 1-9. The computer program is executed by the processor to implement the method of any one of claims 1-9.