CN111666761A - Fine-grained emotion analysis model training method and device - Google Patents

Fine-grained emotion analysis model training method and device Download PDF

Info

Publication number
CN111666761A
CN111666761A CN202010404188.1A CN202010404188A CN111666761A CN 111666761 A CN111666761 A CN 111666761A CN 202010404188 A CN202010404188 A CN 202010404188A CN 111666761 A CN111666761 A CN 111666761A
Authority
CN
China
Prior art keywords
word
vector
sentence
statement
text information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010404188.1A
Other languages
Chinese (zh)
Other versions
CN111666761B (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.)
Peking University
Original Assignee
Peking University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University filed Critical Peking University
Priority to CN202010404188.1A priority Critical patent/CN111666761B/en
Publication of CN111666761A publication Critical patent/CN111666761A/en
Application granted granted Critical
Publication of CN111666761B publication Critical patent/CN111666761B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a fine-grained emotion analysis model training method and a fine-grained emotion analysis model training device, wherein the method comprises the following steps: acquiring text information with emotion marks and aspect words; performing word segmentation processing on each sentence in the text information to obtain a context word vector of each word in each sentence, and obtaining a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the aspect word; obtaining a context statement vector of each statement according to the statement vector corresponding to each statement, obtaining statement weight of each statement based on an aspect word, and obtaining a text vector of text information according to the context statement vector and the statement weight; and inputting the text vector, the emotion mark and the aspect word into a recurrent neural network, and training to obtain a neural network model. By adopting the method, the emotion types of various aspects of fine granularity of the text data can be identified, and the accuracy of emotion identification is further improved.

Description

