Natural language processing method for sentiment analysis

By dividing the evaluation text into multiple theme texts according to the evaluation topic, and analyzing each theme text, combining the degree of emotional fascination and ironic judgment model, the problem of confusion in text emotional analysis content in the existing technology is solved, and accurate analysis and comprehensive evaluation of the emotional tendency of the evaluation content is achieved.

CN119577136AInactive Publication Date: 2025-03-07ANHUI UNIVERSITY OF ARCHITECTURE
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411655572.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Before evaluating the evaluation content, the prior art needs to screen a large number of texts in segments, and it is impossible to determine whether the emotional tendency of the text belongs to the same evaluation topic, resulting in confusion in the analysis content.

Method used

By obtaining multiple evaluation topics in the evaluation text and dividing the evaluation text into multiple theme texts based on the evaluation topic, the evaluation staff’s emotions on each evaluation topic are obtained, and each theme text is analyzed separately. Finally, the evaluation staff obtains the evaluation staff to comprehensively evaluate the items in the evaluation topic based on the degree of emotional charm and ironic judgment model.

Benefits of technology

It achieves an accurate understanding of the degree of emotional tendency of the appraisers on each evaluation topic, saves working time for segmented screening, and avoids misunderstanding of the appraisers' intentions through the ironic judgment model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577136A_ABST
    Figure CN119577136A_ABST
Patent Text Reader

Abstract

The invention discloses a natural language processing method for sentiment analysis. The method comprises the steps of obtaining sentiment tendency coefficients of segmented sentences based on vocabulary tendency scores of multiple vocabularies in an evaluation text and associated vocabularies; obtaining an emotional tendency degree of the subject text based on the emotional tendency coefficient; inputting the theme text into a chaffy judgment model to obtain a chaffy result; obtaining an emotion result according to an emotion tendency degree and a chief result, relates to the technical field of language analysis, and solves the technical problem that before evaluation content is evaluated, a large number of texts need to be segmented and screened, otherwise, whether the emotion tendency of the texts belongs to the same evaluation subject cannot be judged; a plurality of evaluation themes in an evaluation text are obtained, the evaluation text is segmented into a plurality of theme texts according to the evaluation themes, each theme text is analyzed, and finally, according to the emotion inclination degree and a gurnor judgment model, comprehensive evaluation of an evaluator on articles in the evaluation themes can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of language analysis, and in particular relates to a natural language processing method for sentiment analysis. Background Art

[0002] The emergence of computer text analysis technology has made it possible to analyze large-scale and diverse text content, and has also promoted the development of sentiment analysis technology. Sentiment analysis technology is a branch of text analysis. It classifies the emotional colors, emotions and attitudes contained in the text to help people quickly understand the text content and the emotional experience of the author. Sentiment analysis has been widely used in product reviews, customer feedback and other fields.

[0003] The prior art (invention patent application with publication number CN108009297A) discloses a text sentiment analysis method and system based on natural language processing. The patent application mainly judges the sentiment subject and the sentiment tendency of the subject of the text to be identified according to a preset sentiment vocabulary comparison table; and judges the sentiment tendency of the text to be identified according to the sentiment subject and the sentiment tendency of the subject of the text to be identified; and the current texts often contain a large amount of evaluation content. Therefore, before evaluating the evaluation content, a large amount of text needs to be segmented and screened, otherwise it is impossible to judge whether the sentiment tendency of the text belongs to the same evaluation theme, which results in a large workload for the staff. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a natural language processing method for sentiment analysis, which is used to solve the technical problem that before evaluating the evaluation content, a large amount of text needs to be segmented and screened, otherwise it is impossible to judge whether the sentiment tendency of the text belongs to the same evaluation theme, resulting in confusion in the analysis content. The present invention obtains multiple evaluation themes in the evaluation text and divides the evaluation text into multiple theme texts according to the evaluation theme, so as to obtain the evaluator's emotion for each evaluation theme, and analyze each theme text separately, and finally obtains the evaluator's comprehensive evaluation of the items in the evaluation theme according to the emotional infatuation degree and the irony judgment model to solve the above-mentioned problem.

