Sentiment analysis based on food e-commerce reviews

Customer feedback is of great significance for food manufacturers such as wine to improve product quality. With the increase of consumer users, user feedback collection and classification methods in the traditional food industry have become very time-consuming. Aiming at this problem, this paper proposes a method of embedding TD-IDF weighted Word2vec word vector into a bidirectional long and short-term memory network based on the attention mechanism.


INTRODUCTION
The wine production industry is a highly competitive market, and it is developing very rapidly. Wine producers and some wine sellers use traditional user feedback forms, which often require a lot of effort to classify the review text uploaded by users. The feedback from users on Online wine shop on wine evaluations can be a good source for our sentiment analysis. Users who have purchased wine labels multiple times are more sensitive to the taste of wine, and the evaluation data they provide are more valuable to manufacturers. We crawled the comment text of the above-mentioned users. For the sentiment classification task of feedback evaluation text, although some effective models have been proposed, there are still some problems, such as: how to make Word2vec better reflect the key features of the text, how to effectively use context information and semantic features. In order to solve the above problems, and at the same time, a TF-IDF [1] weighted Word2vec [2] word vector embedding is proposed for the user evaluation text containing a large number of characteristics describing the taste, aroma, color and vintage of the wine. At the same time, the attention mechanism [3] is used to help BILSTM [4] to carry out the text before and after the text. According to the characteristics of the text, the model we proposed captures the important words with distinguishing degree in the text, so as to perform more effective emotion classification work.

TF-IDF
Some text. The main idea of TF-IDF: If a word or phrase appears frequently in an article and rarely appears in other articles, it is considered that the word or phrase has good classification ability and is suitable for classification. In fact, TF-IDF is TF*IDF, TF term frequency (Term Frequency), IDF inverse document frequency (Inverse Document Frequency). Term Frequency (Term Frequency, TF) represents the frequency at which the keyword w appears in the document D i :

ATTENTION MECHANISM
When using the bidirectional long and short-term memory network model to predict different tags, not all text words in the context make the same contribution. The attention mechanism captures the important parts of the sentence to enhance accuracy.
The emotional polarity of a sentence is not only related to contextual information, but also highly related to viewpoint terms and aspect terms. But given a sentence, not all context words have the same contribution to the semantics of the sentence. To solve this problem, the attention mechanism is used to increase their importance by giving them more weight, thereby extracting these more important words. The attention mechanism can highlight the impact of input on output and optimize the traditional model by calculating the attention probability distribution. As shown in Figure 2

BILSTM
LSTM is a special recurrent network model, which overcomes the gradient explosion problem of the RNN model in the training process. The bidirectional long short-term memory network (BiLSTM) consists of the following: Two independent LSTMs can merge information from two directions.
i t , f t , o t , c t represent the input gate, forget gate, output gate, memory cell at time t, W i , W f , W o and W c represent the weight matrix corresponding to different control gates, b i , b f , b o , bc represent offset vector, and c t represents the intermediate state of input, x t represents the input vector at time t, h t represents the output result at time t, ⊙ represents the dot multiplication operator.
The structure of BILSTM is shown in Figure 3 and the basic framework of the TF-IDF-weighted Word2vec word vector embedding based on the self-attention bidirectional long and short-term memory network model is shown in Figure 4.

Experiment Results
In the same experimental environment, in order to verify the performance of the Our model, we use the BILSTM [5] and CNN [6] as a comparison experiment. As shown in Table 3: Our Model has achieved good results and has great advantages compared with BILSTM and CNN.

CONCLUSION
Compared with the BILSTM and CNN algorithms, this algorithm has greater advantages and can complete the task of wine sentiment classification. In the future, we will further optimize the model based on the characteristics of Chinese wine texts.