CN114328901A - Emotion classification model construction method, device and equipment - Google Patents

Emotion classification model construction method, device and equipment Download PDF

Info

Publication number
CN114328901A
CN114328901A CN202011074743.5A CN202011074743A CN114328901A CN 114328901 A CN114328901 A CN 114328901A CN 202011074743 A CN202011074743 A CN 202011074743A CN 114328901 A CN114328901 A CN 114328901A
Authority
CN
China
Prior art keywords
emotion
information
classification model
model
adaptive
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.)
Pending
Application number
CN202011074743.5A
Other languages
Chinese (zh)
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.)
Alibaba Group Holding Ltd
National University of Singapore
Original Assignee
Alibaba Group Holding Ltd
National University of Singapore
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 Alibaba Group Holding Ltd, National University of Singapore filed Critical Alibaba Group Holding Ltd
Priority to CN202011074743.5A priority Critical patent/CN114328901A/en
Publication of CN114328901A publication Critical patent/CN114328901A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a method, a device, a system and equipment for constructing an emotion classification model. The model construction method comprises the following steps: constructing a network structure of an emotion classification model, wherein the network structure comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model; training parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field to obtain a first classification model; determining emotion category marking information of the text information in the target field through the first classification model; and training the parts except the language model in the first classification model according to the text information and the emotion type marking information of the source field and the text information and the emotion type marking information of the target field to obtain a second classification model. By adopting the processing mode, the text emotion characteristic data of the field self-adaption is determined based on a plurality of hidden layer states of the language model; therefore, the emotion classification accuracy of the domain adaptive model on the low-resource domain text can be effectively improved.

Description