Fine-grained emotion analysis model training method and device
Technical Field
The invention relates to the field of data processing, in particular to a fine-grained emotion analysis model training method and device.
Background
At present, in various scenes, data input by a user all include the current emotional tendency of the user, for example, when a restaurant has a meal, the left comments can express various emotional tendencies of the user to the current meal, and under big data, emotional analysis is performed on the comments of the user to further understand the user needs.
The traditional emotion classification method mainly comprises two types of rules and machine learning. The rule-based method mainly adopts emotion dictionaries, feature statistics, emotion templates and the like obtained according to manual experience or expert opinions to carry out emotion classification on the texts. The method based on machine learning is characterized in that a training set is constructed by manually marking a part of data, a classification model is trained by carrying out feature extraction and learning on the data of the training set, and finally, a test sample of an unknown label is input into the classification model for performance judgment.
However, the above methods have high dependence on human labor, and the left comments may include evaluations of various aspects such as taste, service, environment and the like when a restaurant has a meal, but the results are only good or poor when the sentiment analysis is performed.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a fine-grained emotion analysis model training method and device.
The embodiment of the invention provides a fine-grained emotion analysis model training method, which comprises the following steps:
acquiring text information with emotion marks and aspect words, and dividing the text information into a plurality of sentences;
performing word segmentation processing on each sentence in the text information to obtain a context word vector of each word in each sentence, obtain a word vector of an aspect word, and obtain a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the aspect word;
obtaining a context statement vector of each statement according to the statement vector corresponding to each statement, obtaining statement weight of each statement based on the aspect word, and obtaining a text vector of the text information according to the context statement vector and the statement weight;
and inputting the text vector, the emotion mark and the aspect word into a cyclic neural network, and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text.
In one embodiment, the method further comprises:
splicing the context word vectors and the word vectors of the aspect words to obtain the aspect vector corresponding to each word;
passing the aspect vector through a linear layer to obtain a value corresponding to each word;
multiplying the value corresponding to each word with the context word vector to obtain a word vector corresponding to each word;
and determining the sentence vector of the corresponding sentence according to the word vector corresponding to each word in each sentence.
In one embodiment, the method further comprises:
and obtaining a word vector corresponding to each word, and obtaining a context word vector corresponding to each word through bidirectional long-short term memory network coding according to the word vector corresponding to each word.
In one embodiment, the method further comprises:
acquiring text information with preset data volume to obtain a corresponding text information set;
generating a word vector of each word in the text information set in a machine learning mode to obtain a word vector set;
the obtaining of the word vector corresponding to each word includes:
and searching a word vector corresponding to each word from the word vector set.
In one embodiment, the method further comprises:
acquiring test text information with test emotion marks and test terms, and inputting the test text information and the test terms into the neural network model to obtain an output emotion mark result;
and comparing the emotion mark result with the test emotion mark to obtain a training result of the neural network model, and outputting the training result.
The embodiment of the invention provides a fine-grained emotion analysis model training device, which comprises:
the first acquisition module is used for acquiring text information with emotion marks and aspect words and dividing the text information into a plurality of sentences;
the word segmentation module is used for performing word segmentation processing on each sentence in the text information, acquiring a context word vector of each word in each sentence, acquiring a word vector of a facet word, and acquiring a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the facet word;
a second obtaining module, configured to obtain a context statement vector of each statement according to the statement vector corresponding to each statement, obtain a statement weight of each statement based on the aspect word, and obtain a text vector of the text information according to the context statement vector and the statement weight;
and the training module is used for inputting the text vector, the emotion mark and the aspect word into a cyclic neural network and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text.
In one embodiment, the apparatus further comprises:
the splicing module is used for splicing the context word vectors and the word vectors of the aspect words to obtain the aspect vector corresponding to each word;
the linear layer module is used for enabling the aspect vectors to pass through a linear layer to obtain a value corresponding to each word;
the multiplication module is used for multiplying the value corresponding to each word with the context word vector to obtain a word vector corresponding to each word;
and the determining module is used for determining the sentence vector of the corresponding sentence according to the word vector corresponding to each word in each sentence.
In one embodiment, the apparatus further comprises:
and the third acquisition module is used for acquiring the word vector corresponding to each word and acquiring the context word vector corresponding to each word through bidirectional long-short term memory network coding according to the word vector corresponding to each word.
The embodiment of the invention provides electronic equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the steps of the fine-grained emotion analysis model training method when executing the program.
An embodiment of the present invention provides a non-transitory computer readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the fine-grained emotion analysis model training method.
According to the fine-grained emotion analysis model training method and device provided by the embodiment of the invention, the text information with emotion marks and aspect words is obtained, and the text information is divided into a plurality of sentences; performing word segmentation processing on each sentence in the text information to obtain a context word vector of each word in each sentence, and obtaining a word vector of a facet word, so as to obtain a sentence vector corresponding to each sentence in the text information; obtaining a text vector of the text information according to the context statement vector and the statement weight; and inputting the text vector, the emotion mark and the aspect word into a cyclic neural network, and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text. After the neural network model is obtained through training, the emotion types of various aspects of fine granularity of the text data can be recognized, and the emotion recognition accuracy is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flowchart of a fine-grained emotion analysis model training method in an embodiment of the present invention;
FIG. 2 is a structural diagram of a fine-grained emotion analysis model training apparatus in an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
Fig. 1 is a flowchart of a fine-grained emotion analysis model training method in an embodiment of the present invention, and as shown in fig. 1, an embodiment of the present invention provides a fine-grained emotion analysis model training method, including:
step S101, acquiring text information with emotion marks and aspect words, and dividing the text information into a plurality of sentences.
Specifically, the text information with emotion marks and aspect words is acquired, the text information may be collected text information such as various comment information and articles, the emotion marks may be emotion tendencies corresponding to the text information, and the emotion marks may be set by themselves, for example, as three types: if there are three types, i.e., good, bad, and not mentioned, then there may be 1, -1, and 0 for marking, or more types may be set, and the aspect word is the type for which the text information is specific and is associated with the emotion mark correspondingly, for example, the text information is a comment of a restaurant: today's dish tastes good, but the restaurant environment is good, the corresponding terms are taste and environment, the emotion mark corresponding to taste may be bad, the emotion mark corresponding to environment may be good, and in addition, the emotion mark corresponding to traffic (terms) is not mentioned. The text information is divided into a plurality of sentences according to a preset rule, and the sentence division can be carried out according to the sentence numbers or the word number of the sentences.
Step S102, performing word segmentation processing on each sentence in the text information, obtaining a context word vector of each word in each sentence, obtaining a word vector of a facet word, and obtaining a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the facet word.
Specifically, each sentence in the text information is segmented, and each sentence is segmented into a plurality of words, such as sentences: today's dish taste is not good, but the restaurant environment is good, and the context word vector of each word in each sentence is obtained by dividing the words such as "today", "dish", "taste", "not good", "restaurant", "environment", "good", and the like, wherein the context word vector is a vector of a context corresponding to each word and is obtained by combining the word vector of each word with the context, for example, the word vector of "not going" is fixed, but after combining the context, the "today's dish taste is not good, but the restaurant environment is good" the not going in the sentence is not good with the "restaurant's traffic is not good, and the not going in the sentence is very blocked". In addition, word vectors corresponding to the aspect words are obtained, and the sentence vectors corresponding to each sentence in the text information can be obtained by combining the context word vectors of each word and the word vectors of the aspect words according to a predefined rule.
In addition, after the word vector corresponding to each word is obtained, the context word vector corresponding to each word can be output through bidirectional long-short term memory network (LSTM) encoding according to the word vector corresponding to each word in combination with the context.
Step S103, obtaining a context statement vector of each statement according to the statement vector corresponding to each statement, obtaining statement weight of each statement based on the aspect word, and obtaining a text vector of the text information according to the context statement vector and the statement weight.
Specifically, the context sentence vector of each sentence is obtained by obtaining the sentence vector corresponding to each sentence through bidirectional long and short term memory network coding, and the sentence weight of each sentence based on the aspect word, that is, the weight occupied by each sentence for the aspect word, for example, in the sentence "today's dish is not good but restaurant's environment is good", when the aspect word is taste, the weight of the previous sentence is large, when the aspect word is environment, the weight of the next sentence is large, when the aspect word is traffic, the weights of the two sentences are small, the specific weight determination can be preset or obtained according to machine learning, then the text vector of the text information is obtained according to the context sentence vector and the sentence weight, specifically, the vector of each sentence can be obtained by multiplying the context sentence vector and the sentence weight, and then the vector of each sentence is averaged, a text vector of the text information can be obtained.
And S104, inputting the text vector, the emotion mark and the aspect word into a cyclic neural network, and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text.
Specifically, after a text vector is determined, the text vector, emotion marks and aspect words are input into a cyclic neural network, a neural network model can be obtained through training, and the neural network model is used for identifying emotion types aiming at the aspect words in the text.
The fine-grained emotion analysis model training method provided by the embodiment of the invention comprises the steps of acquiring text information with emotion marks and aspect words, and dividing the text information into a plurality of sentences; performing word segmentation processing on each sentence in the text information to obtain a context word vector of each word in each sentence, and obtaining a word vector of a facet word, so as to obtain a sentence vector corresponding to each sentence in the text information; obtaining a text vector of the text information according to the context statement vector and the statement weight; and inputting the text vector, the emotion mark and the aspect word into a cyclic neural network, and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text. After the neural network model is obtained through training, the emotion types of various aspects of fine granularity of the text data can be recognized, and the emotion recognition accuracy is further improved.
On the basis of the above embodiment, the fine-grained emotion analysis model training method further includes:
splicing the context word vectors and the word vectors of the aspect words to obtain the aspect vector corresponding to each word;
passing the aspect vector through a linear layer to obtain a value corresponding to each word;
multiplying the value corresponding to each word with the context word vector to obtain a word vector corresponding to each word;
and determining the sentence vector of the corresponding sentence according to the word vector corresponding to each word in each sentence.
In the embodiment of the present invention, context word vectors corresponding to words and term vectors of aspect words are spliced, where splicing refers to combining two vectors, for example, the context word vectors and term vectors of aspect words are three-dimensional vectors, the aspect vectors obtained by splicing are six-dimensional vectors, the aspect vectors are passed through a linear layer to obtain a value corresponding to each word, vector operation can be performed on the aspect vectors and the vectors of corresponding dimensions through the linear layer to obtain a value (a numerical value rather than a vector) corresponding to each word, where the vectors of corresponding dimensions can be obtained by machine learning, then a word vector corresponding to each word is obtained by multiplying the value corresponding to each word with the context word vectors, and further a sentence vector of a corresponding sentence is determined according to the word vector corresponding to each word in each sentence, and a specific determination method can be combined with a word weight of each word in the sentence corresponding to an aspect word, and calculating to obtain statement vectors of corresponding statements.
According to the method provided by the embodiment of the invention, the word vectors are combined for splicing and linear layer calculation, so that more accurate statement vectors can be obtained.
On the basis of the above embodiment, the fine-grained emotion analysis model training method further includes:
acquiring text information with preset data volume to obtain a corresponding text information set;
generating a word vector of each word in the text information set in a machine learning mode to obtain a word vector set;
the obtaining of the word vector corresponding to each word includes:
and searching a word vector corresponding to each word from the word vector set.
In the embodiment of the invention, a large amount of text information is collected to be used as a training text set, a word vector of each word in the text information set is generated by using a machine learning mode to obtain a word vector set, and when the word vector of each word in the text information is obtained, the word vector corresponding to each word can be directly obtained from the word vector set.
The embodiment of the invention trains through the pre-collected text set so as to directly obtain the word vector corresponding to each word during subsequent processing, thereby improving the processing speed.
On the basis of the above embodiment, the fine-grained emotion analysis model training method further includes:
acquiring test text information with test emotion marks and test terms, and inputting the test text information and the test terms into the neural network model to obtain an output emotion mark result;
and comparing the emotion mark result with the test emotion mark to obtain a training result of the neural network model, and outputting the training result.
In the embodiment of the invention, after the neural network model is trained, test text information (with test emotion marks and test words) and the test words are used as input and input into the neural network model, the corresponding emotion mark results can be output through the processing of the neural network model, the output emotion mark results are compared with the test emotion marks, and the compared results can reflect the training scores of the neural network model and output the training scores, so that a user can know the training accuracy of the neural network model conveniently, and the user can perform subsequent confirmation, adjustment, elimination and other processing conveniently.
According to the embodiment of the invention, the training result of the neural network model is obtained through the test sample, and the training result is output, so that the user can conveniently perform subsequent processes such as confirmation, adjustment, elimination and the like.
Fig. 2 is a structural diagram of a fine-grained emotion analysis model training apparatus in an embodiment of the present invention, and as shown in fig. 2, an embodiment of the present invention provides a fine-grained emotion analysis model training apparatus, including: a first obtaining module 201, a word segmentation module 202, a second obtaining module 203, and a training module 204, wherein:
the first obtaining module 201 is configured to obtain text information with emotion marks and aspect words, and divide the text information into a plurality of sentences.
The word segmentation module 202 is configured to perform word segmentation on each sentence in the text information, obtain a context word vector of each word in each sentence, obtain a word vector of a facet word, and obtain a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the facet word.
The second obtaining module 203 is configured to obtain a context statement vector of each statement according to the statement vector corresponding to each statement, obtain a statement weight of each statement based on an aspect word, and obtain a text vector of the text information according to the context statement vector and the statement weight.
And the training module 204 is configured to input the text vector, the emotion mark and the aspect word into a recurrent neural network, and train to obtain a neural network model, where the neural network model is used to identify an emotion type for the aspect word in the text.
In one embodiment, the apparatus may further comprise:
and the splicing module is used for splicing the context word vectors and the word vectors of the aspect words to obtain the aspect vector corresponding to each word.
And the linear layer module is used for enabling the aspect vectors to pass through a linear layer to obtain a value corresponding to each word.
And the multiplication module is used for multiplying the value corresponding to each word with the context word vector to obtain the word vector corresponding to each word.
And the determining module is used for determining the sentence vector of the corresponding sentence according to the word vector corresponding to each word in each sentence.
In one embodiment, the apparatus may further comprise:
and the third acquisition module is used for acquiring the word vector corresponding to each word and acquiring the context word vector corresponding to each word through bidirectional long-short term memory network coding according to the word vector corresponding to each word.
In one embodiment, the apparatus may further comprise:
and the acquisition module is used for acquiring the text information with the preset data volume to obtain a corresponding text information set.
And the machine learning module is used for generating a word vector of each word in the text information set in a machine learning mode to obtain a word vector set.
And the searching module is used for searching the word vector corresponding to each word from the word vector set.
In one embodiment, the apparatus may further comprise:
and the fourth acquisition module is used for acquiring test text information with the test emotion marks and the test words, and inputting the test text information and the test words into the neural network model to obtain an output emotion mark result.
And the comparison module is used for comparing the emotion mark result with the test emotion mark to obtain the training result of the neural network model and outputting the training result.
For specific limitation of the fine-grained emotion analysis model training device, reference may be made to the above limitation on the fine-grained emotion analysis model training method, which is not described herein again. All or part of each module in the fine-grained emotion analysis model training device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the present invention, and as shown in fig. 3, the electronic device may include: a processor (processor)301, a memory (memory)302, a communication Interface (Communications Interface)303 and a communication bus 304, wherein the processor 301, the memory 302 and the communication Interface 303 complete communication with each other through the communication bus 304. The processor 301 may call logic instructions in the memory 302 to perform the following method: acquiring text information with emotion marks and aspect words, and dividing the text information into a plurality of sentences; performing word segmentation processing on each sentence in the text information to obtain a context word vector of each word in each sentence, obtain a word vector of a facet word, and obtain a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the facet word; obtaining a context statement vector of each statement according to the statement vector corresponding to each statement, obtaining statement weight of each statement based on an aspect word, and obtaining a text vector of text information according to the context statement vector and the statement weight; inputting the text vector, the emotion mark and the aspect word into a recurrent neural network, and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text.
Furthermore, the logic instructions in the memory 302 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented by a processor to perform the fine-grained emotion analysis model training method provided in the foregoing embodiments, for example, including: acquiring text information with emotion marks and aspect words, and dividing the text information into a plurality of sentences; performing word segmentation processing on each sentence in the text information to obtain a context word vector of each word in each sentence, obtain a word vector of a facet word, and obtain a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the facet word; obtaining a context statement vector of each statement according to the statement vector corresponding to each statement, obtaining statement weight of each statement based on an aspect word, and obtaining a text vector of text information according to the context statement vector and the statement weight; inputting the text vector, the emotion mark and the aspect word into a recurrent neural network, and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for training a fine-grained emotion analysis model, which is characterized by comprising the following steps:
acquiring text information with emotion marks and aspect words, and dividing the text information into a plurality of sentences;
performing word segmentation processing on each sentence in the text information to obtain a context word vector of each word in each sentence, obtain a word vector of an aspect word, and obtain a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the aspect word;
obtaining a context statement vector of each statement according to the statement vector corresponding to each statement, obtaining statement weight of each statement based on the aspect word, and obtaining a text vector of the text information according to the context statement vector and the statement weight;
and inputting the text vector, the emotion mark and the aspect word into a cyclic neural network, and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text.
2. The fine-grained emotion analysis model training method of claim 1, wherein obtaining a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the aspect word comprises:
splicing the context word vectors and the word vectors of the aspect words to obtain the aspect vector corresponding to each word;
passing the aspect vector through a linear layer to obtain a value corresponding to each word;
multiplying the value corresponding to each word with the context word vector to obtain a word vector corresponding to each word;
and determining the sentence vector of the corresponding sentence according to the word vector corresponding to each word in each sentence.
3. The fine-grained emotion analysis model training method of claim 1, wherein the obtaining context word vectors for each word in each sentence comprises:
and obtaining a word vector corresponding to each word, and obtaining a context word vector corresponding to each word through bidirectional long-short term memory network coding according to the word vector corresponding to each word.
4. The fine-grained emotion analysis model training method of claim 3, further comprising:
acquiring text information with preset data volume to obtain a corresponding text information set;
generating a word vector of each word in the text information set in a machine learning mode to obtain a word vector set;
the obtaining of the word vector corresponding to each word includes:
and searching a word vector corresponding to each word from the word vector set.
5. The fine-grained emotion analysis model training method of claim 1, wherein the method further comprises:
acquiring test text information with test emotion marks and test terms, and inputting the test text information and the test terms into the neural network model to obtain an output emotion mark result;
and comparing the emotion mark result with the test emotion mark to obtain a training result of the neural network model, and outputting the training result.
6. A fine-grained emotion analysis model training device is characterized by comprising:
the first acquisition module is used for acquiring text information with emotion marks and aspect words and dividing the text information into a plurality of sentences;
the word segmentation module is used for performing word segmentation processing on each sentence in the text information, acquiring a context word vector of each word in each sentence, acquiring a word vector of a facet word, and acquiring a sentence vector corresponding to each sentence in the text information according to the context word vector of each word and the word vector of the facet word;
a second obtaining module, configured to obtain a context statement vector of each statement according to the statement vector corresponding to each statement, obtain a statement weight of each statement based on the aspect word, and obtain a text vector of the text information according to the context statement vector and the statement weight;
and the training module is used for inputting the text vector, the emotion mark and the aspect word into a cyclic neural network and training to obtain a neural network model, wherein the neural network model is used for identifying the emotion type of the aspect word in the text.
7. The apparatus for training a fine-grained emotion analysis model according to claim 6, further comprising:
the splicing module is used for splicing the context word vectors and the word vectors of the aspect words to obtain the aspect vector corresponding to each word;
the linear layer module is used for enabling the aspect vectors to pass through a linear layer to obtain a value corresponding to each word;
the multiplication module is used for multiplying the value corresponding to each word with the context word vector to obtain a word vector corresponding to each word;
and the determining module is used for determining the sentence vector of the corresponding sentence according to the word vector corresponding to each word in each sentence.
8. The apparatus for training a fine-grained emotion analysis model according to claim 6, further comprising:
and the third acquisition module is used for acquiring the word vector corresponding to each word and acquiring the context word vector corresponding to each word through bidirectional long-short term memory network coding according to the word vector corresponding to each word.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the fine grain emotion analysis model training method of any of claims 1 to 5.
10. A non-transitory computer readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the fine grained emotion analysis model training method according to any of claims 1 to 5.
CN202010404188.1A 2020-05-13 2020-05-13 Fine-grained emotion analysis model training method and device Active CN111666761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010404188.1A CN111666761B (en) 2020-05-13 2020-05-13 Fine-grained emotion analysis model training method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010404188.1A CN111666761B (en) 2020-05-13 2020-05-13 Fine-grained emotion analysis model training method and device

