Submitted:
23 October 2025
Posted:
27 October 2025
You are already at the latest version
Abstract
Sentiment analysis benefits from representations that highlight polarity-bearing terms while suppressing sentiment-ambivalent ones. This paper introduces Term Sentiment Entropy (TSE), a supervised, information-theoretic global factor for sparse text representation. TSE quantifies how selectively a term associates with sentiment labels in the training fold, and it is composed with TF-IDF to up-weight terms that are distributionally concentrated within a class and down-weight those that are diffuse across classes. We evaluate the approach on four public datasets spanning product reviews, social media, and long-form movie reviews under a fixed protocol with Naïve Bayes, Random Forest, and a linear Support Vector Classifier. Results reported as Accuracy, Macro-Precision, Macro-Recall, and Macro-F1 show that TF-IDF plus TSE often matches or improves performance on short and noisy texts such as Amazon cell-phone reviews and two Twitter corpora, while achieving near-ceiling parity with strong baselines on IMDb. The method is lightweight, reproducible, and compatible with conventional preprocessing and feature-selection pipelines because it requires only label statistics from the training data and no external lexicons. We also discuss limitations related to label quality and class imbalance, and we outline imbalance-aware and learned variants of TSE as natural extensions.
Keywords:
1. Introduction
2. Related Work
3. Materials and Methods
3.1. Problem Setting and Notation
3.2. Baseline Representation
3.3. Term Sentiment Entropy (TSE)
3.3.1. Worked Example on a Toy Corpus
3.3.2. Experimental Pipeline
3.4. Datasets
3.5. Preprocessing
- Unicode NFC normalization; lowercasing.
- Language-appropriate tokenization (fixed per dataset).
- Stopwords: dataset-official lists when available; otherwise none.
- Vocabulary pruning: (default 2).
- Natural-log TF and smoothed IDF, with all corpus statistics computed on the training fold.
- Smoothing constant (default 1); notation as in Section 3.1.
3.6. Classifiers
3.7. Experimental Protocol and Metrics
3.8. Practical Considerations
- Short and noisy text. Microtexts, for example tweets, amplify lexical ambiguity. TSE down-weights sentiment-ambivalent terms. Our comparisons among TF-IDF and its compositions with TSE provide context on robustness in short-text settings.
- Temporal drift. For evolving corpora, time-aware adjustments, for example term recency, can complement TSE [19].
3.9. Reproducibility Statement



4. Results
4.1. Reporting Conventions
4.2. Amazon Cell Phones Reviews

| Tokenize weight | NB | RF | SVC | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | |
| TF | 0.505 | 0.259 | 0.256 | 0.211 | 0.559 | 0.592 | 0.414 | 0.429 | 0.594 | 0.756 | 0.416 | 0.441 |
| IDF | 0.504 | 0.435 | 0.448 | 0.421 | 0.571 | 0.532 | 0.438 | 0.450 | 0.756 | 0.835 | 0.394 | 0.426 |
| CMI(pos) | 0.408 | 0.185 | 0.201 | 0.162 | 0.343 | 0.190 | 0.211 | 0.194 | 0.416 | 0.092 | 0.192 | 0.120 |
| TSE | 0.491 | 0.230 | 0.246 | 0.198 | 0.569 | 0.529 | 0.436 | 0.447 | 0.394 | 0.363 | 0.303 | 0.266 |
| TF_IDF | 0.540 | 0.434 | 0.435 | 0.422 | 0.556 | 0.611 | 0.414 | 0.430 | 0.592 | 0.726 | 0.414 | 0.433 |
| TF_IDF_CMI(pos) | 0.461 | 0.271 | 0.215 | 0.150 | 0.564 | 0.609 | 0.421 | 0.435 | 0.603 | 0.776 | 0.420 | 0.437 |
| TF_IDF_TSE | 0.492 | 0.271 | 0.260 | 0.223 | 0.553 | 0.588 | 0.407 | 0.422 | 0.414 | 0.442 | 0.308 | 0.289 |
| TF_IDF_CMI(pos)_TSE | 0.534 | 0.439 | 0.442 | 0.430 | 0.554 | 0.535 | 0.413 | 0.422 | 0.635 | 0.395 | 0.427 | 0.427 |
4.3. Coronavirus Tweets NLP

