CN114490952A - Text emotion analysis method and device, electronic equipment and storage medium - Google Patents

Text emotion analysis method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114490952A
CN114490952A CN202210392418.6A CN202210392418A CN114490952A CN 114490952 A CN114490952 A CN 114490952A CN 202210392418 A CN202210392418 A CN 202210392418A CN 114490952 A CN114490952 A CN 114490952A
Authority
CN
China
Prior art keywords
data
user
emotion
emotion intensity
text data
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
CN202210392418.6A
Other languages
Chinese (zh)
Other versions
CN114490952B (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.)
GAC Aion New Energy Automobile Co Ltd
Original Assignee
GAC Aion New Energy Automobile 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 GAC Aion New Energy Automobile Co Ltd filed Critical GAC Aion New Energy Automobile Co Ltd
Priority to CN202210392418.6A priority Critical patent/CN114490952B/en
Publication of CN114490952A publication Critical patent/CN114490952A/en
Application granted granted Critical
Publication of CN114490952B publication Critical patent/CN114490952B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • 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

Abstract

The application provides a text emotion analysis method, a text emotion analysis device, electronic equipment and a storage medium, wherein the method comprises the following steps: obtaining the emotion intensity value of target text data of a target user; acquiring the emotion intensity data of the whole user and the personal emotion intensity data of a target user; and correcting the emotion intensity value of the target text data according to the personal emotion intensity data and the overall user emotion intensity data to obtain a corrected emotion intensity value of the target text data. And generating a correction formula through the personal emotion intensity data of the user and the overall user emotion intensity data, and correcting the emotion intensity value of the text data of the user through the correction formula to obtain objective and accurate comment data corrected emotion intensity value. And the accuracy of predicting the emotional intensity by the algorithm is improved by modifying the emotional intensity value training model and obtaining data characteristic classification.

Description