Publications (2)

Publication Number Publication Date
CN111666761A true CN111666761A (en) 2020-09-15
CN111666761B CN111666761B (en) 2022-12-09

Family

ID=72383612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010404188.1A Active CN111666761B (en) 2020-05-13 2020-05-13 Fine-grained emotion analysis model training method and device

Country Status (1)

Country Link
CN (1) CN111666761B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112347258A (en) * 2020-11-16 2021-02-09 合肥工业大学 Short text aspect level emotion classification method
CN112860894A (en) * 2021-02-10 2021-05-28 北京百度网讯科技有限公司 Emotion analysis model training method, emotion analysis method, device and equipment
CN112949282A (en) * 2021-02-26 2021-06-11 中国联合网络通信集团有限公司 Configuration file checking method and device
CN113204616A (en) * 2021-04-30 2021-08-03 北京百度网讯科技有限公司 Method and device for training text extraction model and extracting text
CN113571097A (en) * 2021-09-28 2021-10-29 之江实验室 Speaker self-adaptive multi-view dialogue emotion recognition method and system
CN113821601A (en) * 2021-09-26 2021-12-21 北京中经惠众科技有限公司 Text comparison method, device, equipment and medium
CN113901171A (en) * 2021-09-06 2022-01-07 特赞(上海)信息科技有限公司 Semantic emotion analysis method and device
CN117150025A (en) * 2023-10-31 2023-12-01 湖南锦鳞智能科技有限公司 Intelligent data service identification system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815192A (en) * 2015-11-27 2017-06-09 北京国双科技有限公司 Model training method and device and sentence emotion identification method and device
CN110083829A (en) * 2019-04-03 2019-08-02 平安科技(深圳)有限公司 Feeling polarities analysis method and relevant apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815192A (en) * 2015-11-27 2017-06-09 北京国双科技有限公司 Model training method and device and sentence emotion identification method and device
CN110083829A (en) * 2019-04-03 2019-08-02 平安科技(深圳)有限公司 Feeling polarities analysis method and relevant apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邵兴林等: "基于分层注意力机制的细粒度情感分析", 《计算机科学与应用》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112347258A (en) * 2020-11-16 2021-02-09 合肥工业大学 Short text aspect level emotion classification method
CN112347258B (en) * 2020-11-16 2022-09-13 合肥工业大学 Short text aspect level emotion classification method
CN112860894A (en) * 2021-02-10 2021-05-28 北京百度网讯科技有限公司 Emotion analysis model training method, emotion analysis method, device and equipment
CN112860894B (en) * 2021-02-10 2023-06-27 北京百度网讯科技有限公司 Emotion analysis model training method, emotion analysis device and emotion analysis equipment
CN112949282A (en) * 2021-02-26 2021-06-11 中国联合网络通信集团有限公司 Configuration file checking method and device
CN113204616A (en) * 2021-04-30 2021-08-03 北京百度网讯科技有限公司 Method and device for training text extraction model and extracting text
CN113204616B (en) * 2021-04-30 2023-11-24 北京百度网讯科技有限公司 Training of text extraction model and text extraction method and device
CN113901171A (en) * 2021-09-06 2022-01-07 特赞(上海)信息科技有限公司 Semantic emotion analysis method and device
CN113821601A (en) * 2021-09-26 2021-12-21 北京中经惠众科技有限公司 Text comparison method, device, equipment and medium
CN113571097A (en) * 2021-09-28 2021-10-29 之江实验室 Speaker self-adaptive multi-view dialogue emotion recognition method and system
CN117150025A (en) * 2023-10-31 2023-12-01 湖南锦鳞智能科技有限公司 Intelligent data service identification system
CN117150025B (en) * 2023-10-31 2024-01-26 湖南锦鳞智能科技有限公司 Intelligent data service identification system

