Comment text sentiment analysis method and device

By extracting and analyzing the fine-grained sentiment tendencies of multiple target feature objects in the comment text, the problem of identifying multiple sentiment tendency polarities in the same comment text is solved, and a comprehensive analysis of the corporate user sentiment is achieved.

CN115438668BActive Publication Date: 2025-10-03CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211228009.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-09
Publication Date
2025-10-03
Estimated Expiration
2042-10-09

AI Technical Summary

Technical Problem

Existing sentiment analysis methods cannot effectively handle the analysis of multiple different sentiment polarities in the same review text.

Method used

By obtaining multiple target feature objects in the comment text, using the pre-trained language model and conditional random field algorithm to extract features, constructing the target feature text and performing fine-grained sentiment analysis, we can comprehensively analyze multiple sentiment tendency polarities.

Benefits of technology

It can effectively identify and reflect the different sentiment polarities of multiple target features in review texts, and support companies in obtaining user sentiment information in word-of-mouth analysis and service optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115438668B_ABST
    Figure CN115438668B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for analyzing the sentiment tendency of a comment text. The method comprises: obtaining a comment text to be analyzed and extracting multiple target feature objects from the comment text to be analyzed; determining the target features corresponding to each target feature object from a preset feature dictionary to obtain a target feature set; for each target feature object, constructing a target feature text corresponding to the target feature object based on the comment text to be analyzed, the target feature object, and the target features corresponding to the target feature object; performing fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results; determining a target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, which is used to reflect the target sentiment tendency polarity of each target feature in the target feature set. The present application solves the technical problem in related technologies that it is impossible to effectively analyze multiple different sentiment tendency polarities in the same comment text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and more specifically, to a method and device for analyzing the sentiment tendency of comment texts. Background Art

[0002] Currently, online customer service systems generate massive amounts of textual data daily, including post-conversation user and customer service satisfaction ratings. Companies need to capture user sentiment regarding various attributes, such as the company's business and customer service, from this data to conduct word-of-mouth analysis, business upgrades, and service optimization. Therefore, feature-level sentiment analysis is crucial. However, most current sentiment analysis methods focus solely on analyzing a single sentiment within a text, but are unable to effectively analyze text containing multiple, distinct sentiment polarities.

[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0004] The embodiments of the present application provide a method and device for analyzing the sentiment tendency of a comment text, so as to at least solve the technical problem in the related art that multiple different sentiment tendency polarities in the same comment text cannot be effectively analyzed.

[0005] According to one aspect of an embodiment of the present application, a method for analyzing the sentiment tendency of a comment text is provided, including: obtaining a comment text to be analyzed, and extracting multiple target feature objects from the comment text to be analyzed; determining a target feature corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes a mapping relationship between multiple feature objects and multiple features; for each target feature object, constructing a target feature text corresponding to the target feature object based on the comment text to be analyzed, the target feature object and the target feature corresponding to the target feature object; performing fine-grained sentiment analysis on each target feature text respectively to obtain multiple sentiment tendency analysis sub-results; determining a target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

[0006] Optionally, a preset feature extraction model is used to extract multiple target feature objects in the comment text to be analyzed to obtain a target feature object set; wherein the feature extraction model is a model obtained by training a pre-trained language model based on historical comment text using bidirectional feature representation and a conditional random field algorithm.

[0007] Optionally, a preset feature unification model is used to determine the target features corresponding to each target feature object from the feature dictionary to obtain a target feature set; wherein the feature unification model includes a text similarity analysis model and a feature dictionary, and the text similarity analysis model is a model based on historical review text and trained by a convolutional neural network algorithm.

[0008] Optionally, for any target feature object, the target feature object is compared with multiple feature objects in the feature dictionary using a text similarity analysis model; when there is a first feature object identical to the target feature object in the feature dictionary, the feature corresponding to the first feature object is used as the target feature corresponding to the target feature object; when there is no first feature object identical to the target feature object in the feature dictionary, the second feature object with the highest similarity to the target feature object is determined in the feature dictionary, and the feature corresponding to the second feature object is used as the target feature corresponding to the target feature object.

[0009] Optionally, for each target feature object, the comment text to be analyzed is divided into the first half of the comment text and the second half of the comment text based on the position of the target feature object in the comment text to be analyzed; based on the first half of the comment text, the second half of the comment text, the target feature object and the target features corresponding to the target feature object, a target feature text corresponding to the target feature object is constructed; wherein the target feature text also includes: a semantic characterizer, a text delimiter, a position identifier for reflecting the position of the target feature object in the comment text to be analyzed, and a mapping relationship identifier for reflecting the mapping relationship between the target feature object and the target feature.

