This article presents a comprehensive approach to sentiment analysis in social networks by leveraging modern text processing methods and machine learning algorithms. The primary focus is the integration of the Sentence-BERT model for text vectorization and XGBoost for sentiment classification. Using the Sentiment140 dataset, an extensive study of text messages labeled with sentiment annotations was conducted. The Sentence-BERT model enables the generation of high-quality vector representations of textual data, preserving both lexical and contextual relationships between words. This contributes to a more accurate semantic understanding of messages, thereby enhancing classification performance. The results of the study demonstrate the high efficacy of the proposed model, achieving an overall classification accuracy of 90%. The ROC curve (AUC) value of 0.88 further confirms the model’s capability to distinguish between sentiment classes effectively. The Precision-Recall curve analysis highlights a strong balance between precision and recall, which is particularly crucial for handling imbalanced datasets. Additionally, calibration curves indicate a high degree of consistency between predicted probabilities and actual outcomes, while the cosine similarity matrix validates the model’s ability to capture semantic proximity between texts. Beyond classification, the study also examines the F1-score at various threshold levels, enabling the identification of the optimal operational range for the model. The cumulative gain chart illustrates the progressive improvement in classification performance, emphasizing the model’s stability when processing large-scale textual data. The proposed approach serves as a versatile tool for sentiment analysis, text clustering, and trend identification in social networks. The findings of this study have practical implications in fields such as marketing, public opinion analysis, automated content moderation, and social trend prediction.
No takes yet. Share an insight, caveat, or question.
Batiuk et al. (2025) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: