Efficient Long Short-Term Memory-Based Sentiment Analysis Of E-Commerce Reviews Part 2
Jan 18, 2024
Muhammad et al. [20] presented a model for sentiment analysis by using word2vec and LSTM for hotel reviews.
Muhammad is the prophet and founder of Islam. He is known as a wise, wise, and wise man. His memory is very powerful, which makes him very effective at processing information and expressing his thoughts.
Muhammad's memory has a lot to do with his education and experience. According to records, he was often immersed in thinking and reflection in his youth. This curiosity and thirst for knowledge helped him build a strong knowledge base and memory ability.
In addition, Muhammad's intelligence also played a large role in his memory abilities. He is smart, witty, insightful, and has logical thinking ability, which is very advantageous when dealing with complex information. This advantage helped him better manage and control the memory process, thereby improving his memory.
However, Muhammad's memory was not innate but improved through hard work and practice. He often carries out memory training, such as repeated reading, dictation, and speech, to help him understand and master knowledge more deeply.
Muhammad's memory was not just a natural talent, it was improved through hard work and practice. This shows that each of us can improve our memory and improve our learning and work efficiency through learning and practice. Let us, like Muhammad, actively work hard to continuously improve our memory skills, to achieve greater success in life and work! It can be seen that we need to improve memory, and Cistanche deserticola can significantly improve memory, because Cistanche deserticola can also regulate the balance of neurotransmitters, such as increasing the levels of acetylcholine and growth factors. These substances are very important for memory and learning. In addition, Meat can also improve blood flow and promote oxygen delivery, which can ensure that the brain receives sufficient nutrients and energy, thereby improving brain vitality and endurance.

Click Know to improve short-term memory
For this study, the data was collected by crawling the travel website using selenium and scrap. +e The foremost purpose of this experiment was to analyze the accuracy by changing the parameters of word2vec and LSTM. +e results showed that the mean accuracy of 85.96 could be achieved using the parameters, which showed promising results.
Zhao et al. [21] introduced a new technique to analyze the customers' sentiments from reviews on e-commerce websites. +e proposed optimized technique "the Local Search Improvised Bat Algorithm based Elman Neural Network (LSIBA-ENN)" involves four steps and detects the polarity and classifies the sentiments of the reviews. +e data for this research was gathered by using the web scrapping tool on e-commerce websites to extract customer reviews.
In addition to preprocessing the data, this study utilizes "Log Term Frequency-based Modified Inverse Class Frequency (LTF-MICF) and Hybrid Mutation based Earth Warm Algorithm (HMEWA)" for term weighting and feature selection. +e proposed methodology outsmarted other baseline techniques in terms of prediction accuracy.
Jiang [22] proposed a model to classify the sentiments of reviews obtained from the e-commerce platform Taobao. +e study utilizes the machine learning algorithm as well as support vector machine for classification and improved particle swarm optimization (IPSO) to optimize the parameters. +e data for the study was gathered by crawling the comments from the website. +e experimental results demonstrated that the combined approach of SVM and IPSO had higher accuracy. However, the majority of the existing models suffer from overfitting [23–25], poor convergence speed [26–28], and vanishing gradient problems [29–31].
3. Experimental Study
+is section gives a clear overview of the methodology used in the project for the classification of sentiment. +e technique that has been used is a Long Short-Term Memory network, which is used to classify a large number of Amazon database reviews. +e embedding used is word2vec, which has been custom-trained according to the database.
Tuning the word2vec according to the dataset improves the overall performance of the model. +e benefit of using LSTM is that it gives better results even for the unstructured review data. It is capable of obtaining useful functionality for resources containing long-term dependencies.
+e data is collected from the Amazon review dataset, which is then preprocessed. Word2vec embeddings form an important step in the preprocessing of the data. Train and test data were created. +e training data is split into train and validation datasets. +e custom word2vec model is trained per database. +e feature vector is obtained, which is then used as the embedding layer for the LSTM model.
Keras is used for building the LSTM sequential model with max features equal to 50,000 and embedding size equal to 16. +e model is then trained for 10 epochs. +e model is tested based on sklearn performance metrics. +e process of obtaining features is depicted in Figure 2.
3.1. Dataset. To generate accurate results, the dataset used should be large and enriched. +e dataset has been collected from the cell phone and accessories section online of the Amazon Reviews dataset (2018). +e dataset consists of a total of 938,261 reviews, among which 47901 are of unique products and 153124 are unique user reviews. +e dataset initially consists of 7 columns, namely, a rating which varies from 1 to 5, review time, reviewer ID, product ID, and review text summary.
After dropping the duplicates, the dataset consists of 938254 records, and Table 2 shows a snippet of the original dataset records.
3.2. Methodology. We have custom-trained our word2vec model to be used with the LSTM model for classification. Word2vec is a word embedding that is used to represent a word by a collection of several terms of a vector. It is a way of mapping a word into a vector space. +e dataset is loaded into a pandas data frame. For developing a custom word2vec model, the first step is the preprocessing of data.
We only look at the rating and review text and drop everything else. +e text is cleaned by removing the punctuation. A subsample of the text is created from close to 200,000 reviews and the clean text method is applied to convert every review into a list of words. +is list of words now acts as the input to the genism word2vec model.
We have built a custom-trained skip-gram word2vec model and instantiated the model with dimensions: the size of word vectors as 100, window size equal to 15, min_count as 2 for words appearing less than 2 times in our corpus, negative equal to 5, and sampling rate equal to 1e−5. We have used all these dimensions to build a vocabulary from our review sentences.

We train our word2vec model for 1000 epochs. +en we compute the loss at every epoch. +e loss is high at the beginning and it decreases towards the last epoch. +e loss at epoch 0 is 2239394.0 and the loss at epoch 1000 is 11504.0. +e saved model is then reloaded and operations are performed on it.
For example, if we want to find words similar to noise in our dataset, we get canceling and headphones.
Similarly, we can also find the similarity between certain words such as earphones and headphones which is 0.48756, and the similarity between the words charge and charger is 0.89264.
To reduce the dimensions of our data, we have used TSNE visualization to plot the data into two dimensions. Now, these word vectors can be used for further classification. +ese embeddings are then used as features for further streaming.
3.2.1. Data Preparation for LSTM. Our dataset consists of 938254 records with most of the reviews having a score distribution of more than 3. We have first calculated the number of words for each review. +e average mean is used as statistics to find the average length of reviews. +e mean length of the review is 44.59 and the maximum length is 4303.
We have created a dataset consisting of reviews having 100 words or less. Reviews whose length is more than 20 but less than 100 are categorized under short reviews and the rest are categorized under long reviews. +e number of short reviews is 411313 and long reviews are 100239. Hyperparameters used in the model are described in Table 3.
Next, we have defined the sentiment rating as positive if the rating is greater than or equal to 3; otherwise, the rating is negative. We have considered the review text and sentiment for creating the train data set. +e test data consists of products having at least more than 10 reviews.
After distribution, the training dataset consisted of a total of 203891 records, among which 175910 belonged to the positive class and 27981 to the negative class. +e test dataset consisted of a total of 686345 records, among which 592118 belonged to the positive and 94227 to the negative class.
In this study, we have used Keras to build our LSTM model, which takes a maximum of 50,000 features as the input to the embedding layer. Long short-term memory (LSTM) is a type of recurrent neural network that uses an internal mechanism that regulates the flow of information. +is internal mechanism consists of gates that need to be trained such that they can accurately filter out irrelevant information and retain useful information.

Figure 3 shows the basic architecture of the LSTM model in our proposed methodology.
Ht−1 and Xt are the inputs to the LSTM unit; Ht−1, commonly referred to as short-term memory, takes the output from the previous states as the input. +e memory cell or the long-term memory, Ct −1, helps in carrying relevant information throughout the process of a sequence. +e LSTM architecture combines three gates: forget gate, input gate, and output gate. In the LSTM unit, tanh and sigmoid functions are used to obtain these gates.
+e train data was then split into train and validation data of equal length. +e length of the data was calculated to be 101945 and the class distribution was {1: 87955, 0: 13990}. To create the TensorFlow train test and validation datasets, we need to convert our train data into sequences. We have padded them to a maximum length of 100 so that all sequences are of the same length. +e train and test labels

For more information:1950477648nn@gmail.com






