CN113901171A - Semantic emotion analysis method and device - Google Patents

Semantic emotion analysis method and device Download PDF

Info

Publication number
CN113901171A
CN113901171A CN202111039784.5A CN202111039784A CN113901171A CN 113901171 A CN113901171 A CN 113901171A CN 202111039784 A CN202111039784 A CN 202111039784A CN 113901171 A CN113901171 A CN 113901171A
Authority
CN
China
Prior art keywords
sentences
emotion analysis
recognized
semantic
emotion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111039784.5A
Other languages
Chinese (zh)
Inventor
王喆
裴子龙
范凌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tezign Shanghai Information Technology Co Ltd
Original Assignee
Tezign Shanghai Information Technology 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 Tezign Shanghai Information Technology Co Ltd filed Critical Tezign Shanghai Information Technology Co Ltd
Priority to CN202111039784.5A priority Critical patent/CN113901171A/en
Publication of CN113901171A publication Critical patent/CN113901171A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a semantic emotion analysis method, which is characterized by comprising the following steps: obtaining a sentence to be identified; assembling the aspect categories and the sentences to be identified to obtain test assembled sentences; inputting a test assembly statement into a multi-classification semantic emotion analysis model based on a BERT framework to enable the semantic emotion analysis model to determine the emotion polarity of the statement to be recognized in the aspect category; and receiving the semantic emotion analysis model to determine the aspect category and the emotion polarity of the sentence to be recognized. The method converts the fine-grained aspect category emotion analysis task into a natural language reasoning task, and realizes a fine-grained end-to-end semantic emotion analysis method; the method provides reliable foundation support for digging the objective intention of the consumer and for downstream creative production guidance and release guidance; and the robustness and the generalization capability of the composite material reach a quite high level.

Description

