Method, device and readable storage medium for analyzing sentiment tendency of commodity comment
By extracting target feature words from product reviews and using the Word2vec model to generate keyword vectors, combining the chi-square coefficient and review coefficient to calculate weights, and using the sentiment tendency analysis model to process the sentiment feature vectors, the problem of low accuracy of sentiment analysis in the existing technology is solved, and more accurate sentiment tendency analysis is achieved.
Patent Information
- Application Number
- CN201910130723.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-02-21
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2039-02-21
AI Technical Summary
In existing text sentiment analysis methods, the presence of negative words and degree adverbs leads to low sentiment analysis accuracy, especially in massive unstructured or semi-structured product review texts, where it is difficult to accurately obtain sentiment tendencies.
By extracting preset target feature words as keywords, using the Word2vec model to generate keyword vectors, combining the chi-square coefficient and comment coefficient to calculate the keyword weight, and using the sentiment tendency analysis model to process the sentiment feature vectors, the sentiment type of the comments is obtained.
The accuracy of sentiment analysis has been improved, enabling more accurate identification of sentiment types in product reviews and providing more valuable user feedback and production guidance.
Smart Images

Figure CN111666757B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet, and particularly relates to a commodity comment sentiment tendency analysis method, device, equipment and readable storage medium. BACKGROUND
[0002] With the rapid development of Internet e-commerce market, more and more users choose to purchase commodities such as bags, computers and mobile phones. Taking mobile phones as an example, users with purchase demand usually browse the comment data of previous purchasers. If positive and positive views are more in the comments of a mobile phone, they will be more inclined to purchase such a mobile phone, otherwise, if there are more negative views in the comments of a mobile phone, users with purchase demand may give up the purchase. In addition, the comment text of the commodity can also provide product information feedback for the manufacturers and sellers, so as to make the manufacturers and sellers improve production and operation, and then make decisions beneficial to market demand. It can be seen that the comment text of the user not only provides opinion reference for potential purchasers, but also provides guidance for the production activities of commodity manufacturers. It is of great significance to mine the sentiment tendency of the comment text of the commodity.
[0003] The existing text sentiment analysis method is mainly based on the analysis of the sentiment dictionary. First, a related sentiment dictionary is established, including negative words and degree adverbs. Then, according to a certain strategy, the text data is processed, and the sentiment value score of a sentence or a chapter is calculated, which is used as the sentiment tendency of the judgment material.
[0004] However, in the text sentiment analysis based on the sentiment dictionary, the existence of negative words and degree adverbs will greatly interfere with the semantics, resulting in low accuracy of sentiment analysis. SUMMARY
[0005] The embodiment of the present application provides a commodity comment sentiment tendency analysis method, device, equipment and readable storage medium, which improves the accuracy of commodity comment sentiment tendency analysis.
[0006] In a first aspect, the embodiment of the present application provides a commodity comment sentiment tendency analysis method, comprising:
[0007] Obtaining a keyword contained in a to-be-processed comment, wherein the keyword is one or more of preset target feature words;
[0008] According to the keyword, obtaining a sentiment feature vector corresponding to the to-be-processed comment;
[0009] Processing the sentiment feature vector of the to-be-processed comment by using a preset sentiment tendency analysis model, and obtaining a sentiment type of the to-be-processed comment.
[0010] Optionally, before the acquiring the keywords contained in the to-be-processed comment, the method further comprises:
[0011] According to the at least one preset classification type and the pre-stored product comment sample, target feature words are acquired, wherein each target feature word is related to the classification type;
[0012] According to the relevance of each target feature word to the classification type corresponding thereto and the position of each target feature word in the product comment sample, a weight corresponding to each target feature word in each product comment sample is acquired, wherein the position of each target feature word in the product comment sample indicates that the target feature word is located in an initial comment of the product comment sample or an additional comment of the product comment sample.
[0013] According to the target feature word vector corresponding to each target feature word, the weight corresponding to each target feature word, and the number of target feature words contained in each product comment sample, a sample feature vector corresponding to each product comment sample is acquired.
[0014] According to the sample feature vector corresponding to each product comment sample and a type label corresponding to each product comment sample, a preset initial classification model is trained to acquire a sentiment tendency analysis model, wherein the type label indicates one of the at least one classification type.
[0015] Optionally, the acquiring the weight corresponding to each target feature word in each product comment sample according to the relevance of each target feature word to the classification type corresponding thereto and the position of each target feature word in the product comment sample comprises:
[0016] A ratio of a chi-square value of each target feature word to a chi-square average value is taken as a chi-square coefficient corresponding to each target feature word, wherein the chi-square average value is an average value of chi-square values of all target feature words of the same classification type as the target feature word, and the chi-square value indicates the relevance of each target feature word to the classification type corresponding thereto.
[0017] According to whether each target feature word is located in an initial comment of a product comment sample or an additional comment of the product comment sample, a comment coefficient corresponding to each target feature word in each product comment sample is determined.
[0018] According to a preset inverse sample frequency corresponding to each target feature word, and the chi-square coefficient, the comment coefficient, and the number of occurrences of each target feature word in each product comment sample, a weight corresponding to each target feature word in each product comment sample is acquired.
[0019] Optionally, the obtaining the target feature word according to the preset at least one classification type and the pre-stored commodity comment sample comprises:
[0020] decomposing the pre-stored commodity comment sample to obtain a plurality of backup words;
[0021] obtaining a basic feature word from the plurality of backup words according to the preset at least one classification type, wherein the basic feature word is a backup word related to the classification type;
[0022] obtaining a synonym of the basic feature word in a preset comment corpus according to the basic feature word, wherein the comment corpus contains words in the commodity comment sample;
[0023] determining the basic feature word and the synonym as the target feature word.
[0024] Optionally, the obtaining the basic feature word from the plurality of backup words according to the preset at least one classification type comprises:
[0025] obtaining a chi-square value corresponding to each backup word in each classification type according to the preset at least one classification type;
[0026] determining a set of relevant feature words for each classification type according to the chi-square value corresponding to each backup word in each classification type and a preset relevant threshold;
[0027] determining the relevant feature words corresponding to all the classification types as the basic feature word.
[0028] Optionally, the obtaining the chi-square value corresponding to each backup word in each classification type according to the preset at least one classification type comprises:
[0029] obtaining a first parameter, a second parameter, a third parameter, a fourth parameter and a word frequency parameter for each backup word, wherein the first parameter is used to indicate the number of times that the backup word appears together with the classification type in the pre-stored commodity comment sample, the second parameter is used to indicate the number of times that the backup word appears and the classification type does not appear in the pre-stored commodity comment sample, the third parameter is used to indicate the number of times that the backup word does not appear and the classification type appears in the pre-stored commodity comment sample, the fourth parameter is used to indicate the number of times that the backup word and the classification type do not appear in the pre-stored commodity comment sample, and the word frequency parameter is used to indicate the ratio of the number of times that the backup word appears in the commodity comment sample corresponding to the classification type to the number of commodity comment samples corresponding to the classification type;
[0030] According to the first parameter, the second parameter, the third parameter, the fourth parameter, the word frequency parameter and the sample total number of the product comment sample of each of the classification types according to each of the backup word, the chi-square value corresponding to each of the backup word in each of the classification types is obtained.
[0031] Optionally, the obtaining of the synonym of the basic feature word in the preset comment corpus according to the basic feature word comprises:
[0032] The basic feature word vector corresponding to the basic feature word is obtained.
[0033] In the preset comment corpus, a synonym feature word vector with a similarity greater than or equal to a preset similarity threshold to the basic feature word vector is obtained.
[0034] The word corresponding to the synonym feature word vector is determined as the synonym of the basic feature word.
[0035] Optionally, the obtaining of the sentiment feature vector corresponding to the to-be-processed comment according to the keyword comprises:
[0036] The keyword vector corresponding to each of the keywords is obtained.
[0037] The chi-square coefficient and the comment coefficient corresponding to each of the keywords in the to-be-processed comment are obtained, and the weight corresponding to each of the keywords in each of the to-be-processed comments is obtained according to the preset inverse sample frequency corresponding to each of the keywords, and the chi-square coefficient, the comment coefficient and the number of occurrences of each of the keywords in each of the to-be-processed comments.
[0038] The sentiment feature vector corresponding to the to-be-processed comment is obtained according to the keyword vector, the weight corresponding to each of the keyword vectors and the number of keywords contained in the to-be-processed comment.
[0039] Optionally, the processing of the sentiment feature vector of the to-be-processed comment by using the preset sentiment tendency analysis model to obtain the sentiment type of the to-be-processed comment comprises:
[0040] The sentiment feature vector of the to-be-processed comment is processed by using the preset sentiment tendency analysis model to obtain a sentiment classification vector.
[0041] The sentiment type of the to-be-processed comment is determined according to the sentiment classification vector.
[0042] Optionally, after the processing of the sentiment feature vector of the to-be-processed comment by using the preset sentiment tendency analysis model to obtain the sentiment type of the to-be-processed comment, the method further comprises:
[0043] A plurality of keywords corresponding to a plurality of to-be-processed comments are obtained.
[0044] According to the preset commodity to be measured characteristics, from the plurality of the keywords, obtain the to-be-measured keyword;
[0045] According to the emotion type corresponding to the to-be-measured keyword, determine the emotion tendency proportion corresponding to the commodity to be measured characteristics.
[0046] The second aspect of the embodiment of the application provides a commodity comment emotion tendency analysis device, comprising:
[0047] A keyword extraction module is used to obtain keywords contained in a to-be-processed comment, wherein the keywords are one or more of preset target feature words;
[0048] A vector processing module is used to obtain an emotion feature vector corresponding to the to-be-processed comment according to the keywords;
[0049] An emotion classification module is used to process the emotion feature vector of the to-be-processed comment by using a preset emotion tendency analysis model, and obtain an emotion type of the to-be-processed comment.
[0050] The third aspect of the embodiment of the application provides a device, comprising a memory, a processor and a computer program, the computer program is stored in the memory, and the processor runs the computer program to execute the commodity comment emotion tendency analysis method of the first aspect and various possible designs of the first aspect.
[0051] The fourth aspect of the embodiment of the application provides a readable storage medium, the readable storage medium stores a computer program, and the computer program is executed by a processor to implement the commodity comment emotion tendency analysis method of the first aspect and various possible designs of the first aspect.
[0052] The commodity comment emotion tendency analysis method, device, equipment and readable storage medium provided by the application obtain keywords contained in a to-be-processed comment, wherein the keywords are one or more of preset target feature words, so that the classification type words that can best reflect a to-be-processed comment are obtained; an emotion feature vector corresponding to the to-be-processed comment is obtained according to the keywords; an emotion type of the to-be-processed comment is obtained by processing the emotion feature vector of the to-be-processed comment by using a preset emotion tendency analysis model, so that the accuracy of emotion tendency analysis is improved. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 is an application scenario schematic diagram provided by the embodiment of the application;
[0054] Figure 2 is a commodity comment emotion tendency analysis method flowchart schematic diagram provided by the embodiment of the application;
[0055] Figure 3 is a process flow diagram of an emotional tendency analysis model provided by an embodiment of the present application;
[0056] Figure 4 is a process flow diagram of an emotional tendency analysis model provided by an embodiment of the present application; Figure 3 is a process flow diagram of an emotional tendency analysis model provided by an embodiment of the present application;
[0057] Figure 5 is a process flow diagram of an emotional tendency analysis model provided by an embodiment of the present application;
[0058] Figure 6 is a process flow diagram of an emotional tendency analysis model provided by an embodiment of the present application;
[0059] Figure 7 is a process flow diagram of an emotional tendency analysis model provided by an embodiment of the present application; DETAILED DESCRIPTION
[0060] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0061] The terms "first", "second", "third", "fourth" and the like (if any) in the description, claims and above drawings of the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0062] It should be understood that, in various embodiments of the present application, the magnitude of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0063] It should be understood that, in the present application, "comprising" and "having" and any variants thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0064] It should be understood that in the present application, "a plurality of" means two or more.
[0065] It should be understood that in the present application, "B corresponding to A", "B corresponding to A", "A corresponding to B" or "B corresponding to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, but B can also be determined according to A and / or other information.
[0066] Depending on the context, "if" as used herein can be interpreted as "when" or "when" or "in response to determining" or "in response to detecting".
[0067] The technical solutions of the present application are described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes may not be described in some embodiments.
[0068] Taking a mobile phone as an example, a large amount of mobile phone comment text is generated in various web forums and after-sales evaluation. These comments not only provide opinion reference for potential buyers, but also provide guidance for the production activities of mobile phone manufacturers. The opinion mining research on mobile phone comment text has great economic value. However, taking a mainstream network mall as an example, the evaluation of mobile phone after-sales is as high as 100PB, how to accurately analyze the sentiment tendency of the massive mobile phone comment text is a problem to be solved. Most of these comments are presented in an unstructured or semi-structured manner, which increases the difficulty of sentiment tendency analysis. The analysis based on the sentiment dictionary in the related technology usually needs a complete list of sentiment words. Due to the diversification of network text, it is impossible to obtain a complete list of sentiment words. At the same time, due to the particularity of Chinese, when combined with negative words or degree adverbs, it will produce completely different semantics, which increases the difficulty of analysis, resulting in the problem of low accuracy of sentiment tendency analysis.
[0069] The present application extracts the key words consistent with one or more preset target feature words from the comment to be processed, thereby obtaining the classification type words that best reflect a comment to be processed; then according to the key words, the sentiment feature vector corresponding to the comment to be processed is obtained, realizing the digitization of the feature; finally, the sentiment feature vector of the comment to be processed is processed by the preset sentiment tendency analysis model, and the sentiment type of the comment to be processed is obtained, thereby improving the accuracy of sentiment tendency analysis.
[0070] Reference Figure 1 is a kind of application scene schematic diagram provided by the embodiment of the present application. In Figure 1In the example of the application scenario shown, various terminals 1 are connected to a web server 2 that provides a comment function through a network, and upload comments on the product to the web server 2. The web server 2 provides, for example, a product after-sales comment page, or a forum page, etc. After the web server 2 collects a large number of comments, the product comment sentiment analysis server 3 obtains the comments from the web server 2 and performs sentiment tendency opinion mining on these comments. It can analyze the sentiment type of each comment, and then can be linked to the product characteristics accordingly, highlighting the user's feedback information on the product characteristics, and guiding the decision-making of manufacturers or sellers. It should be understood that the application scenario of the present invention is not limited to Figure 1 As shown, the execution subject is not limited to the product review sentiment analysis server 3, but can also be implemented in a network computing environment with many types of computer system structures, including personal computers, handheld devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network personal computers, pocket computers, mainframe computers, and the like. The present invention can also be implemented in a distributed computing environment, where tasks are performed by local and remote processing devices connected via a communication network (via hard-wired connections, wireless connections, or a combination of hard-wired or wireless connections). In a distributed computing environment, program modules can be located in local and remote storage media.
[0071] See also Figure 2 , is a flow chart of a method for analyzing sentiment tendency of product reviews provided by an embodiment of the present invention, Figure 2 The execution subject of the method shown may be software and / or hardware devices. For the convenience of description, the following example is given using a server as the execution subject. Figure 2 The method shown includes steps S101 to S103, which are specifically as follows:
[0072] S101: Acquire keywords contained in the comments to be processed, wherein the keywords are one or more preset target feature words.
[0073] For example, a recent comment is received and treated as a pending comment. Multiple target feature words are pre-set, such as "running score," "smooth," and "very good." The existing target feature words are then compared with the words in the pending comment. If the pending comment contains a word that matches the target feature word, that word is treated as a keyword. A pending comment may contain one or more keywords.
[0074] Optionally, before obtaining keywords, the comments to be processed can be segmented to decompose the sentences into multiple words, and then these decomposed words are compared with the target feature words to determine the keywords.
[0075] S102, according to the keyword, obtaining the emotional feature vector corresponding to the to-be-processed comment.
[0076] Since the keywords obtained above are natural language words, in order to be processed by a model, improve the efficiency and accuracy of processing, the keywords can be converted into digital vectors. In some embodiments, a keyword vector can be generated for each keyword using a Word2vec model, and an emotional feature vector corresponding to each to-be-processed comment can be generated according to the keyword vector.
[0077] In some embodiments, the process of obtaining the sentiment feature vector may, for example, include: first obtaining a keyword vector corresponding to each of the keywords. For example, using a Word2vec model to generate a keyword vector from an input keyword. The number of items contained in each keyword vector is the word vector length set in the Word2vec model used to generate the keyword vector. The Word2vec model may, for example, be trained using a pre-stored review corpus. For example, first obtain an Internet corpus, train the Word2vec initial model, then obtain pre-stored product review samples, and preprocess the pre-stored product review samples to obtain a review corpus by removing duplicates and performing word segmentation. Continue training the Word2vec initial model using the review corpus to obtain the trained Word2vec model. By using review corpus data as training samples during the training process, the trained Word2vec model can provide processing capabilities for keywords in this step. After obtaining the keyword vector, obtain the chi-square coefficient and the review coefficient corresponding to each of the keywords in the to-be-processed review; obtain the weight corresponding to each of the keywords in each to-be-processed review according to the pre-set inverse sample frequency corresponding to each of the keywords, and the chi-square coefficient, the review coefficient, and the number of occurrences of each of the keywords in each to-be-processed review. The method of obtaining the chi-square coefficient and the review coefficient for each keyword may be the same as the method of obtaining the chi-square coefficient and the review coefficient of the target feature word during the model training process. The pre-set inverse sample frequency corresponding to the keyword can be understood as the ratio of the total number of product review samples to the number of samples with the keyword in the pre-stored product review samples. In order to avoid a denominator of 0 when the number of samples with the keyword is 0, the denominator can be incremented by 1, as shown in Equation Three. For example, the weight of the keyword "very good" is calculated using the weight calculation method during the model training process, resulting in, for example, 0.5. Typically, a to-be-processed review contains multiple keywords, and the contribution of keywords with different weights to the to-be-processed review will differ. Finally, obtain the sentiment feature vector corresponding to the to-be-processed review according to the keyword vector, the weight corresponding to each of the keyword vectors, and the number of keywords contained in the to-be-processed review. For example, calculate the average value of the weighted sum of the items in the keyword vector and the number of keywords, and the resulting vector is the sentiment feature vector. For example, the length of the keyword vector is 5, the keyword vector of the keyword "smoothness" is a = [0.1, 0.2, 0.3, 0.4, 0.5], the corresponding weight is 0.8, the keyword vector of the keyword "photography" is b = [0.2, 0.2, 0.2, 0.2, 0.2], the corresponding weight is 0.4, and the number of keywords is 2. Therefore, the sentiment feature vector c is = (0.8a + 0.4b) / 2 = [0.08, 0.12, 0.16, 0.2, 0.24].
[0078] S103, processing the sentiment feature vector of the to-be-processed comment by using a preset sentiment tendency analysis model to obtain a sentiment type of the to-be-processed comment.
[0079] Specifically, the sentiment feature vector of the to-be-processed comment can be processed by using a preset sentiment tendency analysis model to obtain a sentiment classification vector. Then, the sentiment type of the to-be-processed comment is determined according to the sentiment classification vector. For example, the sentiment tendency analysis model is used to divide the comment into three sentiment types, and the output sentiment classification vector is (1, 0, 0), which indicates that the comment is of the first sentiment type. If the output sentiment classification vector is (0.8, 0.1, 0.1), it indicates that the scoring values of the three sentiment types are 0.8, 0.1 and 0.1 in turn. Whether the output of the sentiment tendency analysis model is a one-hot vector or a multi-item vector can be determined by the selected sample and label type in the model training.
[0080] The method provided by the embodiment of the present application comprises the following steps: obtaining a keyword contained in a to-be-processed comment, wherein the keyword is one or more of preset target feature words, thereby obtaining a classification type word that can best reflect the to-be-processed comment; obtaining a sentiment feature vector corresponding to the to-be-processed comment according to the keyword; processing the sentiment feature vector of the to-be-processed comment by using a preset sentiment tendency analysis model to obtain a sentiment type of the to-be-processed comment, thereby improving the accuracy of sentiment tendency analysis.
[0081] On the basis of the above-mentioned embodiment, before step S101 (obtaining a keyword contained in a to-be-processed comment), a process of obtaining a sentiment tendency analysis model can be further included. Figure 2 In the process, the target feature words and the weights of the target feature words are determined in the process of obtaining the sentiment tendency analysis model. Referring to Figure 3 is a process flow diagram of a process of obtaining a sentiment tendency analysis model provided by the embodiment of the present application, Figure 3 The method in is described in the following steps S201 to S204.
[0082] S201, obtaining target feature words according to at least one preset classification type and pre-stored product comment samples, wherein each target feature word is related to the classification type.
[0083] At least one classification type, for example: satisfied, neutral, and dissatisfied. The pre-stored product review samples are, for example, after-sales reviews of products of the same type, or part of after-sales reviews of products that need to be analyzed for sentiment orientation. For example, there are 1 million after-sales reviews of a series of products, and 10 of them are taken as product review samples, and each product review sample is labeled with a type tag. The way to set the type tag can be manually set, or generated according to the score of the review. For example, a review has a score of 5 (out of 5), so a type tag indicating "satisfied" can be generated directly. For product review samples obtained from forums, the label of each product review sample can be set manually.
[0084] Through word segmentation, deduplication and other processing of product review samples, combined with the pre-set at least one classification type, the target feature words that best reflect the classification type can be obtained. For example, there are a total of 90 target feature words, of which 30 are related to the "satisfied" type, another 30 are related to the "neutral" type, and the remaining 30 are related to the "dissatisfied" type.
[0085] On the basis of the above embodiment, there are many ways to achieve the target feature words, see Figure 4 , a method provided by an embodiment of the present application Figure 3 The flowchart of step S201 is shown in FIG. 1. As shown in FIG. 1, the specific implementation of step S201 (obtaining target feature words according to pre-set at least one classification type and pre-stored product review samples, wherein each target feature word is related to the classification type) can be seen from the following steps S301 to S304. Figure 4
[0086] S301, decompose the pre-stored product review samples to obtain a plurality of backup words.
[0087] It can be understood that the text in the product review sample is decomposed from a sentence to a word to obtain a plurality of backup words. Among them, the interference information, useless information, stop words and the like unrelated to sentiment classification in the product review sample can be removed to improve the effectiveness of the obtained backup words and improve the efficiency of obtaining target feature words. For example, remove words such as "of", "in", "one", etc.
[0088] S302, according to the pre-set at least one classification type, from the plurality of backup words, obtain a basic feature word, wherein the basic feature word is a backup word related to the classification type.
[0089] Specifically, for each classification type, the relevance degree of each alternative word to the classification type is obtained, and one or more alternative words with the highest relevance degree are taken as the basic characteristic words of the classification type. For example, the relevance degree of each alternative word to the "satisfied" type is obtained, and the alternative word with a relevance degree of 80% or more is taken as the basic characteristic word corresponding to the "satisfied" type. Similarly, the relevance degree of each alternative word to the "unsatisfied" type can be obtained, and the alternative word with a relevance degree of 80% or more is taken as the basic characteristic word corresponding to the "unsatisfied" type.
[0090] In some embodiments, the manner of obtaining the basic characteristic words can be to obtain the chi-square value corresponding to each alternative word in each of the preset classification types. Then, according to the chi-square value corresponding to each alternative word in each of the classification types and a preset relevance threshold, a set of relevant characteristic words is determined for each of the classification types. For example, the alternative words are sorted according to the chi-square value corresponding to the classification type from high to low, and the top d alternative words are taken as the relevant characteristic words corresponding to the classification type. Finally, the relevant characteristic words corresponding to all of the classification types can be determined as the basic characteristic words. For example, for the "satisfied", "neutral", and "unsatisfied" classification types, one set of relevant characteristic words can be obtained for each classification type, and the three sets of relevant characteristic words constitute the basic characteristic words.
[0091] In the above embodiments, in the calculation of the chi-square value corresponding to each alternative word, the present embodiment introduces a word frequency parameter on the basis of the existing chi-square value calculation formula, to solve the problem that the traditional chi-square statistical method is unreliable for characteristic words with low document frequency. The manner of obtaining the chi-square value corresponding to each alternative word in each of the classification types can specifically include:
[0092] First, the first parameter, the second parameter, the third parameter, the fourth parameter, and the word frequency parameter are obtained for each alternative word, where the first parameter is used to indicate the number of times that the alternative word appears together with the classification type in the pre-stored product review samples, the second parameter is used to indicate the number of times that the alternative word appears and the classification type does not appear in the pre-stored product review samples, the third parameter is used to indicate the number of times that the alternative word does not appear and the classification type appears in the pre-stored product review samples, the fourth parameter is used to indicate the number of times that the alternative word and the classification type both do not appear in the pre-stored product review samples, and the word frequency parameter is used to indicate the ratio of the number of times that the alternative word appears in the product review samples corresponding to the classification type to the number of product review samples corresponding to the classification type.
[0093] Then, according to the first parameter, the second parameter, the third parameter, the fourth parameter, the word frequency parameter and the sample total number of the product comment sample of each of the classification types, the chi-square value corresponding to each of the spare words in each of the classification types is obtained. Specifically, the chi-square value corresponding to each of the spare words t i The corresponding chi-square value k i .
[0094]
[0095] Wherein, A is the first parameter, B is the second parameter, C is the third parameter, D is the fourth parameter, N is the sample total number, The word frequency parameter.
[0096] From the above formula one, the spare words arranged from high to low according to the chi-square value can be obtained, and the first d of which are taken as the basic words. In the embodiment with three classification types, the sequence ω o For example, W o ={ω1, ω2…ω d , ω'1, ω'2…ω' d , ω"1, ω"2…ω" d ), wherein, ω1, ω2…ω d are the basic words corresponding to the first type, ω'1, ω'2…ω' d are the basic words corresponding to the second type, and ω"1, ω"2…ω" d are the basic words corresponding to the third type.
[0097] S303, according to the basic feature words, the synonyms of the basic feature words are obtained in the preset comment corpus, wherein the comment corpus contains the words in the product comment sample.
[0098] Specifically, the basic feature word vector corresponding to the basic feature word can be obtained first. For example, a basic feature word vector is generated for each basic feature word by the Word2vec model in the above embodiment. Then, in a preset review corpus, a synonym feature word vector with a similarity greater than or equal to a preset similarity threshold is obtained. The review corpus is obtained from the product review sample in the above embodiment, and each word in the review corpus corresponds to a word vector. The synonym can be obtained by, for example, calculating the cosine similarity between each pair of word vectors, and in the review corpus, querying a plurality of word vectors closest to the basic feature word vector as the synonym feature word vector of the basic feature word. Then, the word corresponding to the synonym feature word vector is determined as the synonym of the basic feature word. Wherein, assuming that the basic word vector is x = (x1, x2, …, xN), and the word vector in the corpus for cosine similarity comparison is y = (y1, y2, …, yN), then the cosine similarity between the two word vectors is calculated according to formula two. n n
[0099]
[0100] Wherein, the cosine similarity cos(θ) also reflects the angle between the two word vectors, and the range is [0, 1]. If the cosine similarity tends to 0, it means that the two word vectors are more similar, and if the cosine similarity tends to 1, it means that the two word vectors are less similar. Thus, the words in the review corpus with a cosine similarity greater than the similarity threshold to the basic feature word can be used as synonyms.
[0101] S304, the basic feature word and the synonym are determined as the target feature word.
[0102] For example, the basic feature word “running score” corresponds to the synonym “score” and “score”, and then “running score”, “score” and “score” are included in the target feature word, which realizes the expansion of the target feature word, and is used for the training of the model and the extraction of the keyword, thereby increasing the accuracy of the product review sentiment analysis.
[0103] Optionally, after determining the synonym, the chi-square value of the corresponding classification type of each synonym is also obtained. Finally, the sequence W new of the target feature word is obtained, and the chi-square value sequence K n corresponding to each target feature word is obtained. n n new n n k'1, k'2,... k'n n}.
[0104] S202, according to the degree of correlation between each target feature word and its corresponding classification type, the position of each target feature word in the product review sample, obtaining the weight corresponding to each target feature word in each product review sample, wherein the position of each target feature word in the product review sample is used to indicate that each target feature word is located in the initial review of the product review sample or in the additional review of the product review sample.
[0105] In some embodiments, the TF-IDF weight is used as the weight corresponding to each target feature word, wherein the chi-square coefficient and the review coefficient are introduced into the TF-IDF weight in this embodiment, which highlights the weight value of the target feature word with greater contribution. Specifically, the ratio of the chi-square value of each target feature word to the chi-square mean value can be used as the chi-square coefficient corresponding to each target feature word wherein the chi-square mean value is the mean value of the chi-square values corresponding to all target feature words of the same classification type as the target feature word, and the chi-square value indicates the degree of correlation between each target feature word and its corresponding classification type. Then, according to whether each target feature word is located in the initial review of the product review sample or in the additional review of the product review sample, the review coefficient corresponding to each target feature word in each product review sample is determined. For example, the target feature word located in the initial review corresponds to a lower review coefficient, and the target feature word located in the additional review corresponds to a higher review coefficient. Finally, the weight corresponding to each target feature word can be obtained according to the preset inverse sample frequency corresponding to each target feature word, the chi-square coefficient κ i , the review coefficient, and the number of occurrences in each product review sample.
[0106] Specifically, the weight TF-IDF of each target feature word in each product review sample can be obtained according to Formula Three as follows.
[0107]
[0108] wherein, represents the review coefficient corresponding to the target feature word located in the initial review of a product review sample, represents the review coefficient corresponding to the target feature word located in the additional review of a product review sample, and the chi-square coefficient K ave is the mean value of the chi-square values corresponding to all target feature words of the same classification type as the target feature word t i . is the mean value of the chi-square values corresponding to all target feature words of the same classification type as the target feature word t ithe inverse sample frequency of the sample, wherein |N| is the total number of samples of the product review sample, |j: t i ∈d j | represents the number of samples d i in the product review sample containing the target feature word t j The n i,j and m i,j respectively represent the number of times the target feature word appears in the initial review and the number of times it appears in the additional review in the product review sample. If the target feature word only appears in the initial review of the product review sample, then is taken as the If the target feature word appears in the additional review of the product review sample, then is taken as the n i,k represents the number of times the target feature word t i appears in the product review sample. i The n i,k is multiplied by the chi-square coefficient of the target feature word t i and the review coefficient, and then summed.
[0109] S203, according to the target feature word vector corresponding to each target feature word, the weight corresponding to each target feature word, and the number of target feature words contained in each product review sample, obtaining the sample feature vector corresponding to each product review sample.
[0110] Specifically, it can be weighted summation of the target feature vector corresponding to each product review sample, and the result of weighted summation is averaged to the number of target feature words contained in the product review sample, to obtain the sample feature vector corresponding to the product review sample. For example, the target feature words of a certain product review sample are "smoothness" and "photography". The target feature vector of "smoothness" is a = [0.1, 0.2, 0.3, 0.4, 0.5], the corresponding weight is 0.8, the target feature vector of "photography" is b = [0.2, 0.2, 0.2, 0.2, 0.2], the corresponding weight is 0.4, and the number of keywords is 2. Then, the sample feature vector c is = (0.8a+0.4b) / 2 = [0.08, 0.12, 0.16, 0.2, 0.24].
[0111] S204, according to the sample feature vector corresponding to each product review sample and the type label corresponding to each product review sample, training a preset initial classification model to obtain a sentiment analysis model, wherein the type label is used to indicate one of the at least one classification type.
[0112] For example, the sample feature vector is [0.08, 0.12, 0.16, 0.2, 0.24], and the type label corresponding to the product review sample is "satisfaction", then the preset initial classification model is trained by using the sample feature vector and the corresponding type label. Through a large number of sample feature vectors and their corresponding type labels, a sentiment analysis model is finally trained.
[0113] The above embodiment further improves the accuracy of the product review sentiment analysis from multiple aspects by introducing the word frequency parameter into the calculation of the chi-square value, expanding the feature words to obtain the target feature words, and introducing the chi-square coefficient and the review coefficient into the calculation of the weight.
[0114] Optionally, after step S103 (processing the sentiment feature vector of the to-be-processed review by using the preset sentiment analysis model to obtain the sentiment type of the to-be-processed review), a process of determining the sentiment tendency ratio of the preset product to-be-tested feature can be further included.
[0115] For example, the sentiment tendency ratio of each main parameter can be determined when the satisfaction degree of the main parameters of the product needs to be analyzed. In some embodiments, a plurality of keywords corresponding to the to-be-processed review can be first obtained; then, according to the preset product to-be-tested feature, a to-be-tested keyword is obtained from the plurality of keywords; and finally, according to the sentiment type corresponding to the to-be-tested keyword, the sentiment tendency ratio corresponding to the product to-be-tested feature is determined. For example, for the smoothness performance of a mobile phone, the keywords corresponding to "smoothness" can be "smoothness" itself and a set of synonyms thereof, and then the sentiment tendency ratio corresponding to the mobile phone in the "smoothness" performance is determined according to the sentiment type corresponding to these keywords.
[0116] Referring to Figure 5 is a structure schematic diagram of a product review sentiment analysis device provided by an embodiment of the present application. Figure 5 The product review sentiment analysis device 50 shown in the figure includes:
[0117] A keyword extraction module 51 is configured to obtain keywords contained in a to-be-processed review, wherein the keywords are one or more of preset target feature words.
[0118] A vector processing module 52 is configured to obtain a sentiment feature vector corresponding to the to-be-processed review according to the keywords.
[0119] A sentiment classification module 53 is configured to process the sentiment feature vector of the to-be-processed review by using a preset sentiment analysis model to obtain a sentiment type of the to-be-processed review.
[0120] The embodiment provides a commodity comment sentiment tendency analysis device, which comprises a keyword acquisition module, a sentiment feature vector acquisition module, a sentiment tendency analysis model processing module and a sentiment type acquisition module.
[0121] Referring to Figure 6 , another commodity comment sentiment tendency analysis device structure schematic diagram provided by the embodiment of the application is shown in Figure 5 , the commodity comment sentiment tendency analysis device 50 shown in the structure further comprises: Figure 6
[0122] A model training module 54 is configured to acquire target feature words according to at least one preset classification type and pre-stored commodity comment samples before the sentiment tendency analysis model processing module processes the sentiment feature vector of the to-be-processed comment to acquire the sentiment type of the to-be-processed comment, wherein each target feature word is related to the classification type.
[0123] According to the correlation degree of each target feature word and the classification type corresponding to the target feature word and the position of each target feature word in the commodity comment sample, the weight corresponding to each target feature word in each commodity comment sample is acquired, wherein the position of each target feature word in the commodity comment sample is used to indicate that each target feature word is located in the initial comment of the commodity comment sample or is located in the additional comment of the commodity comment sample.
[0124] According to the target feature word vector corresponding to each target feature word, the weight corresponding to each target feature word and the number of target feature words contained in each commodity comment sample, a sample feature vector corresponding to each commodity comment sample is acquired.
[0125] According to the sample feature vector corresponding to each commodity comment sample and the type label corresponding to each commodity comment sample, a preset initial classification model is trained to acquire a sentiment tendency analysis model, wherein the type label is used to indicate one of the at least one classification type.
[0126] Optionally, the model training module 54 is configured to take the ratio of the chi-square value of each target feature word to the chi-square average value as the chi-square coefficient corresponding to each target feature word, wherein the chi-square average value is the average value of the chi-square values of all target feature words of the same classification type as the target feature word, and the chi-square value indicates the correlation degree of each target feature word and the classification type corresponding to the target feature word.
[0127] determine a comment coefficient corresponding to each of the target feature words in each of the product comment samples according to whether each of the target feature words is located in an initial comment of the product comment sample or is located in an additional comment of the product comment sample;
[0128] According to the preset inverse sample frequency corresponding to each of the target feature words, and the chi-square coefficient, the comment coefficient corresponding to each of the target feature words in each of the product comment samples, and the number of occurrences of each of the target feature words in each of the product comment samples, a weight corresponding to each of the target feature words in each of the product comment samples is obtained.
[0129] Optionally, the model training module 54 is configured to decompose a plurality of backup words from the pre-stored product comment samples;
[0130] According to the preset at least one classification type, a basic feature word is obtained from the plurality of backup words, wherein the basic feature word is a backup word related to the classification type;
[0131] According to the basic feature word, a synonym of the basic feature word is obtained in a preset comment corpus, wherein the comment corpus contains words in the product comment samples;
[0132] The basic feature word and the synonym are determined as target feature words.
[0133] Optionally, the model training module 54 is configured to obtain a chi-square value corresponding to each of the backup words in each of the classification types according to the preset at least one classification type;
[0134] According to the chi-square value corresponding to each of the backup words in each of the classification types and a preset correlation threshold, a set of relevant feature words is determined for each of the classification types;
[0135] All of the relevant feature words corresponding to the classification types are determined as basic feature words.
[0136] Optionally, the model training module 44 is configured to obtain a first parameter, a second parameter, a third parameter, a fourth parameter and a word frequency parameter for each of the backup words, wherein the first parameter is used to indicate the number of times that the backup word appears together with the classification type in the pre-stored product comment samples, the second parameter is used to indicate the number of times that the backup word appears and the classification type does not appear in the pre-stored product comment samples, the third parameter is used to indicate the number of times that the backup word does not appear and the classification type appears in the pre-stored product comment samples, the fourth parameter is used to indicate the number of times that the backup word and the classification type do not appear in the pre-stored product comment samples, and the word frequency parameter is used to indicate the ratio of the number of times that the backup word appears in the product comment samples corresponding to the classification type to the number of product comment samples corresponding to the classification type.
[0137] According to the first parameter, the second parameter, the third parameter, the fourth parameter, the word frequency parameter and the sample total number of the product comment sample of each of the classification types according to each of the backup word, the chi-square value corresponding to each of the backup word in each of the classification types is obtained.
[0138] Optionally, the model training module 54 is configured to obtain a basic feature word vector corresponding to the basic feature word;
[0139] In a preset comment corpus, a synonym feature word vector with a similarity greater than or equal to a preset similarity threshold with the basic feature word vector is obtained.
[0140] The word corresponding to the synonym feature word vector is determined as a synonym of the basic feature word.
[0141] Optionally, the vector processing module 52 is configured to obtain a keyword vector corresponding to each of the keywords;
[0142] The chi-square coefficient and the comment coefficient corresponding to each of the keywords in the to-be-processed comment are obtained, and the weight corresponding to each of the keywords in each of the to-be-processed comments is obtained according to the preset inverse sample frequency corresponding to each of the keywords, the chi-square coefficient, the comment coefficient corresponding to each of the keywords in the to-be-processed comment, and the number of occurrences of each of the keywords in each of the to-be-processed comments.
[0143] According to the keyword vector, the weight corresponding to each of the keyword vectors, and the number of keywords contained in the to-be-processed comment, a sentiment feature vector corresponding to the to-be-processed comment is obtained.
[0144] Optionally, the sentiment classification module 53 is configured to process the sentiment feature vector of the to-be-processed comment by using a preset sentiment tendency analysis model to obtain a sentiment classification vector.
[0145] According to the sentiment classification vector, the sentiment type of the to-be-processed comment is determined.
[0146] Optionally, the sentiment classification module 53 is further configured to obtain a plurality of keywords corresponding to a plurality of to-be-processed comments after processing the sentiment feature vector of the to-be-processed comment by using the preset sentiment tendency analysis model to obtain the sentiment type of the to-be-processed comment.
[0147] According to a preset product to-be-tested feature, a to-be-tested keyword is obtained from the plurality of keywords.
[0148] According to the sentiment type corresponding to the to-be-tested keyword, a sentiment tendency proportion corresponding to the product to-be-tested feature is determined.
[0149] Referring toFigure 7 is a hardware structure schematic diagram of a device provided by an embodiment of the present application, the device 70 comprising: a processor 71, a memory 72 and a computer program; wherein
[0150] The memory 72 is configured to store the computer program, and the memory can also be a flash memory. The computer program is, for example, an application program, a functional module or the like for implementing the above method.
[0151] The processor 71 is configured to execute the computer program stored in the memory, so as to implement each step of the method performed by the server. For details, refer to the related description in the above method embodiment.
[0152] Optionally, the memory 72 can be independent or integrated with the processor 71.
[0153] When the memory 72 is independent of the processor 71, the device can further comprise:
[0154] A bus 73 is configured to connect the memory 72 and the processor 71.
[0155] The present application further provides a readable storage medium, wherein the readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method provided by the various embodiments.
[0156] The readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transfer of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general or special purpose computer. For example, the readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). In addition, the ASIC can be located in a user equipment. Of course, the processor and the readable storage medium can also exist as discrete components in a communication device. The readable storage medium can be a read only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk and an optical data storage device, etc.
[0157] The present application further provides a program product, which comprises execution instructions stored in a readable storage medium. At least one processor of a device can read the execution instructions from the readable storage medium, and the at least one processor executes the execution instructions to make the device implement the method provided by the various embodiments.
[0158] In the embodiments of the above apparatus, it should be understood that the processor can be a central processing unit (CPU for short), and can also be other general-purpose processors, digital signal processors (DSP for short), application specific integrated circuits (ASIC for short), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the present application can be directly embodied as hardware processor execution completion, or executed by a combination of hardware and software modules in the processor.
[0159] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A product review sentiment analysis method, characterized in that, The method comprises the following steps: obtaining a keyword contained in a to-be-processed comment, wherein the keyword is one or more of preset target feature words; obtaining a sentiment feature vector corresponding to the to-be-processed comment according to the keyword; processing the sentiment feature vector of the to-be-processed comment by using a preset sentiment tendency analysis model to obtain a sentiment type of the to-be-processed comment; wherein, before the step of obtaining the keyword contained in the to-be-processed comment, the method further comprises the following steps: obtaining target feature words according to at least one preset classification type and pre-stored commodity comment samples; each target feature word is related to the classification type; a ratio of a chi-square value of each target feature word to a chi-square average value is taken as a chi-square coefficient corresponding to each target feature word; the chi-square average value is an average value of chi-square values corresponding to all target feature words of the same classification type as the target feature word; the chi-square value indicates a correlation degree of each target feature word with the classification type corresponding to the target feature word; determining a comment coefficient corresponding to each target feature word in each commodity comment sample according to whether each target feature word is located in an initial comment of the commodity comment sample or in an additional comment of the commodity comment sample; obtaining a weight corresponding to each target feature word in each commodity comment sample according to a preset inverse sample frequency corresponding to each target feature word, the chi-square coefficient corresponding to each target feature word, the comment coefficient, and a number of occurrences of each target feature word in each commodity comment sample; and obtaining a sentiment tendency analysis model according to a target feature word vector corresponding to each target feature word, the weight corresponding to each target feature word, and a number of target feature words contained in each commodity comment sample.
2. The method of claim 1, wherein: the obtaining of the sentiment tendency analysis model according to the target feature word vector corresponding to each target feature word, the weight corresponding to each target feature word, and the number of target feature words contained in each commodity comment sample comprises: obtaining a sample feature vector corresponding to each commodity comment sample according to the target feature word vector corresponding to each target feature word, the weight corresponding to each target feature word, and the number of target feature words contained in each commodity comment sample; training a preset initial classification model according to the sample feature vector corresponding to each commodity comment sample and a type label corresponding to each commodity comment sample to obtain the sentiment tendency analysis model, wherein the type label is used to indicate one of the at least one classification type.
3. The method of claim 2, wherein, the obtaining of the target feature words according to the at least one preset classification type and the pre-stored commodity comment samples comprises: decomposing a plurality of backup words from the pre-stored commodity comment samples; obtaining a basic feature word from the plurality of backup words according to the at least one preset classification type, wherein the basic feature word is a backup word related to the classification type; obtaining a synonym of the basic feature word in a preset comment corpus, wherein the comment corpus contains words in the commodity comment samples. The base feature word is determined as a target feature word together with the near-synonyms.
4. The method of claim 3, wherein, The base feature word is obtained from the multiple backup words according to at least one preset classification type, including: According to the chi-square value corresponding to each backup word in each classification type and a preset correlation threshold, a set of relevant feature words is determined for each classification type. The base feature word is determined as a target feature word together with the near-synonyms. The base feature word is obtained from the multiple backup words according to at least one preset classification type, including:
5. The method of claim 4, wherein, The first parameter, the second parameter, the third parameter, the fourth parameter and the word frequency parameter are obtained for each backup word, wherein the first parameter is used to indicate the number of times that the backup word appears together with the classification type in the pre-stored commodity comment sample, the second parameter is used to indicate the number of times that the backup word appears and the classification type does not appear in the pre-stored commodity comment sample, the third parameter is used to indicate the number of times that the backup word does not appear and the classification type appears in the pre-stored commodity comment sample, the fourth parameter is used to indicate the number of times that the backup word and the classification type do not appear in the pre-stored commodity comment sample, and the word frequency parameter is used to indicate the ratio of the number of times that the backup word appears in the commodity comment sample corresponding to the classification type to the number of commodity comment samples corresponding to the classification type. The chi-square value corresponding to each backup word in each classification type is obtained according to the first parameter, the second parameter, the third parameter, the fourth parameter and the word frequency parameter of each backup word for each classification type and the total number of samples of the commodity comment sample. The base feature word is obtained from the multiple backup words according to at least one preset classification type, including:
6. The method of claim 3, wherein, The base feature word vector corresponding to the base feature word is obtained. In the preset comment corpus, a near-synonym feature word vector with a similarity greater than or equal to a preset similarity threshold is obtained. The near-synonym feature word vector corresponding to the near-synonym feature word vector is determined as the near-synonym of the base feature word. The base feature word is obtained from the multiple backup words according to at least one preset classification type, including:
7. The method according to any one of claims 1 to 6, characterized in that, The base feature word is obtained from the multiple backup words according to at least one preset classification type, including: The chi-square coefficient and the comment coefficient corresponding to each keyword in the to-be-processed comment are obtained. According to the inverse sample frequency corresponding to each keyword, the chi-square coefficient, the comment coefficient and the number of times that each keyword appears in each to-be-processed comment, the weight corresponding to each keyword in each to-be-processed comment is obtained. The sentiment feature vector corresponding to the to-be-processed comment is obtained according to the keyword vector, the weight corresponding to each keyword vector and the number of keywords contained in the to-be-processed comment. The sentiment type of the to-be-processed comment is obtained by processing the sentiment feature vector of the to-be-processed comment with a preset sentiment tendency analysis model, including:
8. The method according to any one of claims 1 to 6, characterized in that, processing the sentiment feature vector of the to-be-processed comment by using the preset sentiment tendency analysis model to obtain a sentiment classification vector; determining a sentiment type of the to-be-processed comment according to the sentiment classification vector.
9. The method according to any one of claims 1 to 6, characterized in that, After the processing of the sentiment feature vector of the to-be-processed comment by using the preset sentiment tendency analysis model to obtain the sentiment type of the to-be-processed comment, the method further includes: obtaining a plurality of keywords corresponding to the plurality of to-be-processed comments; obtaining a to-be-tested keyword from the plurality of keywords according to a preset feature to be tested of the commodity; determining a sentiment tendency ratio corresponding to the feature to be tested of the commodity according to the sentiment type corresponding to the to-be-tested keyword.
10. A product review sentiment analysis apparatus, characterized by comprising: The method includes: a keyword extraction module, configured to obtain a keyword contained in a to-be-processed comment, wherein the keyword is one or more of preset target feature words; a vector processing module, configured to obtain a sentiment feature vector corresponding to the to-be-processed comment according to the keyword; a sentiment classification module, configured to process the sentiment feature vector of the to-be-processed comment by using a preset sentiment tendency analysis model to obtain a sentiment type of the to-be-processed comment; a model training module, configured to, before the obtaining of the keyword contained in the to-be-processed comment, obtain target feature words according to at least one classification type and pre-stored commodity comment samples; each target feature word is related to the classification type; a ratio of a chi-square value of each target feature word to a chi-square average value is taken as a chi-square coefficient corresponding to each target feature word; the chi-square average value is an average value of chi-square values corresponding to all target feature words of the same classification type as the target feature word, and the chi-square value indicates a correlation degree of each target feature word with the classification type corresponding thereto; a comment coefficient corresponding to each target feature word in each commodity comment sample is determined according to whether each target feature word is located in an initial comment of the commodity comment sample or in an additional comment of the commodity comment sample; a weight corresponding to each target feature word in each commodity comment sample is obtained according to a preset inverse sample frequency corresponding to each target feature word, and the chi-square coefficient, the comment coefficient and a number of occurrences of each target feature word in each commodity comment sample corresponding to each target feature word; and a sentiment tendency analysis model is obtained according to a target feature word vector corresponding to each target feature word, the weight corresponding to each target feature word and a number of target feature words contained in each commodity comment sample.
11. An apparatus, comprising: The method includes: a memory, a processor and a computer program, the computer program is stored in the memory, and the processor runs the computer program to execute the commodity comment sentiment tendency analysis method of any one of claims 1 to 9.
12. A readable storage medium, characterized by, The readable storage medium stores a computer program, and the computer program is executed by the processor to implement the commodity comment sentiment tendency analysis method of any one of claims 1 to 9.
Citation Information
Patent Citations
Method and system for emotion classification of review data based on convolution neural network
CN109033433A