[0010] Optionally, a preset sentiment analysis model is used to perform fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results, wherein each sentiment tendency analysis sub-result includes the confidence of multiple sentiment tendency polarities, and the sentiment tendency polarity includes at least one of the following: positive, neutral, and negative; wherein the sentiment analysis model is a model trained based on historical comment text through a pre-trained language model with bidirectional feature representation.

[0011] Optionally, for each target feature, multiple target feature objects corresponding to the target feature are determined, and the average confidence values ​​of each emotional tendency polarity of the multiple target feature objects are calculated respectively to obtain the confidence results; the confidence results are converted into the probability distribution of each emotional tendency polarity using a normalized exponential function; and the emotional tendency polarity with the largest probability in the probability distribution is taken as the target emotional tendency polarity of the target feature.

[0012] According to another aspect of an embodiment of the present application, a comment text sentiment tendency analysis device is also provided, including: an acquisition module, used to acquire the comment text to be analyzed, and extract multiple target feature objects in the comment text to be analyzed; a first determination module, used to determine the target features corresponding to each target feature object from a preset feature dictionary, and obtain a target feature set, wherein the feature dictionary includes a mapping relationship between multiple feature objects and multiple features; a construction module, used to construct a target feature text corresponding to the target feature object for each target feature object based on the comment text to be analyzed, the target feature object and the target features corresponding to the target feature object; an analysis module, used to perform fine-grained sentiment analysis on each target feature text respectively, and obtain multiple sentiment tendency analysis sub-results; a second determination module, used to determine the target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is also provided, which includes a stored program, wherein the device where the non-volatile storage medium is located executes the above-mentioned comment text sentiment tendency analysis method by running the program.

[0014] According to another aspect of an embodiment of the present application, an electronic device is also provided, which includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned comment text sentiment tendency analysis method through the computer program.

[0015] In an embodiment of the present application, first, the comment text to be analyzed is obtained, and multiple target feature objects in the comment text to be analyzed are extracted; then, the target features corresponding to each target feature object are determined from a preset feature dictionary to obtain a target feature set; for each target feature object, based on the comment text to be analyzed, the target feature object and the target features corresponding to the target feature object, a target feature text corresponding to the target feature object is constructed; then, fine-grained sentiment analysis is performed on each target feature text respectively to obtain multiple sentiment tendency analysis sub-results; finally, the target sentiment tendency analysis result of the comment text to be analyzed is determined based on the multiple sentiment tendency analysis sub-results. Among them, after extracting the feature objects in the comment text, the feature objects corresponding to the same target feature are first classified, and after fine-grained sentiment analysis is performed on each feature object, the sentiment tendency polarities of the multiple feature objects corresponding to the same target feature are comprehensively analyzed. The final result obtained can reflect the different sentiment tendency polarities of the multiple target features in the comment text, thereby solving the technical problem in the related art that multiple different sentiment tendency polarities in the same comment text cannot be effectively analyzed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 This is a flowchart of an optional method for analyzing sentiment tendency of comment text according to an embodiment of the present application;

[0018] Figure 2 is a schematic diagram of an optional unified target feature process according to an embodiment of the present application;

[0019] Figure 3 This is a schematic diagram of an optional process for analyzing target sentiment tendency analysis results according to an embodiment of the present application;

[0020] Figure 4 It is a structural diagram of an optional comment text sentiment tendency analysis device according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0022] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0023] In order to better understand the embodiments of the present application, some nouns or terms that appear in the description of the embodiments of the present application are first translated and explained as follows:

[0024] BERT (Bidirectional Encoder Representation from Transformers) is a pre-trained language representation model based on bidirectional feature representation. The structure of traditional pre-trained models is limited by unidirectional language models (from left to right or from right to left), which also limits the representation ability of the model, so that it can only obtain unidirectional context information. BERT uses MLM (Masked Language Mode) for pre-training and adopts a deep bidirectional Transformer component (a unidirectional Transformer is generally called a Transformer decoder, and each token is only added to the current left token; while a bidirectional Transformer is called a Transformer encoder, and each token is added to all tokens) to build the entire model, thus ultimately generating a deep bidirectional language representation that can integrate left and right context information.

