Real-Time Sentiment Classification on Social Media Platform Using Online Machine Learning
摘要
This paper presents a comprehensive approach for sentiment classification on Twitter using a combination of data collection, preprocessing, sentiment analysis, and machine learning classifiers. Leveraging the Twitter API, real-time data streams of tweets containing phrases related to various content were dynamically collected. The collected tweets underwent preprocessing techniques including text cleaning, lemmatization, and the removal of stopwords and special characters. Later, we applied the VADER lexicon approach to label tweets based on their emotional polarity and intensity. Following preprocessing and sentiment analysis, textual features were extracted using TF-IDF vectorization to represent the tweets numerically. Five ML classifiers, namely Random Forest, Decision Tree, SVM, Naive Bayes, and XGBoost classifiers, were trained on the extracted features to classify tweets into categories of positive, negative, or neutral sentiment. The performance of each classifier was evaluated using metrics such as accuracy, precision, and recall. Random forest has a better accuracy of 96% after applying five algorithms. The experimental results demonstrated the effectiveness of the proposed approach in accurately classifying positive and negative sentiments on Twitter.