| Tokenize weight | NB | RF | SVC | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | |
| TF | 0.277 | 0.139 | 0.227 | 0.135 | 0.346 | 0.377 | 0.327 | 0.320 | 0.317 | 0.403 | 0.280 | 0.255 |
| IDF | 0.336 | 0.330 | 0.339 | 0.330 | 0.350 | 0.367 | 0.332 | 0.309 | 0.333 | 0.343 | 0.297 | 0.255 |
| CMI(pos) | 0.211 | 0.194 | 0.194 | 0.188 | 0.234 | 0.216 | 0.203 | 0.180 | 0.244 | 0.113 | 0.197 | 0.129 |
| TSE | 0.277 | 0.289 | 0.252 | 0.249 | 0.337 | 0.350 | 0.313 | 0.293 | 0.291 | 0.323 | 0.249 | 0.213 |
| TF_IDF | 0.333 | 0.403 | 0.288 | 0.269 | 0.345 | 0.369 | 0.322 | 0.320 | 0.321 | 0.394 | 0.276 | 0.230 |
| TF_IDF_CMI(pos) | 0.292 | 0.201 | 0.235 | 0.155 | 0.332 | 0.360 | 0.300 | 0.295 | 0.333 | 0.392 | 0.272 | 0.224 |
| TF_IDF_TSE | 0.256 | 0.231 | 0.208 | 0.150 | 0.327 | 0.364 | 0.304 | 0.300 | 0.297 | 0.318 | 0.268 | 0.222 |
| TF_IDF_CMI(pos)_TSE | 0.337 | 0.334 | 0.332 | 0.326 | 0.344 | 0.356 | 0.320 | 0.308 | 0.334 | 0.344 | 0.296 | 0.255 |
4.4. Twitter US Airline Sentiment

| Tokenize weight | NB | RF | SVC | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | |
| TF | 0.517 | 0.272 | 0.337 | 0.232 | 0.668 | 0.622 | 0.542 | 0.545 | 0.668 | 0.633 | 0.539 | 0.545 |
| IDF | 0.608 | 0.557 | 0.576 | 0.557 | 0.635 | 0.593 | 0.569 | 0.568 | 0.627 | 0.622 | 0.518 | 0.521 |
| CMI(pos) | 0.640 | 0.585 | 0.569 | 0.569 | 0.632 | 0.581 | 0.553 | 0.553 | 0.658 | 0.675 | 0.531 | 0.532 |
| TSE | 0.561 | 0.467 | 0.420 | 0.400 | 0.638 | 0.586 | 0.550 | 0.552 | 0.603 | 0.504 | 0.465 | 0.453 |
| TF_IDF | 0.644 | 0.591 | 0.570 | 0.564 | 0.670 | 0.623 | 0.545 | 0.549 | 0.612 | 0.629 | 0.488 | 0.485 |
| TF_IDF_CMI(pos) | 0.575 | 0.588 | 0.435 | 0.390 | 0.653 | 0.636 | 0.558 | 0.557 | 0.657 | 0.615 | 0.546 | 0.551 |
| TF_IDF_TSE | 0.545 | 0.494 | 0.409 | 0.371 | 0.649 | 0.570 | 0.516 | 0.513 | 0.634 | 0.582 | 0.525 | 0.523 |
| TF_IDF_CMI(pos)_TSE | 0.629 | 0.568 | 0.572 | 0.563 | 0.672 | 0.612 | 0.562 | 0.562 | 0.638 | 0.641 | 0.521 | 0.528 |
4.5. IMDb 50K Movie Reviews