[0025] CRF (Conditional Random Fields): Combining the characteristics of maximum entropy models and hidden Markov models, it is an undirected graph model commonly used to annotate or analyze sequence data, such as natural language text or biological sequences. CRF is a discriminant model best suited for prediction tasks, where adjacent contextual information or states influence the current prediction. Therefore, it has applications in named entity recognition, part-of-speech tagging, gene prediction, noise reduction, and object detection.

[0026] Fine-grained Sentiment Analysis (ABSA): Sentiment analysis methods are typically divided into paragraph / sentence-level sentiment analysis and fine-grained sentiment analysis, based on the granularity of sentiment polarity. Generally speaking, the objectives of fine-grained sentiment analysis revolve around three key elements: attributes (Aspect Term), opinions (Opinion Term), and sentiment (Sentiment Polarity). This can be broken down into three cascaded tasks: attribute extraction, opinion extraction, and sentiment determination for attribute-opinion pairs. For example, given a user review like "This restaurant has a nice environment, but poor service," the expected outputs are (Environment, good, positive) and (Service, poor, negative).

[0027] Example 1

[0028] In related technologies, when performing sentiment analysis on text, feature-level sentiment analysis is usually used. It is an analysis based on the content of the text and the target information in the text, and can clearly identify sentiment tendencies based on the relevant attribute features of a certain thing. For example, the method of combining the pre-trained language model BERT and the conditional random field CRF can effectively solve the task of extracting entities from sentiment features; the AEN (Attentional Encoder Network) method provides a high-performance fine-grained sentiment analysis; the LCF (Local Context Focus) method is combined with the self-attention mechanism to implement a feature-level local context focusing mechanism to improve the effect of sentiment polarity classification. However, the above methods only consider the situation where a single evaluation feature in the text corresponds to a single sentiment description.

[0029] In order to solve the above problems, an embodiment of the present application provides a method for analyzing the sentiment tendency of comment texts based on multiple features of semantic understanding. After extracting the feature objects in the comment text, the method first classifies the feature objects corresponding to the same target feature, performs fine-grained sentiment analysis on each feature object, and then comprehensively analyzes the sentiment tendency polarities of multiple feature objects corresponding to the same target feature. The final result obtained can reflect the different sentiment tendency polarities of multiple target features in the comment text.

[0030] The following describes the method for analyzing the sentiment tendency of comment texts according to an embodiment of the present application in conjunction with the accompanying drawings, wherein the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0031] Figure 1 This is a flow chart of an optional method for analyzing sentiment tendency of comment text according to an embodiment of the present application. Figure 1 As shown, the method includes at least steps S102-S110, wherein:

[0032] Step S102: obtaining the comment text to be analyzed, and extracting a plurality of target feature objects from the comment text to be analyzed.

[0033] The comment text to be analyzed may be a user comment text from an enterprise customer service evaluation system or a product service evaluation platform, and may be recorded as s=input_sentence.

[0034] As an optional implementation, a preset feature extraction model can be used to extract multiple target feature objects from the comment text to be analyzed, and a target feature object set is obtained, which is recorded as Entities = {e0, e1, ..., e m}, m∈N, where e i (i=0,1,…,m) is the target feature object output by the model, and m is the number of target feature objects extracted.

[0035] Optionally, the feature extraction model is a model trained based on historical review text using a pre-trained language model BERT for bidirectional feature representation and a conditional random field (CRF) algorithm.

[0036] Step S104 : determining the target feature corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes mapping relationships between multiple feature objects and multiple features.

[0037] An optional feature dictionary format is: Dict(L,values), where L = {l0,l1,…,l q}(q∈N) is a set of predefined features, and values ​​is a set of predefined feature objects corresponding to each feature in L.

[0038] As an optional implementation, a preset feature unified model can be used to determine the target feature corresponding to each target feature object from the feature dictionary to obtain a target feature set, which is recorded as Targets = {t0, t1, ..., t m}, m∈N, t i ∈L, i=0,1,…,m. The unified feature model includes a text similarity analysis model and a feature dictionary. The text similarity analysis model is a model trained by a convolutional neural network (CNN) algorithm based on historical review texts.

[0039] Specifically, for any target feature object, the text similarity analysis model can be used to compare the target feature object with multiple feature objects in the feature dictionary; when there is a first feature object identical to the target feature object in the feature dictionary, the feature corresponding to the first feature object is used as the target feature corresponding to the target feature object; when there is no first feature object identical to the target feature object in the feature dictionary, the second feature object with the highest similarity to the target feature object in the feature dictionary is determined, and the feature corresponding to the second feature object is used as the target feature corresponding to the target feature object.