Text emotion analysis method and device, electronic equipment and storage medium
Technical Field
The application relates to the field of text analysis, in particular to a text emotion analysis method and device, electronic equipment and a storage medium.
Background
With the popularization of intellectualization and networking, internet enterprises and various industries perform deep cooperation, and users can make comments from various forums or APP (APPlication program) applications. The comment text content contains rich valuable information. The text content is deeply analyzed, the comment viewpoints and the emotional intensity of the customers are mined, and guidance can be provided for product research and analysis. In the current text analysis, the emotional tendency of words is mainly judged according to the context relationship, and the obtained result is inaccurate.
Disclosure of Invention
The embodiment of the invention aims to provide a text sentiment analysis method, a text sentiment analysis device, electronic equipment and a storage medium, wherein a plurality of user text data are preprocessed and filtered to obtain filtered data, personal sentiment intensity data of a user and integral user sentiment intensity data are calculated according to the filtered data to generate a correction formula, the sentiment intensity value of the text data of the user is corrected through the correction formula, a more objective and accurate comment data corrected sentiment intensity value is obtained, the sentiment intensity of the user is expressed in a quantitative mode, and the text sentiment analysis method is more visual. The judgment of the emotional intensity according to the context relationship is avoided, and the calculation of the emotional intensity value is not accurate. And the accuracy of predicting the emotional intensity by the algorithm is improved by correcting the emotional intensity value training model and obtaining data characteristic classification.
In a first aspect, an embodiment of the present application provides a text emotion analysis method, including: obtaining the emotion intensity value of target text data of a target user; acquiring the emotion intensity data of the whole user and the personal emotion intensity data of a target user; and modifying the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data to obtain a modified emotion intensity value of the target text data.
In the implementation process, the emotion intensity value of the target text data of the target user is corrected through the overall user emotion intensity data and the personal emotion intensity data of the target user, so that a more accurate emotion intensity value is obtained, and the accuracy of emotion analysis is improved.
Optionally, in this embodiment of the present application, the obtaining of the overall user emotion intensity data and the personal emotion intensity data of the target user includes: acquiring text data of a plurality of users in a first historical time, and acquiring overall user emotion intensity data according to the text data of the plurality of users; and acquiring text data of the user person in a plurality of second historical times, and acquiring the emotional intensity data of the user person according to the text data.
In the implementation process, the text data in the first historical time is counted to obtain the overall user emotion intensity, the text data in the second historical time of the user individual is counted to obtain the emotion intensity data of the user individual, wherein the first historical event and the second historical event can be set according to actual requirements, the overall user emotion intensity can be obtained periodically and regularly without being obtained every time, the computing resource consumption is reduced, and the correction efficiency is improved. The personal emotional intensity data of the user can be acquired in real time so as to improve the accuracy of correction.
Optionally, in this embodiment of the present application, after obtaining text data in a first historical time of a plurality of users, before obtaining the overall user emotion intensity data according to the text data of the plurality of users, the method further includes: cleaning and integrating the acquired text data of the plurality of users and segmenting words to obtain word segmentation data; processing the part-word data through a word frequency algorithm to obtain a plurality of preprocessed data; obtaining a user-defined word bank according to the synonym of the preprocessed data; filtering the plurality of preprocessed data according to the user-defined word bank to obtain a plurality of filtered data; obtaining the overall user emotion intensity data according to the text data of the plurality of users, wherein the obtaining comprises the following steps: and obtaining the overall user emotion intensity data by filtering the data.
In the implementation process, the text data of the plurality of users are preprocessed, and the preprocessing comprises cleaning and integrating the text data and filtering the text through a user-defined word bank, so that data enhancement is realized, effective text data is obtained, and the correction accuracy is improved.
Optionally, in this embodiment of the present application, modifying the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data, so as to obtain a modified emotion intensity value of the target text data, includes: generating a correction formula according to the personal emotion intensity data of the user and the overall user emotion intensity data; wherein, the whole user emotion intensity data comprises: a first score, a median and a second score in the emotion intensity distribution value of the whole user; the personal emotional intensity data of the user comprises: the emotion intensity value of the target text data and a first score, a median and a second score in the emotion intensity distribution value of the user person; and correcting the emotion intensity value of the target text data through a correction formula.
In the implementation process, data of different quantiles in the emotion intensity distribution values of the whole user and the user are respectively selected, a correction formula is generated, and the emotion intensity value of the target text data is corrected. And carrying out self-adaptive correction on the user with biased emotion to obtain a more objective emotion intensity value.
Optionally, in an embodiment of the present application, the modification formula includes:
Figure M_220414134024438_438448001
wherein the content of the first and second substances,
Figure M_220414134024485_485819001
the corrected emotion intensity value of the target text data is obtained;
Figure M_220414134024517_517085002
the emotion intensity value of the target text data is obtained;
Figure M_220414134024532_532714003
the first score in the emotion intensity distribution value of the whole user;
Figure M_220414134024563_563968004
the median of the emotional intensity distribution values of the whole user is obtained;
Figure M_220414134024595_595229005
the second score in the emotion intensity distribution value of the whole user;
Figure M_220414134024610_610876006
a first score in the user's personal emotional intensity distribution value;
Figure M_220414134024644_644487007
the median of the personal emotional intensity distribution value of the user,
Figure M_220414134024660_660633008
Is the second score in the user's personal emotional intensity distribution value. In the implementation process, the emotional intensity of the user is expressed in a quantitative mode, so that the emotion intensity is more visual and objective.
Optionally, in an embodiment of the present application, after modifying the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data to obtain a modified emotion intensity value of the target text data, the method further includes: splicing the corrected emotion intensity value with target text data to obtain a text to be predicted; and inputting the text to be predicted into a pre-trained emotion classification model to obtain emotion classification corresponding to the text to be predicted and output by the emotion classification model.
In the implementation process, the spliced text to be predicted is input into a pre-trained emotion classification model, emotion classification is obtained by using the emotion classification model, the manual screening and classification process is reduced, and the emotion classification efficiency is improved; meanwhile, the text to be predicted comprises the corrected emotion intensity value, so that the problem of low prediction accuracy caused by unclear emotion classification label boundary is solved.
Optionally, in this embodiment of the application, before the modified emotion intensity value is spliced with the target text data to obtain the text to be predicted, the method further includes: obtaining a plurality of correction data, wherein the correction data comprises splicing data formed by splicing historical target text data and corresponding correction emotion intensity values and labels of the splicing data; and training a preset network model through the correction data to obtain an emotion classification model.
In the implementation process, the marked correction data is used as a sample set to train the network model, so that the optimized emotion classification model is obtained, and the accuracy of model classification is improved.
In a second aspect, an embodiment of the present application further provides a text emotion analysis apparatus, including: the first acquisition module is used for acquiring the emotion intensity value of target text data of a target user;
the data acquisition module is used for acquiring the emotion intensity data of the whole user and the personal emotion intensity data of the target user;
and the correction module is used for correcting the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data to obtain a corrected emotion intensity value of the target text data.
Optionally, in an embodiment of the present application, the text emotion analyzing device, wherein the data obtaining module is further configured to obtain text data of a plurality of users in a first historical time, and obtain the overall user emotion intensity data according to the text data of the plurality of users; and acquiring text data of the user person in a plurality of second historical times, and acquiring the emotional intensity data of the user person according to the text data.
Optionally, in this embodiment of the present application, the text emotion analyzing apparatus further includes: the preprocessing module is used for cleaning and integrating the acquired text data of the plurality of users and segmenting words to acquire segmented word data; processing the part-word data through a word frequency algorithm to obtain a plurality of preprocessed data; obtaining a user-defined word bank according to the near-meaning words of the preprocessed data; filtering the plurality of preprocessed data according to the user-defined word bank to obtain a plurality of filtered data; obtaining the overall user emotion intensity data according to the text data of the plurality of users, wherein the obtaining comprises the following steps: and obtaining the overall user emotion intensity data by filtering the data.
Optionally, in an embodiment of the present application, the text emotion analyzing apparatus, wherein the modifying module is further configured to generate a modifying formula according to the personal emotion intensity data of the user and the overall user emotion intensity data; wherein, the whole user emotion intensity data comprises: a first score, a median and a second score in the emotion intensity distribution value of the whole user; the personal emotional intensity data of the user comprises: the emotion intensity value of the target text data and a first score, a median and a second score in the emotion intensity distribution value of the user person; and correcting the emotion intensity value of the target text data through a correction formula.
Optionally, in an embodiment of the present application, the text emotion analyzing apparatus, wherein the modification formula includes:
Figure M_220414134024691_691872001
wherein the content of the first and second substances,
Figure M_220414134024738_738762001
the corrected emotion intensity value of the target text data is obtained;
Figure M_220414134024770_770027002
the emotion intensity value of the target text data is obtained;
Figure M_220414134024785_785654003
the first score in the emotion intensity distribution value of the whole user;
Figure M_220414134024801_801267004
the median of the emotional intensity distribution values of the whole user is obtained;
Figure M_220414134024832_832518005
the second score in the emotion intensity distribution value of the whole user;
Figure M_220414134024848_848555006
a first score in the user's personal emotional intensity distribution value;
Figure M_220414134024879_879382007
the median of the personal emotional intensity distribution value of the user,
Figure M_220414134024895_895011008
Is the second score in the user's personal emotional intensity distribution value.
Optionally, in this embodiment of the present application, the text emotion analyzing apparatus further includes: the classification module is used for splicing the corrected emotion intensity value with the target text data to obtain a text to be predicted; and inputting the text to be predicted into a pre-trained emotion classification model to obtain emotion classification corresponding to the text to be predicted and output by the emotion classification model.
Optionally, in this embodiment of the present application, the text emotion analyzing apparatus further includes: the training module is used for obtaining a plurality of correction data, and the correction data comprise splicing data formed by splicing historical target text data and corresponding correction emotion intensity values and labels of the splicing data; and training a preset network model through the correction data to obtain an emotion classification model.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor and a memory, the memory storing processor-executable machine-readable instructions, the machine-readable instructions when executed by the processor performing the method as described above.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the above-described method.
By adopting the text emotion analysis method and device, the electronic equipment and the storage medium, the emotion intensity value of the target text data of the target user can be corrected through the correction formula, and a more accurate and objective corrected emotion intensity value is obtained; and the accuracy of model classification is improved by modifying the data training model after the emotion intensity value and the target text data are spliced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of a text emotion analysis method according to a first embodiment of the present application;
FIG. 2 is a schematic diagram of overall user emotion intensity data provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of user personal emotional intensity data provided by an embodiment of the present application;
FIG. 4 is a flowchart illustrating a text emotion analyzing method according to a second embodiment of the present application;
FIG. 5 is a schematic structural diagram of a text emotion analysis apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The following examples are merely used to more clearly illustrate the technical solutions of the present application, and therefore are only examples, and the protection scope of the present application is not limited thereby.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
In the description of the embodiments of the present application, the technical terms "first", "second", and the like are used only for distinguishing different objects, and are not to be construed as indicating or implying relative importance or implicitly indicating the number, specific order, or primary-secondary relationship of the technical features indicated. In the description of the embodiments of the present application, "a plurality" means two or more unless specifically defined otherwise.
Please refer to fig. 1, which is a schematic flow chart of a text emotion analysis method provided in an embodiment of the present application.
Step S110: and obtaining the emotion intensity value of the target text data of the target user.
The embodiment of the step S110 includes: the method comprises the steps of firstly obtaining target text data of a target user, wherein the target text data can be question and answer data such as comments sent by the user through a client terminal interactive APP, and the target text data can be obtained through a client terminal interactive APP server, and the target text data can also be obtained through other modes. The emotion intensity value of the target text data represents the emotional tendency of the text data, and generally, the more positive the text data is, the higher the emotion intensity value is; the more negative the comment, the lower the sentiment strength value. The emotional intensity value can be obtained by an emotional analysis tool or algorithm, such as a snornlp algorithm.
Step S120 is executed: and acquiring the overall user emotion intensity data and the individual emotion intensity data of the target user.
The embodiment of the step S120 includes: the method comprises the steps that a plurality of text data of a plurality of users are obtained through a client side APP server, the text data are processed to obtain the emotion intensity value of each text data, and the whole user emotion intensity data are obtained through counting and calculating all the emotion intensity values. The method comprises the steps of obtaining a plurality of text data of a target user through a client APP server, and counting personal emotion intensity data of the target user according to emotion intensity values of the text data of the target user. The text data of the users can be all or more comments of all users in the interactive APP; the personal emotional intensity data of the target user can be all or multiple comments of the target user in the interactive APP.
Step S130 is executed: and correcting the emotion intensity value of the target text data according to the personal emotion intensity data and the overall user emotion intensity data to obtain a corrected emotion intensity value of the target text data.
The embodiment of the step S130 includes: the personal emotional intensity data comprise distribution parameters of the personal emotional intensity data, and the overall user emotional intensity data comprise distribution parameters of the overall user emotional intensity data. The correction mode can be that a correction formula is generated according to the distribution parameters of the personal emotional intensity data and the distribution parameters of the overall user emotional intensity data, and the emotional intensity value of the target text data of the target user is corrected by using the correction formula to obtain the corrected emotional intensity value of the target text data.
In the implementation process, the emotion intensity value of the target text data of the target user is corrected through the overall user emotion intensity data and the personal emotion intensity data of the target user, so that a more accurate emotion intensity value is obtained, and the accuracy of emotion analysis is improved.
Optionally, in this embodiment of the application, the obtaining of the overall user emotion intensity data and the personal emotion intensity data of the target user includes: acquiring text data of a plurality of users in a first historical time, and acquiring overall user emotion intensity data according to the text data of the plurality of users; and acquiring text data of the user person in a plurality of second historical times, and acquiring the emotional intensity data of the user person according to the text data.
The implementation manner of the above steps is as follows: acquiring text data of a plurality of users in a first historical time, and acquiring the emotion intensity data of the whole user according to the text data of the plurality of users. A plurality of text data in a first historical time period of a plurality of users are obtained through an APP server, the text data are processed through an emotion analysis tool, and overall user emotion intensity data are obtained and comprise emotion intensity values corresponding to the text data.
And acquiring text data of the user person in a plurality of second historical times, and acquiring the emotional intensity data of the user person according to the text data. The method comprises the steps of acquiring a plurality of text data of a target user by taking the user as a unit, processing the plurality of text data through an emotion analysis tool, and acquiring personal emotion intensity data of the user, wherein the personal emotion intensity data of the user comprises emotion intensity values of a plurality of texts of the user, and the plurality of texts comprise target text data. The text data can be obtained through an APP question-answer interaction board, an APP community user daily dynamic information display board and an exchange group.
It should be noted that, the first history time and the second history time may be the same, that is, the time period for acquiring the personal emotional intensity data of the user and the overall emotional intensity data of the user is the same history time period. The first historical time and the second historical time can be adjusted according to requirements, precision requirements, computing resources and the like. For example, the first historical time is a period for acquiring a plurality of text data of the whole user, the calculation influence of the newly added text data in a short time on the text data of the whole user is small, and in order to save calculation resources and improve processing efficiency, the plurality of data of the plurality of users can be acquired in a timing manner. The second historical time is a period for acquiring a plurality of text data of the target user, each piece of text data has a large influence on the personal emotion intensity data of the target user, and in order to ensure the accuracy of calculation, the plurality of text data of the target user can be acquired in a real-time acquisition mode.
In the implementation process, the text data in the first historical time is counted to obtain the overall user emotion intensity, the text data in the second historical time of the user is counted to obtain the emotion intensity data of the user, wherein the first historical time and the second historical time can be set according to actual requirements, the overall user emotion intensity can be obtained periodically and regularly without being obtained every time, the computing resource consumption is reduced, and the correction efficiency is improved. The personal emotional intensity data of the user can be acquired in real time so as to improve the accuracy of correction.
Optionally, in this embodiment of the present application, after obtaining text data in a first historical time of multiple users, before obtaining overall user emotion intensity data according to the text data of the multiple users, the method further includes: cleaning and integrating the acquired text data of the plurality of users and segmenting words to obtain word segmentation data; processing the part-word data through a word frequency algorithm to obtain a plurality of preprocessed data; obtaining a user-defined word bank according to the near-meaning words of the preprocessed data; filtering the plurality of preprocessed data according to the user-defined word bank to obtain a plurality of filtered data; obtaining the overall user emotion intensity data according to the text data of the plurality of users, wherein the obtaining comprises the following steps: and obtaining the overall user emotion intensity data by filtering the data.
The implementation manner of the above steps is as follows: the method comprises the steps that a plurality of acquired user text data are cleaned and integrated through a data cleaning tool and regular matching, and cleaning content comprises data such as non-user data, repeated data, malicious data, messy code links and emoticons. Performing word segmentation on the cleaned data to obtain word segmentation data; and processing the branch word data through a word frequency algorithm to obtain a plurality of preprocessed data. Wherein the word frequency algorithm can be a TF-IDF algorithm. The method comprises the steps of obtaining near-meaning words of preprocessed data by using a word2vec algorithm, obtaining a user-defined word bank according to the near-meaning words of the preprocessed data, screening and filtering a plurality of preprocessed data through the words in the user-defined word bank, obtaining screened user text data, namely filtered data, and obtaining overall user emotion intensity data through the filtered data.
In the implementation process, the text data of the plurality of users are preprocessed, and the preprocessing comprises cleaning and integrating the text data and filtering the text through a user-defined word bank, so that data enhancement is realized, effective text data is obtained, and the correction accuracy is improved.
Optionally, in this embodiment of the present application, modifying the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data, so as to obtain a modified emotion intensity value of the target text data, includes: generating a correction formula according to the personal emotion intensity data of the user and the overall user emotion intensity data; wherein, the whole user emotion intensity data comprises: a first score, a median and a second score in the emotion intensity distribution value of the whole user; the personal emotional intensity data of the user comprises: the emotion intensity value of the target text data and a first score, a median and a second score in the emotion intensity distribution value of the user person; and correcting the emotion intensity value of the target text data through a correction formula.
The implementation manner of the above steps is as follows: generating a correction formula according to the personal emotion intensity data of the user and the overall user emotion intensity data, wherein the first quantile, the median and the second quantile in the emotion intensity distribution value of the overall user can be respectively 1/4 quantile, median and 3/4 quantile in the emotion intensity distribution value of the overall user; other data may be used, such as 1/5 quantiles, medians, and 4/5 quantiles in the overall user's emotional intensity distribution value, or 1/3 quantiles, medians, and 2/3 quantiles in the overall user's emotional intensity distribution value.
Please refer to fig. 2, which is a schematic diagram of the overall user emotion intensity data provided in the embodiment of the present application.
The method comprises the steps of obtaining 28 thousands of text data of a plurality of users, processing the text data through an emotion analysis tool, and obtaining overall user emotion intensity data as shown in FIG. 2, wherein 1/4 quantiles, median and 3/4 quantiles in emotion intensity distribution values of the overall users are 0.33, 0.58 and 0.85 respectively.
The first, median, and second quantile in the emotional intensity distribution values of the user person may be 1/4 quantiles, medias, and 3/4 quantiles in the emotional intensity distribution values of the user person. And correcting the emotion intensity value of the target text data through a correction formula.
Please refer to fig. 3, which illustrates a schematic diagram of the emotional intensity data of the user person provided in the embodiment of the present application.
1117 comment data of a target user are obtained, 1117 text data are processed through an emotion analysis tool, and overall user emotion intensity data are obtained as shown in FIG. 3, wherein 1/4 quantiles, median and 3/4 quantiles in the emotion intensity distribution value of the user are 0.33, 0.54 and 0.80 respectively.
It should be noted that, the emotion intensity value of the target text data is greater than or not greater than the median of the personal emotion intensity distribution value of the user, and can be corrected through the correction formula, so as to obtain the corrected emotion intensity value.
In the implementation process, data of different quantiles in the emotion intensity distribution values of the whole user and the user are respectively selected, a correction formula is generated, and the emotion intensity value of the target text data is corrected. And carrying out self-adaptive correction on the user with biased emotion to obtain a more objective emotion intensity value.
Optionally, in an embodiment of the present application, the modification formula includes:
Figure M_220414134024910_910637001
wherein the content of the first and second substances,
Figure M_220414134024957_957526001
the corrected emotion intensity value of the target text data is obtained;
Figure M_220414134024988_988770002
the emotion intensity value of the target text data is obtained;
Figure M_220414134025004_004406003
the first score in the emotion intensity distribution value of the whole user;
Figure M_220414134025035_035608004
the median of the emotional intensity distribution values of the whole user is obtained;
Figure M_220414134025052_052708005
the second score in the emotion intensity distribution value of the whole user;
Figure M_220414134025084_084471006
a first score in the user's personal emotional intensity distribution value;
Figure M_220414134025100_100116007
the median of the personal emotional intensity distribution value of the user,
Figure M_220414134025131_131360008
Is the second score in the user's personal emotional intensity distribution value. In the implementation process, the emotional intensity of the user is expressed in a quantitative mode, so that the emotion intensity is more visual and objective.
Optionally, in this embodiment of the application, after modifying the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data to obtain a modified emotion intensity value of the target text data, the method further includes: splicing the corrected emotion intensity value with target text data to obtain a text to be predicted; and inputting the text to be predicted into a pre-trained emotion classification model to obtain emotion classification corresponding to the text to be predicted and output by the emotion classification model.
The implementation manner of the above steps is as follows: and splicing the corrected emotion intensity value with the target text data to obtain a text to be predicted, wherein the format of the text to be predicted can be as follows: text to be predicted = target text data + revised emotion of intensity value. The emotion classification model can be built based on tensiorflow, history text data are marked to obtain marked data, the built network model is trained by using the marked data, the model structure and corresponding parameters are stored, the emotion classification model is generated, and the emotion classification model comprises an embedding layer, an Encoder layer and a softmax classification layer. And inputting the text to be predicted into a pre-trained emotion classification model to obtain emotion classification corresponding to the text to be predicted and output by the emotion classification model. The output sentiment classification may include five types of sentiments: complaints, consultations, advice, praise.
In the implementation process, the spliced text to be predicted is input into a pre-trained emotion classification model, emotion classification is obtained by using the emotion classification model, the manual screening and classification process is reduced, and the emotion classification efficiency is improved; meanwhile, the text to be predicted comprises the corrected emotion intensity value, so that the problem of low prediction accuracy caused by unclear emotion classification label boundary is solved.
Optionally, in this embodiment of the application, before the modified emotion intensity value is spliced with the target text data to obtain the text to be predicted, the method further includes: obtaining a plurality of correction data, wherein the correction data comprises spliced data formed by splicing historical target text data and corresponding correction emotion intensity values and labels of the spliced data; and training a preset network model through the correction data to obtain an emotion classification model.
The implementation manner of the above steps is as follows: and obtaining a plurality of correction data, wherein the correction data comprises splicing data formed by splicing the historical target text data and the corresponding correction emotion intensity values, and labels of the splicing data. The labels of the spliced data can be manually marked, correction data corresponding to a plurality of correction word strength values in different preset intervals are obtained, for example, spliced data of three intervals with high, medium and low correction word strength values are obtained, the spliced data is manually marked, the correction data of three intervals with manual marking are subdivided, complaints, consultations, suggestions and expressions can be marked, the correction data are obtained, and a preset network model is trained through the correction data to obtain an emotion classification model.
In the implementation process, the marked correction data is used as a sample set to train the network model, so that the optimized emotion classification model is obtained, and the accuracy of model classification is improved.
Please refer to fig. 4, which is a schematic structural diagram of a text emotion analyzing apparatus provided in the embodiment of the present application;
in a preferred embodiment, an APP background server obtains a plurality of user question-answer data from a user question-answer module, a user dynamic module and a user tribe module in an APP, and performs preprocessing on the user question-answer data, wherein the preprocessing comprises obtaining a keyword through a word frequency algorithm, obtaining a near meaning word of the keyword through a word2vec algorithm, and generating a user-defined word bank according to the obtained near meaning word. And then, carrying out data cleaning on the obtained user question and answer data to obtain a user text data set, and filtering data in the self-use corpus through word screening in the self-defined word bank to obtain the screened user data.
And obtaining the emotion score of each piece of data from the screened user data through a snornlp algorithm, and correcting the emotion score of each piece of data through a user statement emotion correction function to obtain the emotion score of each piece of data after correction.
And splicing the screened user data and the corresponding corrected emotion scores to obtain spliced data, wherein specifically, the new text data = the original text data + the emotion correction scores. And screening partial data from different emotion scoring intervals of the spliced data, and manually marking the partial data, wherein the marked data are emotion labels. Inputting the manually marked data into the ensemble learning bert model for training, generating an emotion classification model, and putting the unmarked spliced data into the trained emotion classification model to obtain a classification result.
Please refer to fig. 5, which is a schematic structural diagram of a text emotion analyzing apparatus provided in the embodiment of the present application; the embodiment of the present application provides a text emotion analysis 200, including:
a first obtaining module 210, configured to obtain an emotion intensity value of target text data of a target user;
the data acquisition module 220 is used for acquiring the emotion intensity data of the whole user and the personal emotion intensity data of the target user;
and a correcting module 230, configured to correct the emotion intensity value of the target text data according to the personal emotion intensity data and the overall user emotion intensity data, so as to obtain a corrected emotion intensity value of the target text data.
It should be understood that the apparatus corresponds to the above text emotion analysis method embodiment, and can perform the steps related to the above method embodiment, and the specific functions of the apparatus can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy. The device includes at least one software function that can be stored in memory in the form of software or firmware (firmware) or solidified in the Operating System (OS) of the device.
Please refer to fig. 6 for a schematic structural diagram of an electronic device according to an embodiment of the present application. An electronic device 300 provided in an embodiment of the present application includes: a processor 310 and a memory 320, the memory 320 storing machine readable instructions executable by the processor 310, the machine readable instructions when executed by the processor 310 performing the method as above.
The embodiment of the application also provides a storage medium, wherein the storage medium is stored with a computer program, and the computer program is executed by a processor to execute the method.
The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The above description is only an alternative embodiment of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present application, and all the changes or substitutions should be covered by the scope of the embodiments of the present application.