Also Published As

Publication number Publication date
CN111666761B (en) 2022-12-09

Similar Documents

Publication Publication Date Title
CN111666761B (en) Fine-grained emotion analysis model training method and device
CN108363790B (en) Method, device, equipment and storage medium for evaluating comments
CN112270196B (en) Entity relationship identification method and device and electronic equipment
CN104809103B (en) A kind of interactive semantic analysis and system
US20140351228A1 (en) Dialog system, redundant message removal method and redundant message removal program
CN108090099B (en) Text processing method and device
CN110503143B (en) Threshold selection method, device, storage medium and device based on intention recognition
CN111563384A (en) Evaluation object identification method and device for E-commerce products and storage medium
CN112860896A (en) Corpus generalization method and man-machine conversation emotion analysis method for industrial field
CN107291775A (en) The reparation language material generation method and device of error sample
CN112100374A (en) Text clustering method and device, electronic equipment and storage medium
CN112836053A (en) Man-machine conversation emotion analysis method and system for industrial field
CN111079433B (en) Event extraction method and device and electronic equipment
CN107783958B (en) Target statement identification method and device
CN107797981B (en) Target text recognition method and device
CN113486174B (en) Model training, reading understanding method and device, electronic equipment and storage medium
CN108197274B (en) Abnormal personality detection method and device based on conversation
CN113609865A (en) Text emotion recognition method and device, electronic equipment and readable storage medium
CN113934834A (en) Question matching method, device, equipment and storage medium
CN113782123A (en) Online medical patient satisfaction measuring method based on network data
CN117454217A (en) Deep ensemble learning-based depression emotion recognition method, device and system
CN115687790B (en) Advertisement pushing method and system based on big data and cloud platform
CN112732908B (en) Test question novelty evaluation method and device, electronic equipment and storage medium
CN114676699A (en) Entity emotion analysis method and device, computer equipment and storage medium
CN110827794B (en) Method and device for evaluating quality of voice recognition intermediate result

Legal Events

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