May 2025
The use of machine learning to analyze sentiments has attained considerable interest in the past few years. The task of analyzing sentiments has becfigome increasingly important and challenging. Due to the specific attributes of this type of data, including length of text, spelling errors, and abbreviations, unconventional methods and multiple steps are required for effectively analyzing sentiment in such a complex environment. In this research, two distinct word embedding models, GloVe and Word2Vec, were utilized for vectorization. To enhance the performance long short-term memory (LSTM), the model was optimized using the amended dwarf mongoose optimization (ADMO) algorithm, leading to improvements in the hyperparameters. The LSTM–ADMO achieved the accuracy values of 97.74 and 97.47 using Word2Vec and GloVe, respectively on IMDB, and it could gain the accuracy values of 97.84 and 97.51 using Word2Vec and GloVe, respectively on SST-2. In general, it was determined that the proposed model significantly outperformed other models, and there was very little difference between the two different word embedding techniques.