Emotion classification model construction method, device and equipment
Technical Field
The application relates to the technical field of natural language processing, in particular to a sentiment classification model construction method and device, a commodity evaluation sentiment classification method and device and electronic equipment.
Background
In order to enhance the user experience, the e-commerce platform typically pushes commodity information that may be of interest to the user according to the user preference information. The determination method of the user preference information is various, and one common method is to determine the user preference information by judging the emotional polarity of the evaluation based on the evaluation information of the user on the purchased goods.
The commodity evaluation information emotion analysis system mainly adopts a supervised machine learning mode to learn and obtain an emotion classification model from a large amount of training data consisting of commodity evaluation information and emotion category marking information, and then predicts emotion categories evaluated by other commodities through the emotion classification model. The emotion classification model can be a model which is universal in different fields (commodity classes), and is also called a field self-adaptive model; or may be a model dedicated to each of the different domains. Because the labeling data in different fields in the e-commerce scene are extremely unbalanced, for example, the effective labeling data amount contained in popular women's clothing is possibly far higher than that in the cold fields such as automobile parts, in some cold fields, the labeling data in the popular field is often needed, and the adaptive model can reduce the difference between different fields and perform cross-field emotion classification, so that the emotion classification problem is mainly processed through the field adaptive model in the e-commerce scene. At present, a typical domain adaptive emotion classification method is to perform classification prediction based on the state of the last hidden layer of a language model, and the model training stage needs to perform fine tuning (Finetune) on a pre-trained language model.
However, in the process of implementing the present invention, the inventors found that the above solution has at least the following problems: 1) classification prediction is performed only on the basis of the state of the last hidden layer of the language model, so that the field adaptive model obtained by training based on source field data is poor in performance in the target field, and if the model is obtained by training based on mother and infant training data, when emotion classification is performed on commodity evaluation in the field of automobile accessories, the accuracy of emotion classification results is low; 2) in the traditional fine tuning method of the pre-training language model, parameters of the whole classification model need to be updated, so that more computing resources are occupied, and the time consumed by model training is longer.
Disclosure of Invention
The application provides an emotion classification model construction method, which aims to solve the problems that in the prior art, the domain self-adaptive model has low emotion classification accuracy for commodity evaluation in a low-resource domain, and the model construction efficiency is low. The application further provides a commodity evaluation emotion classification device, an emotion classification model construction device, a user preference information determination method and device, a commodity object processing system and electronic equipment.
The application provides an emotion classification model construction method, which comprises the following steps:
constructing a network structure of an emotion classification model, wherein the classification model comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model;
training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model;
determining emotion category marking information of the text information in the target field through the first classification model;
and training the parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field and the text information and the emotion classification marking information of the target field to obtain a second classification model.
Optionally, the field includes: a category of goods and/or a language.
Optionally, the feature extractor is configured to determine domain-adaptive emotional feature data of the text information, where the domain-adaptive emotional feature data is related to a plurality of hidden layer states of the language model;
and the classifier is used for determining the emotion category information of the text information according to the field self-adaptive emotion feature data.
Optionally, the feature extractor includes a language model and a domain adaptive feature processing module;
the language model is used for determining the states of the plurality of hidden layers according to text information;
and the domain self-adaptive feature processing module is used for determining the emotional feature data according to the plurality of hidden layer states.
Optionally, the domain adaptive feature processing module includes an attention module;
and the attention module is used for carrying out weighting processing on the plurality of hidden layer states to obtain the emotional characteristic data.
Optionally, the domain adaptive feature processing module is specifically configured to perform dimension reduction on a plurality of hidden layer states, and determine the emotion feature data according to the plurality of hidden layer states after dimension reduction.
Optionally, the loss function of the first classification model includes: emotion classification cross entropy of the source domain;
the loss function of the second classification model comprises: source domain emotion classification cross entropy, and at least one of the following penalties:
the target domain pseudo emotion classification cross entropy, the mutual information between the hidden layer state data and the emotion feature data of the target domain, and the intra-class distance of each emotion type.
Optionally, the method further includes:
and constructing the language model according to the text information of the source field and the target field.
The application also provides a commodity evaluation emotion classification method, which comprises the following steps:
acquiring evaluation information of commodities to be processed in a target field;
determining field self-adaptive emotional feature data of the evaluation information of the commodities to be processed, which are related to a plurality of hidden layer states of the language model, through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information;
and determining the emotion category information of the commodity evaluation information to be processed according to the emotion feature data through a classifier included by the classification model.
Optionally, the feature extractor includes a language model and a domain adaptive feature processing module;
determining the states of the plurality of hidden layers according to the evaluation information of the commodities to be processed through a language model;
and determining the emotional feature data according to the plurality of hidden layer states through a domain self-adaptive feature processing module.
Optionally, the domain adaptive feature processing module includes an attention module;
and performing weighting processing on the plurality of hidden layer states through an attention module to obtain the emotional characteristic data.
Optionally, the domain adaptive feature processing module includes a dimension reduction module;
executing dimension reduction processing on the plurality of hidden layer states through a dimension reduction module;
and determining the emotional characteristic data according to the plurality of hidden layer states after dimension reduction through an attention module.
The application also provides an emotion classification model construction method, which comprises the following steps:
constructing a network structure of an emotion classification model, wherein the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data;
and training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field.
The application also provides an emotion classification model construction device, which comprises:
the model structure construction unit is used for constructing a network structure of an emotion classification model, and the classification model comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model;
the first training unit is used for training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model;
the prediction unit is used for determining emotion category marking information of the text information in the target field through the first classification model;
and the second training unit is used for training the parts except the language model in the classification model according to the text information and the emotion class marking information of the source field and the text information and the emotion class marking information of the target field to obtain a second classification model.
The application also provides a commodity evaluation emotion classification device, including:
the commodity evaluation acquisition unit is used for acquiring to-be-processed commodity evaluation information of a target field;
the feature extraction unit is used for determining field self-adaptive emotional feature data, related to a plurality of hidden layer states of the language model, of the commodity evaluation information to be processed through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information;
and the classification unit is used for determining the emotion category information of the evaluation information of the commodity to be processed according to the emotion characteristic data through the classifier included by the classification model.
The application also provides an emotion classification model construction device, which comprises:
the model structure construction unit is used for constructing a network structure of an emotion classification model, and the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data;
and the training unit is used for training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field.
The present application also provides a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the various methods described above.
The present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the various methods described above.
Compared with the prior art, the method has the following advantages:
according to the emotion classification model construction method provided by the embodiment of the application, by constructing the network structure of the emotion classification model, the classification model comprises a domain adaptive feature extractor and a classifier based on a pre-training language model; training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model; determining emotion category marking information of the text information in the target field through the first classification model; training the parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field, and the text information and the emotion classification marking information of the target field to obtain a second classification model; the processing mode ensures that the emotion characteristic data of the text field self-adaptation is determined based on the multilayer hidden states of the language model, avoids emotion classification only by adopting the last layer of hidden states, can greatly improve the performance of cross-field emotion analysis by combining the multilayer hidden states, and realizes a higher-level field self-adaptation emotion analysis model without the help of the labeled data of a low-resource field; therefore, the accuracy of the emotion classification model can be effectively improved. Meanwhile, compared with the language model fine-tuning method in the prior art, the processing method only uses the pre-training language model as a hidden state feature extractor, the trained parameters are only a lightweight domain adaptive feature processing module (also called a domain adaptive model), and the pre-training language model does not need to be finely tuned when the domain adaptive emotion classification model is trained, so that the parameters needing to be optimized of the classification model can be greatly reduced, the computing resources are saved, the time consumption of model training is shortened, the model construction and deployment efficiency is improved, and the method belongs to the very lightweight classification model. In addition, because the model does not need to be trained independently for each field, the number of the models can be effectively reduced, the model training time is shortened, and the computing resources and the storage resources consumed by model construction are saved.
According to the emotion classification model construction method provided by the embodiment of the application, by constructing the network structure of the emotion classification model, the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data; training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field; the processing mode ensures that the emotion characteristic data of the text field self-adaptation is determined based on the multilayer hidden states of the language model, avoids emotion classification only by adopting the last layer of hidden states, can greatly improve the performance of cross-field emotion analysis by combining the multilayer hidden states, and realizes a higher-level field self-adaptation emotion analysis model without the help of the labeled data of a low-resource field; therefore, the accuracy of the emotion classification model can be effectively improved.
According to the commodity evaluation emotion classification method provided by the embodiment of the application, to-be-processed commodity evaluation information in a target field is acquired; determining field self-adaptive emotional feature data of the evaluation information of the commodities to be processed, which are related to a plurality of hidden layer states of the language model, through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information; determining emotion category information of the commodity evaluation information to be processed according to the emotion feature data through a classifier included in the classification model; the processing mode ensures that the emotion characteristic data of the field self-adaption of the commodity evaluation is determined based on the multilayer hidden states of the language model, avoids emotion classification only by adopting the last layer of hidden states, can greatly improve the performance of cross-field emotion analysis by combining the multilayer hidden states, and realizes a higher-level field self-adaption emotion analysis model without the help of the labeled data of the low-resource field; therefore, the emotion classification accuracy can be effectively improved.
According to the user preference information determining method provided by the embodiment of the application, commodity evaluation information of a target field of a target user is obtained; determining domain self-adaptive emotional feature data of the commodity evaluation information, which are related to a plurality of hidden layer states of the language model, through a domain self-adaptive feature extractor included in the emotion classification model; the model is obtained by learning from commodity evaluation information sets of a plurality of users in the target field, commodity evaluation information sets of a plurality of users in the source field and emotion type labeling information thereof; determining emotion category information of the commodity evaluation information according to the emotion feature data through a classifier included by the model; determining preference information of a target user according to the emotion category information; the processing mode ensures that the emotion characteristic data of the field self-adaption of the commodity evaluation is determined based on the multilayer hidden states of the language model, avoids emotion classification only by adopting the last layer of hidden states, can greatly improve the performance of cross-field emotion analysis by combining the multilayer hidden states, and realizes a higher-level field self-adaption emotion analysis model without the help of the labeled data of the low-resource field; therefore, the emotion classification accuracy can be effectively improved, and the accuracy of the preference information of the user can be further improved.
Drawings
FIG. 1 is a schematic flow chart of an embodiment of a method for constructing an emotion classification model provided by the present application;
FIG. 2 is a model schematic diagram of an embodiment of a sentiment classification model construction method provided by the present application;
FIG. 3 is a specific diagram of a determination mutual information estimator according to an embodiment of the method for classifying commodity evaluation sentiment provided by the present application;
FIG. 4 is a schematic flow chart diagram illustrating an embodiment of a method for classifying commodity evaluation sentiment provided by the present application;
FIG. 5 is a schematic diagram of a scenario of a merchandise object processing system provided by the present application;
FIG. 6 is a schematic diagram of a scenario of a merchandise object processing system provided by the present application;
fig. 7 is a schematic view of a scenario of a commodity object processing system according to the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The application provides an emotion classification model construction method and device, a commodity evaluation emotion classification method and device, a user preference information determination method and device, a commodity object processing system and electronic equipment. Each of the schemes is described in detail in the following examples.
First embodiment
Please refer to fig. 1, which is a flowchart illustrating an embodiment of a method for constructing an emotion classification model according to the present application. The execution subject of the method includes but is not limited to a server, and may be any device capable of implementing the method. In this embodiment, the method may include the steps of:
step S101: and constructing a network structure of an emotion classification model, wherein the classification model comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model.
The emotion classification model is a model which is obtained by learning from training data through a machine learning algorithm and is used for predicting emotion types of input texts. The input data of the model may be a piece of text information, and the output data may be emotion category information contained in the text, for example, the input text is evaluation information of a certain commodity object purchased by the user, "the received commodity conforms to the commodity description …," and the emotion category of the commodity evaluation is "satisfaction.
The input text of the emotion classification model includes but is not limited to commodity evaluation information, and can also be the text of news, questionnaires, advertisements and other contents. The following describes a construction method of the emotion classification model, taking product evaluation information as an example.
The emotion classification model is a domain self-adaptive classification model and is obtained by learning from commodity evaluation information of a source domain, emotion class marking information of the commodity evaluation information and commodity evaluation information of a target domain. That is, only emotion category labeling information of commodity evaluation in the source field is needed and emotion category labeling information of commodity evaluation in the target field is not needed when the emotion classification model is trained.
The field can be commodity type, for example, the source field is mother and infant commodity type, the target field is automobile accessory commodity type, and emotion type marking data of the evaluation of the mother and infant commodity can be utilized to determine emotion type of the evaluation of the automobile accessory commodity. The field can also be a language, if the source field is English, the target field is Vietnamese, and the emotion category of the Vietnamese maternal and infant commodity evaluation can be determined by using the emotion category marking data of the English maternal and infant commodity evaluation. The field can also be commodity types and languages, if the source field is English mother and infant, and the target field is Vietnamese automobile accessory, and the emotion type evaluated by the English mother and infant commodity can be determined by using emotion type marking data of the evaluation of the Vietnamese automobile accessory commodity.
Compared with a cross-domain emotion classification model in the prior art, the emotion classification model provided by the embodiment of the application comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model. The domain self-adaptive feature extractor is used for determining domain self-adaptive emotional feature data of the text information to be processed, wherein the domain self-adaptive emotional feature data are related to a plurality of hidden layer states of the language model. And the classifier is used for determining the emotion category information of the input text according to the field self-adaptive emotion feature data. Therefore, the classifier does not perform emotion classification prediction based on the state of the last hidden layer of the language model any more.
In one example, the hidden layer state may be an average value of a plurality of hidden states in one hidden layer, i.e. a mean hidden state. By adopting the processing mode, the emotion classification accuracy can be effectively improved.
In this embodiment, the feature extractor includes a language model and a domain adaptive feature processing module. In the emotion classification model, the language model is used for determining a plurality of hidden layer states according to text information; and the domain self-adaptive feature processing module is used for determining the domain self-adaptive emotional feature data according to the plurality of hidden layer states. Since the feature extractor includes the domain adaptive feature processing module, the language model may be a pre-trained language model, that is, in the emotion classification model training stage, parameters of the language model may not be adjusted, but parameters of the domain adaptive feature processing module may be adjusted. According to the method provided by the embodiment of the application, the domain-crossing feature adaptive processing can be completed by the domain adaptive feature processing module by combining a plurality of hidden layer states of the language model.
In one example, the method may further comprise the steps of: and constructing the language model according to the text information of the source field and the target field. The role of the Language Model (Language Model) is to determine a probability distribution for a text of fixed length m to indicate the likelihood of the text being present. In short, a language model is a probability distribution of a text sequence. Language models are widely used in natural language processing tasks, such as machine translation, emotion analysis, magnetic labeling, etc., and a large amount of label-free data is used to train the language models. A pre-trained Language Model (PrLM) is one type of Language Model. Since the structure of the language model and the training method belong to the mature prior art, they are not described herein again. In specific implementation, the language model can be constructed according to other corpora.
The domain adaptive feature processing module can adopt an Attention mechanism to carry out weighting change on a plurality of hidden layer states output by the language model so as to realize the domain adaptive feature processing function. In a specific implementation, the domain adaptive feature processing module may include an attention module, and perform weighted summation on the plurality of hidden layer states to form the emotional feature data. For example, the attention module may employ an adaptive attention matrix to incorporate different hidden layer states. Since the attention module belongs to the mature prior art, it is not described herein again.
The domain adaptive feature processing module may also implement a domain adaptive feature processing function in other manners, and for example, the domain adaptive feature processing module determines the emotional feature data according to the plurality of hidden layer states through a full connection layer, such as splicing the plurality of hidden layer states together.
In an example, the domain adaptive feature processing module is specifically configured to perform dimension reduction processing on a plurality of hidden layer states, and determine the emotional feature data according to the plurality of hidden layer states after dimension reduction. By adopting the processing mode, the calculated amount of the model can be effectively reduced, so that the model prediction speed is improved.
The classifier can comprise a full connection layer, and the emotion category information of the input text is determined according to the domain self-adaptive emotion feature data.
Please refer to fig. 2, which is a schematic structural diagram of an emotion classification model according to an embodiment of the method for constructing an emotion classification model. In this embodiment, the Feature extractor includes a pre-training language model and a domain adaptive Feature processing Module (i.e., Feature Adaptation Module in the figure, FAM). The pre-trained language model may include a word embedding layer and a plurality of hidden layers. Wherein the word embedding layer may convert words in the input text into word vectors. The hidden layer in the language model can adopt a Transformer model and can also adopt other network results such as a recurrent neural network and the like. Inputting the hidden layer state output by the last N layers of the language model into the domain adaptive feature processing module, wherein the hidden layer state of the l-th layer can be
Figure BDA0002716356540000091
The domain self-adaptive feature processing module firstly performs dimension reduction processing on the received hidden layer state through a dimension reduction module f, wherein the hidden layer state after dimension reduction of the l-th layer is Zl. And the domain self-adaptive characteristic processing module is used for carrying out weighted summation processing on a plurality of hidden layer states after dimension reduction through the attention module to obtain the domain self-adaptive emotional characteristic data Z. And the classifier determines the emotion category information of the input text according to the field self-adaptive emotion feature data Z.
In specific implementation, open source XLM-R can be used as a pre-training language model, and the model adopts a 24-layer transformer structure. The parameters of the pre-training language model do not participate in training in the emotion classification model training stage, after the input text is coded by the language model, the last ten layers of hidden states (hidden states) are extracted, and for a text sequence, the hidden states of each layer are averaged, and the ten layers of averaged hidden states
Figure BDA0002716356540000092
Will be treated as a text vector. The ten layers of hidden states pass through a domain self-adaptive feature processing module formed by a full connection layer to obtain ten vector expressions ZlThe vector representations of these ten intermediate layers will then be weighted by the Attention Mechanism (Attention Mechanism) to get the representation Z that finally enters the classifier.
Because the emotion classification model is based on the multilayer hidden states of the language model and determines the domain self-adaptive emotion characteristic data of the text, compared with the emotion classification model which only adopts the last layer of hidden states for classification prediction in the prior art, the model which combines the multilayer hidden states for emotion classification can greatly improve the performance of cross-domain emotion analysis and realize a higher-level domain self-adaptive emotion analysis model without the help of labeled data in a low-resource domain.
Step S103: and training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model.
In this embodiment, a tagging data set S ═ X including text information and emotion category tagging information thereof in a source domain is selecteds,YsIn which X isSText information representing the source domain, YSAnd emotion category marking information representing the source field text information. As shown in FIG. 2, the text information in the source domain is used as the input data of the emotion classification model, the states of the hidden layers of the text are extracted through the pre-training language model, and the mean hidden state of each hidden layer can be determined to be
Figure BDA0002716356540000101
Wherein
Figure BDA0002716356540000102
I-th hidden state representing the i-th hidden layer, the i-th layer having | x | hidden states in total. Then, dimension reduction is carried out on the hidden state of each layer through a dimension reduction module f of the full-connection layer network structure, and parameters of each layer are not shared to obtainTo single layer representation (hidden layer state after dimensionality reduction)
Figure BDA0002716356540000103
Weighting each layer of representation by using an attention mechanism to obtain a text representation (the emotional characteristic data)
Figure BDA0002716356540000104
Wherein
Figure BDA0002716356540000105
WattAre learnable parameters. z will be used as input to the classifier.
When the first classification model is trained, emotion classification prediction information output by the classifier can be compared with marking information of the source field, the loss function can be emotion classification cross entropy of the source field, and model parameters except the language model can be adjusted until the first classification model is obtained when the model optimization target is reached.
Step S105: and determining emotion category marking information of the text information in the target field through the first classification model.
The embodiment also selects an unlabeled data set T ═ X including only text information of the target domainTIn which X isTText information representing the target domain. By preliminarily matching the source region data set S ═ X in step S103s,YsAnd predicting the target field data set by the learning result (the first classification model), and selecting the prediction result with high confidence as emotion category marking information of the text information of the target field. Because the emotion category marking information of the text information in the target field is a result obtained by prediction through the first classification model, and is not real emotion category information, the marking data is a pseudo label.
And then, acquiring the text information and emotion type marking information of the source field, and the text information and emotion type marking information of the target field, and entering the next step to learn from the marking information of the source field and the pseudo marking information of the target field to obtain a final emotion classification model.
Step S107: and training the parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field and the text information and the emotion classification marking information of the target field to obtain a second classification model.
According to the method, network parameters of the emotion classification model are trained according to the labeling information of the source field and the pseudo labeling information of the target field, so that the emotion classification model which is also suitable for performing emotion classification on the text of the low-resource target field can be constructed by only using the labeling data of the high-resource source field, the training data and the development data of the field self-adaptive model can be completely from the source field, and the labeling data of the target field is not needed.
The method provided by the embodiment is a feature self-adaptive method, and the parameters of the whole pre-training language model do not need to be optimized, so that the parameters needing to be optimized of the classification model can be greatly reduced, and the method belongs to a very light-weight classification model. Taking an XLM-R pre-training language model as an example, the language model fine-tuning method in the prior art needs to optimize the parameters of the XLM-R pre-training model to 5.6 hundred million, and the fine-tuning method requires at least 12GB of GPU memory and about 2 hours of training time, which occupies large computing resources and takes a long training time. By adopting the feature adaptive method of the embodiment, only the 6GB GPU memory is required to be used for training for about 30 minutes, and the parameters to be optimized are only within one million, so that the method belongs to a very lightweight model.
Step S107 can be implemented as follows: and training the network constructed in the step S101 according to the labeling information of the source field and the labeling information of the target field, and learning to obtain a second classification model. Step S107 can also be implemented as follows: and training the first classification model obtained by training in the step S103 according to the labeling information of the source field and the labeling information of the target field, and learning to obtain a second classification model.
In one example, the loss function of the second classification model includes: and the emotion classification cross entropy of the source field and the pseudo emotion classification cross entropy of the target field. In the process of learning to obtain the second classification model, the emotion category prediction result of the text information of the target domain obtained by the second classification model and the cross entropy loss function of the pseudo tag data obtained in step S105 (i.e., the pseudo emotion classification cross entropy of the target domain) may be used as a part of the loss function.
In one example, the loss function of the second classification model may further include: mutual Information (Mutual Information) between hidden layer state data and emotion feature data of the target domain, and intra-class distance of each emotion category.
In a specific implementation, in the optimization goal of mutual information, the mutual information estimator that can be used can be an NCE (Noise contrast Estimation) operator. Fig. 3 shows a way of determining a mutual information estimator, taking the hidden state of the target domain data and the mutual information finally representing Z as optimization targets.
The intra-class distance is an optimization target, so that after emotion classification, the intra-label distance of each class label is reduced as much as possible.
In this embodiment, the second classification model adopts a composite loss function composed of the above four different targets, and the composite loss function is suitable for a domain-adaptive emotion classification model. Under the condition of only using the unlabeled data in the target field, by optimizing the mutual information of the data in the target field, selecting a composite loss function such as a pseudo label with high confidence coefficient and the like and a self-adaptive multi-layer hidden state extraction mode, the performance of a cross-field emotion analysis task can be greatly improved, and the emotion classification model obviously surpasses an emotion classification model needing to be subjected to fine tuning of a language model.
In specific implementation, training can be performed by optimizing the composite loss function, another group of labeled data in the source field is used as a development set, and the finally obtained second classification model can be used for predicting a test set in the target field. Experiments show that on a monolingual data set, the cross-domain emotion classification performance of monolingual is improved by 4.8% compared with a fine-tuning benchmark; the improvement is about 4% compared with the standard under the condition of cross-language or cross-language and cross-domain.
As can be seen from the above embodiments, the emotion classification model construction method provided in the embodiments of the present application constructs a network structure of an emotion classification model, where the classification model includes a domain adaptive feature extractor and a classifier based on a pre-training language model; training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model; determining emotion category marking information of the text information in the target field through the first classification model; training the parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field, and the text information and the emotion classification marking information of the target field to obtain a second classification model; by the aid of the processing mode, the emotion characteristic data of the text in the field self-adaption is determined based on the multi-layer hidden states of the language model, the last layer of hidden state is avoided, the performance of cross-field emotion analysis can be greatly improved by combining the multi-layer hidden states, and a higher-level field self-adaption emotion analysis model without the help of labeled data in a low-resource field is realized; therefore, the accuracy of the emotion classification model can be effectively improved. Meanwhile, compared with the language model fine-tuning method in the prior art, the processing method only uses the pre-training language model as a hidden state feature extractor, the trained parameters are only a lightweight domain adaptive feature processing module (also called a domain adaptive model), and the pre-training language model does not need to be finely tuned when the domain adaptive emotion classification model is trained, so that the parameters needing to be optimized of the classification model can be greatly reduced, the computing resources are saved, the time consumption of model training is shortened, the model construction and deployment efficiency is improved, and the method belongs to the very lightweight classification model. In addition, because the model does not need to be trained independently for each field, the number of the models can be effectively reduced, the model training time is shortened, and the computing resources and the storage resources consumed by model construction are saved.
Second embodiment
In the foregoing embodiment, a method for constructing an emotion classification model is provided, and correspondingly, a device for constructing an emotion classification model is also provided in the present application. The apparatus corresponds to an embodiment of the method described above. Parts of this embodiment that are the same as the first embodiment are not described again, please refer to corresponding parts in the first embodiment.
The application provides an emotion classification model construction device includes:
the model structure construction unit is used for constructing a network structure of an emotion classification model, and the classification model comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model;
the first training unit is used for training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model;
the prediction unit is used for determining emotion category marking information of the text information in the target field through the first classification model;
and the second training unit is used for training the parts except the language model in the classification model according to the text information and the emotion class marking information of the source field and the text information and the emotion class marking information of the target field to obtain a second classification model.
The fields include: a category of goods and/or a language.
In one example, the feature extractor is configured to determine domain-adaptive emotional feature data of the textual information related to a plurality of hidden layer states of the language model; and the classifier is used for determining the emotion category information of the text information according to the field self-adaptive emotion feature data.
In one example, the feature extractor includes a language model and a domain adaptive feature processing module; the language model is used for determining the states of the plurality of hidden layers according to text information; and the domain self-adaptive feature processing module is used for determining the emotional feature data according to the plurality of hidden layer states.
In one example, the domain adaptive feature processing module includes an attention module; and the attention module is used for carrying out weighting processing on the plurality of hidden layer states to form the emotional characteristic data.
In an example, the domain adaptive feature processing module is specifically configured to perform dimension reduction processing on a plurality of hidden layer states, and determine the emotional feature data according to the plurality of hidden layer states after dimension reduction.
In one example, the loss function of the first classification model includes: emotion classification cross entropy of the source domain; the loss function of the second classification model comprises: source domain emotion classification cross entropy, and at least one of the following penalties: the target domain pseudo emotion classification cross entropy, the mutual information between the hidden layer state data and the emotion feature data of the target domain, and the intra-class distance of each emotion type.
In one example, the apparatus further comprises:
and the language model building unit is used for building the language model according to the text information of the source field and the target field.
Third embodiment
The application also provides an electronic device. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor and a memory; the memory is used for storing a program for realizing the emotion classification model construction method, and after the equipment is powered on and the program for realizing the emotion classification model construction method is run by the processor, the following steps are executed: constructing a network structure of an emotion classification model, wherein the classification model comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model; training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model; determining emotion category marking information of the text information in the target field through the first classification model; and training the parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field and the text information and the emotion classification marking information of the target field to obtain a second classification model.
Fourth embodiment
The application also provides an emotion classification model construction method, and an execution subject of the method comprises but is not limited to a server side, and the method can also be any equipment capable of realizing the method. Since the present embodiment is substantially similar to the first embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the first embodiment. The method embodiments described below are merely illustrative.
In this embodiment, the method may include the steps of:
step 1: constructing a network structure of an emotion classification model, wherein the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data;
step 2: and training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field.
The method provided by the embodiment is different from the method provided by the first embodiment in that: in this embodiment, the language model is not limited to a pre-trained language model, and in the specific implementation, parameters of the language model may be finely adjusted when the emotion classification model is trained.
In one example, step 2 may include the following sub-steps: 1) training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model; 2) determining emotion category marking information of the text information in the target field through the first classification model; 3) and training the parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field and the text information and the emotion classification marking information of the target field to obtain a second classification model.
In another example, step 2 may include the following sub-steps: 1) training the classification model according to the text information and emotion category marking information of the source field to obtain a first classification model; 2) determining emotion category marking information of the text information in the target field through the first classification model; 3) and training the classification model according to the text information and the emotion class marking information of the source field and the text information and the emotion class marking information of the target field to obtain a second classification model.
As can be seen from the above embodiments, the emotion classification model construction method provided in the embodiments of the present application constructs a network structure of an emotion classification model, where the classification model includes a domain adaptive feature extractor and a classifier based on a language model; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data; training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field; the processing mode ensures that the emotion characteristic data of the text field self-adaptation is determined based on the multilayer hidden states of the language model, avoids emotion classification only by adopting the last layer of hidden states, can greatly improve the performance of cross-field emotion analysis by combining the multilayer hidden states, and realizes a higher-level field self-adaptation emotion analysis model without the help of the labeled data of a low-resource field; therefore, the accuracy of the emotion classification model can be effectively improved.
Fifth embodiment
In the foregoing embodiment, a method for constructing an emotion classification model is provided, and correspondingly, a device for constructing an emotion classification model is also provided in the present application. The apparatus corresponds to an embodiment of the method described above. Parts of this embodiment that are the same as the fourth embodiment are not described again, please refer to corresponding parts in the fourth embodiment.
The application provides an emotion classification model construction device includes:
the model structure construction unit is used for constructing a network structure of an emotion classification model, and the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data;
and the training unit is used for training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field.
Sixth embodiment
The application also provides an electronic device. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor and a memory; the memory is used for storing a program for realizing the emotion classification model construction method, and after the equipment is powered on and the program for realizing the emotion classification model construction method is run by the processor, the following steps are executed: constructing a network structure of an emotion classification model, wherein the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data; and training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field.
Seventh embodiment
Please refer to fig. 4, which is a flowchart illustrating an embodiment of a method for classifying merchandise evaluation sentiment according to the present application. The execution subject of the method includes but is not limited to a server, and may be any device capable of implementing the method. Since this embodiment is basically similar to the fourth embodiment, the description is simple, and the relevant points can be referred to the description of the fourth embodiment. The method embodiments described below are merely illustrative.
In this embodiment, the method may include the steps of:
step S401: acquiring evaluation information of commodities to be processed in a target field;
step S403: determining field self-adaptive emotional feature data of the evaluation information of the commodities to be processed, which are related to a plurality of hidden layer states of the language model, through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information;
step S405: and determining the emotion category information of the commodity evaluation information to be processed according to the emotion feature data through a classifier included by the classification model.
In one example, the feature extractor includes a language model and a domain adaptive feature processing module; determining the states of the plurality of hidden layers according to the evaluation information of the commodities to be processed through a language model; and determining the emotional feature data according to the plurality of hidden layer states through a domain self-adaptive feature processing module.
In one example, the domain adaptive feature processing module includes an attention module; and performing weighting processing on the plurality of hidden layer states through an attention module to obtain the emotional characteristic data.
In one example, the domain adaptive feature processing module comprises a dimension reduction module; executing dimension reduction processing on the plurality of hidden layer states through a dimension reduction module; and determining the emotional characteristic data according to the plurality of hidden layer states after dimension reduction through an attention module.
As can be seen from the above embodiments, the commodity evaluation emotion classification method provided in the embodiments of the present application obtains commodity evaluation information to be processed in a target field; determining field self-adaptive emotional feature data of the evaluation information of the commodities to be processed, which are related to a plurality of hidden layer states of the language model, through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information; determining emotion category information of the commodity evaluation information to be processed according to the emotion feature data through a classifier included in the classification model; the processing mode ensures that the emotion characteristic data of the text field self-adaptation is determined based on the multilayer hidden states of the language model, avoids emotion classification only by adopting the last layer of hidden states, can greatly improve the performance of cross-field emotion analysis by combining the multilayer hidden states, and realizes a higher-level field self-adaptation emotion analysis model without the help of the labeled data of a low-resource field; therefore, the emotion classification accuracy can be effectively improved.
Eighth embodiment
In the embodiment, the commodity evaluation emotion classification method is provided, and correspondingly, the application also provides a commodity evaluation emotion classification device. The apparatus corresponds to an embodiment of the method described above. Parts of this embodiment that are the same as the seventh embodiment will not be described again, please refer to corresponding parts in embodiment seven.
The application provides a commodity evaluation emotion classification device includes:
the commodity evaluation acquisition unit is used for acquiring to-be-processed commodity evaluation information of a target field;
the feature extraction unit is used for determining field self-adaptive emotional feature data, related to a plurality of hidden layer states of the language model, of the commodity evaluation information to be processed through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information;
and the classification unit is used for determining the emotion category information of the evaluation information of the commodity to be processed according to the emotion characteristic data through the classifier included by the classification model.
Ninth embodiment
The application also provides an electronic device. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor and a memory; a memory for storing a program for implementing the method for classifying the evaluation feelings of commodities, wherein the apparatus executes the following steps after being powered on and the program for implementing the method is executed by the processor: acquiring evaluation information of commodities to be processed in a target field; determining field self-adaptive emotional feature data of the evaluation information of the commodities to be processed, which are related to a plurality of hidden layer states of the language model, through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information; and determining the emotion category information of the commodity evaluation information to be processed according to the emotion feature data through a classifier included by the classification model.
Tenth embodiment
The application also provides a user preference information determination method, and an execution subject of the method includes but is not limited to a server side, and the method can also be any device capable of implementing the method. Since this embodiment is basically similar to the fourth embodiment, the description is simple, and the relevant points can be referred to the description of the fourth embodiment. The method embodiments described below are merely illustrative.
In this embodiment, the method may include the steps of:
step 1: and acquiring commodity evaluation information of the target field of the target user.
In this embodiment, a plurality of product evaluation information of the target area of the target user may be obtained by searching the product evaluation library.
The field can be commodity types, such as mother and infant commodities in the source field, the target field can comprise commodity types outside the source field, such as automobile accessory commodities, clothes, shoes and hat commodities, and the emotion type of the target user's evaluation on the commodities such as the automobile accessory commodities, the clothes, shoes and hat commodities can be determined by utilizing emotion type marking data of all users' evaluation on the mother and infant commodities and evaluation information of all users on the commodities such as the automobile accessory commodities, the clothes, shoes and hat commodities.
The field can also be a language, if the source field is English, and the target field is Vietnamese, the emotion type of the Vietnamese evaluation of the target user on the mother and infant commodities can be determined by utilizing the emotion type label data of the English evaluation of all users on the mother and infant commodities and the Vietnamese evaluation information of all users on the mother and infant commodities.
The field can also be commodity types and languages, if the source field is English mother and infant, and the target field is Vietnamese automobile accessory, the emotion type of the Vietnamese evaluation of the target user to the automobile accessory commodity can be determined by utilizing the emotion type labeling data of the English evaluation of all users to the mother and infant commodities and the Vietnamese evaluation information of all users to the automobile accessory commodity.
Step 2: determining domain self-adaptive emotional feature data of the commodity evaluation information, which are related to a plurality of hidden layer states of the language model, through a domain self-adaptive feature extractor included in the emotion classification model; the model is obtained by learning from commodity evaluation information sets of a plurality of users in the target field, commodity evaluation information sets of a plurality of users in the source field and emotion type labeling information thereof.
And step 3: determining emotion category information of the commodity evaluation information according to the emotion feature data through a classifier included by the model;
and 4, step 4: and determining preference information of the target user according to the emotion category information.
After emotion category information of a plurality of product evaluation information in a target field of a target user is determined, preference information of the target user can be determined.
As can be seen from the above embodiments, the user preference information determining method provided by the embodiments of the present application obtains commodity evaluation information of a target field of a target user; determining domain self-adaptive emotional feature data of the commodity evaluation information, which are related to a plurality of hidden layer states of the language model, through a domain self-adaptive feature extractor included in the emotion classification model; the model is obtained by learning from commodity evaluation information sets of a plurality of users in the target field, commodity evaluation information sets of a plurality of users in the source field and emotion type labeling information thereof; determining emotion category information of the commodity evaluation information according to the emotion feature data through a classifier included by the model; determining preference information of a target user according to the emotion category information; the processing mode ensures that the emotion characteristic data of the field self-adaption of the commodity evaluation is determined based on the multilayer hidden states of the language model, avoids emotion classification only by adopting the last layer of hidden states, can greatly improve the performance of cross-field emotion analysis by combining the multilayer hidden states, and realizes a higher-level field self-adaption emotion analysis model without the help of the labeled data of the low-resource field; therefore, the emotion classification accuracy can be effectively improved, and the accuracy of the preference information of the user can be further improved.
Eleventh embodiment
In the embodiment, the application further provides a user preference information determining device corresponding to the user preference information determining method. The apparatus corresponds to an embodiment of the method described above. Parts of this embodiment that are the same as the seventh embodiment will not be described again, please refer to corresponding parts in embodiment seven.
The application provides a user preference information determination device, which comprises:
a commodity evaluation acquisition unit for acquiring commodity evaluation information of a target field of a target user;
the feature extraction unit is used for determining domain self-adaptive emotional feature data of the commodity evaluation information, which are related to a plurality of hidden layer states of the language model, through a domain self-adaptive feature extractor included in the emotion classification model; the model is obtained by learning from commodity evaluation information sets of a plurality of users in the target field, commodity evaluation information sets of a plurality of users in the source field and emotion type labeling information thereof;
the emotion classification unit is used for determining emotion category information of the commodity evaluation information according to the emotion characteristic data through the classifier included in the model;
and the preference information determining unit is used for determining the preference information of the target user according to the emotion category information.
Twelfth embodiment
The application also provides an electronic device. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor and a memory; a memory for storing a program implementing the user preference information determining method, the apparatus performing the following steps after being powered on and running the program of the method by the processor: acquiring commodity evaluation information of a target field of a target user; determining domain self-adaptive emotional feature data of the commodity evaluation information, which are related to a plurality of hidden layer states of the language model, through a domain self-adaptive feature extractor included in the emotion classification model; the model is obtained by learning from commodity evaluation information sets of a plurality of users in the target field, commodity evaluation information sets of a plurality of users in the source field and emotion type labeling information thereof; determining emotion category information of the commodity evaluation information according to the emotion feature data through a classifier included by the model; and determining preference information of the target user according to the emotion category information.
Thirteenth embodiment
Corresponding to the user preference information determining method, the application also provides a commodity object processing system. Since the system embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The system embodiments described below are merely illustrative.
Please refer to fig. 5, which is a schematic view illustrating a scenario of an embodiment of a commodity object processing system according to the present application. In this embodiment, the system may include: a server and a client.
As can be seen from fig. 5, the commodity object processing system implements a commodity information pushing function based on user preference information, and the server is configured to determine evaluation information of a target user on a commodity in a target field, and determine emotion category information of commodity evaluation through an emotion classification model; determining preference information of a target user according to emotion category information of commodity evaluation through a user preference information determining module; and determining a commodity object recommendation result according to the preference information of the target user through a commodity recommendation module, and sending the recommendation result to the client for the client user to check.
Fourteenth embodiment
Corresponding to the user preference information determining method, the application also provides a commodity object processing system. Since the system embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The system embodiments described below are merely illustrative.
Please refer to fig. 6, which is a schematic view illustrating a scenario of an embodiment of a commodity object processing system according to the present application. In this embodiment, the system may include: a server and a client.
As can be seen from fig. 6, the commodity object processing system implements a commodity information search recommendation function based on user preference information, and the server is configured to receive a commodity object search request for a target search term sent by the client; determining the evaluation information of the target user on the target field commodity, and determining the emotion category information of commodity evaluation through an emotion classification model; determining preference information of a target user according to emotion category information of commodity evaluation through a user preference information determining module; and determining a commodity object search recommendation result according to the preference information of the target user and the target search words specified by the user through a search recommendation module, and sending the search recommendation result to the client for the client user to check.
Fifteenth embodiment
Corresponding to the commodity evaluation emotion classification method, the application also provides a commodity object processing system. Since the system embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The system embodiments described below are merely illustrative.
Please refer to fig. 7, which is a schematic view illustrating a scenario of an embodiment of a commodity object processing system according to the present application. In this embodiment, the system may include: a server and a client.
As can be seen from fig. 7, the commodity object processing system implements a commodity information pushing function, and the server is configured to determine evaluation information of multiple users on commodities in the target field, and determine emotion category information of commodity evaluation through an emotion classification model; and determining a commodity object recommendation result according to the emotion category information of the commodity evaluation through a commodity recommendation module, and sending the recommendation result to the client for the client user to check. The commodity object recommendation result may include a commodity object unrelated to the user preference information, and the commodity object may be a commodity with a higher user goodness of evaluation, and is recommended to the user.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
1. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
2. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (16)