[0005] To achieve the above object, a first aspect of the present invention provides a natural language processing method for sentiment analysis, comprising:

[0006] Step 1: extract the evaluation text to be identified, obtain several sentences in the evaluation text, and then pre-process the several sentences to obtain evaluation features; wherein the evaluation features include evaluation topics and related words;

[0007] Step 2: Extract the sentiment words of the associated words in the sentence segment, obtain the lexical tendency score of the sentiment words based on the sentiment dictionary, and obtain the sentiment tendency coefficient of the sentence segment based on the lexical tendency score and the associated words; where the lexical tendency score Qf∈[-1,1];

[0008] Step 3: Extract sentences with the same evaluation topic and integrate them into the topic text, obtain the emotional tendency degree of the topic text based on the emotional tendency coefficient; input the topic text into the irony judgment model to obtain the irony result; obtain the emotional result according to the emotional tendency degree and the irony result, wherein the irony judgment model is established based on the classification training model, the irony results include irony and non-irony; the emotional results include positive emotion and negative emotion.

[0009] Preferably, the step of obtaining a plurality of sentences in the evaluation text and then preprocessing the plurality of sentences to obtain evaluation features includes:

[0010] Extract the evaluation text and segment the text data into several sentences according to punctuation marks;

[0011] Segment the sentences using natural language processing tools to obtain a number of words; tag the words with parts of speech, and remove the words with stop words to obtain standard words;

[0012] Mark the object nouns in the standard vocabulary as evaluation topics, and extract related words in the standard vocabulary; the natural language processing tool can be the jieba library in Python; stop words are parts of speech that do not contribute to the meaning of the text, stop words include prepositions, pronouns, determiners, emoticons, etc., and related words include emotional words, degree adverbs and transitional words, etc.; the evaluation topics include objects and object parameters.

[0013] Preferably, the acquiring of the vocabulary tendency score of the sentiment word based on the sentiment dictionary includes:

[0014] Input the sentiment words into the synonym dictionary to obtain sentiment synonyms corresponding to the sentiment words;

[0015] Input sentiment words and sentiment synonyms into the sentiment dictionary to obtain sentiment scores of the corresponding words;

[0016] Determine whether there is a 0 score in the sentiment scores of sentiment words and sentiment synonyms;

[0017] No, count the total number Zs and total score Zf of sentiment words and sentiment synonyms, and calculate the vocabulary tendency score by the formula Qf=Zf / Zs;

[0018] Yes, remove the sentiment words or sentiment synonyms corresponding to 0 points to obtain the evaluable words, count the number of evaluable words Zk and the evaluable scores Pk, and calculate the vocabulary tendency score Qf through the formula Qf=Pk / Zk.

[0019] It should be noted that when there is no corresponding word in the sentiment dictionary, the sentiment score of the corresponding word is 0, and the vocabulary tendency is divided into, and the sentiment score corresponding to the positive sentiment word is a positive number, and the sentiment score corresponding to the negative sentiment word is a negative number.

[0020] The above method can avoid the situation where network terms cannot obtain corresponding sentiment scores in the sentiment dictionary, resulting in the inability to accurately obtain the evaluator's evaluation sentiment. It also avoids the staff from updating the sentiment dictionary scores. This method only needs to update the existing synonym dictionary to improve its accuracy. At the same time, the synonyms obtained are not limited to one synonym.

[0021] Preferably, the sentiment tendency coefficient of the sentence segment is obtained based on the vocabulary tendency score and the associated vocabulary, including:

[0022] Extract the degree adverbs in the associated vocabulary, associate the degree adverbs with sentiment words according to the degree score Cf corresponding to the matching degree adverbs in the adverb-score mapping table, obtain the associated vocabulary, and calculate the sentiment tendency coefficient QX of the sentence segment by the formula QX=∑Cfi·Qfi; wherein each adverb in the adverb-score mapping table corresponds to a score, and the adverb-score mapping table is set by language experts according to the degree of expression of the degree adverb, Cfi is the degree score of the i-th degree adverb in the sentence segment, Qfi is the lexical tendency score of the sentiment word that is the associated vocabulary with the i-th degree adverb, and i is a positive integer.