[0040] Figure 2 A schematic diagram of an optional process of determining a target feature corresponding to a target feature object is shown, and the specific steps are as follows:

[0041] S1, input the target feature object e to be unified i ;

[0042] S2, search for query e in the feature dictionary Dict(L,values) i The corresponding target feature l k ;

[0043] S3, determine the query result Dict Results , if e i Exists in values ​​and has a corresponding target feature l k , then go to step 5, otherwise go to step 4;

[0044] S4, according to the text similarity analysis model, is e i Match the target feature l with the highest similarity in Dict k ;

[0045] S5, output target feature object e i The unified result t i =l k .

[0046] Step S106 : For each target feature object, based on the comment text to be analyzed, the target feature object, and the target features corresponding to the target feature object, construct a target feature text corresponding to the target feature object.

[0047] As an optional implementation, the target feature text set can be constructed by combining Entities and Targets with s: AdjunctTexts = {d0, d1, ..., d m}, m∈N, is used to assist in fine-grained sentiment analysis.

[0048] Specifically, for each target feature object, the comment text to be analyzed is divided into the first half of the comment text and the second half of the comment text based on the position of the target feature object in the comment text to be analyzed; based on the first half of the comment text, the second half of the comment text, the target feature object and the target features corresponding to the target feature object, the target feature text corresponding to the target feature object is constructed; wherein the target feature text also includes: a semantic characterizer, a text delimiter, a position identifier for reflecting the position of the target feature object in the comment text to be analyzed, and a mapping relationship identifier for reflecting the mapping relationship between the target feature object and the target feature.

[0049] Optionally, the target feature text format is d i =[CLS]s left ENTITY right [SEP]e i AKAi [SEP], [CLS] are semantic tokens, [SEP] is a text delimiter, and ENTITY is the target feature object. i The location identifier, AKA the target feature object e i With the target feature t i The mapping relationship identifier, s left and s right The comment text to be analyzed is s according to e i The e obtained after splitting the position in the sentence i The text content before and after.

[0050] Step S108 , performing fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results.

[0051] As an optional implementation, a preset sentiment analysis model can be used to perform fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results, which are recorded as Each sentiment analysis sub-result includes the confidence levels of multiple sentiment polarities, where the sentiment polarities include at least one of the following: positive, neutral, and negative.

[0052] Among them, the sentiment analysis model is a feature-based fine-grained sentiment analysis model based on historical review text and trained by the pre-trained language model BERT with bidirectional feature representation.

[0053] Step S110 , determining a target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

[0054] As an optional implementation, the target sentiment analysis results can be analyzed in the following ways:

[0055] For each target feature, multiple target feature objects corresponding to the target feature are determined, and the average confidence of each emotional tendency polarity of the multiple target feature objects is calculated respectively to obtain the confidence result; the confidence result is converted into the probability distribution of each emotional tendency polarity using the normalized exponential function; the emotional tendency polarity with the largest probability in the probability distribution is taken as the target emotional tendency polarity of the target feature.

[0056] Figure 3 A schematic diagram of an optional process for analyzing the target sentiment analysis results is shown, and the specific steps are as follows:

[0057] S1, input belongs to the target feature lk Multiple target feature objects The confidence set of each sentiment polarity:

[0058] S2, as shown in formula 1, is k The average confidence of the same sentiment tendency polarity of all target feature objects in is calculated to obtain l k The confidence level of each sentiment polarity is as follows:

[0059] S3, as shown in Formula 2 and Formula 3, uses the normalized exponential function softmax to convert O k The confidence values ​​of each sentiment tendency polarity in the equation are transformed into a probability distribution with a range of [0,1] and a sum of 1, and we get l k The probability value set of each sentiment tendency polarity:

[0060]

[0061]

[0062] S4, as shown in formula 4, uses the maximum independent variable method Argmax to obtain P k The sentiment polarity corresponding to the maximum probability value is taken as l k The final fine-grained sentiment tendency r k , output analysis results: {l k :r k =polarity}(polarity∈{positive, neutral, negative}).

[0063]

[0064] The comment text sentiment tendency analysis method in the embodiment of the present application can be applied to many other fields such as user satisfaction analysis, user portrait analysis, public opinion analysis, and sentiment analysis. It helps enterprises obtain user satisfaction information on various dimensions of their business and customer service from comment data, and conduct word-of-mouth analysis, business upgrades, and service optimization.