Semantic emotion analysis method and device
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a semantic emotion analysis method and device.
Background
In the creative marketing field, originality is an important link from putting to generating consumption influence, wherein the insight on the consumption behavior of consumers is an important basis for guiding the production of originality. Therefore, it is very important to focus on the consumer feedback of the consumer on the e-commerce platform and mine the potential consumer power of the consumer to guide the production of creative content.
The purchase evaluation of the consumer often includes contents in a plurality of semantic aspects, such as: the method comprises the following steps of 'use effect', 'logistics express delivery', and the like, wherein the aspect categories are hierarchical, and the underlying aspect categories are finer in granularity. The emotion analysis based on the aspect categories is to dig the mentioned aspect categories in the comment text of the consumer and dig out the emotion tendencies contained in the aspect categories, for example, the consumer evaluates that the chip removal effect is good, the gift component is too small, the whole sentence emotion is neutral, the effect aspect emotion is fair, and the gift aspect emotion is derogative.
In the prior art, semantic emotion mining for consumer evaluation mainly comprises the following steps: first, sentiment analysis based on whole sentences; second, keyword-based aspects are targeted to sentiment analysis; thirdly, extracting aspect categories and then classifying the sentences with known aspects. However, as with the above example, the aspects contained in a sentence tend to be complex with emotion, and fine-grained emotion will not be extracted using the first approach; in the second method, the keywords often need a pre-step to extract key words, and the generalization performance is poor; the third method adopts a step-by-step mode to perform emotion analysis based on aspect categories, needs to train a classifier for each aspect category, and is not very efficient.
Therefore, a semantic emotion analysis method which has high efficiency and high accuracy and can completely extract all aspect categories in consumer evaluation is needed to overcome the above problems.
Disclosure of Invention
The embodiment of the application provides a semantic emotion analysis method and a semantic emotion analysis device, wherein a multi-classification semantic emotion analysis model based on a BERT framework is utilized, aspect categories and statements to be recognized are input into the model together for recognition, the emotion polarity of each aspect category in consumer evaluation can be recognized quickly and effectively, and accordingly fine-grained emotion information in the consumer evaluation is obtained.
In a first aspect, a semantic emotion analysis method is provided, where the method includes:
obtaining a sentence to be identified;
assembling the aspect categories and the sentences to be identified to obtain test assembled sentences;
inputting a test assembly statement into a multi-classification semantic emotion analysis model based on a BERT framework to enable the semantic emotion analysis model to determine the emotion polarity of the statement to be recognized in the aspect category;
and receiving the semantic emotion analysis model to determine the aspect category and the emotion polarity of the sentence to be recognized.
Optionally, in the above method, the aspect category includes a plurality of sub-categories;
the assembling the aspect category and the sentence to be recognized to obtain an assembled sentence comprises:
respectively taking the plurality of subcategories as the Sennce 1;
taking the Sentence to be recognized as the Sennce 2;
and respectively splicing the plurality of sub-categories and the sentences to be recognized according to a format of [ CLS + Sennce 1+ SEP + Sennce 2+ SEP ] to obtain a plurality of spliced sentences, so that the semantic emotion analysis model determines the aspect categories and the emotion polarities of the sentences to be recognized according to the vectors of the CLS positions in the spliced sentences.
Optionally, in the above method, the semantic emotion analysis model is obtained by training through the following method:
assembling the aspect categories and all sentences in the training data set to obtain training assembled sentences; loading a BERT pre-training model;
selectively unfreezing part of the network layer of the BERT pre-training model, and training the unfrozen network layer based on the training assembly sentences;
acquiring an output layer of the BERT pre-training model, and extracting a vector of a CLS position;
determining the emotion polarity of the sentence to be recognized in each category and belonging to the sentence to be recognized on the basis of the vector and a multilayer perception network additionally arranged on the output layer to obtain a semantic emotion analysis model; wherein the emotion polarity is the GroudTruth of the semantic emotion analysis model.
Optionally, in the above method, the selectively thawing a part of a network layer of the BERT pre-training model includes:
and unfreezing the previous layer of the output layer of the BERT pre-training model.
Optionally, the method further includes:
verifying the prediction result of the semantic emotion analysis model by adopting a verification data set labeled manually, wherein when the emotion polarity comprises three items, the prediction accuracy reaches 98.7%; when the emotion polarities comprise two terms, the prediction accuracy rate reaches 99.4%.
Optionally, the method further includes:
and determining the aspect type and the belonging emotion polarity of the statement to be recognized according to the semantic emotion analysis model, and drawing a thermal analysis diagram.
In a second aspect, there is provided a semantic emotion analyzing apparatus, comprising:
the acquiring unit is used for acquiring the sentence to be identified;
the assembling unit is used for respectively assembling the aspect categories and the sentences to be identified to obtain test assembling sentences;
the input unit is used for inputting the test assembled statement into a multi-classification semantic emotion analysis model based on a BERT framework so that the semantic emotion analysis model determines the emotion polarity of the statement to be recognized in the aspect category;
and the receiving unit is used for receiving the semantic emotion analysis model to determine the aspect type and the emotion polarity of the sentence to be recognized.
Optionally, in the above apparatus, the aspect category includes a plurality of sub-categories;
the splicing unit is used for respectively taking the plurality of subcategories as Sennce 1;
taking the Sentence to be recognized as the Sennce 2;
and respectively splicing the plurality of sub-categories and the sentences to be recognized according to a format of [ CLS + Sennce 1+ SEP + Sennce 2+ SEP ] to obtain a plurality of spliced sentences, so that the semantic emotion analysis model determines the aspect categories and the emotion polarities of the sentences to be recognized according to the vectors of the CLS positions in the spliced sentences.
Optionally, in the apparatus, the semantic emotion analysis model is obtained by training through the following method:
assembling the aspect categories and all sentences in the training data set to obtain training assembled sentences; loading a BERT pre-training model;
selectively unfreezing part of the network layer of the BERT pre-training model, and training the unfrozen network layer based on the training assembly sentences;
acquiring an output layer of the BERT pre-training model, and extracting a vector of a CLS position;
determining the emotion polarity of the sentence to be recognized in each category and belonging to the sentence to be recognized on the basis of the vector and a multilayer perception network additionally arranged on the output layer to obtain a semantic emotion analysis model; wherein the emotion polarity is the GroudTruth of the semantic emotion analysis model.
Optionally, the apparatus further includes: the verification unit is used for verifying the prediction result of the semantic emotion analysis model based on a verification data set labeled manually, wherein when the emotion polarity comprises three items, the prediction accuracy reaches 98.7%; when the emotion polarities comprise two terms, the prediction accuracy rate reaches 99.4%.
Optionally, the apparatus further includes: and the drawing unit is used for determining the aspect type and the belonging emotion polarity of the statement to be recognized according to the semantic emotion analysis model and drawing a thermal analysis chart.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform any of the methods described above.
In a fourth aspect, this application embodiment also provides a computer-readable storage medium storing one or more programs which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform any of the methods described above.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
the method comprises the steps of obtaining a sentence to be identified; respectively assembling the aspect categories and the sentences to be identified to obtain test assembled sentences; inputting a test assembly statement into a multi-classification semantic emotion analysis model based on a BERT framework to enable the semantic emotion analysis model to determine the emotion polarity of the statement to be recognized in the aspect category; and receiving the semantic emotion analysis model to determine the aspect category and the emotion polarity of the sentence to be recognized. The method is based on a BERT framework, a multi-classification semantic emotion analysis model is constructed, during prediction, aspect categories and sentences to be recognized are spliced together and input into the multi-classification semantic emotion analysis model together, and emotion polarities of the sentences to be recognized in all the aspect categories are obtained. The method converts an End-to-End Aspect type emotion Analysis (ABSA) task into a natural language reasoning task, and realizes a fine-grained End-to-End semantic emotion Analysis method; the emotion mining on the aspect of comments in the creative marketing field is realized, and the obtained information on various aspects in the evaluation of the consumer provides reliable basic support for mining the objective intention of the consumer and applying to downstream creative production guidance and delivery guidance; compared with the convolutional neural network model in the prior art, the convolutional neural network model has the advantages that the robustness and the generalization capability reach a quite high (state of the art, SOTA) level.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 shows a schematic flow diagram of a semantic emotion analysis method according to an embodiment of the present application;
FIG. 2 shows a schematic structure diagram of an input layer of a BERT architecture in the prior art;
FIG. 3 illustrates a thermodynamic analysis graph of predicted results according to one embodiment of the present application;
FIG. 4 is a schematic structural diagram of a semantic emotion analysis device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
In the prior art, in the aspect of emotion analysis of consumer evaluation sentences, emotion polarity of the sentences in fine-grained aspect categories cannot be effectively analyzed. Fig. 1 is a schematic flow diagram of a semantic emotion analysis method according to an embodiment of the present application, and as shown in fig. 1, the present application at least includes steps S110 to S140:
step S110: obtaining a sentence to be identified;
the sentence to be recognized in the application can be an evaluation sentence of a target product obtained from a network by a consumer, and can also be a sentence in a test data set, and the application is not limited.
In some embodiments of the present application, the ABSA scenes are focused on a single marketing item class, and for 5000 certain item consumer evaluation texts, 400 text data are manually labeled based on business scenes, and the total number of the text data contains 35 vertical aspect classes. Each aspect category includes at least two positive, negative, in other embodiments three positive, negative, and neutral, and in still other embodiments three positive, negative, neutral, and null sentimental polarities.
Step S120: and (5) assembling the aspect categories and the sentences to be identified to obtain the test assembled sentences.
The method is different from the prior art in that when a model and test sentences are trained, the method not only aims at the sentences to be recognized, but also preprocesses the aspect categories and the sentences to be recognized, the preprocessing includes but is not limited to assembly, so that the test assembly sentences are obtained, and when the test is carried out, the test assembly sentences are tested.
The assembling process is designed based on a BERT architecture, FIG. 2 shows a structural schematic diagram of an input layer of the BERT architecture in the prior art, Sennce 1 and Sennce 2 are inputs of a BERT model, and for assembling a test statement, a plurality of subcategories of aspect categories are respectively used as Sennce 1; taking the Sentence to be recognized as the Sennce 2; and (3) respectively splicing the plurality of subcategories of the aspect categories and the sentences to be recognized according to the format of [ CLS + Sennce 1+ SEP + Sennce 2+ SEP ], so as to obtain a plurality of spliced sentences.
With three dimensions including result of use, commodity circulation express delivery and gift in aspect classification, the statement of waiting to discern is: for example, if the anti-dandruff effect is good and the bonus amount is too small, the sentence to be recognized can be assembled into the form shown in table 1:
TABLE 1
Label Sentence 1 Sentence 2
positive Effects of use Good effect of removing dandruff and small amount of gift
none Logistics express delivery Good effect of removing dandruff and small amount of gift
negative Gift Good effect of removing dandruff and small amount of gift
Wherein Label is a model GroundTruth, and Sennce 1 and Sennce 2 are assembled into the following form and input into the BERT framework for training: [ CLS + Sennce 1+ SEP + Sennce 2+ SEP ].
In the assembling process, the using effect is used as the Sennce 1, the anti-dandruff effect is good, the gift weight is too small and is used as the Sennce 2, and a test splicing statement is formed; similarly, logistics express is used as the Sennce 1, the anti-dandruff effect is good, the gift amount is too small and is used as the Sennce 2, and a test splicing statement is formed; then, the gift is used as the Sennce 1, the anti-dandruff effect is good, and the gift amount is too small to be used as the Sennce 2.
As can be seen from the model framework shown in FIG. 2, Sennce 1 and Sennce 2 will be cut by [ SEP ] positions, and the BERT model uses vectors of [ CLS ] positions to complete subsequent classification tasks.
Step S130: and inputting the test assembly sentences into a multi-classification semantic emotion analysis model based on a BERT framework to ensure that the semantic emotion analysis model determines the emotion polarity of the sentences to be recognized in the aspect categories.
And inputting the test assembly sentences obtained by assembly into a BERT architecture-based multi-classification semantic emotion analysis model.
The multi-classification semantic emotion analysis model can be a two-classification model, a three-classification model or a four-classification model, and can be a classification model with more polarities when needed.
In some embodiments of the present application, the multi-classification semantic emotion analysis model is obtained by training with a training data set based on a BERT architecture, where each piece of data in the training data set is a training assembled statement obtained in the same assembling manner as described above.
The semantic emotion analysis model can predict the test assembled sentences to obtain the emotion polarities of the sentences to be recognized in each dimension of the aspect categories.
Step S140: and receiving a semantic emotion analysis model to determine the aspect category and the emotion polarity of the sentence to be recognized.
Table 2 shows the predicted result of the sentence to be recognized determined by some semantic emotion analysis models in the application.
TABLE 2
Figure BDA0003248829990000071
As can be seen from table 2, the aspect categories include: lather, anti-dandruff, crowd-friendly, supple, fragrant, authentic, and the like, with negative and positive emotional polarity.
As can be seen from the method shown in FIG. 1, the multi-classification semantic emotion analysis model is constructed based on the BERT architecture, and during prediction, aspect categories and statements to be recognized are assembledTogether, the emotion polarities of the sentences to be recognized in all aspects are obtained by inputting the emotion polarities into the multi-classification semantic emotion analysis model together. The application analyzes the emotion of fine-grained Aspect category (End-to-End Aspect/Target-Based Sentiment Analysis)ABSA) task is converted into a natural language reasoning task, and a fine-grained end-to-end semantic emotion analysis method is realized; the emotion mining on the aspect of comments in the creative marketing field is realized, and the obtained information on various aspects in the evaluation of the consumer provides reliable basic support for mining the objective intention of the consumer and applying to downstream creative production guidance and delivery guidance; compared with the convolutional neural network model in the prior art, the convolutional neural network model has the advantages that the robustness and the generalization capability reach a quite high (state of the art, SOTA) level.
In some embodiments of the present application, the semantic emotion analysis model is obtained by training the following method: assembling the aspect categories and all sentences in the training data set to obtain training assembled sentences; loading a BERT pre-training model; selectively unfreezing part of the network layer of the BERT pre-training model, and training the unfrozen network layer based on the training assembly sentences; obtaining an output layer of a BERT pre-training model, and extracting a vector of a CLS position; determining the types and the belonging emotion polarities of the sentences to be recognized in all aspects based on the vector and a multilayer perception network additionally arranged on an output layer to obtain a semantic emotion analysis model; and the emotion polarity is the GroudTruth of the semantic emotion analysis model.
In the training process, during the same test, each sentence in the Data set needs to be processed first, and the aspect categories and each sentence in the training Data set are assembled to obtain training assembled sentences.
Then, a BERT pre-training model is loaded, the model can be obtained from a response platform of Google, has the characteristics of depth and narrowness, has 12 layers in total, and adopts an unsupervised method to train a transformer (without uniform Chinese name) model.
In the present application, not all network layers of the BERT pre-training model are trained, but part of the network layers of the BERT pre-training model are selectively thawed, specifically, the network layers may be previous to the output layer.
Then, obtaining an output layer of the BERT pre-training model, namely the top layer of the BERT pre-training model, and extracting a vector of a CLS position; based on the vector and a multilayer perception network additionally arranged on an output layer, determining the types and the belonging emotion polarities of the sentences to be recognized in all aspects to obtain a semantic emotion analysis model, and specifically, outputting a classification result by taking Softmax as an activation function.
It should be noted here that, compared with the prior art, the present application further adds a multilayer perceptron, that is, a multilayer perception network, in the output layer, where the layer is a fully connected layer, and facilitates classification prediction at a fine-grained level.
In some embodiments of the present application, 400 verification data sets labeled manually are further used to verify the prediction result of the semantic emotion analysis model, and the result is shown in table 3.
TABLE 3
Text data volume (bar) P/R/F 3-way/2-way
400 pieces of manual labeling data 0.979/0.942/0.96 0.987/0.994
Wherein, P/R/F respectively represents accuracy, recall and F1score evaluation index, and n-way is the accuracy on n emotional polarities. As can be seen from Table 3, when the emotion polarities include three items, the prediction accuracy reaches 98.7%; when the emotional polarity comprises two items, the prediction accuracy rate reaches 99.4%; and the accuracy and the recall rate of the semantic emotion analysis model reach high scores, so the semantic emotion analysis model has good generalization capability and robustness.
In addition, the present application further supports drawing of a thermodynamic analysis graph according to the prediction result, as shown in fig. 3, fig. 3 shows a thermodynamic analysis graph of the prediction result according to an embodiment of the present application, and as can be seen from fig. 3, fig. 3 is a thermodynamic graph drawn from the perspective of "attention degree" and "comment rate", where the vertical axis is 35 fine-grained aspects of the category, and the horizontal axis is the attention degree of users at different angles. From this it can be analyzed: what is the aspect characteristic that the favorable rating reaches 90%; what is the facet characteristic of the most popular product (top 10) that consumers are more concerned with; what is the efficacy that is not recognized by the consumer; how well the consumer agrees on the brand selling points, etc., deeper mining of the consumer's intentions can be made based on the thermal analysis graph.
FIG. 4 shows a semantic emotion analysis apparatus 400 according to an embodiment of the present application, including:
an obtaining unit 410 for obtaining the sentence to be recognized
The assembling unit 420 is configured to assemble the aspect categories and the sentences to be identified to obtain test assembling sentences;
an input unit 430, configured to input the test assembled statement as an input into a multi-classification semantic emotion analysis model based on a BERT architecture, so that the semantic emotion analysis model determines an emotion polarity to which an aspect category and an emotion polarity of the statement to be recognized belong;
the receiving unit 440 is configured to receive the semantic emotion analysis model to determine an emotion polarity to which the to-be-identified sentence belongs in the aspect category.
In some embodiments of the present application, in the above apparatus, the aspect category includes a plurality of sub-categories;
the assembling unit 420 is configured to use the plurality of subcategories as sequence 1; taking the Sentence to be recognized as the Sennce 2; and respectively splicing the plurality of sub-categories and the sentences to be recognized according to a format of [ CLS + Sennce 1+ SEP + Sennce 2+ SEP ] to obtain a plurality of spliced sentences, so that the semantic emotion analysis model determines the aspect categories and the emotion polarities of the sentences to be recognized according to the vectors of the CLS positions in the spliced sentences.
In some embodiments of the present application, in the above apparatus, the semantic emotion analysis model is obtained by training: assembling the aspect categories and all sentences in the training data set to obtain training assembled sentences; loading a BERT pre-training model; selectively unfreezing part of the network layer of the BERT pre-training model, and training the unfrozen network layer based on the training assembly sentences; acquiring an output layer of the BERT pre-training model, and extracting a vector of a CLS position; determining the emotion polarity of the sentence to be recognized in each category and belonging to the sentence to be recognized on the basis of the vector and a multilayer perception network additionally arranged on the output layer to obtain a semantic emotion analysis model; wherein the emotion polarity is the GroudTruth of the semantic emotion analysis model.
In some embodiments of the present application, the apparatus further comprises: the verification unit is used for verifying the prediction result of the semantic emotion analysis model based on a verification data set labeled manually, wherein when the emotion polarity comprises three items, the prediction accuracy reaches 98.7%; when the emotion polarities comprise two terms, the prediction accuracy rate reaches 99.4%.
In some embodiments of the present application, the apparatus further comprises: and the drawing unit is used for determining the aspect type and the belonging emotion polarity of the statement to be recognized according to the semantic emotion analysis model and drawing a thermal analysis chart.
It can be understood that, the above semantic emotion analyzing apparatus can implement the steps of the semantic emotion analyzing method provided in the foregoing embodiment, and the related explanations about the semantic emotion analyzing method are all applicable to the semantic emotion analyzing apparatus, and are not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 5, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the semantic emotion analysis device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
obtaining a sentence to be identified;
assembling the aspect categories and the sentences to be identified to obtain test assembled sentences;
inputting a test assembly statement into a multi-classification semantic emotion analysis model based on a BERT framework to enable the semantic emotion analysis model to determine the emotion polarity of the statement to be recognized in the aspect category;
and receiving the semantic emotion analysis model to determine the aspect category and the emotion polarity of the sentence to be recognized.
The method executed by the semantic emotion analyzing apparatus according to the embodiment shown in fig. 4 of the present application can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method executed by the semantic emotion analyzing apparatus in fig. 4, and implement the functions of the semantic emotion analyzing apparatus in the embodiment shown in fig. 4, which are not described herein again in this embodiment of the present application.
An embodiment of the present application further provides a computer-readable storage medium storing one or more programs, where the one or more programs include instructions, which, when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the method performed by the semantic emotion analysis apparatus in the embodiment shown in fig. 4, and are specifically configured to perform:
obtaining a sentence to be identified;
assembling the aspect categories and the sentences to be identified to obtain test assembled sentences;
inputting a test assembly statement into a multi-classification semantic emotion analysis model based on a BERT framework to enable the semantic emotion analysis model to determine the emotion polarity of the statement to be recognized in the aspect category;
and receiving the semantic emotion analysis model to determine the aspect category and the emotion polarity of the sentence to be recognized.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A semantic emotion analysis method, the method comprising:
obtaining a sentence to be identified;
assembling the aspect categories and the sentences to be identified to obtain test assembled sentences;
inputting a test assembly statement into a multi-classification semantic emotion analysis model based on a BERT framework to enable the semantic emotion analysis model to determine the emotion polarity of the statement to be recognized in the aspect category;
and receiving the semantic emotion analysis model to determine the aspect category and the emotion polarity of the sentence to be recognized.
2. The method of claim 1, wherein the aspect category comprises a plurality of sub-categories;
the assembling the aspect category and the sentence to be recognized to obtain an assembled sentence comprises:
respectively taking the plurality of subcategories as the Sennce 1;
taking the Sentence to be recognized as the Sennce 2;
and respectively splicing the plurality of sub-categories and the sentences to be recognized according to a format of [ CLS + Sennce 1+ SEP + Sennce 2+ SEP ] to obtain a plurality of spliced sentences, so that the semantic emotion analysis model determines the aspect categories and the emotion polarities of the sentences to be recognized according to the vectors of the CLS positions in the spliced sentences.
3. The method of claim 1, wherein the semantic emotion analysis model is trained by:
assembling the aspect categories and all sentences in the training data set to obtain training assembled sentences;
loading a BERT pre-training model;
selectively unfreezing part of the network layer of the BERT pre-training model, and training the unfrozen network layer based on the training assembly sentences;
acquiring an output layer of the BERT pre-training model, and extracting a vector of a CLS position;
determining the emotion polarity of the sentence to be recognized in each category and belonging to the sentence to be recognized on the basis of the vector and a multilayer perception network additionally arranged on the output layer to obtain a semantic emotion analysis model; wherein the emotion polarity is the GroudTruth of the semantic emotion analysis model.
4. The method of claim 3, wherein the selectively unfreezing the partial network layer of the BERT pre-training model comprises:
and unfreezing the previous layer of the output layer of the BERT pre-training model.
5. The method of claim 3, further comprising:
verifying the prediction result of the semantic emotion analysis model by adopting a verification data set labeled manually, wherein when the emotion polarity comprises three items, the prediction accuracy reaches 98.7%; when the emotion polarities comprise two terms, the prediction accuracy rate reaches 99.4%.
6. The method of claim 1, further comprising:
and determining the aspect type and the belonging emotion polarity of the statement to be recognized according to the semantic emotion analysis model, and drawing a thermal analysis diagram.
7. A semantic emotion analysis apparatus, characterized in that the apparatus comprises:
the acquiring unit is used for acquiring the sentence to be identified;
the assembling unit is used for assembling the aspect categories and the sentences to be identified to obtain test assembling sentences;
the input unit is used for inputting the test assembled statement into a multi-classification semantic emotion analysis model based on a BERT framework so that the semantic emotion analysis model determines the emotion polarity of the statement to be recognized in the aspect category;
and the receiving unit is used for receiving the semantic emotion analysis model to determine the aspect type and the emotion polarity of the sentence to be recognized.
8. The apparatus of claim 1, wherein the aspect category comprises a plurality of subcategories;
the splicing unit is used for respectively taking the plurality of subcategories as Sennce 1;
taking the Sentence to be recognized as the Sennce 2;
and respectively splicing the plurality of sub-categories and the sentences to be recognized according to a format of [ CLS + Sennce 1+ SEP + Sennce 2+ SEP ] to obtain a plurality of spliced sentences, so that the semantic emotion analysis model determines the aspect categories and the emotion polarities of the sentences to be recognized according to the vectors of the CLS positions in the spliced sentences.
9. The apparatus of claim 1, wherein the semantic emotion analysis model is trained by the following method comprising:
assembling the aspect categories and all sentences in the training data set to obtain training assembled sentences;
loading a BERT pre-training model;
selectively unfreezing part of the network layer of the BERT pre-training model, and training the unfrozen network layer based on the training assembly sentences;
acquiring an output layer of the BERT pre-training model, and extracting a vector of a CLS position;
determining the emotion polarity of the sentence to be recognized in each category and belonging to the sentence to be recognized on the basis of the vector and a multilayer perception network additionally arranged on the output layer to obtain a semantic emotion analysis model; wherein the emotion polarity is the GroudTruth of the semantic emotion analysis model.
10. The apparatus of claim 8, further comprising: the verification unit is used for verifying the prediction result of the semantic emotion analysis model based on a verification data set labeled manually, wherein when the emotion polarity comprises three items, the prediction accuracy reaches 98.7%; when the emotion polarities comprise two terms, the prediction accuracy rate reaches 99.4%.
CN202111039784.5A 2021-09-06 2021-09-06 Semantic emotion analysis method and device Pending CN113901171A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111039784.5A CN113901171A (en) 2021-09-06 2021-09-06 Semantic emotion analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111039784.5A CN113901171A (en) 2021-09-06 2021-09-06 Semantic emotion analysis method and device