| Tokenize weight | NB | RF | SVC | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | Acc | Pre | Rec | F1 | |
| TF | 0.609 | 0.746 | 0.643 | 0.573 | 0.796 | 0.796 | 0.797 | 0.795 | 0.754 | 0.753 | 0.755 | 0.753 |
| IDF | 0.781 | 0.781 | 0.783 | 0.780 | 0.788 | 0.788 | 0.788 | 0.787 | 0.803 | 0.804 | 0.806 | 0.802 |
| CMI(pos) | 0.794 | 0.793 | 0.796 | 0.793 | 0.775 | 0.774 | 0.776 | 0.774 | 0.749 | 0.753 | 0.752 | 0.748 |
| TSE | 0.750 | 0.750 | 0.752 | 0.749 | 0.771 | 0.769 | 0.770 | 0.769 | 0.760 | 0.760 | 0.763 | 0.759 |
| TF_IDF | 0.767 | 0.784 | 0.778 | 0.767 | 0.775 | 0.774 | 0.777 | 0.774 | 0.773 | 0.774 | 0.776 | 0.772 |
| TF_IDF_CMI(pos) | 0.677 | 0.771 | 0.703 | 0.645 | 0.774 | 0.775 | 0.777 | 0.773 | 0.755 | 0.755 | 0.757 | 0.754 |
| TF_IDF_TSE | 0.701 | 0.727 | 0.716 | 0.699 | 0.774 | 0.774 | 0.775 | 0.773 | 0.725 | 0.727 | 0.728 | 0.724 |
| TF_IDF_CMI(pos)_TSE | 0.776 | 0.776 | 0.778 | 0.775 | 0.775 | 0.774 | 0.777 | 0.774 | 0.796 | 0.797 | 0.799 | 0.795 |
4.6. Cross-Dataset Synthesis
- Composition rather than isolation. Stand-alone TSE and stand-alone CMI(pos) rarely exceed TF-IDF. In contrast, TF_IDF_TSE and TF_IDF_CMI(pos)_TSE are competitive and in several cells reach the numerically highest Macro-F1 for a given classifier–dataset pair. This suggests using TSE as a complementary global factor alongside frequency- and rarity-based evidence rather than as a replacement.
- Classifier effects. Linear SVC is generally the most stable across corpora and weightings, which aligns with expectations for high-dimensional sparse text. NB is sensitive to weighting and class imbalance. RF often provides balanced precision–recall, though Macro-F1 can trail SVC on short texts.
- Domain effects. Twitter corpora yield lower absolute scores than review corpora, reflecting brevity and higher lexical noise. Improvements from sentiment-aware factors are more visible when classes are imbalanced or when discriminative sentiment terms are sparse, conditions under which entropy-based dispersion can help.
5. Discussion
5.1. Overall Empirical Findings
5.2. Why TSE Helps: An Information Theoretic View
5.3. Comparison with Alternative Supervised or Global Weightings
5.4. Dataset and Robustness Effects
5.5. Practical Implications
5.6. Limitations, Validity, and Future Work
6. Conclusions
Declaration of Generative AI and AI-assisted technologies in the writing process
Ethical Approval
Data Availability Statement
Acknowledgements
Conflicts of Interests
References
- R. N. Rathi and A. Mustafi, “The importance of Term Weighting in semantic understanding of text: A review of techniques,” Multimed Tools Appl, vol. 82, pp. 9761–9783, 2023. [CrossRef]
- P. Sheridan, Z. Ahmed, and A. A. Farooque, “A Fisher’s Exact Test Justification of the TF–IDF Term–Weighting Scheme,” Am Stat, 2025. [CrossRef]
- A. Moreo Fernández, A. Esuli, and F. Sebastiani, “Learning to Weight for Text Classification,” IEEE Trans Knowl Data Eng, vol. 32, no. 2, pp. 302–316, 2020. [CrossRef]
- T. Doğan and A. K. Uysal, “Improved inverse gravity moment term weighting for text classification,” Expert Syst Appl, vol. 130, 2019. [CrossRef]
- Z. Tang, W. Li, and Y. Li, “An improved supervised term weighting scheme for text representation and classification,” Expert Syst Appl, vol. 189, p. 115985, 2022. [CrossRef]
- A. Alshehri and A. Algarni, “TF-TDA: A Novel Supervised Term Weighting Scheme for Sentiment Analysis,” Electronics (Basel), vol. 12, no. 7, p. 1632, 2023. [CrossRef]
- T. Wang, Y. Cai, H. Leung, R. Y. K. Lau, H. Xie, and Q. Li, “On entropy-based term weighting schemes for text categorization,” Knowl Inf Syst, vol. 63, pp. 2313–2346, Sep. 2021. [CrossRef]
- S. K. Kattumannil, E. P. Sreedevi, and N. Balakrishnan, “A Generalized Measure of Cumulative Residual Entropy,” Entropy, vol. 24, no. 4, p. 444, 2022. [CrossRef]
- F. Foroghi, “Extensions of fractional cumulative residual entropy with applications,” Commun Stat Theory Methods, 2022. [CrossRef]
- L. Chen, L. Jiang, and C. Li, “Using modified term frequency to improve term weighting for text classification,” Eng Appl Artif Intell, vol. 101, p. 104215, 2021. [CrossRef]
- F. Shehzad, A. Rehman, K. Javed, K. A. Alnowibet, H. A. Babri, and H. T. Rauf, “Binned Term Count: An Alternative to Term Frequency for Text Categorization,” Mathematics, vol. 10, no. 21, p. 4124, 2022. [CrossRef]
- M. Okkalioglu, “TF-IGM revisited: Imbalance text classification with relative imbalance ratio,” Expert Syst Appl, vol. 217, p. 119578, 2023. [CrossRef]
- M. Siino, I. Tinnirello, and M. La Cascia, “Is text preprocessing still worth the time? A comparative survey on the influence of popular preprocessing methods on Transformers and traditional classifiers,” Inf Syst, vol. 121, p. 102342, 2024. [CrossRef]
- H. J. Alantari, I. S. Currim, Y. Deng, and S. Singh, “An empirical comparison of machine learning methods for text-based sentiment analysis of online consumer reviews,” International Journal of Research in Marketing, vol. 39, no. 1, pp. 1–19, 2022. [CrossRef]
- C. Li, W. Li, Z. Tang, S. Li, and H. Xiang, “An improved term weighting method based on relevance frequency for text classification,” Soft comput, vol. 27, no. 7, pp. 3563–3579, 2023. [CrossRef]
- K. Taha, P. D. Yoo, C. Yeun, and A. Taha, “A comprehensive survey of text classification techniques and their research applications: Observational and experimental insights,” Comput Sci Rev, vol. 54, p. 100664, 2024. [CrossRef]
- V. Dogra et al., “A Complete Process of Text Classification System Using State-of-the-Art NLP Models,” Comput Intell Neurosci, p. 1883698, 2022. [CrossRef]
- Z. Jiang, B. Gao, Y. He, Y. Han, P. Doyle, and Q. Zhu, “Text Classification Using Novel Term Weighting Scheme-Based Improved TF-IDF for Internet Media Reports,” Math Probl Eng, pp. 1–30, 2021. [CrossRef]
- D. Marwah and J. Beel, “Term-Recency for TF-IDF, BM25 and USE Term Weighting,” in Proceedings of the 7th International Workshop on Mining Scientific Publications (WOSP 2020), 2020. [Online]. Available: https://aclanthology.org/2020.wosp-1.5/.
- J. Attieh, “Supervised term-category feature weighting for improved text classification,” Knowl Based Syst, vol. 261, p. 110215, 2023. [CrossRef]
- R. Çekik, “Effective Text Classification Through Supervised Rough Set-Based Term Weighting,” Symmetry (Basel), vol. 17, no. 1, p. 90, 2025. [CrossRef]
- W. Zhao, H. Li, S. Jin, G. Qiao, and Y. Zhang, “WTL-CNN: a news text classification method of convolutional neural network based on weighted word embedding,” Conn Sci, 2022. [CrossRef]
- L. Xiao, Q. Li, Q. Ma, J. Shen, Y. Yang, and others, “Text classification algorithm of tourist attractions subcategories with modified TF-IDF and Word2Vec,” PLoS One, vol. 19, no. 10, p. e0305095, 2024. [CrossRef]
- J. Kim, H.-U. Kim, J. Adamowski, S. Hatami, and H. Jeong, “Comparative study of term-weighting schemes for environmental big data using machine learning,” Environmental Modelling & Software, vol. 157, p. 105536, 2022. [CrossRef]
- Z. Wei, J. Wang, X. Liu, and Q. Lin, “Sentiment classification of Chinese Weibo based on extended sentiment dictionary and organisational structure of comments,” Conn Sci, 2021. [CrossRef]
- A. E. Blanchard, T. Nixon, M. Kamal, O. J. Bear Don’t Walk IV, C. C. Funk, and others, “A Keyword-Enhanced Approach to Handle Class Imbalance in Clinical Text Classification,” IEEE J Biomed Health Inform, 2022. [CrossRef]
- grikomsn, “Amazon Cell Phones Reviews,” 2024, Kaggle. [Online]. Available: https://www.kaggle.com/datasets/grikomsn/amazon-cell-phones-reviews.
- Datatattle, “Coronavirus Tweets NLP – Text Classification,” 2024, Kaggle. [Online]. Available: https://www.kaggle.com/datasets/datatattle/covid-19-nlp-text-classification.
- C. (Figure Eight/Appen), “Twitter US Airline Sentiment,” 2024, Kaggle. [Online]. Available: https://www.kaggle.com/datasets/crowdflower/twitter-airline-sentiment.
- A. L. Maas, R. E. Daly, P. T. Pham, D. Huang, A. Y. Ng, and C. Potts, “IMDB Large Movie Review Dataset (Official Dataset Page),” 2011. [Online]. Available: https://ai.stanford.edu/~amaas/data/sentiment/.
- T. Cai and X. Zhang, “Imbalanced Text Sentiment Classification Based on Multi-Channel BLTCN-BLSTM Self-Attention,” Sensors, vol. 23, no. 4, p. 2257, 2023. [CrossRef]
- M. Bordoloi and S. K. Biswas, “Sentiment analysis: A survey on design framework, applications and future scopes,” Artif Intell Rev, vol. 56, pp. 12505–12560, 2023. [CrossRef]
- O. A. M. Salem, X. Xu, H. Sindi, and E. Emary, “Feature selection based on fuzzy joint mutual information maximization,” Mathematical Biosciences and Engineering, vol. 18, no. 1, pp. 305–327, 2021. [CrossRef]
- Y. Wang, M. Sun, L. Long, J. Liu, and Y. Ren, “Feature gene selection based on fuzzy neighborhood joint entropy,” Complex & Intelligent Systems, vol. 10, pp. 129–144, 2024. [CrossRef]
- D. Deng et al., “Feature selection based on fuzzy joint entropy and feature interaction for label distribution learning,” Inf Process Manag, no. 6, p. 104234, 2025. [CrossRef]
- X. Yan, S. Shang, D. Li, and Y. Dang, “An efficient and interactive feature selection approach based on copula entropy for high-dimensional genetic data,” Sci Rep, vol. 15, no. 1, p. 30100, 2025. [CrossRef]