[0065] The following describes the above-mentioned comment text sentiment analysis method by taking the analysis process of a user review text in an actual operator's customer service evaluation system as an example.

[0066] The user evaluation text is shown in Table 1:

[0067] Table 1

[0068]

[0069] S1, enter the text to be analyzed s="My home broadband used to work well, but recently the network has been unstable and disconnected frequently. It's very convenient to report a problem directly to customer service on WeChat. The technician came to my home to inspect it quickly. Also, the customer service has been very patient. Thumbs up."

[0070] S2, extract features from s through the feature extraction model to obtain the set of all target feature objects of sentiment evaluation in the text: Entities = {Broadband, Network, Repair, Maintenance, Customer Service};

[0071] S3: Unify the features of Entities according to the feature unification model. The specific steps are as follows:

[0072] S3.1, input each target feature object to be unified in Entities = {Broadband, Network, Repair, Maintenance, Customer Service} in sequence;

[0073] S3.2, in the feature dictionary Dict shown in Table 2, search for the target feature corresponding to each target feature object in the query Entities and obtain the query result: Dict Results ={home broadband,home broadband,fault report,NULL,human customer service};

[0074] Table 2

[0075] L values Manual customer service customer service downtime Arrears, service suspension Restart Power on Home broadband Broadband, Internet Report a fault Report a repair, report a fault Troubleshooting repair … …

[0076] S3.3, according to the query result Dict Results , the target feature corresponding to the target feature object "maintenance" is not found in Dict, so S3.4 needs to be executed for it. The query results of the remaining target feature objects "broadband", "network", "repair" and "customer service" can be directly executed in S3.5;

[0077] S3.4, based on the text similarity analysis model, match the target feature object "repair" to obtain the target feature "troubleshooting" with the highest similarity in Dict;

[0078] S3.5, output unified results: Targets = {home broadband, home broadband, fault reporting, troubleshooting, manual customer service}.

[0079] S4, combine Entities and Targets with s to construct the target feature text set: AdjunctTexts = {d0 = [CLS] My home broadband used to work well, but recently the network has been unstable and disconnected frequently. It was very convenient to contact customer service directly on WeChat and the technician came to repair it quickly. In addition, the customer service was very patient. Thumbs up. [SEP] Broadband AKA Home Broadband [SEP], d1 = [CLS] My home broadband used to work well, but recently the network has been unstable and disconnected frequently. It was very convenient to contact customer service directly on WeChat and the technician came to repair it quickly. In addition, the customer service was very patient. Thumbs up. [SEP] Network AKA Home Broadband [SEP], d2 = [CLS] My home broadband used to work well, but recently the network has been unstable and disconnected frequently. It was very convenient to contact customer service directly on WeChat and the technician came to repair it quickly. In addition, the customer service was very patient. Thumbs up. [SEP]Repair AKA Reporting a fault [SEP], d3=[CLS]My home broadband used to work well, but recently the network has been unstable and disconnected frequently. It was very convenient to contact customer service on WeChat to report a problem, and the technician came to my home very quickly. ENTITY, and this customer service has always been very patient. Thumbs up. [SEP]Repair AKA Troubleshooting [SEP], d4=[CLS]My home broadband used to work well, but recently the network has been unstable and disconnected frequently. It was very convenient to contact customer service on WeChat to report a problem, and the technician came to my home to repair it very quickly. ENTITY, and this customer service has always been very patient. Thumbs up. [SEP]Customer service AKA Manual customer service [SEP]};

[0080] S5, based on the sentiment analysis model, performs feature-based fine-grained sentiment analysis on AdjunctTexts to obtain the confidence set of each sentiment tendency polarity of all target feature objects:

[0081]

[0082] S6, based on the multi-emotion polarity combination strategy for a single target feature in the text, multiple emotional tendency polarities of multiple target feature objects corresponding to the same target feature are fused and analyzed. The specific steps are as follows:

[0083] S6.1. Input the sentiment polarity confidence of multiple target feature objects {broadband, network}, {repair}, {repair}, and {customer service} belonging to the target features "home broadband," "trouble reporting," "troubleshooting," and "manual customer service" respectively:

[0084]

[0085]

[0086]

[0087]

[0088] S6.2, for O′ 家庭宽带 The confidence of each sentiment polarity of the target feature "home broadband" is obtained by averaging the confidence of the same sentiment polarity of all target feature objects in the dataset:

[0089]

[0090]

[0091]

[0092]

