Transformer based model for sentiment analysis using moth flame optimization on movie review
摘要
The World Wide Web spanning blogs, review sites, forums, and social networks—has become a massive hub of information where people share their arguments, opinions, emotions, and perspectives on politics, brands, products, and social events. This user-generated content plays a powerful role in shaping the decisions of readers, influencing advertisers, movie reviews and even swaying politicians. In the field of natural language processing (NLP), analyzing these sentiments is not straightforward. One of the biggest challenges is dealing with incomplete or inconsistently tagged data. This study focuses on key issues such as lexical diversity (the wide variety of words people use), imbalanced datasets (where some sentiments are overrepresented compared to others), and the difficulty of capturing long-distance relationships between words in text. To tackle these challenges, the paper explores a hybrid approach using XLNet, a transformer-based model, combined with Moth-Flame Optimization (MFO). XLNet excels at understanding the contextual relationships between words. Meanwhile, MFO is applied to optimize the model by searching for the best possible weights, ensuring that the most relevant features are used for prediction. The dataset chosen for this study is the IMDB movie reviews, which was first cleaned and preprocessed. XLNet then generated tokens, mask, and segmentation embeddings, while MFO fine-tuned the model to achieve global optimization. This combination significantly improved performance, with the hybrid technique reaching an impressive accuracy of 92.4%. When compared with other well-known machine learning and transformer models, the proposed method consistently outperformed them. Given these promising results, the study suggests that this approach could be applied to a wide range of real-world problems, from analyzing social media trends to addressing commercial challenges.