1. A method for constructing an emotion classification model is characterized by comprising the following steps:
constructing a network structure of an emotion classification model, wherein the classification model comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model;
training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model;
determining emotion category marking information of the text information in the target field through the first classification model;
and training the parts except the language model in the classification model according to the text information and the emotion classification marking information of the source field and the text information and the emotion classification marking information of the target field to obtain a second classification model.
2. The method of claim 1,
the fields include: a category of goods and/or a language.
3. The method of claim 1,
the feature extractor is used for determining field self-adaptive emotional feature data of the text information related to a plurality of hidden layer states of the language model;
and the classifier is used for determining the emotion category information of the text information according to the field self-adaptive emotion feature data.
4. The method of claim 3,
the feature extractor comprises a language model and a domain self-adaptive feature processing module;
the language model is used for determining the states of the plurality of hidden layers according to text information;
and the domain self-adaptive feature processing module is used for determining the emotional feature data according to the plurality of hidden layer states.
5. The method of claim 4,
the domain adaptive feature processing module comprises an attention module;
and the attention module is used for carrying out weighting processing on the plurality of hidden layer states to obtain the emotional characteristic data.
6. The method of claim 4,
the domain self-adaptive feature processing module is specifically configured to perform dimension reduction processing on the plurality of hidden layer states, and determine the emotional feature data according to the plurality of hidden layer states after dimension reduction.
7. The method of claim 1,
the loss function of the first classification model includes: emotion classification cross entropy of the source domain;
the loss function of the second classification model comprises: source domain emotion classification cross entropy, and at least one of the following penalties:
the target domain pseudo emotion classification cross entropy, the mutual information between the hidden layer state data and the emotion feature data of the target domain, and the intra-class distance of each emotion type.
8. The method of claim 1, further comprising:
and constructing the language model according to the text information of the source field and the target field.
9. A commodity evaluation emotion classification method is characterized by comprising the following steps:
acquiring evaluation information of commodities to be processed in a target field;
determining field self-adaptive emotional feature data of the evaluation information of the commodities to be processed, which are related to a plurality of hidden layer states of the language model, through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information;
and determining the emotion category information of the commodity evaluation information to be processed according to the emotion feature data through a classifier included by the classification model.
10. The method of claim 9,
the feature extractor comprises a language model and a domain self-adaptive feature processing module;
determining the states of the plurality of hidden layers according to the evaluation information of the commodities to be processed through a language model;
and determining the emotional feature data according to the plurality of hidden layer states through a domain self-adaptive feature processing module.
11. The method of claim 10,
the domain adaptive feature processing module comprises an attention module;
and performing weighting processing on the plurality of hidden layer states through an attention module to obtain the emotional characteristic data.
12. The method of claim 11,
the domain adaptive feature processing module comprises a dimensionality reduction module;
executing dimension reduction processing on the plurality of hidden layer states through a dimension reduction module;
and determining the emotional characteristic data according to the plurality of hidden layer states after dimension reduction through an attention module.
13. A method for constructing an emotion classification model is characterized by comprising the following steps:
constructing a network structure of an emotion classification model, wherein the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data;
and training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field.
14. An emotion classification model construction apparatus, comprising:
the model structure construction unit is used for constructing a network structure of an emotion classification model, and the classification model comprises a domain self-adaptive feature extractor and a classifier based on a pre-training language model;
the first training unit is used for training the parts except the language model in the classification model according to the text information and the emotion category marking information of the source field to obtain a first classification model;
the prediction unit is used for determining emotion category marking information of the text information in the target field through the first classification model;
and the second training unit is used for training the parts except the language model in the classification model according to the text information and the emotion class marking information of the source field and the text information and the emotion class marking information of the target field to obtain a second classification model.
15. An apparatus for classifying emotion in merchandise evaluation, comprising:
the commodity evaluation acquisition unit is used for acquiring to-be-processed commodity evaluation information of a target field;
the feature extraction unit is used for determining field self-adaptive emotional feature data, related to a plurality of hidden layer states of the language model, of the commodity evaluation information to be processed through a field self-adaptive feature extractor in the emotion classification model; the classification model is obtained by learning from commodity evaluation information of a target field, commodity evaluation information of a source field and emotion class marking information of the commodity evaluation information;
and the classification unit is used for determining the emotion category information of the evaluation information of the commodity to be processed according to the emotion characteristic data through the classifier included by the classification model.
16. An emotion classification model construction apparatus, comprising:
the model structure construction unit is used for constructing a network structure of an emotion classification model, and the classification model comprises a language model-based domain adaptive feature extractor and a classifier; the feature extractor comprises a language model and a domain self-adaptive feature processing module; the language model is used for determining a plurality of hidden layer states of the text information; the domain self-adaptive feature processing module is used for determining domain self-adaptive emotional feature data of the text information according to the states of the plurality of hidden layers; the classifier is used for determining emotion category information of the text information according to the field self-adaptive emotion feature data;
and the training unit is used for training the classification model according to the text information of the source field, the emotion class marking information of the source field and the text information of the target field.
CN202011074743.5A 2020-10-09 2020-10-09 Emotion classification model construction method, device and equipment Pending CN114328901A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011074743.5A CN114328901A (en) 2020-10-09 2020-10-09 Emotion classification model construction method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011074743.5A CN114328901A (en) 2020-10-09 2020-10-09 Emotion classification model construction method, device and equipment