[0023] Preferably, the step of associating degree adverbs with sentiment words to obtain associated words includes:

[0024] Respectively obtain the position information of the sentiment words and degree adverbs in the sentence segmentation; the position information is the character sequence number corresponding to the first character of the sentiment words or degree adverbs in the same sentence segmentation;

[0025] The position information differences between the sentiment word and several degree adverbs are calculated respectively, and the degree adverb corresponding to the minimum value of the position information difference is marked as the associated adverb of the sentiment word.

[0026] Preferably, obtaining the degree of sentiment tendency of the topic text based on the sentiment tendency coefficient includes:

[0027] S1: Extract the sentiment coefficients of several sentences in the topic text and mark them as QXj; where j is a positive integer; QXj is the sentiment coefficient of the jth sentence;

[0028] S2: Determine whether there is a transition word in the topic text; if not, add up the sentiment tendency coefficients QXj of several sentences to obtain the sentiment tendency degree QCz; if yes, extract the sentences before the transition word and the sentences after the transition word respectively, and mark them as the first sentiment sentence and the second sentiment sentence respectively; obtain the sentiment tendency degree QCz of the topic text based on the first sentiment sentence and the second sentiment sentence.

[0029] Preferably, the step of acquiring the emotional tendency of the subject text based on the first emotional sentence and the second emotional sentence includes:

[0030] Calculate the sum of the emotional tendency coefficients of the sentences interrupted by the first emotional sentence and the sum of the emotional tendency coefficients of the sentences interrupted by the second emotional sentence respectively, and mark them as QCq and QCh respectively, and calculate the emotional tendency degree QCz by the formula QCz=a1×QCq+a2×QCh; wherein a1 and a2 are preset weight coefficients respectively, and the weight coefficients a1 and a2 are obtained based on the first emotional sentence and the second emotional sentence.

[0031] Preferably, the weight coefficients a1 and a2 are obtained based on the first emotional sentence and the second emotional sentence, including:

[0032] Count the number of interrupted sentences in the first emotional sentence and the number of interrupted sentences in the second emotional sentence, and mark them as m and n respectively;

[0033] Compare m / (m+n) and n / (m+n); if m / (m+n) is greater than n / (m+n), assign the value of m / (m+n) to a2 and n / (m+n) to a1; otherwise, assign m / (m+n) to a1 and n / (m+n) to a2.

[0034] Preferably, the irony judgment model is established based on a classification training model, including:

[0035] Obtain several subject texts, evaluation topics and corresponding ironic results through the database;

[0036] Several topic texts and evaluation topics are integrated into several groups of training data, and the several groups of training data are input into a convolutional neural network for training, so as to obtain an irony judgment model with the topic text and the evaluation topic as input and the irony result as output.

[0037] Preferably, obtaining the emotional result according to the emotional tendency degree and the irony result includes:

[0038] Extract the emotional tendency degree and irony result corresponding to the subject text; judge whether the irony result is positive irony; if yes, mark the emotional tendency degree as the evaluation score; if no, mark the opposite of the emotional tendency degree as the evaluation score;

[0039] The evaluation score is compared with the scoring threshold. If the evaluation score is greater than the scoring threshold, the topic text is marked as positive sentiment, otherwise, the topic text is marked as negative sentiment.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] (1) In the present invention, by obtaining multiple evaluation topics in the evaluation text and dividing the evaluation text into multiple topic texts according to the evaluation topics, the evaluator's emotion on each evaluation topic can be obtained, and each topic text is analyzed separately, so as to more accurately understand the evaluator's emotional inclination towards each evaluation topic, while saving a lot of working time for segmented screening. Finally, according to the emotional inclination degree and the irony judgment model, the evaluator's comprehensive evaluation of the items in the evaluation topic can be obtained, and the total emotion on the items can be obtained. Moreover, according to the irony judgment model, it can be judged whether the evaluation text expresses the opposite meaning, so as to avoid misunderstanding the evaluator's intended meaning.