| Term | d1 | d2 | d3 | d4 | log-TF d1 | log-TF d2 |
|---|---|---|---|---|---|---|
| t1 | 5 | 2 | 3 | 4 | 2.61 | 1.69 |
| t2 | 3 | 5 | 3 | 4 | 2.10 | 2.61 |
| t3 | 0 | 1 | 0 | 0 | 0.00 | 1.00 |
| t4 | 1 | 0 | 0 | 0 | 1.00 | 0.00 |
| t5 | 0 | 0 | 1 | 0 | 0.00 | 0.00 |
| Term | IDF (Eq. (2)) | (Eqs.(4)-(6) | ||
|---|---|---|---|---|
| t1 | (2, 1, 1) | 4 | 0.69 | 0.018 |
| t2 | (2, 1, 1) | 4 | 0.69 | 0.018 |
| t3 | (0, 1, 0) | 1 | 1.61 | 0.054 |
| t4 | (1, 0, 0) | 1 | 1.61 | 0.054 |
| t5 | (2, 1, 1) | 4 | 0.69 | 0.018 |
| Dataset (citation) | Classes (granularity) | Split (train/val/test or k-fold) |
Docs per class (post-preproc) | Median length (IQR, tokens) | Vocab (post-preproc) |
|---|---|---|---|---|---|
| Amazon Cell Phones Reviews [27] | Stars → polarity (1–2 = neg, 3 = neu, 4–5 = pos) | Stratified 5-fold (Sec. 3.7) | pos 22,014 · neu 4,083 · neg 8,541 |
88 (44–166) | 28.5k |
| Coronavirus Tweets NLP [28] | 3-class (pos/neu/neg) | Official if any; else stratified 5-fold | pos 11,274 · neu 17,982 · neg 10,744 |
17 (11–24) | 35.2k |
| Twitter US Airline Sentiment [29] | 3-class (pos/neu/neg); negative-reason metadata unused | Provider split (if available) or stratified 5-fold | pos 2,363 · neu 3,099 · neg 9,178 |
19 (13–27) | 12.7k |
| IMDb 50K Movie Reviews[30] | Binary (pos/neg) | Canonical 25k/25k | train: pos 12,500 · neg 12,500; test: pos 12,500 · neg 12,500 |
231 (147–340) | 86.5k |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).