[0093] In addition, since other target features have only one corresponding target feature object, O 报障 =O′ 报障 , O′ 排障 =O′ 排障 , O′ 人工客服 =O′ 人工客服 ;

[0094] S6.3, according to the normalized exponential function Softmax, O 家庭宽带 , O 报障 , O 排障 and O 人工客服 The confidence values ​​of each sentiment polarity are transformed into a probability distribution in the range [0, 1] and the sum is 1, and the probability values ​​of each sentiment polarity are obtained:

[0095]

[0096]

[0097]

[0098]

[0099] in,

[0100]

[0101]

[0102]

[0103]

[0104]

[0105]

[0106]

[0107]

[0108]

[0109]

[0110]

[0111]

[0112]

[0113]

[0114]

[0115] S6.4, according to the maximum independent variable method Argmax, we can get P 家庭宽带 、P 报障 、P 排障 and P 人工客服 The sentiment polarity corresponding to the maximum probability value is used as the target feature "home broadband", "fault reporting", "troubleshooting" and "manual customer service" for the final fine-grained sentiment tendency r 家庭宽带 、r 报障 、r 排障 and r 人工客服 , output analysis results:

[0116]

[0117]

[0118]

[0119]

[0120] Polarities = {Home broadband: negative, Problem reporting: positive, Troubleshooting: positive, Customer service: positive}

[0121] In an embodiment of the present application, first, the comment text to be analyzed is obtained, and multiple target feature objects in the comment text to be analyzed are extracted; then, the target features corresponding to each target feature object are determined from a preset feature dictionary to obtain a target feature set; for each target feature object, based on the comment text to be analyzed, the target feature object and the target features corresponding to the target feature object, a target feature text corresponding to the target feature object is constructed; then, fine-grained sentiment analysis is performed on each target feature text respectively to obtain multiple sentiment tendency analysis sub-results; finally, the target sentiment tendency analysis result of the comment text to be analyzed is determined based on the multiple sentiment tendency analysis sub-results. Among them, after extracting the feature objects in the comment text, the feature objects corresponding to the same target feature are first classified, and after fine-grained sentiment analysis is performed on each feature object, the sentiment tendency polarities of the multiple feature objects corresponding to the same target feature are comprehensively analyzed. The final result obtained can reflect the different sentiment tendency polarities of the multiple target features in the comment text, thereby solving the technical problem in the related art that multiple different sentiment tendency polarities in the same comment text cannot be effectively analyzed.

[0122] Example 2

[0123] According to the embodiment of the present application, a comment text sentiment tendency analysis device for implementing the comment text sentiment tendency analysis method in embodiment 1 is also provided. Figure 4 As shown, the comment text sentiment analysis device includes at least an acquisition module 41, a first determination module 42, a construction module 43, an analysis module 44 and a second determination module 45, wherein:

[0124] The acquisition module 41 is used to acquire the comment text to be analyzed and extract multiple target feature objects from the comment text to be analyzed.

[0125] The review text to be analyzed may be a user review text from a corporate customer service evaluation system or a product service evaluation platform, etc. As an optional implementation, the acquisition module may use a preset feature extraction model to extract multiple target feature objects from the review text to be analyzed to obtain a target feature object set.

[0126] Optionally, the feature extraction model is a model trained based on historical review text using a pre-trained language model BERT for bidirectional feature representation and a conditional random field (CRF) algorithm.

[0127] The first determining module 42 is configured to determine the target feature corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes mapping relationships between multiple feature objects and multiple features.

[0128] As an optional implementation, the first determination module can use a preset feature unification model to determine the target features corresponding to each target feature object from the feature dictionary to obtain a target feature set, wherein the feature unification model includes a text similarity analysis model and a feature dictionary, and the text similarity analysis model is based on historical review text and is a model trained by a convolutional neural network (CNN) algorithm.

[0129] Specifically, for any target feature object, the first determination module can use the text similarity analysis model to compare the target feature object with multiple feature objects in the feature dictionary; when there is a first feature object identical to the target feature object in the feature dictionary, the feature corresponding to the first feature object is used as the target feature corresponding to the target feature object; when there is no first feature object identical to the target feature object in the feature dictionary, the second feature object with the highest similarity to the target feature object in the feature dictionary is determined, and the feature corresponding to the second feature object is used as the target feature corresponding to the target feature object.

[0130] The construction module 43 is configured to construct, for each target feature object, a target feature text corresponding to the target feature object based on the comment text to be analyzed, the target feature object, and the target features corresponding to the target feature object.

