МЕТОД КЛАСИФІКАЦІЇ ТОКСИЧНОГО КОНТЕНТУ НА ОСНОВІ ГІБРИДНОГО TF-IDF ПРЕДСТАВЛЕННЯ ТА ПОРІВНЯЛЬНОГО АНАЛІЗУ МОДЕЛЕЙ МАШИННОГО НАВЧАННЯ

Максим Куземський, Kateryna Iakhnovska, Володимир Русінов · Scientific periodicals of Ukraine · 2026

The rapid growth of user-generated content on social media has made the automated detection of toxic language such as hate speech and offensive expressions a critical task for maintaining safe online communication. This paper proposes a method of toxic content classification for English-language texts based on a hybrid term frequency–inverse document frequency (TF-IDF) representation that combines word-level and character-level n-grams, evaluated through a comparative analysis of classical machine-learning models. The method is studied on a public dataset of 24,783 labelled tweets. Text is normalised and vectorised. There are four classifiers: logistic regression, linear support vector machine (SVM), multinomial naive Bayes and random forest. They are trained on word-level TF-IDF features and compared using accuracy and macro-averaged F1-score under class imbalance. The best model is then re-trained on the proposed hybrid representation. Experimental results show that the linear SVM achieves the highest performance, and that augmenting word features with character n-grams improves the macro-F1 from 0.910 to 0.920 and accuracy from 0.947 to 0.954, while better handling obfuscated and misspelled toxic words. The findings confirm that a carefully engineered hybrid TF-IDF representation with a linear SVM provides a strong, computationally inexpensive and reproducible baseline for toxic-content moderation. Directions for further work include extension to multilingual data and transformer-based encoders.

Cited by 0 works.

Authors