[0042] (2) Usually, texts often contain a large number of Internet terms. In the present invention, by obtaining synonyms of emotions from a synonym dictionary and inputting the synonyms into a sentiment dictionary, it is possible to avoid the inability of Internet terms to obtain corresponding sentiment scores in the sentiment dictionary, resulting in the inability to accurately obtain the evaluator's evaluation emotions. At the same time, it also avoids the staff from updating the sentiment dictionary scores. This method only needs to update the existing synonym dictionary to improve its accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 It is a schematic diagram of the processing flow of the present invention;

[0045] Figure 2 A logical schematic diagram for obtaining vocabulary tendency scores in the present invention;

[0046] Figure 3 It is a logical schematic diagram of the degree of emotional tendency in the present invention. DETAILED DESCRIPTION

[0047] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] See also Figure 1-Figure 3 The first aspect of the present invention provides a natural language processing method for sentiment analysis, comprising:

[0049] Step 1: extract the evaluation text to be identified, obtain several sentences in the evaluation text, and then pre-process the several sentences to obtain evaluation features; wherein the evaluation features include evaluation topics and related words;

[0050] Step 2: Extract the sentiment words of the associated words in the sentence segment, obtain the lexical tendency score of the sentiment words based on the sentiment dictionary, and obtain the sentiment tendency coefficient of the sentence segment based on the lexical tendency score and the associated words; where the lexical tendency score Qf∈[-1,1];

[0051] Step 3: Use SnowNLP to extract sentences with the same evaluation topic according to the semantics of the evaluation text, and integrate them into the topic text, and obtain the emotional tendency degree of the topic text based on the emotional tendency coefficient; input the topic text into the irony judgment model to obtain the irony result; obtain the emotional result based on the emotional tendency degree and the irony result, wherein the irony judgment model is established based on the classification training model, and the irony results include irony and non-irony; the emotional results include positive emotions and negative emotions.

[0052] By obtaining multiple evaluation topics in the evaluation text and dividing the evaluation text into multiple topic texts according to the evaluation topics, the evaluator's sentiment towards each evaluation topic can be obtained. In practical applications, not only can the evaluation texts of different content types be analyzed and compared, but each evaluation topic can also be analyzed separately, so as to more accurately understand the evaluator's sentiment towards each evaluation topic. Moreover, according to the irony judgment model, it can be judged whether the evaluation text expresses the opposite meaning, so as to avoid misunderstanding the evaluator's meaning.

[0053] In step 1 of this embodiment, after obtaining a number of sentences in the evaluation text, the several sentences are preprocessed to obtain evaluation features, including:

[0054] Extract the evaluation text and segment the text data into several sentences according to punctuation marks;

[0055] The sentence segments are segmented using the jieba library tool in Python to obtain several words; the parts of speech are tagged for several words, and meaningless stop words such as prepositions, pronouns, determiners, and emoticons are removed to obtain standard words;

[0056] Mark the object nouns in the standard vocabulary as evaluation topics, and extract related vocabulary in the standard vocabulary; among them; stop words are parts of speech that do not contribute to the meaning of the text, stop words include prepositions, pronouns, determiners, emoticons, etc., and related vocabulary includes emotional words, degree adverbs and transitional words, etc.

[0057] For example, if the review text is: "This phone has a high screen resolution, but the battery life is not long enough. I played games on the phone for 3-4 hours before it ran out of power. ", segmenting the review text will yield three sentences.

[0058] Sentence 1: This phone has a very high screen resolution;

[0059] Sentence 2: But the battery life is not long enough;

[0060] Sentence 3: After playing games for 3-4 hours, the phone ran out of battery.

[0061] The evaluation topic in the evaluation text is: item - mobile phone, item parameters - screen resolution, battery life, related words: very high, not long enough, out of power, but; stop words: o(╥﹏╥)o; and when classifying the evaluation content, the items in the evaluation topic can be used as the classification standard or basis.