[0131] As an optional implementation method, for each target feature object, the construction module divides the comment text to be analyzed into the first half of the comment text and the second half of the comment text based on the position of the target feature object in the comment text to be analyzed; and constructs the target feature text corresponding to the target feature object based on the first half of the comment text, the second half of the comment text, the target feature object and the target features corresponding to the target feature object; wherein the target feature text also includes: a semantic characterizer, a text delimiter, a position identifier for reflecting the position of the target feature object in the comment text to be analyzed, and a mapping relationship identifier for reflecting the mapping relationship between the target feature object and the target feature.

[0132] The analysis module 44 is used to perform fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results.

[0133] As an optional implementation, the analysis module can use a preset sentiment analysis model to perform fine-grained sentiment analysis on each target feature text separately to obtain multiple sentiment tendency analysis sub-results, wherein each sentiment tendency analysis sub-result includes the confidence of multiple sentiment tendency polarities, and the sentiment tendency polarity includes at least one of the following: positive, neutral, and negative.

[0134] Among them, the sentiment analysis model is a feature-based fine-grained sentiment analysis model based on historical review text and trained by the pre-trained language model BERT with bidirectional feature representation.

[0135] The second determination module 45 is used to determine a target sentiment tendency analysis result of the comment text to be analyzed based on multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

[0136] As an optional implementation, the second determination module can analyze the target sentiment tendency analysis results in the following manner: for each target feature, determine multiple target feature objects corresponding to the target feature, and calculate the average confidence value of each sentiment tendency polarity of the multiple target feature objects to obtain the confidence result; use the normalized exponential function to convert the confidence result into a probability distribution of each sentiment tendency polarity; and take the sentiment tendency polarity with the largest probability in the probability distribution as the target sentiment tendency polarity of the target feature.

[0137] It should be noted that the modules in the comment text sentiment tendency analysis device in the embodiment of the present application correspond one-to-one to the implementation steps of the comment text sentiment tendency analysis method in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be elaborated here.

[0138] Example 3

[0139] According to an embodiment of the present application, a non-volatile storage medium is also provided, which includes a stored program, wherein the device where the non-volatile storage medium is located executes the comment text sentiment tendency analysis method in Example 1 by running the program.

[0140] Specifically, the device where the non-volatile storage medium is located implements the following steps by running the program: obtaining the comment text to be analyzed, and extracting multiple target feature objects in the comment text to be analyzed; determining the target features corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes a mapping relationship between multiple feature objects and multiple features; for each target feature object, based on the comment text to be analyzed, the target feature object and the target features corresponding to the target feature object, constructing a target feature text corresponding to the target feature object; performing fine-grained sentiment analysis on each target feature text respectively to obtain multiple sentiment tendency analysis sub-results; determining the target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

[0141] According to an embodiment of the present application, a processor is also provided, which is used to run a program, wherein the comment text sentiment tendency analysis method in Example 1 is executed when the program is running.

[0142] Specifically, the following steps are executed when the program is running: obtaining the comment text to be analyzed, and extracting multiple target feature objects in the comment text to be analyzed; determining the target features corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes a mapping relationship between multiple feature objects and multiple features; for each target feature object, constructing a target feature text corresponding to the target feature object based on the comment text to be analyzed, the target feature object and the target features corresponding to the target feature object; performing fine-grained sentiment analysis on each target feature text respectively to obtain multiple sentiment tendency analysis sub-results; determining the target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

[0143] According to an embodiment of the present application, an electronic device is also provided, which includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the comment text sentiment tendency analysis method in Example 1 through the computer program.

[0144] Specifically, the processor is configured to execute the following steps through a computer program: obtaining the comment text to be analyzed, and extracting multiple target feature objects from the comment text to be analyzed; determining the target features corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes a mapping relationship between multiple feature objects and multiple features; for each target feature object, based on the comment text to be analyzed, the target feature object and the target features corresponding to the target feature object, constructing a target feature text corresponding to the target feature object; performing fine-grained sentiment analysis on each target feature text respectively to obtain multiple sentiment tendency analysis sub-results; determining a target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

[0145] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0146] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0147] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0148] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0149] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0150] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0151] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for analyzing sentiment tendency of comment text, characterized by: include: Obtaining a review text to be analyzed, and extracting a plurality of target feature objects from the review text to be analyzed; Determining a target feature corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes a mapping relationship between a plurality of feature objects and a plurality of features; For each target feature object, constructing a target feature text corresponding to the target feature object based on the comment text to be analyzed, the target feature object, and the target feature corresponding to the target feature object; Performing fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results; A target sentiment tendency analysis result of the comment text to be analyzed is determined based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

