CN110704581B - Text emotion analysis method and device executed by computer - Google Patents

Text emotion analysis method and device executed by computer Download PDF

Info

Publication number
CN110704581B
CN110704581B CN201910858800.XA CN201910858800A CN110704581B CN 110704581 B CN110704581 B CN 110704581B CN 201910858800 A CN201910858800 A CN 201910858800A CN 110704581 B CN110704581 B CN 110704581B
Authority
CN
China
Prior art keywords
emotion
alternative
text
category
tendencies
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.)
Active
Application number
CN201910858800.XA
Other languages
Chinese (zh)
Other versions
CN110704581A (en
Inventor
王雅芳
韩非吾
姚琳琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201910858800.XA priority Critical patent/CN110704581B/en
Publication of CN110704581A publication Critical patent/CN110704581A/en
Application granted granted Critical
Publication of CN110704581B publication Critical patent/CN110704581B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the specification provides a text emotion analysis method executed by a computer, which comprises the following steps: firstly, marking data obtained by marking a first text is obtained, wherein the marking data comprises a first emotion tendency selected from a plurality of alternative emotion tendencies aiming at a first emotion aspect and a first emotion intensity selected from a plurality of alternative emotion intensities aiming at the first emotion tendency; next, determining a first emotion type tag corresponding to the combination of the first emotion tendency and the first emotion intensity based on a predetermined mapping relation between the plurality of alternative emotion tendencies and the alternative combinations of the plurality of alternative emotion intensities and alternative emotion type tags; and then, determining a first training sample based on the first text and the first emotion type label, wherein the first training sample is used for training a text emotion analysis model so as to carry out emotion analysis on the text to be analyzed.

Description

Text emotion analysis method and device executed by computer
Technical Field
One or more embodiments of the present disclosure relate to the field of computers, and in particular, to a method and apparatus for analyzing text emotion performed by a computer, a method and apparatus for analyzing picture emotion performed by a computer, a method and apparatus for analyzing sample category performed by a computer, and a method and apparatus for obtaining annotation data.
Background
Text emotion analysis, which is to analyze emotion colors expressed by text, is generally applied to evaluate the preference of a user for a certain product or a certain service. For example, the satisfaction of a user with a commodity is determined by analyzing the published evaluation content of the user with respect to the commodity. For another example, by analyzing opinion content that a user has published for a certain opinion, it is determined whether the user agrees with the opinion.
With the rapid development of machine learning, building predictive models for text emotion analysis has become a research hotspot. However, the accuracy of the prediction result obtained by the current prediction model is not high enough, so that it is difficult to meet the actual requirements, especially in the case that the difference between emotion to be analyzed is small, for example, the difference between emotion and anger is required, and the prediction result with high confidence is difficult to obtain.
Therefore, an improvement scheme is highly needed, and accuracy of model prediction results can be improved.
Disclosure of Invention
One or more embodiments of the present disclosure describe a method and apparatus for text emotion analysis performed by a computer, which may improve accuracy of a prediction result of a text emotion analysis model.
According to a first aspect, there is provided a computer-implemented text emotion analysis method, the method comprising: obtaining annotation data obtained by annotating a first text, wherein the annotation data comprises a first emotion tendency selected from a plurality of alternative emotion tendencies aiming at a first emotion aspect and a first emotion intensity selected from a plurality of alternative emotion intensities aiming at the first emotion tendency; determining a first emotion type tag corresponding to a combination of the first emotion tendency and the first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion type tags; and determining a first training sample based on the first text and the first emotion type label, wherein the first training sample is used for training a text emotion analysis model so as to carry out emotion analysis on the text to be analyzed.
In one embodiment, the first affective aspect is one of the following: pleasure, optimism, access, love, humming, photophobia, approval and self-responsibility.
According to a second aspect, there is provided a computer-implemented text emotion analysis method, the method comprising: the method comprises the steps of obtaining annotation data obtained by annotating a first text, wherein the annotation data comprise selected dimension values selected from alternative dimension values for each emotion dimension in a plurality of preset emotion dimensions in a plurality of layers; determining a first emotion type label corresponding to each combination of the selected dimension values based on a predetermined mapping relation between each alternative combination of the alternative dimension values of each emotion dimension and alternative emotion type labels; and determining a first training sample based on the first text and the first emotion type label, wherein the first training sample is used for training a text emotion analysis model so as to carry out emotion analysis on the text to be analyzed.
In one embodiment, the plurality of emotion dimensions includes at least one of: emotion aspect, emotion tendency, emotion intensity.
According to a third aspect, there is provided a computer-implemented method of emotion analysis of a picture, the method comprising: obtaining annotation data obtained by annotating a first picture, wherein the annotation data comprises a first emotion tendency selected from a plurality of alternative emotion tendencies aiming at a first emotion aspect and a first emotion intensity selected from a plurality of alternative emotion intensities aiming at the first emotion tendency; determining a first emotion type tag corresponding to a combination of the first emotion tendency and the first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion type tags; and determining a first training sample based on the first picture and the first emotion type label, wherein the first training sample is used for training a picture emotion analysis model so as to carry out emotion analysis on the picture to be analyzed.
According to a fourth aspect, there is provided a computer-implemented classification method for a target sample, comprising: obtaining labeling data obtained by labeling the first sample, wherein the labeling data comprises selected categories selected from various alternative categories for each preset classification level in a plurality of classification levels; determining a first class label corresponding to each selected class combination based on a predetermined mapping relation between each candidate class combination of each classification hierarchy and the candidate class label; and determining a first training sample based on the first sample and the first class label, wherein the first training sample is used for training a classification model so as to classify the target sample to be classified.
According to a fifth aspect, there is provided a method of obtaining annotation data, the method comprising: providing the text or picture to be annotated to the annotator, as well as a plurality of alternative emotion tendencies for the first emotion aspect and a plurality of alternative emotion intensities for each alternative emotion tendencies; the first emotion tendency selected by the labeling personnel from the multiple alternative emotion tendencies and the first emotion intensity selected from the multiple alternative emotion intensities aiming at the first emotion tendency are obtained, and the first emotion tendency and the first emotion intensity are used as labeling data aiming at the text or the picture.
In one embodiment, the providing the text or picture to be annotated to the annotator, and the plurality of alternative emotion tendencies for the first emotion aspect and the plurality of alternative emotion intensities for the respective alternative emotion tendencies includes: displaying an interactive interface, wherein the interactive interface comprises the text or the picture to be annotated, the multiple alternative emotion tendencies and multiple alternative emotion intensities aiming at each alternative emotion tendency; the obtaining the first emotion tendencies selected by the labeling person from the plurality of alternative emotion tendencies and the first emotion intensities selected from the plurality of alternative emotion intensities for the first emotion tendencies includes: and receiving the first emotion tendency and the first emotion intensity selected by the labeling personnel based on the interactive interface.
According to a sixth aspect, there is provided a method of obtaining annotation data, the method comprising: providing a text or a picture to be marked and preset candidate dimension values of each emotion dimension in a plurality of emotion dimensions of a plurality of levels to a marking person; and acquiring each selected dimension value selected by the labeling personnel from the candidate dimension values of each emotion dimension, and taking each selected dimension value as labeling data for the text or the picture.
According to a seventh aspect, there is provided a method of obtaining annotation data, the method comprising: providing a sample to be marked and preset alternative categories of each classification level in a plurality of classification levels to a marking person; and acquiring each selected category selected by the annotator from the alternative categories of each classification level, and taking each selected category as annotation data for the sample.
In one embodiment, the providing the sample to be annotated to the annotator and the preset alternative category of each classification level in the plurality of classification levels includes: displaying an interactive interface, wherein the interactive interface comprises the sample to be marked, and the alternative category of each classification level in the plurality of classification levels; the obtaining each selected category selected by the annotator from the candidate categories of each classification level includes: and receiving the selected categories selected by the annotators based on the interactive interface.
According to an eighth aspect, there is provided a computer-implemented text emotion analysis apparatus comprising: a labeling data acquisition unit configured to acquire labeling data obtained by labeling a first text, the labeling data including a first emotion tendency selected from a plurality of alternative emotion tendencies for a first emotion aspect, and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency; a category label determining unit configured to determine a first emotion category label corresponding to a combination of the first emotion tendency and first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion category labels; the training sample determining unit is configured to determine a first training sample based on the first text and the first emotion type label, and is used for training a text emotion analysis model so as to perform emotion analysis on the text to be analyzed.
According to a ninth aspect, there is provided a computer-implemented text emotion analysis apparatus comprising: the labeling data acquisition unit is configured to acquire labeling data obtained by labeling the first text, wherein the labeling data comprises selected dimension values selected from alternative dimension values aiming at each of a plurality of preset emotion dimensions in a plurality of layers; a category label determining unit configured to determine a first emotion category label corresponding to a combination of the selected dimension values based on a predetermined mapping relationship between each candidate combination of candidate dimension values of each emotion dimension and candidate emotion category labels; the training sample determining unit is configured to determine a first training sample based on the first text and the first emotion type label, and is used for training a text emotion analysis model so as to perform emotion analysis on the text to be analyzed.
According to a tenth aspect, there is provided a computer-implemented photo emotion analysis apparatus, comprising: a labeling data acquisition unit configured to acquire labeling data obtained by labeling a first picture, the labeling data including a first emotion tendency selected from a plurality of alternative emotion tendencies for a first emotion aspect, and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency; a category label determining unit configured to determine a first emotion category label corresponding to a combination of the first emotion tendency and first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion category labels; the training sample determining unit is configured to determine a first training sample based on the first picture and the first emotion type label, and is used for training a picture emotion analysis model so as to perform emotion analysis on a picture to be analyzed.
According to an eleventh aspect, there is provided a computer-implemented classification apparatus for a target sample, comprising: a labeling data obtaining unit configured to obtain labeling data obtained by labeling the first sample, the labeling data including, for each of a plurality of classification levels set in advance, each selected category selected from each candidate category; a category label determining unit configured to determine a first category label corresponding to each combination of selected categories based on a predetermined mapping relationship between each combination of alternatives of the respective classification levels and alternative category labels; and the training sample determining unit is configured to determine a first training sample based on the first sample and the first class label, and is used for training a classification model to classify the target sample to be classified.
According to a twelfth aspect, there is provided an apparatus for acquiring annotation data, the apparatus comprising: a providing unit configured to provide a text or a picture to be annotated to an annotator, and a plurality of alternative emotion tendencies for the first emotion aspect and a plurality of alternative emotion intensities for the respective alternative emotion tendencies; an acquisition unit configured to acquire a first emotion tendency selected by the labeling person from the plurality of alternative emotion tendencies and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency, and to use the first emotion tendency and the first emotion intensity as labeling data for the text or the picture.
According to a thirteenth aspect, there is provided an apparatus for acquiring annotation data, comprising: the labeling unit is configured to provide texts or pictures to be labeled for labeling personnel and preset candidate dimension values of each emotion dimension in a plurality of emotion dimensions of a plurality of levels; the acquiring unit is configured to acquire each selected dimension value selected by the labeling personnel from the candidate dimension values of each emotion dimension, and the selected dimension value is used as labeling data for the text or the picture.
According to a fourteenth aspect, there is provided an apparatus for acquiring annotation data, comprising: the labeling unit is configured to provide a sample to be labeled and preset alternative categories of each classification level in the plurality of classification levels for labeling personnel; and the acquisition unit is configured to acquire each selected category selected by the labeling personnel from the alternative categories of each classification level, and the selected category is used as labeling data for the sample.
According to a fifteenth aspect, there is provided a computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed in a computer, causes the computer to perform the method of any of the first to seventh aspects.
According to a sixteenth aspect, there is provided a computing device comprising a memory and a processor, wherein the memory has executable code stored therein, which when executed by the processor, implements the method of any of the first to seventh aspects.
By adopting the text emotion analysis method disclosed by the embodiment of the specification, the corresponding first emotion type label can be determined according to the labeling data of the first text, so that the first training sample is determined, and a plurality of other training samples can be determined similarly, so that a training sample set is constructed, and further a text emotion analysis model is trained. The label data has higher effectiveness and consistency, and the correspondingly determined label data also has higher effectiveness and consistency, so that the trained text emotion analysis model has high availability, and the obtained prediction result has high confidence coefficient and high accuracy and has higher use value.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates a schematic diagram of an implementation scenario of one embodiment disclosed herein;
FIG. 2 illustrates a flow diagram of a text emotion analysis method, according to one embodiment;
FIG. 3 illustrates a flow diagram of a method of acquiring annotation data, according to one embodiment;
FIG. 4 illustrates a schematic diagram of an interactive interface for obtaining annotation data, according to one embodiment;
FIG. 5 illustrates a schematic diagram of an interactive interface for retrieving annotation data, according to another embodiment;
FIG. 6 illustrates a partial schematic diagram of an excl document containing annotation data, according to one embodiment;
FIG. 7 illustrates a flow diagram of a photo emotion analysis method, according to one embodiment;
FIG. 8 shows a flow chart of a text emotion analysis method according to another embodiment;
FIG. 9 illustrates a classification method flow diagram for a target sample according to an embodiment;
FIG. 10 illustrates a flow chart of a method of acquiring annotation data, according to another embodiment;
FIG. 11 shows a flowchart of a method of acquiring annotation data, according to yet another embodiment;
FIG. 12 shows a flowchart of a method of acquiring annotation data, according to yet another embodiment;
FIG. 13 shows a schematic block diagram of a text emotion analysis device, according to one embodiment;
FIG. 14 shows a schematic block diagram of a photo emotion analysis device, according to one embodiment;
FIG. 15 shows a schematic block diagram of a text emotion analysis device according to another embodiment;
FIG. 16 shows a schematic block diagram of an apparatus for target samples according to one embodiment;
FIG. 17 shows a schematic block diagram of an apparatus for acquiring annotation data, according to one embodiment;
FIG. 18 shows a schematic block diagram of an apparatus for acquiring annotation data, according to another embodiment;
fig. 19 shows a schematic block diagram of an apparatus for acquiring annotation data according to a further embodiment.
Detailed Description
The embodiments of the present invention will be described below with reference to the accompanying drawings.
As previously mentioned, attempts are currently being made to build predictive models for text emotion analysis. According to one embodiment, the text with emotion colors is manually marked to form marked texts, and then the marked texts are used as training samples to train a text emotion analysis model. Fig. 1 is a schematic diagram of an implementation scenario of an embodiment disclosed in the present specification. As shown in FIG. 1, a training sample set is formed using manually annotated text, and then the computing platform trains a text emotion analysis model using the training sample set. After training to obtain a text emotion analysis model, uploading commodity evaluation to a computing platform for the text to be analyzed, such as newly generated commodity evaluation, and analyzing emotion colors of the text by using the text emotion analysis model.
In the above supervised machine learning process, model training based on a large number of manually labeled text is required. The labeling mode of the text determines what training sample is obtained, and further determines the training effect of the model. Therefore, the problem of the labeling mode of the training sample needs to be considered.
In one embodiment, some alternative emotion type labels can be directly provided for the marker, so that the marker marks the emotion type label of the text according to the alternative labels and serves as a training sample. Wherein the alternative labels are typically flattened, requiring a marking person to clearly and unequivocally distinguish between the emotional semantics of each label therein. However, in some cases, where the distinction between several alternative labels is small, it is difficult for the marking personnel to achieve consistency of the marking. For example, in an emotion markup scenario, provided alternative emotion tags include, for example, angry, anger, annoyance, etc. Thus, for the same sample to be marked, it is possible that the label marked by the marking person a is angry, and the label marked by the marking person B is angry. For another example, for the same sample to be marked, the first marked label by the marking person a is angry, and if it is marked again, the marked label may be angry. Obviously, the marking mode has great difficulty for marking staff, and the consistency of the marking data obtained in the way is poor, and further, the accuracy and the effectiveness of the prediction result for the text emotion obtained by the trained prediction model are low.
Based on the method, the inventor proposes a new labeling mode, the labeling difficulty of a labeling person can be reduced, meanwhile, the effectiveness and consistency of labeling data are obviously improved, and therefore a training sample with higher usability is constructed and used for training a text emotion analysis model, and the accuracy of a model prediction result is improved. In one example, instead of providing the candidate tag to the labeler, a quantization index predetermined based on the candidate tag may be provided, for example, including a quantization index for emotion tendencies and emotion intensities of a certain emotion aspect, further, according to data marked by the labeler on the text based on the quantization index, an emotion type tag of the text is determined, and a training sample is further constructed for training the prediction model. In the following, specific implementations of the solution concept are described.
FIG. 2 illustrates a flow diagram of a text emotion analysis method, according to one embodiment, whose execution subject may be any device, apparatus, platform, cluster of devices, etc. having computing or processing capabilities, such as the computing platform illustrated in FIG. 1. As shown in fig. 2, the method comprises the steps of: step S210, labeling data obtained by labeling a first text is obtained, wherein the labeling data comprises a first emotion tendency selected from a plurality of alternative emotion tendencies aiming at a first emotion aspect and a first emotion intensity selected from a plurality of alternative emotion intensities aiming at the first emotion tendency; step S220, determining a first emotion type label corresponding to the combination of the first emotion tendency and the first emotion intensity based on a predetermined mapping relation between the plurality of alternative emotion tendencies and the alternative combinations of the plurality of alternative emotion intensities and the alternative emotion type label; step S230, determining a first training sample based on the first text and the first emotion type tag, for training a text emotion analysis model to perform emotion analysis on the text to be analyzed.
In the above steps, the labeling data of the first text is obtained in step S210, and then the text label of the first text is determined based on the obtained labeling data in step S220, and then a first training sample corresponding to the first text is constructed in step S230, for training the text emotion analysis model.
Further, as is known from the above steps S210 and S220, in order to implement the method, it is necessary to determine in advance an emotion aspect, a plurality of alternative emotion tendencies and a plurality of alternative emotion intensities for the emotion aspect, and establish a mapping relationship between an alternative combination of the plurality of alternative emotion tendencies and the plurality of alternative emotion intensities and an alternative emotion type tag. This part of the content is first described by way of example.
In one embodiment, the requirements of the text emotion analysis model can provide emotion tags which need to be identified for target analysis data according to actual requirements. In a specific embodiment, the above-mentioned requirement party may be an online or offline service platform for providing a certain product or service, such as an e-commerce platform, a lesson selection platform, a news consultation platform, an offline entity store, and so on. In a specific embodiment, the target analysis data may be user evaluation data, dynamic data published by the user on the social platform, and so on.
In one example, the news information platform may provide the following labels based on its emotional analysis needs for user ratings: happiness, excitement, happiness, surprise, depression, vitality, anger, sadness, calm, no-boring, smoldering, slight support, absolute support, affirmative, no-boring, neutral, questioning, resistance, rejection, and the like.
Further, one or more emotion aspects may be determined based on the labels provided by the demander, and a plurality of alternative emotion category labels are determined to be included in each emotion aspect. In a specific embodiment, the determined emotional aspect may include: pleasure, optimism, access, love, humming, photophobia, praise, approval and self-responsibility, and the like.
In one example, the determined emotional aspects include happiness and approval, and the respective emotion category labels are shown in table 1 below:
TABLE 1
In this manner, one or more emotion aspects and alternative emotion category labels corresponding to each aspect may be determined based on the plurality of labels provided by the model demander for the target analysis data. Hereinafter, description will be given mainly of one emotion aspect (hereinafter, collectively referred to as a first emotion aspect) as an example.
Still further, a plurality of alternative emotion tendencies for the first emotion aspect may be determined from the plurality of alternative emotion tags corresponding to the first emotion aspect, and wherein each of the alternative emotion tags corresponds to an alternative emotion tendency.
In a particular embodiment, the plurality of alternative emotional tendencies described above may include at least two of positive, negative, and no tendencies. In one example, assuming the first emotional aspect is pleasant, the alternative emotional trends are specifically a pleasant trend, an unpleasant trend, and no apparent trend in pleasure and unpleasantness. In another example, assuming the first emotion aspect is endorsement, the alternative emotion tendencies are specifically endorsement tendencies, disapproval tendencies, and no obvious tendencies in endorsement and disapproval. In another specific embodiment, the plurality of alternative emotional tendencies may include a predisposition and a no-predisposition. On the other hand, in one particular embodiment, the alternative emotional tendency may be represented by numbers or letters or other characters. In one example, positive, no tendency, and negative may be represented by 1, 0, and-1, respectively.
In a specific embodiment, a plurality of alternative emotion tendencies may be determined first, and then the alternative emotion tendencies corresponding to each of the alternative emotion tags may be determined, thereby obtaining alternative tags with respective alternative emotion tendencies. In another specific embodiment, a plurality of alternative emotion tags may be categorized first, and then the alternative emotion tendencies corresponding to the various tags may be determined.
In one example, taking the emotional aspect pleasure shown in table 1 as an example, the determined plurality of alternative emotional tendencies shown in table 2 includes positive, negative, and no tendencies, and alternative emotional category labels to which each of the alternative emotional tendencies corresponds, respectively.
TABLE 2
Thus, a plurality of alternative emotion tendencies, and alternative emotion type tags corresponding to the respective tendencies, can be obtained. In other words, the alternative emotion tendencies corresponding to the individual alternative emotion type tags can be obtained.
Still further, a plurality of alternative emotion intensities may be determined, and a mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and the alternative emotion tags is established.
In a specific embodiment, the service experience or the life experience may be combined first, and the corresponding number of the alternative emotion type labels under each alternative emotion inclination may be ranked, where the ranking result reflects the inclination degree of the alternative emotion inclination. And setting the alternative emotion intensity corresponding to each alternative emotion type label based on the sorting result. In one example, the expression form of the alternative emotion intensity is preferably selected from a form with a natural meaning of ordering, such as a single numerical value, or a numerical range, or a letter, etc.
In a specific example, assuming that the first emotion aspect is pleasure in table 2 and that a certain alternative emotion tendency is forward, the ranking result reflects the degree of tendency for pleasure, for example, the ranking result is: surprise, excitement, happiness, and happiness, the result shows that surprise is more pleasant than excitement, excitement is more pleasant than happiness, and so on. Further, in a more specific example, the correspondence between the alternative category labels and the alternative emotion intensities shown in table 3 may be obtained.
TABLE 3 Table 3
Alternative emotion category labels Surprise is surprised Excitation method Open heart Happy
Alternate emotion intensity a b c d
In another more specific example, the correspondence between the alternative category labels and the alternative emotion intensities shown in table 4 may be obtained.
TABLE 4 Table 4
Alternative emotion category labels Surprise is surprised Excitation method Open heart Happy
Alternate emotion intensity 10 7-9 4-6 1-3
Therefore, the alternative emotion intensity corresponding to each alternative emotion label can be determined, and emotion quantification is achieved. It should be understood that the number of values or the range of values of the alternative emotion intensities corresponding to the alternative emotion tendencies may be completely the same, may be completely different, or may be partially the same.
The alternative emotion tendencies and the alternative emotion intensities corresponding to the alternative emotion tags can be determined, and then the mapping relation between the alternative combinations of the multiple alternative emotion tendencies and the multiple alternative emotion intensities for the first emotion aspect and the multiple alternative emotion tags can be established. In one example, as shown in table 5, the mapping relationships shown therein include: in the case where the emotion tendency for pleasure is positive and the emotion intensity is 4, the corresponding alternative emotion label is surprise.
TABLE 5
In the above, the process of establishing the mapping relationship between the candidate combinations of the plurality of candidate emotion tendencies and the plurality of candidate emotion intensities and the candidate emotion type tags is exemplarily described. It should be understood that some changes may be made based on the above-described establishment procedure, as long as the mapping relationship can be established. When determining the corresponding alternative emotion intensities of the alternative labels, the alternative emotion intensities can be directly set without sorting. In a variation, a certain alternative emotion type tag may be selected first, for example, a happy emotion, and its corresponding alternative emotion intensity is set to 2, then, another alternative emotion type tag may be selected, for example, a happy emotion, and the happy corresponding alternative emotion intensity is set to 1 based on the set happy emotion intensity being 2.
The steps involved in the method shown in fig. 2 are described next, specifically as follows:
first, in step S210, labeling data obtained by labeling the first text is obtained.
It should be noted that, for convenience of description and understanding, in the embodiment of the present specification, any text of a plurality of texts to be labeled is referred to as a first text. In one embodiment, the first text may be a word or sentence or chapter.
In one embodiment, step S210 may include sub-steps S31 and S32 shown in fig. 3. Specifically, first, in step S31, a text to be annotated is provided to an annotator, together with a plurality of alternative emotion tendencies for the first emotion aspect and a plurality of alternative emotion intensities for the respective alternative emotion tendencies. Specifically, the text to be annotated, the multiple alternative emotion tendencies and the multiple alternative emotion intensities can be displayed to the annotator in various forms. In a particular embodiment, presentation may be based on an interactive interface. In another specific embodiment, the presentation may be made by an electronic document, such as a word document or an excl document, or the like. In yet another specific embodiment, the presentation may also be made by a paper document.
Further, in step S32, a first emotion tendency selected by the labeling person from among a plurality of alternative emotion tendencies and a first emotion intensity selected from among a plurality of alternative emotion intensities for the first emotion tendency are acquired, and the first emotion tendency and the first emotion intensity are used as labeling data of the text or the picture. In a specific embodiment, the first emotion tendency and the first emotion intensity selected by the labeling personnel based on the interactive interface may be received as the labeling data. In another specific embodiment, the labeling person inputs the first emotion tendency and the first emotion intensity in the electronic document, and accordingly, the first emotion tendency and the first emotion intensity can be read from the electronic document as the labeling data.
According to one example, the interactive interface shown in fig. 4 includes: the text to be marked is also better in function of the bar-! "; a first emotional aspect, namely pleasure; a plurality of alternative emotional tendencies, namely positive, negative, and no tendency; a number of alternative emotional intensities, namely 1, 2, 3 and 4 for positive, 1, 2 and 3 for negative, and 1 and 2 for no trend. In this way, the first alternative emotion tendencies forward and first alternative emotion intensity 4 for the first emotion aspect selected by the labeling person can be obtained.
According to another example, the interactive interface shown in fig. 5 includes: the text to be annotated is "convincing, and our work is better-! "; a first emotional aspect, namely pleasure; a plurality of alternative emotional tendencies, namely positive, negative, and no tendency; a number of alternative emotional intensities, namely 1,2 and 3. A second emotional aspect, endorsement; a plurality of alternative emotional tendencies, namely positive, negative, and no tendency; a number of alternative emotional intensities, namely 1,2 and 3. In this way, the first alternative emotion tendencies forward direction and first alternative emotion intensity 1 for the first emotion aspect and the second alternative emotion tendencies forward direction and second alternative emotion intensity 2 for the second emotion aspect selected by the labeling person can be obtained.
According to yet another example, FIG. 6 shows labeling data recorded by a label maker through an excel table. The method comprises the following steps: for text number 3, emotion tendency is-1 and emotion intensity is 1. Thus, the recorded annotation data can be obtained by reading the excel document.
The above, the labeling data obtained by labeling the first text can be obtained.
Next, in step S220, a first emotion type tag corresponding to the labeling data for the first text is determined based on the predetermined mapping relation.
In one example, based on the mapping relationship shown in table 5, assuming that the first emotion type tendency included in the annotation data is negative and the first emotion type intensity is 5, it may be determined that the corresponding first emotion type tag is angry. In another example, assuming that the first emotion type tendency included in the annotation data is negative and the first emotion type intensity is 6, it may be determined that the corresponding first emotion type label is anger. Thus, the corresponding emotion type label can be accurately positioned through the quantization index.
In the above, the text label may be determined, and in step S230, a first training sample is determined based on the first text and the first emotion type label, and the first training sample is used for training a text emotion analysis model to perform emotion analysis on the text to be analyzed.
In one embodiment, the text emotion analysis model may be a multi-classification model. In another embodiment, the text emotion analysis model may include a plurality of classification models. In one embodiment, the algorithm on which the text emotion analysis model is based may include decision trees, bayes, support vector machines SVMs, and the like. In another embodiment, the text emotion analysis model may employ a neural network model such as RNN, LSTM, GRU.
Therefore, the corresponding first emotion type label can be determined according to the labeling data of the first text, the first training sample can be further determined, a plurality of other training samples can be similarly determined, a training sample set is constructed, and then the text emotion analysis model is trained.
In summary, by adopting the text emotion analysis method disclosed by the embodiment of the specification, the labeling data has higher effectiveness and consistency, and the correspondingly determined label data also has higher effectiveness and consistency, so that the trained text emotion analysis model has high availability, the confidence coefficient of the obtained prediction result is high, the accuracy is high, and the use value is higher.
In the above embodiment, the method for emotion analysis of text shown in fig. 2 will be mainly described. Similarly, the embodiment of the specification also discloses a method for emotion analysis of pictures. In particular, fig. 7 shows a flowchart of a method of emotion analysis of a picture, according to an embodiment, the subject of which may be any device, apparatus, platform, cluster of devices, etc. having computing or processing capabilities. As shown in fig. 7, the method comprises the steps of:
step S710, obtaining labeling data obtained by labeling the first picture, wherein the labeling data comprises a first emotion tendency selected from a plurality of alternative emotion tendencies aiming at the first emotion aspect and a first emotion intensity selected from a plurality of alternative emotion intensities aiming at the first emotion tendency; step S720, determining a first emotion type label corresponding to the combination of the first emotion tendency and the first emotion intensity based on a predetermined mapping relation between the candidate combinations of the plurality of candidate emotion tendencies and the plurality of candidate emotion intensities and the candidate emotion type label; step S730, determining a first training sample based on the first picture and the first emotion type tag, where the first training sample is used to train a picture emotion analysis model to perform emotion analysis on a picture to be analyzed.
In the above steps, in the embodiment of the present disclosure, any one of the plurality of pictures to be marked is referred to as a first picture. In one embodiment, the plurality of pictures may be pictures with emotional colors. In a specific embodiment, a picture with facial expression may be included. In one example, multiple people may be included to self-photograph. In another specific embodiment, a picture with limb language may be included. In one example, a whole body photograph of a plurality of animals or humans may be included.
In one embodiment, the photo emotion analysis model may be a neural network model. In a particular embodiment, a CNN network, a DNN network, or the like may be employed.
In addition, for the description of the above steps S710 to S730, reference may also be made to the description of the above steps S210 to S230.
In summary, by adopting the image emotion analysis method disclosed by the embodiment of the specification, the labeling data has higher effectiveness and consistency, and the correspondingly determined label data also has higher effectiveness and consistency, so that the trained image emotion analysis model has high availability, the confidence coefficient of the obtained prediction result is high, the accuracy is high, and the application value is higher.
From another point of view, in the emotion analysis method shown in fig. 2, the annotation data includes the set first emotion aspect, and the first emotion tendency and the corresponding first emotion intensity selected by the marker for the emotion aspect. In summary, the above mentioned emotion aspects, emotion tendencies and emotion intensities have a hierarchical relationship, in other words, three correspond to three levels, and three emotion dimensions corresponding to the three levels are represented respectively. Further, the candidate dimension values corresponding to each emotion dimension can be provided for the marking personnel, wherein the candidate dimension values comprise candidate emotion tendencies corresponding to emotion tendency dimensions and candidate emotion intensities corresponding to emotion intensity dimensions.
Based on this, hierarchical information that is richer or has other hierarchical structures may also be included in the annotation data. In one embodiment, the first emotional aspect described above may not be set, but rather selected by the marking person from a plurality of alternative emotional aspects. In another embodiment, one or more of emotion aspects, emotion tendencies, and emotion intensities may be included in the plurality of emotion dimensions. In yet another embodiment, emotion realism, emotion expression intent, and the like may be included in the plurality of emotion dimensions. In a specific embodiment, the candidate dimension values corresponding to the emotion realism may include: true, camouflage, and indistinguishable. In another specific embodiment, the candidate dimension values to which the emotion expressions are to correspond may include: restraint, natural bleeding, release, etc.
In particular, FIG. 8 illustrates a flow chart of a text emotion analysis method, according to another embodiment, whose execution subject may be any device, apparatus, platform, cluster of devices, etc. that has computing or processing capabilities. As shown in fig. 8, the method comprises the steps of:
step S810, marking data obtained by marking the first text is obtained, wherein the marking data comprises selected dimension values selected from alternative dimension values aiming at each of a plurality of preset emotion dimensions in a plurality of layers; step S820, determining a first emotion type label corresponding to the combination of the selected dimension values based on a predetermined mapping relation between each alternative combination of the alternative dimension values of each emotion dimension and alternative emotion type labels; step S830, determining a first training sample based on the first text and the first emotion type tag, where the first training sample is used to train a text emotion analysis model to perform emotion analysis on the text to be analyzed.
For the above steps, it is to be understood that a hierarchical relationship exists between a plurality of emotion dimensions, and the plurality of emotion dimensions are respectively located in different hierarchies. In one embodiment, the plurality of emotion dimensions may include a hierarchy from high to low emotion aspect dimension, emotion tendencies dimension, and emotion intensity dimension. Further, emotion aspect dimensions correspond to a plurality of alternative emotion aspects; the emotion tendencies dimension corresponds to a plurality of alternative emotion tendencies including alternative emotion tendencies corresponding to respective alternative emotion aspects; the emotion intensity dimension corresponds to a plurality of alternative emotion intensities, including alternative emotion intensities corresponding to respective alternative emotion tendencies.
In another embodiment, the plurality of emotion dimensions may include a hierarchy of high-to-low emotion state dimensions and emotion real dimensions. In a specific embodiment, the mapping between each alternative combination of alternative dimension values and alternative emotion type labels in each of these two dimensions is shown in table 6:
TABLE 6
In one example, based on table 6, assuming that the selected dimension value that is annotated for a text includes both positive and natural, a first category label optimism can be determined from the above-described mapping. The first training sample can be determined and used for training a text emotion analysis model aiming at the text, and emotion analysis is carried out on the picture to be analyzed.
In the above-described embodiment, fig. 2 and 8 show an emotion analysis method in which a sample in text form is a target sample, and fig. 7 shows an emotion analysis method in which a sample in picture form is a target sample. Further, the methods shown in fig. 2, 7 and 8 can be further expanded, and the method can be suitable for more forms of target samples and more scenes. On the one hand, the method is not limited to the emotion analysis scene, but can be used for other classification scenes, particularly suitable for the situation that the degree of distinction between classification labels is low, for example, classification of the field to which the knowledge points belong, classification of subjective objectivity, view and the like of news content. On the other hand, the target sample may be text, a picture, audio, video, or the like.
In particular, FIG. 9 illustrates a flowchart of a classification method for a target sample, according to an embodiment, the subject of which may be any device, apparatus, platform, cluster of devices, etc. having computing or processing capabilities. As shown in fig. 9, the method comprises the steps of:
step S910, obtaining labeling data obtained by labeling the first sample, wherein the labeling data comprises each selected category selected from each alternative category aiming at each classification level in a plurality of preset classification levels; step S920, determining a first class label corresponding to each selected class combination based on a predetermined mapping relation between each candidate class candidate combination and candidate class labels of each classification hierarchy; step S930, determining a first training sample based on the first sample and the first class label, where the first training sample is used to train a classification model to classify the target sample to be classified.
It should be noted that for the above steps, for the multiple classification levels mentioned therein, in one embodiment, different category levels, or different classification granularities, may be corresponded. In a particular embodiment, the plurality of classification levels includes a primary category and a secondary category, wherein the plurality of alternative categories in the primary category includes: the multiple alternative categories under the mathematical, physical and chemical classes include: theory, application, acoustics, particles, lasers, inorganic, organic. Further, the predetermined mapping relationship may be as shown in table 7:
TABLE 7
In one example, based on Table 7, assuming that the selected category for which labeling is done for a paper includes physics and particles, it can be determined that the first category label is particle physics. From this, a first training sample may be determined for training a classification model for the articles, classifying the target articles to be classified.
In addition, for the description of step S910 to step S930 above, reference may also be made to the description of the foregoing related content.
Above, by adopting the classification method for the target sample disclosed in the embodiment of the specification, the labeling data has higher effectiveness and consistency, and the correspondingly determined label data also has higher effectiveness and consistency, so that the trained classification model has high availability, the confidence of the obtained prediction result is high, the accuracy is high, and the use value is higher.
It should be noted that a method for obtaining annotation data for text is disclosed in fig. 3. According to another embodiment, the present specification also discloses a method for obtaining annotation data for a picture. In particular, FIG. 10 illustrates a flowchart of a method for obtaining annotation data, according to another embodiment, the subject of execution of which may be any device, apparatus, platform, cluster of devices, etc. having computing or processing capabilities. As shown in fig. 10, the method includes the steps of:
Step S1010, providing the text or picture to be annotated to the annotator, as well as a plurality of alternative emotion tendencies for the first emotion aspect and a plurality of alternative emotion intensities for the respective alternative emotion tendencies. Step S1020, obtaining a first emotion tendency selected by the labeling person from the plurality of alternative emotion tendencies and a first emotion intensity selected from the plurality of alternative emotion intensities, and using the first emotion tendency and the first emotion intensity as labeling data of the text or the picture.
For the above steps, in one embodiment, the step S1010 may include: and displaying an interactive interface, wherein the interactive interface comprises the text or the picture to be annotated, the multiple alternative emotion tendencies and the multiple alternative emotion intensities. Accordingly, step S1020 may include: and receiving the first emotion tendency and the first emotion intensity selected by the labeling personnel based on the interactive interface.
Further, for the description of step S1010 and step S1020, reference may also be made to the foregoing description of step S31 and step S32.
Corresponding to the emotion analysis method shown in fig. 8, the present specification also discloses a method for acquiring annotation data. In particular, FIG. 11 illustrates a flowchart of a method for obtaining annotation data, according to another embodiment, the subject of execution of which may be any device, apparatus, platform, cluster of devices, etc. having computing or processing capabilities. As shown in fig. 11, the method comprises the steps of:
Step S1110, providing texts or pictures to be annotated and preset candidate dimension values of each emotion dimension in a plurality of emotion dimensions of a plurality of levels to an annotator; step S1120, obtaining each selected dimension value selected by the labeling personnel from the candidate dimension values of each emotion dimension, and taking each selected dimension value as labeling data for the text or the picture.
For the above steps, in one embodiment, step S1110 may include: and displaying an interactive interface, wherein the interactive interface comprises the text or the picture to be annotated, and the alternative dimension values of each emotion dimension. Accordingly, step S1120 may include: and receiving the selected dimension values selected by the annotators based on the interactive interface.
Further, for the description of step S1110 and step S1120, reference may also be made to the foregoing description of step S31 and step S32.
According to an embodiment of yet another aspect, the present disclosure further discloses a method for obtaining sample annotation data applicable to more scenarios. In particular, fig. 12 shows a flowchart of a method for obtaining annotation data according to yet another embodiment, where the method may be performed by any device, apparatus, platform, cluster of devices, etc. having computing or processing capabilities. As shown in fig. 12, the method includes the steps of:
In step S1210, the labeling personnel is provided with the sample to be labeled and the preset candidate category of each classification level in the plurality of classification levels. Step S1220, obtaining each selected category selected by the labeling personnel from the candidate categories of each classification hierarchy, and taking each selected category as labeling data of the sample.
For the above steps, in one embodiment, step S1210 may include: and displaying an interactive interface, wherein the interactive interface comprises the sample to be marked, and the alternative category of each classification level in the plurality of classification levels. Accordingly, step S1220 may include: and receiving the selected categories selected by the annotators based on the interactive interface.
Further, for the description of step S1210 and step S1220, reference may also be made to the foregoing description of step S31 and step S32.
Corresponding to the methods described in the above embodiments, various devices are also disclosed in this specification. The method comprises the following steps:
13 FIG. 13 shows a schematic block diagram of a text emotion analysis device according to one embodiment. As shown, the apparatus 1300 includes:
the annotation data obtaining unit 1310 is configured to obtain annotation data obtained by annotating a first text, where the annotation data includes a first emotion tendency selected from a plurality of alternative emotion tendencies for a first emotion aspect, and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency. A category label determining unit 1320 configured to determine a first emotion category label corresponding to a combination of the first emotion tendencies and first emotion intensities based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion category labels; and a training sample determining unit 1330 configured to determine, based on the first text and the first emotion type tag, a first training sample for training a text emotion analysis model to perform emotion analysis on the text to be analyzed.
In one embodiment, the plurality of alternative emotional trends includes positive, negative, and no trends.
In one embodiment, the first affective aspect is one of the following: pleasure, optimism, access, love, humming, photophobia, approval and self-responsibility.
In one embodiment, the number of the plurality of alternative emotion intensities for the first emotion tendencies is determined based on a pre-sorted number of alternative emotion category labels with the first emotion orientation of the first emotion aspect.
Fig. 14 shows a schematic block diagram of a photo emotion analysis device according to one embodiment. As shown, the apparatus 1400 includes:
a labeling data obtaining unit 1410 configured to obtain labeling data obtained by labeling a first picture, where the labeling data includes a first emotion tendency selected from a plurality of alternative emotion tendencies for a first emotion aspect, and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency; a category label determining unit 1420 configured to determine a first emotion category label corresponding to a combination of the first emotion tendencies and first emotion intensities based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion category labels; and a training sample determining unit 1430 configured to determine a first training sample based on the first picture and the first emotion type tag, where the first training sample is used to train a picture emotion analysis model to perform emotion analysis on a picture to be analyzed.
In one embodiment, the plurality of alternative emotional trends includes positive, negative, and no trends.
In one embodiment, the first affective aspect is one of the following: pleasure, optimism, access, love, humming, photophobia, approval and self-responsibility.
In one embodiment, the number of the plurality of alternative emotion intensities for the first emotion tendencies is determined based on a pre-sorted number of alternative emotion category labels with the first emotion orientation of the first emotion aspect.
Fig. 15 shows a schematic block diagram of a text emotion analyzing apparatus according to another embodiment. As shown in fig. 15, the apparatus 1500 includes: a labeling data obtaining unit 1510 configured to obtain labeling data obtained by labeling the first text, where the labeling data includes, for each of a plurality of emotion dimensions in a plurality of levels set in advance, each selected dimension value selected from the candidate dimension values; a category label determining unit 1520 configured to determine a first emotion category label corresponding to a combination of the selected dimension values based on a predetermined mapping relationship between each candidate combination of candidate dimension values of each emotion dimension and candidate emotion category labels; and a training sample determining unit 1530 configured to determine a first training sample based on the first text and the first emotion type tag, for training a text emotion analysis model to perform emotion analysis on the text to be analyzed.
In one embodiment, the plurality of emotion dimensions includes at least one of: emotion aspect, emotion tendency, emotion intensity.
Fig. 16 shows a schematic block diagram of a classification apparatus for target samples according to an embodiment. As shown in fig. 16, the apparatus 1600 includes: a labeling data obtaining unit 1610 configured to obtain labeling data obtained by labeling a first sample, where the labeling data includes, for each of a plurality of preset classification levels, each selected category selected from each candidate category; a category label determining unit 1620 configured to determine a first category label corresponding to each selected category item combination based on a predetermined mapping relationship between each candidate item combination of each classification hierarchy and a candidate category label; the training sample determining unit 1630 is configured to determine, based on the first sample and the first class label, a first training sample for training a classification model to classify the target sample to be classified.
FIG. 17 illustrates a schematic block diagram of an apparatus for acquiring annotation data, according to one embodiment. As shown in fig. 17, the apparatus 1700 includes:
A providing unit 1710 configured to provide a text or a picture to be annotated to an annotator, and a plurality of alternative emotion tendencies for the first emotion aspect and a plurality of alternative emotion intensities for the respective alternative emotion tendencies; an obtaining unit 1720 configured to obtain a first emotion tendency selected by the labeling person from the plurality of alternative emotion tendencies and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency, and use the first emotion tendency and the first emotion intensity as labeling data for the text or the picture.
In one embodiment, the providing unit 1710 is specifically configured to: displaying an interactive interface, wherein the interactive interface comprises the text or the picture to be annotated, the multiple alternative emotion tendencies and multiple alternative emotion intensities aiming at each alternative emotion tendency; the acquisition unit 1720 is specifically configured to: and receiving the first emotion tendency and the first emotion intensity selected by the labeling personnel based on the interactive interface.
FIG. 18 shows a schematic block diagram of an apparatus for acquiring annotation data, according to another embodiment. As shown in fig. 18, the apparatus 1800 includes: a providing unit 1810 configured to provide the labeling person with a text or a picture to be labeled, and preset candidate dimension values of each emotion dimension among a plurality of emotion dimensions in a plurality of levels; an obtaining unit 1820, configured to obtain each selected dimension value selected by the labeling person from the candidate dimension values of each emotion dimension, and use the each selected dimension value as labeling data for the text or the picture.
FIG. 19 shows a schematic block diagram of an apparatus for acquiring annotation data, according to another embodiment. As shown in fig. 19, the apparatus 1900 includes:
a providing unit 1910 configured to provide a sample to be annotated to an annotator and preset alternative categories of each of a plurality of classification levels; an obtaining unit 1920 configured to obtain each selected category selected by the labeling person from the candidate categories of each classification hierarchy, and take the each selected category as labeling data for the sample.
In one embodiment, the providing unit 1910 is specifically configured to: displaying an interactive interface, wherein the interactive interface comprises the sample to be marked, and the alternative category of each classification level in the plurality of classification levels; the acquiring unit 1920 is specifically configured to: and receiving the selected categories selected by the annotators based on the interactive interface.
According to an embodiment of another aspect, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method described in connection with fig. 2, 3, 8, 9, 10, 11 and 12.
According to an embodiment of yet another aspect, there is also provided a computing device including a memory having executable code stored therein and a processor that, when executing the executable code, implements the method described in connection with fig. 2, 3, 8, 9, 10, 11 and 12.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the present invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, these functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention in further detail, and are not to be construed as limiting the scope of the invention, but are merely intended to cover any modifications, equivalents, improvements, etc. based on the teachings of the invention.

Claims (26)

1. A computer-implemented text emotion analysis method, comprising:
Obtaining annotation data obtained by manually annotating a first text, wherein the annotation data comprises a first emotion tendency selected from a plurality of alternative emotion tendencies aiming at a first emotion aspect and a first emotion intensity selected from a plurality of alternative emotion intensities aiming at the first emotion tendency; the first emotion aspect is determined based on emotion category labels, the plurality of alternative emotion tendencies are determined based on a plurality of alternative emotion labels corresponding to the first emotion aspect, and the number of the plurality of alternative emotion intensities is determined based on the number of alternative emotion category labels with the first emotion downward;
determining a first emotion type tag corresponding to a combination of the first emotion tendency and the first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion type tags;
and determining a first training sample based on the first text and the first emotion type label, wherein the first training sample is used for training a text emotion analysis model so as to carry out emotion analysis on the text to be analyzed.
2. The method of claim 1, wherein the plurality of alternative emotional tendencies include positive, negative, and no tendency.
3. The method of claim 1, wherein the first affective aspect is one of: pleasure, optimism, access, love, humming, photophobia, approval and self-responsibility.
4. A computer-implemented text emotion analysis method, comprising:
the method comprises the steps of obtaining annotation data obtained by manually annotating a first text, wherein the annotation data comprise, for each emotion dimension in a plurality of preset emotion dimensions in a plurality of levels, each selected dimension value selected from alternative dimension values, and the plurality of emotion dimensions and the alternative dimension values of each emotion dimension are determined based on emotion category labels;
determining a first emotion type label corresponding to each combination of the selected dimension values based on a predetermined mapping relation between each alternative combination of the alternative dimension values of each emotion dimension and alternative emotion type labels;
and determining a first training sample based on the first text and the first emotion type label, wherein the first training sample is used for training a text emotion analysis model so as to carry out emotion analysis on the text to be analyzed.
5. The method of claim 4, wherein the plurality of emotion dimensions comprises at least one of: emotion aspect, emotion tendency, emotion intensity.
6. A computer-implemented picture emotion analysis method, comprising:
the method comprises the steps of obtaining annotation data obtained by manually annotating a first picture, wherein the annotation data comprises a first emotion tendency selected from a plurality of alternative emotion tendencies aiming at a first emotion aspect and a first emotion intensity selected from a plurality of alternative emotion intensities aiming at the first emotion tendency; the first emotion aspect is determined based on emotion category labels, the plurality of alternative emotion tendencies are determined based on a plurality of alternative emotion labels corresponding to the first emotion aspect, and the number of the plurality of alternative emotion intensities is determined based on the number of alternative emotion category labels with the first emotion downward;
determining a first emotion type tag corresponding to a combination of the first emotion tendency and the first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion type tags;
and determining a first training sample based on the first picture and the first emotion type label, wherein the first training sample is used for training a picture emotion analysis model so as to carry out emotion analysis on the picture to be analyzed.
7. A computer-implemented classification method for a target sample, comprising:
obtaining labeling data obtained by manually labeling a first sample, wherein the labeling data comprises, for each classification level in a plurality of preset classification levels, each selected category selected from each alternative category, and the plurality of classification levels and the alternative categories of each classification level are determined based on category labels;
determining a first class label corresponding to each selected class combination based on a predetermined mapping relation between each candidate class combination of each classification hierarchy and the candidate class label;
and determining a first training sample based on the first sample and the first class label, wherein the first training sample is used for training a classification model so as to classify the target sample to be classified.
8. A method of obtaining annotation data, comprising:
providing the text or picture to be annotated to the annotator, as well as a plurality of alternative emotion tendencies for the first emotion aspect and a plurality of alternative emotion intensities for each alternative emotion tendencies; the first emotion aspect is determined based on emotion category labels, the plurality of alternative emotion tendencies are determined based on a plurality of alternative emotion labels corresponding to the first emotion aspect, and the number of the plurality of alternative emotion intensities is determined based on the number of alternative emotion category labels under each alternative emotion tendency;
The first emotion tendency selected by the labeling personnel from the multiple alternative emotion tendencies and the first emotion intensity selected from the multiple alternative emotion intensities aiming at the first emotion tendency are obtained, and the first emotion tendency and the first emotion intensity are used as labeling data aiming at the text or the picture.
9. The method of claim 8, wherein the providing the annotator with text or pictures to be annotated, and a plurality of alternative emotional tendencies for the first emotional aspect and a plurality of alternative emotional intensities for the respective alternative emotional tendencies, comprises:
displaying an interactive interface, wherein the interactive interface comprises the text or the picture to be annotated, the multiple alternative emotion tendencies and multiple alternative emotion intensities aiming at each alternative emotion tendency;
the obtaining the first emotion tendencies selected by the labeling person from the plurality of alternative emotion tendencies and the first emotion intensities selected from the plurality of alternative emotion intensities for the first emotion tendencies includes:
and receiving the first emotion tendency and the first emotion intensity selected by the labeling personnel based on the interactive interface.
10. A method of obtaining annotation data, comprising:
Providing a text or a picture to be marked for a marking person, and presetting candidate dimension values of each emotion dimension in a plurality of emotion dimensions of a plurality of levels, wherein the plurality of emotion dimensions and the candidate dimension values of each emotion dimension are determined based on emotion category labels;
and acquiring each selected dimension value selected by the labeling personnel from the candidate dimension values of each emotion dimension, and taking each selected dimension value as labeling data for the text or the picture.
11. A method of obtaining annotation data, comprising:
providing a sample to be marked for a marking person, and presetting alternative categories of each classification level in a plurality of classification levels, wherein the classification levels and the alternative categories of each classification level are determined based on class labels;
and acquiring each selected category selected by the annotator from the alternative categories of each classification level, and taking each selected category as annotation data for the sample.
12. The method of claim 11, wherein the providing the sample to be annotated to the annotator and the preset alternative categories for each of the plurality of classification levels comprises:
Displaying an interactive interface, wherein the interactive interface comprises the sample to be marked, and the alternative category of each classification level in the plurality of classification levels;
the obtaining each selected category selected by the annotator from the candidate categories of each classification level includes:
and receiving the selected categories selected by the annotators based on the interactive interface.
13. A computer-implemented text emotion analysis device, comprising:
a labeling data acquisition unit configured to acquire labeling data obtained by manually labeling a first text, the labeling data including a first emotion tendency selected from a plurality of alternative emotion tendencies for a first emotion aspect, and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency; the first emotion aspect is determined based on emotion category labels, the plurality of alternative emotion tendencies are determined based on a plurality of alternative emotion labels corresponding to the first emotion aspect, and the number of the plurality of alternative emotion intensities is determined based on the number of alternative emotion category labels with the first emotion downward;
a category label determining unit configured to determine a first emotion category label corresponding to a combination of the first emotion tendency and first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion category labels;
The training sample determining unit is configured to determine a first training sample based on the first text and the first emotion type label, and is used for training a text emotion analysis model so as to perform emotion analysis on the text to be analyzed.
14. The apparatus of claim 13, wherein the plurality of alternative emotional trends includes positive, negative, and no trends.
15. The apparatus of claim 13, wherein the first affective aspect is one of: pleasure, optimism, access, love, humming, photophobia, approval and self-responsibility.
16. A computer-implemented text emotion analysis device, comprising:
the labeling data acquisition unit is configured to acquire labeling data obtained by manually labeling the first text, wherein the labeling data comprises a plurality of emotion dimensions and candidate dimension values of the emotion dimensions, wherein the selected dimension values are selected from the candidate dimension values for each emotion dimension in a plurality of preset emotion dimensions, and the emotion dimensions and the candidate dimension values of the emotion dimensions are determined based on emotion category labels;
a category label determining unit configured to determine a first emotion category label corresponding to a combination of the selected dimension values based on a predetermined mapping relationship between each candidate combination of candidate dimension values of each emotion dimension and candidate emotion category labels;
The training sample determining unit is configured to determine a first training sample based on the first text and the first emotion type label, and is used for training a text emotion analysis model so as to perform emotion analysis on the text to be analyzed.
17. The apparatus of claim 16, wherein the plurality of emotion dimensions comprises at least one of: emotion aspect, emotion tendency, emotion intensity.
18. A computer-implemented picture emotion analysis device, comprising:
a labeling data acquisition unit configured to acquire labeling data obtained by manually labeling a first picture, the labeling data including a first emotion tendency selected from a plurality of alternative emotion tendencies for a first emotion aspect, and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency; the first emotion aspect is determined based on emotion category labels, the plurality of alternative emotion tendencies are determined based on a plurality of alternative emotion labels corresponding to the first emotion aspect, and the number of the plurality of alternative emotion intensities is determined based on the number of alternative emotion category labels with the first emotion downward;
a category label determining unit configured to determine a first emotion category label corresponding to a combination of the first emotion tendency and first emotion intensity based on a predetermined mapping relationship between the plurality of alternative emotion tendencies and alternative combinations of the plurality of alternative emotion intensities and alternative emotion category labels;
The training sample determining unit is configured to determine a first training sample based on the first picture and the first emotion type label, and is used for training a picture emotion analysis model so as to perform emotion analysis on a picture to be analyzed.
19. A computer-implemented classification apparatus for a target sample, comprising:
a labeling data acquisition unit configured to acquire labeling data obtained by manually labeling a first sample, the labeling data including, for each of a plurality of classification levels set in advance, each selected category selected from each candidate category, the plurality of classification levels and the candidate categories of each classification level being determined based on a category label;
a category label determining unit configured to determine a first category label corresponding to each combination of selected categories based on a predetermined mapping relationship between each combination of alternatives of the respective classification levels and alternative category labels;
and the training sample determining unit is configured to determine a first training sample based on the first sample and the first class label, and is used for training a classification model to classify the target sample to be classified.
20. An apparatus for obtaining annotation data, comprising:
a providing unit configured to provide a text or a picture to be annotated to an annotator, and a plurality of alternative emotion tendencies for the first emotion aspect and a plurality of alternative emotion intensities for the respective alternative emotion tendencies; the first emotion aspect is determined based on emotion category labels, the plurality of alternative emotion tendencies are determined based on a plurality of alternative emotion labels corresponding to the first emotion aspect, and the number of the plurality of alternative emotion intensities is determined based on the number of alternative emotion category labels under each alternative emotion tendency;
an acquisition unit configured to acquire a first emotion tendency selected by the labeling person from the plurality of alternative emotion tendencies and a first emotion intensity selected from a plurality of alternative emotion intensities for the first emotion tendency, and to use the first emotion tendency and the first emotion intensity as labeling data for the text or the picture.
21. The apparatus of claim 20, wherein the providing unit is specifically configured to:
displaying an interactive interface, wherein the interactive interface comprises the text or the picture to be annotated, the multiple alternative emotion tendencies and multiple alternative emotion intensities aiming at each alternative emotion tendency;
The acquisition unit is specifically configured to:
and receiving the first emotion tendency and the first emotion intensity selected by the labeling personnel based on the interactive interface.
22. An apparatus for obtaining annotation data, comprising:
the labeling unit is configured to provide texts or pictures to be labeled for labeling personnel, and preset candidate dimension values of each emotion dimension in a plurality of emotion dimensions of a plurality of levels, wherein the plurality of emotion dimensions and the candidate dimension values of each emotion dimension are determined based on emotion category labels;
the acquiring unit is configured to acquire each selected dimension value selected by the labeling personnel from the candidate dimension values of each emotion dimension, and the selected dimension value is used as labeling data for the text or the picture.
23. An apparatus for obtaining annotation data, comprising:
a providing unit configured to provide a sample to be annotated to an annotator, and a preset alternative category of each of a plurality of classification levels, the plurality of classification levels and the alternative category of each of the classification levels being determined based on a category label;
and the acquisition unit is configured to acquire each selected category selected by the labeling personnel from the alternative categories of each classification level, and the selected category is used as labeling data for the sample.
24. The apparatus of claim 23, wherein the providing unit is specifically configured to:
displaying an interactive interface, wherein the interactive interface comprises the sample to be marked, and the alternative category of each classification level in the plurality of classification levels;
the acquisition unit is specifically configured to:
and receiving the selected categories selected by the annotators based on the interactive interface.
25. A computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed in a computer, causes the computer to perform the method of any of claims 1-12.
26. A computing device comprising a memory and a processor, wherein the memory has executable code stored therein, which when executed by the processor, implements the method of any of claims 1-12.
CN201910858800.XA 2019-09-11 2019-09-11 Text emotion analysis method and device executed by computer Active CN110704581B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910858800.XA CN110704581B (en) 2019-09-11 2019-09-11 Text emotion analysis method and device executed by computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910858800.XA CN110704581B (en) 2019-09-11 2019-09-11 Text emotion analysis method and device executed by computer

Publications (2)

Publication Number Publication Date
CN110704581A CN110704581A (en) 2020-01-17
CN110704581B true CN110704581B (en) 2024-03-08

Family

ID=69195377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910858800.XA Active CN110704581B (en) 2019-09-11 2019-09-11 Text emotion analysis method and device executed by computer

Country Status (1)

Country Link
CN (1) CN110704581B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695357A (en) * 2020-05-28 2020-09-22 平安科技(深圳)有限公司 Text labeling method and related product
CN112069315A (en) * 2020-08-31 2020-12-11 深圳市卡牛科技有限公司 Method, device, server and storage medium for extracting text multidimensional information

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105844424A (en) * 2016-05-30 2016-08-10 中国计量学院 Product quality problem discovery and risk assessment method based on network comments
CN106528533A (en) * 2016-11-08 2017-03-22 浙江理工大学 Dynamic sentiment word and special adjunct word-based text sentiment analysis method
CN108205522A (en) * 2016-12-16 2018-06-26 北京酷我科技有限公司 The method and its system of Emotion tagging
CN108804512A (en) * 2018-04-20 2018-11-13 平安科技(深圳)有限公司 Generating means, method and the computer readable storage medium of textual classification model
CN108959268A (en) * 2018-07-20 2018-12-07 科大讯飞股份有限公司 A kind of text emotion analysis method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105844424A (en) * 2016-05-30 2016-08-10 中国计量学院 Product quality problem discovery and risk assessment method based on network comments
CN106528533A (en) * 2016-11-08 2017-03-22 浙江理工大学 Dynamic sentiment word and special adjunct word-based text sentiment analysis method
CN108205522A (en) * 2016-12-16 2018-06-26 北京酷我科技有限公司 The method and its system of Emotion tagging
CN108804512A (en) * 2018-04-20 2018-11-13 平安科技(深圳)有限公司 Generating means, method and the computer readable storage medium of textual classification model
CN108959268A (en) * 2018-07-20 2018-12-07 科大讯飞股份有限公司 A kind of text emotion analysis method and device

Also Published As

Publication number Publication date
CN110704581A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
Zhao et al. Affective image content analysis: Two decades review and new perspectives
KR102222451B1 (en) An apparatus for predicting the status of user's psychology and a method thereof
CN105608477B (en) Method and system for matching portrait with job position
US20110135195A1 (en) System and method for classification and selection of color palettes
CN107735782A (en) Image and text data hierarchical classification device
Ortis et al. An Overview on Image Sentiment Analysis: Methods, Datasets and Current Challenges.
US11023503B2 (en) Suggesting text in an electronic document
US11803872B2 (en) Creating meta-descriptors of marketing messages to facilitate in delivery performance analysis, delivery performance prediction and offer selection
JP6569183B2 (en) Information processing apparatus, method, and program
CN111507097A (en) Title text processing method and device, electronic equipment and storage medium
US11182540B2 (en) Passively suggesting text in an electronic document
CN110704586A (en) Information processing method and system
CN110704581B (en) Text emotion analysis method and device executed by computer
US9129216B1 (en) System, method and apparatus for computer aided association of relevant images with text
Sekhar et al. Emotion recognition through human conversation using machine learning techniques
EP3471049A1 (en) Information processing device, information processing method, and program
CN108733672B (en) Method and system for realizing network information quality evaluation
CN116701637B (en) Zero sample text classification method, system and medium based on CLIP
US11886809B1 (en) Identifying templates based on fonts
JP7427510B2 (en) Information processing device, information processing method and program
CN117015789A (en) SNS text-based decoration style analysis model providing device and method for user
Ji et al. Design and Application of Mapping Model for Font Recommendation System Based on Contents Emotion Analysis
CN113297520A (en) Page design auxiliary processing method and device and electronic equipment
Duan et al. Multi-emotion estimation in narratives from crowdsourced annotations
JP2020009453A (en) Information processing device and program

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
TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant