A Machine Learning-Based Framework for Sentiment Detection from Textual Data

  • Sudhanshu Panwar Research Scholar, Department of Computer Science & Engineering, HNB Garhwal University (A Central University), Srinagar Garhwal Uttarakhand, India
  • Pritam Singh Negi Assistant Professor, Department of Computer Science & Engineering HNB Garhwal University (A Central University), Srinagar Garhwal Uttarakhand, India
Keywords: Sentiment Detection, Feature Extraction, TF-IDF, Machine Learning, SVM, LR, NB, RF

Abstract

Sentiment detection from textual content plays a vital role in understanding hu-man opinions and behavioral patterns across digital platforms. This study pre-sents a systematic approach for sentiment classification using classical machine learning techniques. The experiments are conducted on the Combined Sentiment dataset, which is publicly available on Kaggle. To improve data quality and mini-mize noise, several text pre-processing steps are applied, including lowercase conversion, punctuation removal, and stopword elimination. After pre-processing, meaningful textual features are extracted using the TF-IDF method, which effectively represents the relevance of terms within the dataset. The pro-cessed data is then partitioned into training and testing sets using an 80:20 ratio. Multiple ML classifiers, including Support Vector Machine (SVM), Logistic Re-gression (LR), Naïve Bayes (NB), and Random Forest (RF), are employed to evaluate their effectiveness in emotion classification. The comparative analysis reveals that the SVM classifier achieves superior accuracy compared to other models. Appropriate classifier selection in enhancing emotion classification per-formance.

Published
2026-02-27