2. The method according to claim 1, characterized in that Extracting multiple target feature objects from the comment text to be analyzed includes: Extracting a plurality of target feature objects from the comment text to be analyzed using a preset feature extraction model to obtain a target feature object set; The feature extraction model is based on historical review texts and is trained using a pre-trained language model with bidirectional feature representation and a conditional random field algorithm.

3. The method according to claim 1, characterized in that Determining target features corresponding to each target feature object from a preset feature dictionary to obtain a target feature set includes: Determining the target feature corresponding to each target feature object from the feature dictionary using a preset feature unification model to obtain the target feature set; The feature unified model includes a text similarity analysis model and the feature dictionary. The text similarity analysis model is a model obtained by training a convolutional neural network algorithm based on historical review texts.

4. The method according to claim 3, characterized in that Determining the target feature corresponding to each target feature object from the feature dictionary using a preset feature unified model includes: For any of the target feature objects, using the text similarity analysis model to compare the target feature object with a plurality of feature objects in the feature dictionary; When there is a first feature object identical to the target feature object in the feature dictionary, taking the feature corresponding to the first feature object as the target feature corresponding to the target feature object; When the first feature object identical to the target feature object does not exist in the feature dictionary, a second feature object having the highest similarity to the target feature object in the feature dictionary is determined, and a feature corresponding to the second feature object is used as the target feature corresponding to the target feature object.

5. The method according to claim 1, wherein For each target feature object, constructing a target feature text corresponding to the target feature object based on the comment text to be analyzed, the target feature object, and the target feature corresponding to the target feature object includes: For each target feature object, dividing the review text to be analyzed into a first half review text and a second half review text based on a position of the target feature object in the review text to be analyzed; Based on the first half of the comment text, the second half of the comment text, the target feature object, and the target feature corresponding to the target feature object, constructing a target feature text corresponding to the target feature object; The target feature text also includes: a semantic characterizer, a text delimiter, a position identifier for reflecting the position of the target feature object in the comment text to be analyzed, and a mapping relationship identifier for reflecting the mapping relationship between the target feature object and the target feature.

6. The method according to claim 1, wherein Perform fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results, including: Using a preset sentiment analysis model, fine-grained sentiment analysis is performed on each target feature text to obtain multiple sentiment tendency analysis sub-results, wherein each sentiment tendency analysis sub-result includes confidence levels of multiple sentiment tendency polarities, and the sentiment tendency polarities include at least one of the following: positive, neutral, and negative; The sentiment analysis model is a model obtained by training a pre-trained language model based on historical review texts using bidirectional feature representation.

7. The method according to claim 6, characterized in that Determining a target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results includes: For each target feature, determining a plurality of target feature objects corresponding to the target feature, and respectively calculating an average of the confidences of each sentiment tendency polarity of the plurality of target feature objects to obtain a confidence result; The confidence result is converted into a probability distribution of each sentiment tendency polarity using a normalized exponential function; The emotional tendency polarity with the highest probability in the probability distribution is used as the target emotional tendency polarity of the target feature.

8. A device for analyzing sentiment tendency of comment text, characterized in that: include: An acquisition module, configured to acquire a comment text to be analyzed and extract a plurality of target feature objects from the comment text to be analyzed; A first determining module is configured to determine a target feature corresponding to each target feature object from a preset feature dictionary to obtain a target feature set, wherein the feature dictionary includes a mapping relationship between a plurality of feature objects and a plurality of features; A construction module, configured to construct, for each target feature object, a target feature text corresponding to the target feature object based on the comment text to be analyzed, the target feature object, and the target feature corresponding to the target feature object; An analysis module is used to perform fine-grained sentiment analysis on each target feature text to obtain multiple sentiment tendency analysis sub-results; The second determination module is used to determine the target sentiment tendency analysis result of the comment text to be analyzed based on the multiple sentiment tendency analysis sub-results, wherein the target sentiment tendency analysis result is used to reflect the target sentiment tendency polarity of each target feature in the target feature set.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein the device where the non-volatile storage medium is located executes the comment text sentiment tendency analysis method according to any one of claims 1 to 7 by running the program.

10. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the comment text sentiment tendency analysis method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Commodity futures news public opinion analysis method and system

    CN110377696A

  • Fine-grained sentiment classification method based on graph neural network

    CN113641822A