A spicy food preference evaluation method and system
By conducting emotional polarity judgment and keyword weight analysis on spicy food purchase review data, and combining the rating information to construct a preference evaluation model, the problem of the lack of scientificity and objectivity of existing evaluation methods is solved, and the preference for spicy food is achieved. Accurate assessment improves the targeting of product development and marketing.
Patent Information
- Application Number
- CN202410284995.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-03-13
AI Technical Summary
The existing methods of evaluating preferences of spicy foods mostly rely on subjective questionnaires and simple taste assessments, lack objective and scientific analytical methods, and cannot accurately evaluate the preferences of spicy foods.
By collecting purchase review data, a variety of compression processing rules are used to process highly repetitive review texts, and the scoring information and word attention mechanism are combined to determine the emotional polarity, and a spicy food liking evaluation index system is constructed, and based on keywords The frequency of occurrence determines the weight of each evaluation index, a preference evaluation model is constructed for iterative processing, and the true preference evaluation results of spicy food are calculated.
It has achieved a scientific and objective evaluation of spicy food preferences, which can better understand consumers' taste preferences and needs, improve the pertinence of product development and marketing, and enhance the competitiveness of products.
Smart Images

Figure CN118037365B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of food preference evaluation, and in particular to a method and system for evaluating the preference of spicy food. Background Art
[0002] With the rapid development of social economy and the improvement of people's living standards, people's demand for food has gradually shifted from basic satisfaction to personalization, diversification and quality. Spicy food, as a major feature of traditional Chinese food, has attracted a wide range of consumer groups due to its unique taste and flavor. However, with the continuous improvement of people's demand for dietary health and taste, how to accurately evaluate the preference for spicy food has become a problem that needs to be solved urgently. Existing spicy food preference evaluation methods mostly rely on subjective questionnaires and simple taste assessments, lacking objective and scientific analysis methods, so a more systematic and scientific research method is needed to accurately evaluate the preference for spicy food. In response to this problem, the present invention proposes a spicy food preference evaluation method and system, which can better understand consumers' taste preferences and needs by scientifically and objectively evaluating the preference for spicy food, which helps to strengthen the pertinence of product development and marketing and improve the competitiveness of products. Summary of the invention
[0003] In view of this, the present invention provides a method for evaluating the preference of spicy food, the purpose of which is to: 1) collect multiple groups of purchase review data, and use multiple compression processing rules to compress the review texts with very high repetition, realize the filtering of meaningless texts, enhance the reliability of the review texts, and combine the rating information and the word attention mechanism to judge the sentiment polarity of the pre-processed review texts, divide the purchase review data into positive, negative or neutral sentiments, and realize the sentiment analysis of each group of purchase review data; 2) construct a spicy food preference evaluation index system including the taste, spiciness, freshness of ingredients and rationality of ingredient matching of spicy food, and determine the weight of each evaluation index based on the frequency of occurrence of keywords corresponding to different evaluation indicators, and combine the rating information and sentiment polarity to form the user's weighted coded review data on spicy food. The weighted coded review data is weighted based on the evaluation index weights to perform weighted processing on the evaluation index keywords with different weights, focusing on the evaluation index information, and combining the spicy food preference evaluation index system to achieve key information representation and coding processing of the purchase review data; 3) Construct a preference evaluation model, represent the multiple groups of rating information in the purchase review data with the comment ratio of different rating data, and form an initial preference distribution. Combined with the obtained several groups of weighted coded review data, the preference distribution is iteratively processed to achieve the iteration of the spicy food preference distribution that integrates all the key information, sentiment polarity and rating information of the purchase review data, and then realize the weakening of abnormal purchase review data that does not have key information and the gap between the comment text and the rating information is too large. Based on the final iterative result, the true preference evaluation result of the spicy food is calculated.
[0004] To achieve the above object, the present invention provides a method for evaluating the liking of spicy food, comprising the following steps:
[0005] S1: Obtaining users' purchase review data on spicy food from the e-commerce platform, where the purchase review data includes review text and rating information, and preprocessing the review text in the purchase review data;
[0006] S2: Combine the rating information to judge the sentiment polarity of the preprocessed review text, divide the purchase review data into positive, negative or neutral sentiment, and extract the keyword sequence of the preprocessed review text;
[0007] S3: Construct a spicy food preference evaluation index system, determine the weight of each evaluation index based on the keyword sequence, and combine the rating information and sentiment polarity to form the weighted coding comment data of users on spicy food. The evaluation indexes in the spicy food preference evaluation index system include taste, spiciness, freshness of ingredients, and rationality of ingredient matching;
[0008] S4: construct a preference evaluation model to calculate the preference evaluation result of spicy food, wherein the preference evaluation model takes the weighted coded review data as input and takes the preference of spicy food as output.
[0009] As a further improvement method of the present invention:
[0010] Optionally, in step S1, obtaining user purchase review data on spicy food from the e-commerce platform includes:
[0011] The purchase review data of users on spicy food is obtained from the e-commerce platform, where the purchase review data includes the review text and rating information. The obtained purchase review data is expressed in the following form:
[0012] {(x n ,y n )|n∈[1,N]}
[0013] in:
[0014] (x n ,y n ) represents the nth group of purchase review data obtained, x n represents the review text in the nth group of purchase review data, y n represents the rating information in the nth group of purchase review data, and N represents the number of groups of the obtained purchase review data; in the embodiment of the present invention, the rating information is numerical data, and the larger the numerical value, the higher the user's satisfaction with the purchased spicy food;
[0015] Preprocess the review text in the purchase review data.
[0016] Optionally, the step S1 pre-processes the review text in the purchase review data, including:
[0017] Preprocess the review text in the purchase review data, where the purchase review data (x n ,y n ) Comment text x n The preprocessing process is:
[0018] S11: Based on review text x n Punctuation marks in comment text x n Perform sentence processing to obtain the comment text x n Compare each sentence text, delete the completely repeated sentence texts, and keep only the unique sentence texts;
[0019] S12: Comment text x on the text with duplicate sentences deleted n Perform compression processing, where the compression processing rules are:
[0020] Set the unit length of repeated characters in compression processing to e, where e∈[1,5];
[0021] Select text characters of length e from the comment text. If the number of consecutive occurrences of the text characters reaches count(e) or more, compress the consecutively appearing text character sequence into a single text character. The calculation formula for the consecutive occurrence limit is:
[0022]
[0023] S13: Comment text x after statistical compression processing n The text character length of each sentence in the text, delete the sentence text with a text character length less than 4, and get the comment text x′ after sentence processing n ;
[0024] S14: Use jieba word segmentation tool to analyze the comment text x′ n Perform word segmentation, and filter the word segmentation results based on the stop word list to obtain the comment text x n The preprocessing results are:
[0025] x″ n =(x″ n (1),x″ n (2),...,x″ n (i),...,x″ n (num n )),i∈[1,num n ]
[0026] in:
[0027] x″ n Represents comment text x n The preprocessing result, i.e. the preprocessed comment text;
[0028] x″ n (i) represents the preprocessing result x″ n The i-th word segmentation result in num n Represents the preprocessing result x″ n In the embodiment of the present invention, the stop word list contains several types of stop words, and the stop word types include modal particles, prepositions, adverbs, etc.
[0029] Optionally, in step S2, judging the sentiment polarity of the preprocessed review text in combination with the rating information includes:
[0030] Combine the rating information to preprocess the review text x″ nPerform sentiment polarity judgment, use the sentiment polarity judgment result of the comment text as the sentiment polarity of the corresponding purchase comment data, and divide the purchase comment data into positive, negative or neutral sentiment, where the comment text x″ n The emotional polarity judgment process is as follows:
[0031] Use the Word2vev model to preprocess the comment text x″ n Each word segmentation result in is represented by a word vector, and the word vector representation sequence corresponding to the word segmentation result is obtained:
[0032] s n =(s n (1),s n (2),...,s n (i),...,s n (num n ))
[0033] in:
[0034] s n Indicates comment text x″ n The word vector represents the sequence, s n (i) represents the comment text x″ n The word vector representation of the i-th word segmentation result;
[0035] Perform word attention calculation on the word vector representation sequence, where the word vector represents s n The word attention calculation result of (i) is:
[0036]
[0037] u n (i) = tanh(W1s n (i)+b1)
[0038] in:
[0039] a n (i) represents the word vector representation s n (i) Word attention calculation results;
[0040] exp(·) represents an exponential function with a natural constant as the base;
[0041] ||·|| represents the L1 norm;
[0042] u n (i) represents the word vector representation s n (i) The mapping result, W1 represents the mapping weight matrix, b1 represents the mapping bias;
[0043] Based on the word attention calculation results, the word vector representation sequence is encoded with attention to obtain the word attention encoding sequence:
[0044] r n =(r n (1),r n (2),...,r n (i),...,r n (num n ))
[0045] r n (i) = exp(a n (i)u n (i))
[0046] in:
[0047] r n Indicates comment text x″ n The word attention encoding sequence of
[0048] r n (i) represents the comment text x″ n The attention encoding result of the i-th word segmentation result in ;
[0049] Generate comment text x″ n The sentiment polarity probability vector is:
[0050]
[0051] in:
[0052] y n Indicates comment text x″ n Corresponding purchase review data (x n ,y n ) in the rating information;
[0053] μ y Represents the mean value of the rating information in the N groups of purchase review data collected;
[0054] σ y Represents the standard deviation of the rating information in the collected N groups of purchase review data;
[0055] W2 represents the convolution parameter matrix; W3 represents the dimension reduction mapping matrix;
[0056] R n Indicates comment text x″ n The sentiment polarity probability vector of
[0057] Sentiment polarity probability vector R n =[R n (1),R n(0),R n (―1)],R n (1),R n (0),R n (―1) represents the comment text x″ n The probability that the sentiment polarity of is positive, neutral, or negative;
[0058] Select the sentiment polarity with the highest probability value as the purchase review data (x n ,y n )'s sentiment polarity α n , where α n =1 or 0 or -1, α n =1,0,-1 respectively represent the purchase review data (x n ,y n )’s sentiment polarity is positive, neutral, and negative;
[0059] Extract the keyword sequence of the preprocessed review text.
[0060] Optionally, the keyword sequence extracted from the preprocessed comment text in step S2 includes:
[0061] Extract the keyword sequence of the preprocessed comment text, where the preprocessed comment text x″ n The keyword sequence extraction process is as follows:
[0062] S21: constructing a food evaluation vocabulary, wherein the food evaluation vocabulary is a vocabulary composed of common words that describe the taste, spiciness, freshness of ingredients, and rationality of ingredient combinations of spicy foods;
[0063] S22: preprocess the comment text x″ n num n The word segmentation results are matched with the food evaluation vocabulary, where the word segmentation result x″ n The matching result of (i) is: matching n (i) matching n (i) 0 means that the common words in the food evaluation vocabulary are not matched successfully. n (i) 1, 2, 3, and 4 respectively indicate successful matching of common words in the food evaluation vocabulary that describe the taste, spiciness, freshness of ingredients, and rationality of ingredient combination of spicy food;
[0064] S23: Calculate and obtain the pre-processed comment text x″ n The importance of each word segmentation result in n The formula for calculating the importance of (i) is:
[0065]
[0066] in:
[0067] value n (i) represents the word segmentation result x″ n (i) importance;
[0068] count n (value n (i)) represents the preprocessed review text x″ n The result of the word segmentation x″ n (i) the number of occurrences;
[0069] Sum(value n (i)) indicates
[0070] S24: Select the word segmentation results that successfully match the food evaluation vocabulary and whose importance is higher than the preset threshold, and use the selected word segmentation results and the nearest context word segmentation results of the selected word segmentation results as the pre-processed review text x″ n Keywords, comment text x″ after preprocessing according to keywords n The order in the text is sorted to form the preprocessed comment text x″ n The keyword sequence:
[0071] key n =(key n (1),key n (2),...,key n (k),...,key n (K n ))
[0072] in:
[0073] key n Represents the preprocessed comment text x″ n The keyword sequence, key n (k) represents the preprocessed comment text x″ n The kth keyword, K n Represents the preprocessed comment text x″ n The total number of keywords, k∈[1,K n ].
[0074] Optionally, in step S3, a spicy food preference evaluation index system is constructed, and the weight of each evaluation index is determined based on the keyword sequence, including:
[0075] A spicy food preference evaluation index system is constructed, where the evaluation indicators in the spicy food preference evaluation index system are label(1), label(2), label(3), label(4), which correspond to taste, spiciness, freshness of ingredients, and rationality of ingredient combination. The weight of each evaluation indicator is determined based on the keyword sequence, where the weight calculation formula of the evaluation indicator label(j) is:
[0076]
[0077] in:
[0078] w j Represents the weight of the evaluation index label(j), j∈[1,4];
[0079] Count1, count2, count3, and count4 represent the number of segmentation results that successfully match the food evaluation vocabulary describing the taste, spiciness, freshness of ingredients, and rationality of ingredient matching of spicy food;
[0080] Ω1,Ω2,Ω3,Ω4 represent the word segmentation result sets in the successfully matched food evaluation vocabulary describing the taste, spiciness, freshness of ingredients, and rationality of ingredient matching of spicy food, a∈Ω j , a represents the word segmentation result set Ω j For any word segmentation result in , p(a) represents the frequency of word segmentation result a in N groups of keyword sequences.
[0081] Optionally, in step S3, the rating information and the sentiment polarity are combined to form weighted coded comment data of the user on spicy food, including:
[0082] According to the weight calculation results of different evaluation indicators, combined with the rating information and sentiment polarity, the weighted coding comment data of users on spicy food is constructed. The construction process of the weighted coding comment data corresponding to the nth group of purchase comment data collected is as follows:
[0083] S31: Extract the rating information y of the nth group of purchase review data n and sentiment polarity α n ;
[0084] S32: Extract the keyword sequence key of the nth group of purchase review data n , for the keyword sequence key n The keywords in the word vector representation and attention encoding are performed to obtain the keyword encoding sequence The keyword key n The keyword encoding result corresponding to (k) is
[0085] S33: Encoding sequence for keywords The keyword encoding results in the are weighted by combining the evaluation index weights, where the keyword encoding results The weighted processing formula is:
[0086]
[0087]
[0088] w0=0
[0089] in:
[0090] Indicates the keyword encoding result The corresponding weighted processing results;
[0091] Indicates the keyword sequence key n The matching result between the kth keyword and the food evaluation vocabulary;
[0092] S34: weighted coded review data corresponding to the nth group of purchase review data:
[0093]
[0094] in:
[0095] f n Represents the weighted coded review data corresponding to the nth group of purchase review data collected.
[0096] Optionally, in step S4, a preference evaluation model is constructed to calculate the preference evaluation result of spicy food, including:
[0097] Constructing a preference evaluation model, wherein the preference evaluation model takes weighted coded comment data as input and takes spicy food preference as output, wherein the preference evaluation model comprises an input layer, an initial preference distribution simulation layer, a preference distribution iteration layer and an output layer, wherein the input layer is used to receive the weighted coded comment data, the initial preference distribution simulation layer is used to generate an initial preference distribution, the preference distribution iteration layer is used to perform preference distribution iteration in combination with the weighted coded comment data, and the output layer is used to output the spicy food preference;
[0098] The process of using the preference evaluation model to evaluate the preference of spicy food is as follows:
[0099] S41: The input layer receives weighted coded review data corresponding to N groups of purchase review data;
[0100] S42: The initial preference distribution simulation layer extracts rating information from N groups of weighted coded comment data to obtain the ratio of comments with different rating values as the initial preference distribution Q0;
[0101] S43: The preference distribution iteration layer combines the weighted coded comment data to perform preference distribution iteration, wherein the current iteration number of the preference distribution is d, the maximum iteration number is N, and the initial value of d is 0;
[0102] S44: The iteration strategy of preference distribution is:
[0103]
[0104]
[0105] in:
[0106] Q d+1 represents the d+1th iteration result of the preference distribution;
[0107] W4 represents the distribution iteration parameter;
[0108] represents the keyword encoding result after weighted processing in the dth group of weighted coded comment data;
[0109] S45: Let d = d + 1, return to step S44 to iterate the preference distribution until the maximum number of iterations is reached, and the preference distribution Q that reaches the maximum number of iterations is N The mean of the rating information in is used as the calculation result of the spicy food preference evaluation.
[0110] In order to solve the above problems, the present invention provides a spicy food preference evaluation system, characterized in that the system comprises:
[0111] The review data collection module is used to obtain users' purchase review data on spicy food from the e-commerce platform and pre-process the review text in the purchase review data;
[0112] The sentiment polarity judgment module is used to judge the sentiment polarity of the preprocessed review text in combination with the rating information, classify the purchase review data into positive, negative or neutral sentiment, and extract the keyword sequence of the preprocessed review text;
[0113] The device for evaluating the preference of spicy food is used to construct an evaluation index system for the preference of spicy food, determine the weight of each evaluation index based on the keyword sequence, combine the rating information and the sentiment polarity to form the weighted coding comment data of the user on spicy food, construct a preference evaluation model, and calculate the evaluation result of the preference of spicy food.
[0114] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0115] A memory storing at least one instruction;
[0116] Communication interface, enabling electronic equipment to communicate; and
[0117] The processor executes the instructions stored in the memory to implement the above-mentioned spicy food preference evaluation method.
[0118] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned method for evaluating the preference of spicy food.
[0119] Compared with the prior art, the present invention proposes a method for evaluating the preference of spicy food, which has the following advantages:
[0120] First, this scheme proposes a method for judging the sentiment polarity of comment data, combining the rating information with the preprocessed comment text x″ n Perform sentiment polarity judgment, use the sentiment polarity judgment result of the comment text as the sentiment polarity of the corresponding purchase comment data, and divide the purchase comment data into positive, negative or neutral sentiment, where the comment text x″ n The emotional polarity judgment process is as follows: Use the Word2vev model to pre-process the comment text x″ n Each word segmentation result in is represented by a word vector, and the word vector representation sequence corresponding to the word segmentation result is obtained:
[0121] s n =(s n (1),s n (2),...,s n (i),...,s n (num n ))
[0122] Where: s n Indicates comment text x″ n The word vector represents the sequence, s n (i) represents the comment text x″ n The word vector representation of the i-th word segmentation result in ; word attention calculation is performed on the word vector representation sequence, where the word vector representation s n The word attention calculation result of (i) is:
[0123]
[0124] u n (i) = tanh(W1sn (i)+b1)
[0125] Among them: a n (i) represents the word vector representation s n (i) The word attention calculation result; exp(·) represents an exponential function with a natural constant as the base; ||·|| represents the L1 norm; u n (i) represents the word vector representation s n (i) is the mapping result, W1 represents the mapping weight matrix, b1 represents the mapping bias; based on the word attention calculation result, the word vector representation sequence is encoded to obtain the word attention encoding sequence:
[0126] r n =(r n (1),r n (2),...,r n (i),...,r n (num n ))
[0127] r n (i) = exp(a n (i)u n (i))
[0128] Where: r n Indicates comment text x″ n The word attention encoding sequence of n (i) represents the comment text x″ n The attention encoding result of the i-th word segmentation result in ; Generate comment text x″ n The sentiment polarity probability vector is:
[0129]
[0130] Where: y n Indicates comment text x″ n Corresponding purchase review data (x n ,y n ) in the scoring information; μ y represents the mean value of the rating information in the N groups of purchase review data collected; σ y represents the standard deviation of the rating information in the collected N groups of purchase review data; W2 represents the convolution parameter matrix; W3 represents the dimension reduction mapping matrix; R n Indicates comment text x″ n The sentiment polarity probability vector of n =[R n (1),R n (0),R n (―1)],R n(1),R n (0),R n (―1) represents the comment text x″ n The probability that the sentiment polarity is positive, neutral or negative; the sentiment polarity with the highest probability value is selected as the purchase review data (x n ,y n )'s sentiment polarity α n , where α n =1 or 0 or -1, α n =1,0,-1 respectively represent the purchase review data (x n ,y n ) has a sentiment polarity of positive, neutral, and negative. This solution collects multiple groups of purchase review data, and uses a variety of compression processing rules to compress the review text with a very high degree of repetition, realizes the filtering of meaningless text, enhances the reliability of the review text, and combines the rating information and the word attention mechanism to judge the sentiment polarity of the pre-processed review text, divides the purchase review data into positive, negative or neutral sentiment, and realizes the sentiment analysis of each group of purchase review data. Construct a spicy food preference evaluation index system that includes the taste, spiciness, freshness of ingredients, and rationality of ingredient matching of spicy food, and determine the weight of each evaluation index based on the frequency of occurrence of keywords corresponding to different evaluation indicators. Combine the rating information and sentiment polarity to form the user's weighted coding review data on spicy food. The weighted coding review data is weighted based on the evaluation index weights for the evaluation index keywords with different weights, and the evaluation index information is highlighted. Combined with the spicy food preference evaluation index system, the key information representation and coding processing of the purchase review data are realized.
[0131] At the same time, this scheme proposes a preference evaluation method. The process of using the preference evaluation model to evaluate the preference of spicy food is as follows: the input layer receives the weighted coded comment data corresponding to N groups of purchase comment data; the initial preference distribution simulation layer extracts the rating information from the N groups of weighted coded comment data, and obtains the comment ratios with different rating values as the initial preference distribution Q0; the preference distribution iteration layer combines the weighted coded comment data to iterate the preference distribution, where the current iteration number of the preference distribution is d, the maximum iteration number is N, and the initial value of d is 0; the iteration strategy of the preference distribution is:
[0132]
[0133]
[0134] Where: Q d+1 represents the d+1th iteration result of the preference distribution; W4 represents the distribution iteration parameter; represents the weighted keyword encoding result in the dth group of weighted coded comment data; let d = d + 1, iterate the preference distribution until the maximum number of iterations is reached, and the preference distribution Q that reaches the maximum number of iterations is N The mean of the rating information in is taken as the result of the spicy food preference evaluation calculation. This scheme constructs a preference evaluation model, represents the review ratio of different rating data for multiple groups of rating information in the purchase review data, and forms an initial preference distribution. The preference distribution is iteratively processed in combination with several groups of weighted coded review data, and the spicy food preference distribution iteration is realized by integrating the key information, sentiment polarity and rating information of all purchase review data. This further weakens the abnormal purchase review data that does not have key information and has a large gap between the review text and the rating information. Based on the final iterative result, the true preference evaluation result of the spicy food is calculated. BRIEF DESCRIPTION OF THE DRAWINGS
[0135] Figure 1 A schematic diagram of a process for evaluating the likability of spicy food provided by an embodiment of the present invention;
[0136] Figure 2 A functional module diagram of a spicy food preference evaluation system provided by an embodiment of the present invention;
[0137] Figure 2 In: 100 spicy food preference evaluation system, 101 comment data collection module, 102 sentiment polarity judgment module, 103 preference evaluation device;
[0138] Figure 3 A schematic diagram of the structure of an electronic device for implementing a method for evaluating the preference of spicy food provided by an embodiment of the present invention.
[0139] Figure 3 In: 1 electronic device, 10 processor, 11 memory, 12 program, 13 communication interface;
[0140] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0141] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0142] The embodiment of the present application provides a method for evaluating the likability of spicy food. The execution subject of the spicy food likability evaluation method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the spicy food likability evaluation method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0143] Embodiment 1:
[0144] S1: Obtain users' purchase review data on spicy food from the e-commerce platform, where the purchase review data includes review text and rating information, and pre-process the review text in the purchase review data.
[0145] In step S1, the purchase review data of users on spicy food is obtained from the e-commerce platform, including:
[0146] The purchase review data of users on spicy food is obtained from the e-commerce platform, where the purchase review data includes the review text and rating information. The obtained purchase review data is expressed in the following form:
[0147] {(x n ,y n )|n∈[1,N]}
[0148] in:
[0149] (x n ,y n ) represents the nth group of purchase review data obtained, x n represents the review text in the nth group of purchase review data, y n represents the rating information in the nth group of purchase review data, and N represents the number of groups of the obtained purchase review data; in the embodiment of the present invention, the rating information is numerical data, and the larger the numerical value, the higher the user's satisfaction with the purchased spicy food;
[0150] Preprocess the review text in the purchase review data.
[0151] In step S1, the review text in the purchase review data is preprocessed, including:
[0152] Preprocess the review text in the purchase review data, where the purchase review data (x n ,y n ) in the comment text x n The preprocessing process is:
[0153] S11: Based on review text x nPunctuation marks in comment text x n Perform sentence processing to obtain the comment text x n Compare each sentence text, delete the completely repeated sentence texts, and keep only the unique sentence texts;
[0154] S12: Comment text x on the text with duplicate sentences deleted n Perform compression processing, where the compression processing rules are:
[0155] Set the unit length of repeated characters in compression processing to e, where e∈[1,5];
[0156] Select text characters of length e from the comment text. If the number of consecutive occurrences of the text characters reaches count(e) or more, compress the consecutively appearing text character sequence into a single text character. The calculation formula for the consecutive occurrence limit is:
[0157]
[0158] S13: Comment text x after statistical compression processing n The text character length of each sentence in the text, delete the sentence text with a text character length less than 4, and get the comment text x′ after sentence processing n ;
[0159] S14: Use jieba word segmentation tool to analyze the comment text x′ n Perform word segmentation, and filter the word segmentation results based on the stop word list to obtain the comment text x n The preprocessing results are:
[0160] x″ n =(x″ n (1),x″ n (2),...,x″ n (i),...,x″ n (num n )),i∈[1,num n ]
[0161] in:
[0162] x″ n Represents comment text x n The preprocessing result, i.e. the preprocessed comment text;
[0163] x″ n (i) represents the preprocessing result x″ n The i-th word segmentation result in num n Represents the preprocessing result x″ nThe total number of word segmentation results in .
[0164] S2: Combine the rating information to judge the sentiment polarity of the preprocessed review text, divide the purchase review data into positive, negative or neutral sentiment, and extract the keyword sequence of the preprocessed review text.
[0165] In step S2, the sentiment polarity of the preprocessed review text is judged in combination with the rating information, including:
[0166] Combine the rating information to preprocess the review text x″ n Perform sentiment polarity judgment, use the sentiment polarity judgment result of the comment text as the sentiment polarity of the corresponding purchase comment data, and divide the purchase comment data into positive, negative or neutral sentiment, where the comment text x″ n The emotional polarity judgment process is as follows:
[0167] Use the Word2vev model to preprocess the comment text x″ n Each word segmentation result in is represented by a word vector, and the word vector representation sequence corresponding to the word segmentation result is obtained:
[0168] s n =(s n (1),s n (2),...,s n (i),...,s n (num n ))
[0169] in:
[0170] s n Indicates comment text x″ n The word vector represents the sequence, s n (i) represents the comment text x″ n The word vector representation of the i-th word segmentation result;
[0171] Perform word attention calculation on the word vector representation sequence, where the word vector represents s n The word attention calculation result of (i) is:
[0172]
[0173] u n (i) = tanh(W1s n (i)+b1)
[0174] in:
[0175] a n (i) represents the word vector representation s n (i) Word attention calculation results;
[0176] exp(·) represents an exponential function with a natural constant as the base;
[0177] ||·|| represents the L1 norm;
[0178] u n (i) represents the word vector representation s n (i) The mapping result, W1 represents the mapping weight matrix, b1 represents the mapping bias;
[0179] Based on the word attention calculation results, the word vector representation sequence is encoded with attention to obtain the word attention encoding sequence:
[0180] r n =(r n (1),r n (2),...,r n (i),...,r n (num n ))
[0181] r n (i) = exp(a n (i)u n (i))
[0182] in:
[0183] r n Indicates comment text x″ n The word attention encoding sequence of
[0184] r n (i) represents the comment text x″ n The attention encoding result of the i-th word segmentation result in ;
[0185] Generate comment text x″ n The sentiment polarity probability vector is:
[0186]
[0187] in:
[0188] y n Indicates comment text x″ n Corresponding purchase review data (x n ,y n ) in the rating information;
[0189] μ y Represents the mean value of the rating information in the N groups of purchase review data collected;
[0190] σ y Represents the standard deviation of the rating information in the collected N groups of purchase review data;
[0191] W2 represents the convolution parameter matrix; W3 represents the dimension reduction mapping matrix;
[0192] R n Indicates comment text x″ n The sentiment polarity probability vector of
[0193] Sentiment polarity probability vector R n =[R n (1),R n (0),R n (―1)],R n (1),R n (0),R n (―1) represents the comment text x″ n The probability that the sentiment polarity of is positive, neutral, or negative;
[0194] Select the sentiment polarity with the highest probability value as the purchase review data (x n ,y n )'s sentiment polarity α n , where α n =1 or 0 or -1, α n =1,0,-1 respectively represent the purchase review data (x n ,y n )’s sentiment polarity is positive, neutral, and negative;
[0195] Extract the keyword sequence of the preprocessed review text.
[0196] The keyword sequence extracted from the preprocessed comment text in step S2 includes:
[0197] Extract the keyword sequence of the preprocessed comment text, where the preprocessed comment text x″ n The keyword sequence extraction process is as follows:
[0198] S21: constructing a food evaluation vocabulary, wherein the food evaluation vocabulary is a vocabulary composed of common words that describe the taste, spiciness, freshness of ingredients, and rationality of ingredient combinations of spicy foods;
[0199] S22: preprocess the comment text x″ n num n The word segmentation results are matched with the food evaluation vocabulary, where the word segmentation result x″ n The matching result of (i) is: matching n (i) matching n (i) 0 means that the common words in the food evaluation vocabulary are not matched successfully. n(i) 1, 2, 3, and 4 respectively indicate successful matching of common words in the food evaluation vocabulary that describe the taste, spiciness, freshness of ingredients, and rationality of ingredient combination of spicy food;
[0200] S23: Calculate and obtain the pre-processed comment text x″ n The importance of each word segmentation result in n The formula for calculating the importance of (i) is:
[0201]
[0202] in:
[0203] value n (i) represents the word segmentation result x″ n (i) importance;
[0204] count n (value n (i)) represents the preprocessed review text x″ n The result of the word segmentation x″ n (i) the number of occurrences;
[0205] Sum(value n (i)) indicates
[0206] S24: Select the word segmentation results that successfully match the food evaluation vocabulary and whose importance is higher than the preset threshold, and use the selected word segmentation results and the nearest context word segmentation results of the selected word segmentation results as the pre-processed review text x″ n Keywords, comment text x″ after preprocessing according to keywords n The order in the text is sorted to form the preprocessed comment text x″ n The keyword sequence:
[0207] key n =(key n (1),key n (2),...,key n (k),...,key n (K n ))
[0208] in:
[0209] key n Represents the preprocessed comment text x″ n The keyword sequence, key n (k) represents the preprocessed comment text x″ n The kth keyword, K n Represents the preprocessed comment text x″n The total number of keywords, k∈[1,K n ].
[0210] S3: Construct a spicy food preference evaluation index system, and determine the weight of each evaluation index based on the keyword sequence. Combine the rating information and sentiment polarity to form the weighted coded comment data of users on spicy food. The evaluation indicators in the spicy food preference evaluation index system include taste, spiciness, freshness of ingredients, and rationality of ingredient combination.
[0211] In the step S3, the rating information and the sentiment polarity are combined to form the weighted coded comment data of the user on spicy food, including:
[0212] According to the weight calculation results of different evaluation indicators, combined with the rating information and sentiment polarity, the weighted coding comment data of users on spicy food is constructed. The construction process of the weighted coding comment data corresponding to the nth group of purchase comment data collected is as follows:
[0213] S31: Extract the rating information y of the nth group of purchase review data n and sentiment polarity α n ;
[0214] S32: Extract the keyword sequence key of the nth group of purchase review data n , for the keyword sequence key n The keywords in the word vector representation and attention encoding are performed to obtain the keyword encoding sequence The keyword key n The keyword encoding result corresponding to (k) is
[0215] S33: Encoding sequence for keywords The keyword encoding results in the are weighted by combining the evaluation index weights, where the keyword encoding results The weighted processing formula is:
[0216]
[0217]
[0218] w0=0
[0219] in:
[0220] Indicates the keyword encoding result The corresponding weighted processing results;
[0221] Indicates the keyword sequence key nThe matching result between the kth keyword and the food evaluation vocabulary;
[0222] S34: weighted coded review data corresponding to the nth group of purchase review data:
[0223]
[0224] in:
[0225] f n Represents the weighted coded review data corresponding to the nth group of purchase review data collected.
[0226] S4: construct a preference evaluation model to calculate the preference evaluation result of spicy food, wherein the preference evaluation model takes the weighted coded review data as input and takes the preference of spicy food as output.
[0227] In the step S4, a preference evaluation model is constructed to calculate the preference evaluation result of spicy food, including:
[0228] Constructing a preference evaluation model, wherein the preference evaluation model takes weighted coded comment data as input and takes spicy food preference as output, wherein the preference evaluation model comprises an input layer, an initial preference distribution simulation layer, a preference distribution iteration layer and an output layer, wherein the input layer is used to receive the weighted coded comment data, the initial preference distribution simulation layer is used to generate an initial preference distribution, the preference distribution iteration layer is used to perform preference distribution iteration in combination with the weighted coded comment data, and the output layer is used to output the spicy food preference;
[0229] The process of using the preference evaluation model to evaluate the preference of spicy food is as follows:
[0230] S41: The input layer receives weighted coded review data corresponding to N groups of purchase review data;
[0231] S42: The initial preference distribution simulation layer extracts rating information from N groups of weighted coded comment data to obtain the ratio of comments with different rating values as the initial preference distribution Q0;
[0232] S43: The preference distribution iteration layer combines the weighted coded comment data to perform preference distribution iteration, wherein the current iteration number of the preference distribution is d, the maximum iteration number is N, and the initial value of d is 0;
[0233] S44: The iteration strategy of preference distribution is:
[0234]
[0235]
[0236] in:
[0237] Q d+1 represents the d+1th iteration result of the preference distribution;
[0238] W4 represents the distribution iteration parameter;
[0239] represents the keyword encoding result after weighted processing in the dth group of weighted coded comment data;
[0240] S45: Let d = d + 1, return to step S44 to iterate the preference distribution until the maximum number of iterations is reached, and the preference distribution Q that reaches the maximum number of iterations is N The mean of the rating information in is used as the calculation result of the spicy food preference evaluation.
[0241] Embodiment 2:
[0242] like Figure 2 , which is a functional module diagram of a spicy food preference evaluation system provided by an embodiment of the present invention, which can implement the spicy food preference evaluation method in Example 1.
[0243] The spicy food preference evaluation system 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the spicy food preference evaluation system can include a review data collection module 101, a sentiment polarity judgment module 102 and a preference evaluation device 103. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0244] The review data collection module 101 is used to obtain the purchase review data of users on spicy food from the e-commerce platform and pre-process the review text in the purchase review data;
[0245] The sentiment polarity judgment module 102 is used to judge the sentiment polarity of the pre-processed review text in combination with the rating information, classify the purchase review data into positive, negative or neutral sentiment, and extract the keyword sequence of the pre-processed review text;
[0246] The preference evaluation device 103 is used to construct a spicy food preference evaluation index system, determine the weight of each evaluation index based on the keyword sequence, combine the rating information and sentiment polarity to form the user's weighted coded comment data on spicy food, construct a preference evaluation model, and calculate the spicy food preference evaluation result.
[0247] In detail, each module in the spicy food preference evaluation system 100 of the embodiment of the present invention is used in the same manner as described above. Figure 1The same technical means as the spicy food preference evaluation method described in and can produce the same technical effects are used, which will not be repeated here.
[0248] Embodiment 3:
[0249] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing a method for evaluating the preference of spicy food provided by an embodiment of the present invention.
[0250] The electronic device 1 may include a processor 10 , a memory 11 , a communication interface 13 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as a program 12 .
[0251] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 may be used not only to store application software and various types of data installed in the electronic device 1, such as the code of the program 12, etc., but also to temporarily store data that has been output or is to be output.
[0252] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (such as the program 12 for implementing the spicy food preference evaluation) and calls the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
[0253] The communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices, and to achieve connection and communication between internal components of the electronic device.
[0254] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0255] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0256] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0257] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0258] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0259] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0260] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0261] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for evaluating the liking of spicy food, characterized in that: The method comprises: S1: Obtaining users' purchase review data on spicy food from the e-commerce platform, where the purchase review data includes review text and rating information, and preprocessing the review text in the purchase review data; S2: Combine the rating information to judge the sentiment polarity of the preprocessed review text, divide the purchase review data into positive, negative or neutral sentiment, and extract the keyword sequence of the preprocessed review text; Combine the rating information with the preprocessed review text The sentiment polarity judgment is performed, and the sentiment polarity judgment result of the comment text is used as the sentiment polarity of the corresponding purchase comment data, and the purchase comment data is divided into positive, negative or neutral sentiment, where the comment text The emotional polarity judgment process is as follows: Use the Word2vec model to preprocess the comment text Each word segmentation result in is represented by a word vector, and the word vector representation sequence corresponding to the word segmentation result is obtained: ; in: Indicates comment text The word vector represents the sequence, Indicates comment text The word vector representation of the i-th word segmentation result; Perform word attention calculation on the word vector representation sequence, where the word vector represents The word attention calculation result is: ; ; in: Representation of word vectors The word attention calculation results of ; represents an exponential function with a natural constant as base; represents the L1 norm; Representation of word vectors The mapping result is represents the mapping weight matrix, Indicates the mapping bias; Based on the word attention calculation results, the word vector representation sequence is encoded with attention to obtain the word attention encoding sequence: in: Indicates comment text The word attention encoding sequence of Indicates comment text The attention encoding result of the i-th word segmentation result in ; Generate review text The sentiment polarity probability vector is: in: Indicates comment text Corresponding purchase review data Rating information in ; Represents the mean value of the rating information in the N groups of purchase review data collected; Represents the standard deviation of the rating information in the collected N groups of purchase review data; Represents the convolution parameter matrix; Represents the dimension reduction mapping matrix; Indicates comment text The sentiment polarity probability vector of Sentiment polarity probability vector , Comment text in sequence The probability that the sentiment polarity of is positive, neutral, or negative; Select the sentiment polarity with the highest probability value as the purchase review data Emotional polarity ,in 1 or 0 or -1, In order to indicate the purchase review data The sentiment polarity is positive, neutral, and negative; Extract the keyword sequence of the preprocessed review text; Extract the keyword sequence of the preprocessed comment text, where the preprocessed comment text The keyword sequence extraction process is as follows: S21: constructing a food evaluation vocabulary, wherein the food evaluation vocabulary is a vocabulary composed of common words that describe the taste, spiciness, freshness of ingredients, and rationality of ingredient combinations of spicy foods; S22: Preprocessed comment text In The word segmentation results are matched with the food evaluation vocabulary, where the word segmentation results The matching results are: , A value of 0 indicates that no common words in the food evaluation vocabulary are successfully matched. for The commonly used words in the food evaluation vocabulary that successfully match the taste, spiciness, freshness of ingredients, and rationality of ingredient combination of spicy food are represented in turn; S23: Calculate the preprocessed comment text The importance of each word segmentation result in The importance calculation formula is: in: Indicates word segmentation results The importance of Represents the preprocessed comment text Chinese word segmentation results Number of occurrences; Represents the sum of the importance of all segmentation results; N represents the number of groups of purchased review data obtained; S24: Select the word segmentation results that successfully match the food evaluation vocabulary and whose importance is higher than the preset threshold, and use the selected word segmentation results and the nearest context word segmentation results of the selected word segmentation results as the pre-processed review text Keywords, comment on the text after preprocessing according to the keywords The order in the text is sorted to form the preprocessed comment text. The keyword sequence: in: Represents the preprocessed comment text The keyword sequence of Represents the preprocessed comment text The kth keyword of Represents the preprocessed comment text The total number of keywords, ; S3: Construct a spicy food preference evaluation index system, determine the weight of each evaluation index based on the keyword sequence, and combine the rating information and sentiment polarity to form the weighted coding comment data of users on spicy food. The evaluation indexes in the spicy food preference evaluation index system include taste, spiciness, freshness of ingredients, and rationality of ingredient matching; Construct a spicy food preference evaluation index system, where the evaluation indexes in the spicy food preference evaluation index system are: , which correspond to taste, spiciness, freshness of ingredients and rationality of ingredients matching. The weight of each evaluation index is determined based on the keyword sequence. The weight calculation formula is: in: Indicates evaluation index The weight of ; It represents the number of segmentation results describing the taste, spiciness, freshness of ingredients and rationality of ingredient combination of spicy food in the successfully matched food evaluation vocabulary; It represents the set of segmentation results describing the taste, spiciness, freshness of ingredients and rationality of ingredient combination of spicy food in the food evaluation vocabulary that matches successfully. , Represents the word segmentation result set Any word segmentation result in Indicates word segmentation results The frequency of occurrence in N sets of keyword sequences; Combine the rating information and sentiment polarity to form the weighted coding review data of users on spicy food; According to the weight calculation results of different evaluation indicators, combined with the rating information and sentiment polarity, the weighted coding comment data of users on spicy food is constructed. The construction process of the weighted coding comment data corresponding to the nth group of purchase comment data collected is as follows: S31: Extracting the rating information of the nth group of purchase review data and emotional polarity ; S32: Extracting the keyword sequence of the nth group of purchase review data , for the keyword sequence The keywords in the word vector representation and attention encoding are performed to obtain the keyword encoding sequence , where the key words The corresponding keyword encoding result is ; S33: Encoding sequence for keywords The keyword encoding results in the are weighted by combining the evaluation index weights, where the keyword encoding results The weighted processing formula is: in: Indicates the keyword encoding result The corresponding weighted processing results; Represents a keyword sequence The matching result between the kth keyword and the food evaluation vocabulary; S34: weighted coded review data corresponding to the nth group of purchase review data: in: represents the weighted coded review data corresponding to the nth group of purchase review data collected; S4: constructing a preference evaluation model to calculate the preference evaluation result of the spicy food, wherein the preference evaluation model takes the weighted coded review data as input and takes the preference of the spicy food as output; The preference evaluation model takes weighted coded comment data as input and takes spicy food preference as output, wherein the preference evaluation model comprises an input layer, an initial preference distribution simulation layer, a preference distribution iteration layer and an output layer, wherein the input layer is used to receive the weighted coded comment data, the initial preference distribution simulation layer is used to generate an initial preference distribution, the preference distribution iteration layer is used to perform preference distribution iteration in combination with the weighted coded comment data, and the output layer is used to output the spicy food preference; The process of using the preference evaluation model to evaluate the preference of spicy food is as follows: S41: The input layer receives weighted coded review data corresponding to N groups of purchase review data; S42: Initial preference distribution simulation layer extracts rating information from N groups of weighted coded comment data and obtains the ratio of comments with different rating values as the initial preference distribution ; S43: The preference distribution iteration layer combines the weighted coded comment data to perform preference distribution iteration, wherein the current iteration number of the preference distribution is d, the maximum iteration number is N, and the initial value of d is 0; S44: The iteration strategy of preference distribution is: in: represents the d+1th iteration result of the preference distribution; represents the distribution iteration parameter; represents the keyword encoding result after weighted processing in the dth group of weighted coded comment data; S45: Order , return to step S44 to iterate the preference distribution until the maximum number of iterations is reached, and the preference distribution that reaches the maximum number of iterations The mean of the rating information in is used as the calculation result of the spicy food preference evaluation.
2. A spicy food preference evaluation method as claimed in claim 1, characterized in that: In step S1, the purchase review data of users on spicy food is obtained from the e-commerce platform, including: The purchase review data of users on spicy food is obtained from the e-commerce platform, where the purchase review data includes the review text and rating information. The obtained purchase review data is expressed in the following form: in: Indicates the nth group of purchase review data obtained. Represents the review text in the nth group of purchase review data, represents the rating information in the nth group of purchase review data, and N represents the number of groups of the obtained purchase review data; Preprocess the review text in the purchase review data.
3. A spicy food preference evaluation method as claimed in claim 2, characterized in that: In step S1, the review text in the purchase review data is preprocessed, including: Preprocess the review text in the purchase review data, where the purchase review data Comment text The preprocessing process is: S11: Based on review text Punctuation in comment text Perform sentence processing to obtain the comment text Compare each sentence text, delete the completely repeated sentence texts, and keep only the unique sentence texts; S12: Comments on the text that deleted repeated sentences Perform compression processing, where the compression processing rules are: Set the unit length of repeated characters in compression processing to e, where ; Select text characters of length e from the comment text. If the number of consecutive occurrences of the text characters reaches times or more, the sequence of consecutive text characters is compressed into a single text character, where the calculation formula for the consecutive occurrence limit is: S13: Comment text after statistical compression processing The length of each sentence in the text is calculated by the character length of each sentence. The sentence text with a character length of less than 4 is deleted to obtain the comment text after sentence processing. ; S14: Use Jieba word segmentation tool to analyze the comment text Perform word segmentation, and filter the word segmentation results based on the stop word list to obtain the comment text The preprocessing results are: in: Indicates comment text The preprocessing result, i.e. the preprocessed comment text; Indicates the preprocessing result The i-th word segmentation result in Indicates the preprocessing result The total number of word segmentation results in .
4. A spicy food preference evaluation system, characterized in that: The system comprises: The review data collection module is used to obtain users' purchase review data on spicy food from the e-commerce platform and pre-process the review text in the purchase review data; The sentiment polarity judgment module is used to judge the sentiment polarity of the preprocessed review text in combination with the rating information, classify the purchase review data into positive, negative or neutral sentiment, and extract the keyword sequence of the preprocessed review text; A preference evaluation device is used to construct a spicy food preference evaluation index system, determine the weight of each evaluation index based on a keyword sequence, combine rating information and sentiment polarity to form weighted coded comment data of users on spicy food, construct a preference evaluation model, and calculate the preference evaluation result of spicy food to realize a spicy food preference evaluation method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Sentiment word polarity analysis method, apparatus and device
CN106919551A
Online comment sentiment analysis method for fresh cold-chain logistics
CN111598454A