Claims (10)

1. A text emotion analysis method is characterized by comprising the following steps:
obtaining the emotion intensity value of target text data of a target user;
obtaining the emotion intensity data of the whole user and the personal emotion intensity data of the target user;
and modifying the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data to obtain a modified emotion intensity value of the target text data.
2. The method of claim 1, wherein the obtaining of the overall user emotion intensity data and the personal emotion intensity data of the target user comprises:
acquiring text data of a plurality of users in first historical time, and acquiring overall user emotion intensity data according to the text data of the plurality of users;
and acquiring the text data of the user person in a plurality of second historical times, and acquiring the emotional intensity data of the user person according to the text data.
3. The method of claim 2, wherein after the obtaining text data in a first historical time of a plurality of users, and before the obtaining overall user emotion intensity data according to the text data of the plurality of users, the method further comprises:
cleaning, integrating and segmenting the acquired text data of the plurality of users to obtain segmented word data;
processing the part-word data through a word frequency algorithm to obtain a plurality of preprocessed data;
obtaining a user-defined word bank according to the near-meaning words of the preprocessed data;
filtering the preprocessing data according to the user-defined word bank to obtain filtering data;
the obtaining of the overall user emotion intensity data according to the plurality of user text data includes: and obtaining the whole user emotion intensity data through the filtering data.
4. The method of claim 1, wherein the modifying the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data to obtain a modified emotion intensity value of the target text data comprises:
generating a correction formula according to the personal emotion intensity data of the user and the overall user emotion intensity data; wherein the overall user emotion intensity data comprises: a first score, a median and a second score in the emotion intensity distribution value of the whole user; the personal emotional intensity data of the user comprises: the emotion intensity value of the target text data and a first quantile, a median and a second quantile in the emotion intensity distribution value of the user person;
and correcting the emotion intensity value of the target text data through the correction formula.
5. The method of claim 4, wherein the modification formula comprises:
Figure M_220414134022018_018088001
wherein the content of the first and second substances,
Figure M_220414134022192_192398001
the corrected emotion intensity value of the target text data is obtained;
Figure M_220414134022223_223643002
the emotion intensity value of the target text data is obtained;
Figure M_220414134022254_254919003
the first score in the emotion intensity distribution value of the whole user is obtained;
Figure M_220414134022286_286160004
the median of the emotion intensity distribution values of the whole user is obtained;
Figure M_220414134022317_317411005
the second score in the emotion intensity distribution value of the whole user;
Figure M_220414134022348_348649006
a first score in the user's personal emotional intensity distribution value;
Figure M_220414134022379_379916007
is the median of the emotional intensity distribution value of the user person,
Figure M_220414134022395_395535008
Is the second score in the user's personal emotional intensity distribution value.
6. The method of claim 1, wherein after said modifying the emotion intensity value of the target text data according to the individual emotion intensity data of the user and the overall user emotion intensity data to obtain a modified emotion intensity value of the target text data, the method further comprises:
splicing the corrected emotion intensity value with the target text data to obtain a text to be predicted;
and inputting the text to be predicted into a pre-trained emotion classification model to obtain emotion classification corresponding to the text to be predicted and output by the emotion classification model.
7. The method of claim 6, wherein before the step of concatenating the modified emotion intensity value with the target text data to obtain the text to be predicted, the method further comprises:
obtaining a plurality of correction data, wherein the correction data comprise splicing data formed by splicing historical target text data and corresponding correction emotion intensity values and labels of the splicing data;
and training a preset network model through the correction data to obtain the emotion classification model.
8. A text sentiment analysis device is characterized by comprising:
the first acquisition module is used for acquiring the emotion intensity value of target text data of a target user;
the data acquisition module is used for acquiring the emotion intensity data of the whole user and the personal emotion intensity data of the target user;
and the correction module is used for correcting the emotion intensity value of the target text data according to the personal emotion intensity data of the user and the overall user emotion intensity data to obtain a corrected emotion intensity value of the target text data.
9. An electronic device, comprising: a processor and a memory, the memory storing machine-readable instructions executable by the processor, the machine-readable instructions, when executed by the processor, performing the method of any of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the method of any one of claims 1 to 7.
CN202210392418.6A 2022-04-15 2022-04-15 Text emotion analysis method and device, electronic equipment and storage medium Active CN114490952B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210392418.6A CN114490952B (en) 2022-04-15 2022-04-15 Text emotion analysis method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210392418.6A CN114490952B (en) 2022-04-15 2022-04-15 Text emotion analysis method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114490952A true CN114490952A (en) 2022-05-13
CN114490952B CN114490952B (en) 2022-07-15