[0062] The step 2 of this embodiment of obtaining the vocabulary tendency score of the sentiment word based on the sentiment dictionary includes:

[0063] Input the sentiment words into the synonym dictionary to obtain sentiment synonyms corresponding to the sentiment words;

[0064] Input sentiment words and sentiment synonyms into the sentiment dictionary to obtain sentiment scores of the corresponding words;

[0065] Example sentence segmentation: But the battery life is not long enough; Specifically, the sentiment word "not long enough" is input into the synonym dictionary to obtain its sentiment synonym "short-lived". These sentiment words and their synonyms are input into the sentiment dictionary to obtain the corresponding sentiment scores. The score of "not long enough" is -0.5, and the score of its synonym "short-lived" is also -0.5;

[0066] There is no 0 score in the sentiment scores of sentiment words and sentiment synonyms;

[0067] The total number of sentiment words and sentiment synonyms Zs=2 and the total score Zf=-1 are counted, and the vocabulary tendency score is calculated by the formula Qf=Zf / Zs=-0.5.

[0068] Furthermore, the sentiment tendency coefficient of the sentence segment is obtained based on the vocabulary tendency score and the associated vocabulary, including:

[0069] Extract the degree adverb "not enough" from the associated vocabulary, and according to the degree score Cf=-2 corresponding to the matching degree adverb in the adverb-score mapping table, associate the degree adverb with the sentiment word to obtain the associated vocabulary "not long enough", and calculate the sentiment tendency coefficient QX=-1 of the sentence segmentation through the formula QX=∑Cf1·Qf1;

[0070] Among them, each adverb in the adverb-score mapping table corresponds to a score, and the adverb-score mapping table is set by language experts according to the degree of expression of the degree adverb. Cf1 is the degree score of the degree adverb "not enough" in the sentence, and Qf1 is the lexical tendency score of the sentiment word associated with the degree adverb "not enough".

[0071] Specifically, after associating degree adverbs with sentiment words, associated words are obtained, including:

[0072] Respectively obtain the position information of the sentiment words and degree adverbs in the sentence segmentation; the position information is the character sequence number corresponding to the first character of the sentiment words or degree adverbs in the same sentence segmentation;

[0073] The position information differences between the sentiment word and several degree adverbs are calculated respectively, and the degree adverb corresponding to the minimum value of the position information difference is marked as the associated adverb of the sentiment word.

[0074] Since “not enough” is closest to “long”, “not enough” is the associated adverb of the sentiment word “long”.

[0075] The step 3 of this embodiment of obtaining the emotional tendency degree of the topic text based on the emotional tendency coefficient includes:

[0076] S1: Extract the sentiment coefficients of several sentences in the topic text and mark them as QXj; where j is a positive integer; specifically, QX1=1, QX2=-1, QX3=-0.5;

[0077] S2: Determine whether there is a transition word in the topic text; if not, add up the sentiment tendency coefficients QXj of several sentences to obtain the sentiment tendency degree QCz; if yes, extract the sentences before the transition word and the sentences after the transition word respectively, and mark them as the first sentiment sentence and the second sentiment sentence respectively; obtain the sentiment tendency degree QCz of the topic text based on the first sentiment sentence and the second sentiment sentence.

[0078] Further, obtaining the emotional tendency of the subject text based on the first emotional sentence and the second emotional sentence includes:

[0079] Calculate the sum of the emotional tendency coefficients of the sentences interrupted by the first emotional sentence and the sum of the emotional tendency coefficients of the sentences interrupted by the second emotional sentence respectively, and mark them as QCq and QCh respectively, and calculate the emotional tendency degree QCz by the formula QCz=a1×QCq+a2×QCh=1 / 3×1+2 / 3×(-1.5)=-1 / 6; wherein a1 and a2 are preset weight coefficients respectively, and the weight coefficients a1 and a2 are obtained based on the first emotional sentence and the second emotional sentence.

[0080] Specifically, the weight coefficients a1 and a2 are obtained based on the first emotional sentence and the second emotional sentence, including:

[0081] Count the number of interrupted sentences in the first emotional sentence and the number of interrupted sentences in the second emotional sentence, and mark them as m=1 and n=2 respectively;

[0082] Assign 1 / 3 to a1 and 2 / 3 to a2.

[0083] It should be noted that the irony judgment model is established based on the classification training model, including:

[0084] Obtain several subject texts, evaluation topics and corresponding ironic results through the database;

[0085] Several topic texts and evaluation topics are integrated into several groups of training data, and the several groups of training data are input into a convolutional neural network for training, so as to obtain an irony judgment model with the topic text and the evaluation topic as input and the irony result as output.

[0086] The step 3 of this embodiment of obtaining the emotional result according to the emotional tendency degree and the irony result includes:

[0087] Extract the emotional tendency degree and irony result corresponding to the subject text; judge whether the irony result is positive irony; if yes, mark the emotional tendency degree as the evaluation score; if no, mark the opposite of the emotional tendency degree as the evaluation score;

[0088] Since the above content has no ironic effect, the evaluation score is -1 / 6;

[0089] The evaluation score is compared with the scoring threshold of 0 points, and the evaluation score is less than the scoring threshold, so the topic text has negative sentiment.

[0090] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.

[0091] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A natural language processing method for sentiment analysis, characterized in that: include: Step 1: extract the evaluation text to be identified, obtain several sentences in the evaluation text, and then pre-process the several sentences to obtain evaluation features; wherein the evaluation features include evaluation topics and related words; Step 2: Extract the sentiment words of the associated words in the sentence segment, obtain the lexical tendency score Qf of the sentiment words based on the sentiment dictionary, and obtain the sentiment tendency coefficient of the sentence segment based on the lexical tendency score and the associated words; where the lexical tendency score Qf∈[-1,1]; Step 3: Extract sentences with the same evaluation topic and integrate them into the topic text, obtain the emotional tendency degree of the topic text based on the emotional tendency coefficient; input the topic text into the irony judgment model to obtain the irony result; obtain the emotional result according to the emotional tendency degree and the irony result, wherein the irony judgment model is established based on the classification training model, the irony results include irony and non-irony; the emotional results include positive emotion and negative emotion.

2. The natural language processing method for sentiment analysis according to claim 1, characterized in that: After obtaining a plurality of sentences in the evaluation text, preprocessing the plurality of sentences to obtain evaluation features includes: Extract the evaluation text and segment the text data into several sentences according to punctuation marks; Segment the sentences using natural language processing tools to obtain a number of words; tag the words with parts of speech, and remove the words with stop words to obtain standard words; The object nouns in the standard vocabulary are marked as evaluation topics, and the related words in the standard vocabulary are extracted; the natural language processing tool is the jieba library in Python; stop words are parts of speech that do not contribute to the meaning of the text, and the related words include sentiment words, degree adverbs and transition words.

3. The natural language processing method for sentiment analysis according to claim 1, characterized in that: The step of obtaining the vocabulary tendency score of the sentiment words based on the sentiment dictionary includes: Input the sentiment words into the synonym dictionary to obtain sentiment synonyms corresponding to the sentiment words; Input sentiment words and sentiment synonyms into the sentiment dictionary to obtain sentiment scores of the corresponding words; Determine whether there is a 0 score in the sentiment scores of sentiment words and sentiment synonyms; No, count the total number Zs and total score Zf of sentiment words and sentiment synonyms, and calculate the vocabulary tendency score Qf by the formula Qf=Zf / Zs; Yes, remove the sentiment words or sentiment synonyms corresponding to 0 points to obtain the evaluable words, count the number of evaluable words Zk and the evaluable scores Pk, and calculate the vocabulary tendency score Qf through the formula Qf=Pk / Zk.

