Sentiment Analysis of Public Comments on X Social Media Related to Israeli Product Boycotts Using The Long Short-Term Memory (LSTM) Method - Panggabean, Pitra Rahmadani; Asrianda, Asrianda; Aidilof, Hafizh Al-Kausar (Politeknik Negeri Batam, 2025)
The boycott of Israeli products is a widely discussed issue on social media, particularly on X. This study aims to analyze public sentiment regarding the boycott using the Long Short-Term Memory (LSTM) method. Data was collected via the X API, resulting in 800 comments after cleaning and removing duplicates from initially 980 crawled datasets. LSTM was chosen for this analysis due to its superior ability to process sequential data like text and effectively capture long-term dependencies in natural language, which is crucial for accurate sentiment classification. Data was processed through preprocessing steps, sentiment labeling, and Term Frequency-Inverse Document Frequency (TF-IDF) weighting before being fed into the LSTM model. Sentiment was classified into three categories: positive, negative, and neutral. Model evaluation was conducted using accuracy, precision, recall, and F1-score metrics. The results show that the LSTM model achieved an accuracy of 80.62%, with negative sentiment dominating, followed by neutral and positive. This study demonstrates that the LSTM method effectively classifies public sentiment and can be applied to inform public policy decisions, map public opinion trends, and monitor responses to foreign policy issues related to the Israeli-Palestinian conflict.