Family

ID=81488285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210392418.6A Active CN114490952B (en) 2022-04-15 2022-04-15 Text emotion analysis method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114490952B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202032A (en) * 2016-06-24 2016-12-07 广州数说故事信息科技有限公司 A kind of sentiment analysis method towards microblogging short text and system thereof
US20190079922A1 (en) * 2017-09-12 2019-03-14 Michael Phillips Moskowitz Method and system for imposing a dynamic sentiment vector to an electronic message
CN111565322A (en) * 2020-05-14 2020-08-21 北京奇艺世纪科技有限公司 User emotional tendency information obtaining method and device and electronic equipment
CN112991017A (en) * 2021-03-26 2021-06-18 刘秀萍 Accurate recommendation method for label system based on user comment analysis

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202032A (en) * 2016-06-24 2016-12-07 广州数说故事信息科技有限公司 A kind of sentiment analysis method towards microblogging short text and system thereof
US20190079922A1 (en) * 2017-09-12 2019-03-14 Michael Phillips Moskowitz Method and system for imposing a dynamic sentiment vector to an electronic message
CN111565322A (en) * 2020-05-14 2020-08-21 北京奇艺世纪科技有限公司 User emotional tendency information obtaining method and device and electronic equipment
CN112991017A (en) * 2021-03-26 2021-06-18 刘秀萍 Accurate recommendation method for label system based on user comment analysis