Publications (1)

Publication Number Publication Date
CN113901171A true CN113901171A (en) 2022-01-07

Family

ID=79188536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111039784.5A Pending CN113901171A (en) 2021-09-06 2021-09-06 Semantic emotion analysis method and device

Country Status (1)

Country Link
CN (1) CN113901171A (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170351971A1 (en) * 2016-06-07 2017-12-07 International Business Machines Corporation Method and apparatus for informative training repository building in sentiment analysis model learning and customaization
CN111159416A (en) * 2020-04-02 2020-05-15 腾讯科技(深圳)有限公司 Language task model training method and device, electronic equipment and storage medium
CN111339260A (en) * 2020-03-02 2020-06-26 北京理工大学 BERT and QA thought-based fine-grained emotion analysis method
CN111339255A (en) * 2020-02-26 2020-06-26 腾讯科技(深圳)有限公司 Target emotion analysis method, model training method, medium, and device
CN111444709A (en) * 2020-03-09 2020-07-24 腾讯科技(深圳)有限公司 Text classification method, device, storage medium and equipment
CN111666761A (en) * 2020-05-13 2020-09-15 北京大学 Fine-grained emotion analysis model training method and device
CN111738015A (en) * 2020-06-22 2020-10-02 北京百度网讯科技有限公司 Method and device for analyzing emotion polarity of article, electronic equipment and storage medium
CN111813894A (en) * 2020-06-30 2020-10-23 郑州信大先进技术研究院 Natural language emotion recognition method based on deep learning
CN112069320A (en) * 2020-09-10 2020-12-11 东北大学秦皇岛分校 Span-based fine-grained emotion analysis method
US20210089936A1 (en) * 2019-09-24 2021-03-25 International Business Machines Corporation Opinion snippet detection for aspect-based sentiment analysis
CN112632972A (en) * 2020-12-25 2021-04-09 浙江国际海运职业技术学院 Method for rapidly extracting fault information in power grid equipment fault report
CN112667803A (en) * 2019-09-30 2021-04-16 北京国双科技有限公司 Text emotion classification method and device
CN112818691A (en) * 2021-02-01 2021-05-18 北京金山数字娱乐科技有限公司 Named entity recognition model training method and device
CN112883188A (en) * 2019-11-29 2021-06-01 京东方科技集团股份有限公司 Emotion classification method and device, electronic equipment and storage medium
CN113268599A (en) * 2021-05-31 2021-08-17 平安国际智慧城市科技股份有限公司 Training method and device of file classification model, computer equipment and storage medium
KR20210106884A (en) * 2021-01-14 2021-08-31 아주대학교산학협력단 Apparatus and method for emotion classification based on artificial intelligence for online data

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170351971A1 (en) * 2016-06-07 2017-12-07 International Business Machines Corporation Method and apparatus for informative training repository building in sentiment analysis model learning and customaization
US20210089936A1 (en) * 2019-09-24 2021-03-25 International Business Machines Corporation Opinion snippet detection for aspect-based sentiment analysis
CN112667803A (en) * 2019-09-30 2021-04-16 北京国双科技有限公司 Text emotion classification method and device
CN112883188A (en) * 2019-11-29 2021-06-01 京东方科技集团股份有限公司 Emotion classification method and device, electronic equipment and storage medium
CN111339255A (en) * 2020-02-26 2020-06-26 腾讯科技(深圳)有限公司 Target emotion analysis method, model training method, medium, and device
CN111339260A (en) * 2020-03-02 2020-06-26 北京理工大学 BERT and QA thought-based fine-grained emotion analysis method
CN111444709A (en) * 2020-03-09 2020-07-24 腾讯科技(深圳)有限公司 Text classification method, device, storage medium and equipment
CN111159416A (en) * 2020-04-02 2020-05-15 腾讯科技(深圳)有限公司 Language task model training method and device, electronic equipment and storage medium
CN111666761A (en) * 2020-05-13 2020-09-15 北京大学 Fine-grained emotion analysis model training method and device
CN111738015A (en) * 2020-06-22 2020-10-02 北京百度网讯科技有限公司 Method and device for analyzing emotion polarity of article, electronic equipment and storage medium
CN111813894A (en) * 2020-06-30 2020-10-23 郑州信大先进技术研究院 Natural language emotion recognition method based on deep learning
CN112069320A (en) * 2020-09-10 2020-12-11 东北大学秦皇岛分校 Span-based fine-grained emotion analysis method
CN112632972A (en) * 2020-12-25 2021-04-09 浙江国际海运职业技术学院 Method for rapidly extracting fault information in power grid equipment fault report
KR20210106884A (en) * 2021-01-14 2021-08-31 아주대학교산학협력단 Apparatus and method for emotion classification based on artificial intelligence for online data
CN112818691A (en) * 2021-02-01 2021-05-18 北京金山数字娱乐科技有限公司 Named entity recognition model training method and device
CN113268599A (en) * 2021-05-31 2021-08-17 平安国际智慧城市科技股份有限公司 Training method and device of file classification model, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
WO2020082569A1 (en) Text classification method, apparatus, computer device and storage medium
Chen et al. Incorporating structured commonsense knowledge in story completion
CN111340509A (en) False transaction identification method and device and electronic equipment
Goel et al. Sarcasm detection using deep learning and ensemble learning
US20200160196A1 (en) Methods and systems for detecting check worthy claims for fact checking
Winata et al. CAiRE_HKUST at semeval-2019 task 3: Hierarchical attention for dialogue emotion classification
Violos et al. Sentiment analysis using word-graphs
CN113254637A (en) Grammar-fused aspect-level text emotion classification method and system
CN115470354A (en) Method and system for identifying nested and overlapped risk points based on multi-label classification
CN115374259A (en) Question and answer data mining method and device and electronic equipment
Rahutomo et al. Finetunning indobert to understand indonesian stock trader slang language
CN114218392A (en) Futures question-answer oriented user intention identification method and system
Singal et al. Twitter sentiment analysis based on neural network techniques
CN113901171A (en) Semantic emotion analysis method and device
Ratmele et al. OpExHAN: opinion extraction using hierarchical attention network from unstructured reviews
CN111858919A (en) Text classification method and device and computer readable storage medium
Sisodia et al. Performance evaluation of learners for analyzing the hotel customer sentiments based on text reviews
CN112115258B (en) Credit evaluation method and device for user, server and storage medium
Prabhakar et al. Claim extraction from text using transfer learning.
Ochiai et al. Local app classification using deep neural network based on mobile app market data
Raj et al. Fake News Detection
CN112256841A (en) Text matching and confrontation text recognition method, device and equipment
CN109558582B (en) Visual angle-based sentence emotion analysis method and device
CN110969011B (en) Text emotion analysis method and device, storage medium and processor
Neha et al. An Evaluation for various text summarization algorithms on blog summarization dataset

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