4. The natural language processing method for sentiment analysis according to claim 1, characterized in that: The sentiment tendency coefficient of the sentence segment obtained based on the vocabulary tendency score and the associated vocabulary includes: Extract the degree adverbs in the associated vocabulary, and associate the degree adverbs with sentiment words according to the degree score Cf corresponding to the matching degree adverbs in the adverb-score mapping table to obtain the associated vocabulary, and calculate the sentiment tendency coefficient QX of the sentence segment by the formula QX=∑Cfi·Qfi; wherein each adverb in the adverb-score mapping table corresponds to a score, Cfi is the degree score of the i-th degree adverb in the sentence segment, Qfi is the lexical tendency score of the sentiment word that is the associated vocabulary with the i-th degree adverb, and i is a positive integer.

5. The natural language processing method for sentiment analysis according to claim 4, characterized in that: The associated words obtained by associating the degree adverbs with the sentiment words include: Respectively obtain the position information of the sentiment words and degree adverbs in the sentence segmentation; the position information is the character sequence number corresponding to the first character of the sentiment words or degree adverbs in the same sentence segmentation; The position information differences between the sentiment word and several degree adverbs are calculated respectively, and the degree adverb corresponding to the minimum value of the position information difference is marked as the associated adverb of the sentiment word.

6. The natural language processing method for sentiment analysis according to claim 1, characterized in that: The step of obtaining the emotional tendency degree of the topic text based on the emotional tendency coefficient includes: S1: Extract the sentiment coefficients of several sentences in the topic text and mark them as QXj; where j is a positive integer; S2: Determine whether there is a transition word in the topic text; if not, add up the sentiment tendency coefficients QXj of several sentences to obtain the sentiment tendency degree QCz; if yes, extract the sentences before the transition word and the sentences after the transition word respectively, and mark them as the first sentiment sentence and the second sentiment sentence respectively; obtain the sentiment tendency degree QCz of the topic text based on the first sentiment sentence and the second sentiment sentence.

7. The natural language processing method for sentiment analysis according to claim 6, characterized in that: The step of acquiring the emotional tendency of the subject text based on the first emotional sentence and the second emotional sentence includes: Calculate the sum of the emotional tendency coefficients of the sentences interrupted by the first emotional sentence and the sum of the emotional tendency coefficients of the sentences interrupted by the second emotional sentence respectively, and mark them as QCq and QCh respectively, and calculate the emotional tendency degree QCz by the formula QCz=a1×QCq+a2×QCh; wherein a1 and a2 are preset weight coefficients respectively, and the weight coefficients a1 and a2 are obtained based on the first emotional sentence and the second emotional sentence.

8. The natural language processing method for sentiment analysis according to claim 7, characterized in that: The weight coefficients a1 and a2 are obtained based on the first emotional sentence and the second emotional sentence, including: Count the number of interrupted sentences in the first emotional sentence and the number of interrupted sentences in the second emotional sentence, and mark them as m and n respectively; Compare m / (m+n) and n / (m+n); if m / (m+n) is greater than n / (m+n), assign the value of m / (m+n) to a2 and n / (m+n) to a1; otherwise, assign n / (m+n) to a1 and m / (m+n) to a2.

9. The natural language processing method for sentiment analysis according to claim 1, characterized in that: The irony judgment model is established based on a classification training model, including: Obtain several subject texts, evaluation topics and corresponding ironic results through the database; Several topic texts and evaluation topics are integrated into several groups of training data, and the several groups of training data are input into a convolutional neural network for training, so as to obtain an irony judgment model with the topic text and the evaluation topic as input and the irony result as output.

10. The natural language processing method for sentiment analysis according to claim 1, characterized in that: The obtaining of the emotional result according to the emotional tendency degree and the irony result includes: Extract the emotional tendency degree and irony result corresponding to the subject text; judge whether the irony result is positive irony; if yes, mark the emotional tendency degree as the evaluation score; if no, mark the opposite of the emotional tendency degree as the evaluation score; The evaluation score is compared with the scoring threshold. If the evaluation score is greater than the scoring threshold, the topic text is marked as positive sentiment, otherwise, the topic text is marked as negative sentiment.

Citation Information

Patent Citations

  • Text sentiment analysis method and system based on natural language processing

    CN108009297A