Publications (1)

Publication Number Publication Date
CN114328901A true CN114328901A (en) 2022-04-12

Family

ID=81032033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011074743.5A Pending CN114328901A (en) 2020-10-09 2020-10-09 Emotion classification model construction method, device and equipment

Country Status (1)

Country Link
CN (1) CN114328901A (en)

Similar Documents

Publication Publication Date Title
Buber et al. Performance analysis and CPU vs GPU comparison for deep learning
US11398062B2 (en) Face synthesis
CN110472090B (en) Image retrieval method based on semantic tags, related device and storage medium
US20200356729A1 (en) Generation of text from structured data
Wang et al. Efficient video transformers with spatial-temporal token selection
CN111433784A (en) Method and system for retrieving video time segments
US11663280B2 (en) Search engine using joint learning for multi-label classification
CN110377727B (en) Multi-label text classification method and device based on multi-task learning
CN112699305A (en) Multi-target recommendation method, device, computing equipment and medium
CN111666416A (en) Method and apparatus for generating semantic matching model
CN116226785A (en) Target object recognition method, multi-mode recognition model training method and device
Shajini et al. A knowledge-sharing semi-supervised approach for fashion clothes classification and attribute prediction
US11250299B2 (en) Learning representations of generalized cross-modal entailment tasks
CN111078881B (en) Fine-grained sentiment analysis method and system, electronic equipment and storage medium
CN112183946A (en) Multimedia content evaluation method, device and training method thereof
CN112069404A (en) Commodity information display method, device, equipment and storage medium
CN111444335B (en) Method and device for extracting central word
CN117217284A (en) Data processing method and device
CN116910357A (en) Data processing method and related device
CN110851600A (en) Text data processing method and device based on deep learning
Dornier et al. Scaf: Skip-connections in auto-encoder for face alignment with few annotated data
CN114328901A (en) Emotion classification model construction method, device and equipment
CN117011737A (en) Video classification method and device, electronic equipment and storage medium
Neerbek et al. Selective training: A strategy for fast backpropagation on sentence embeddings
Menardi et al. Text-to-Image Synthesis Based on Machine Generated Captions

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