Also Published As

Publication number Publication date
CN114490952B (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN109325165B (en) Network public opinion analysis method, device and storage medium
CN112906384B (en) BERT model-based data processing method, BERT model-based data processing device, BERT model-based data processing equipment and readable storage medium
CN111144079B (en) Method and device for intelligently acquiring learning resources, printer and storage medium
CN116629275B (en) Intelligent decision support system and method based on big data
CN111798123A (en) Compliance evaluation method, device, equipment and medium based on artificial intelligence
CN111324739B (en) Text emotion analysis method and system
CN109299470B (en) Method and system for extracting trigger words in text bulletin
CN112347787A (en) Method, device and equipment for classifying aspect level emotion and readable storage medium
CN106610932A (en) Corpus processing method and device and corpus analyzing method and device
Kortum et al. Dissection of AI job advertisements: A text mining-based analysis of employee skills in the disciplines computer vision and natural language processing
CN110490056A (en) The method and apparatus that image comprising formula is handled
CN111597805B (en) Method and device for auditing short message text links based on deep learning
CN107783958B (en) Target statement identification method and device
CN114490952B (en) Text emotion analysis method and device, electronic equipment and storage medium
Gutsche Automatic weak signal detection and forecasting
CN116719920A (en) Dynamic sampling dialogue generation model training method, device, equipment and medium
CN115718807A (en) Personnel relationship analysis method, device, equipment and storage medium
CN113011164B (en) Data quality detection method, device, electronic equipment and medium
CN112328812B (en) Domain knowledge extraction method and system based on self-adjusting parameters and electronic equipment
CN113282715A (en) Deep learning-combined big data topic comment emotion analysis method and server
CN115146064A (en) Intention recognition model optimization method, device, equipment and storage medium
CN106815592B (en) Text data processing method and device and wrong word recognition methods and device
CN113255368A (en) Method and device for emotion analysis of text data and related equipment
CN114548825B (en) Complaint work order distortion detection method, device, equipment and storage medium
CN110008334B (en) Information processing method, device and storage medium

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