AI & Society
Two machine learning classifiers identified offensive language in Urdu tweets with 86 percent accuracy

In a 2025 paper in IEEE Access, researchers from the University of Peshawar and other institutions collected 12,020 Urdu tweets and labeled them with OLID, a benchmark taxonomy for offensive language. They turned the posts into character-level and word-level features, including single words, three-character sequences, and TFIDF scores, which emphasize words that are frequent in a tweet but uncommon across the whole set. They tested seven machine learning classifiers. Logistic regression and the support vector machine performed best, reaching 86 percent accuracy and a 75 percent F1 score, a standard measure that balances precision and recall.
Why is Urdu a difficult language for this task?
Urdu's complex script and rich morphology make it difficult to apply methods that work directly in other languages. The authors write that Urdu has received little research attention because language resources and high-quality datasets are scarce. This study responded by creating its own annotated collection of 12,020 Urdu tweets.
What features and classifiers worked best?
The strongest signals came from word unigrams (single words), character trigrams (three-character sequences), and word TFIDF features. Among the seven classifiers tested, logistic regression and the support vector machine achieved the highest result, with 86 percent accuracy and a 75 percent F1 score.
FAQ
How many tweets were studied?
The dataset contained 12,020 Urdu tweets.
What does the F1 score tell us?
It combines precision, how often flagged posts are truly offensive, with recall, how often truly offensive posts are found.
Did all seven classifiers perform equally?
No. Logistic regression and the support vector machine achieved the highest accuracy and F1 score.
Limits and what's next
This is one study, and the abstract reports no independent replication or external validation. The result comes from 12,020 Urdu tweets labeled with the OLID scheme and tested on seven machine learning classifiers. The abstract does not show how the same approach would perform on other languages or on a different set of Urdu tweets. The abstract does not say how the tweets were sampled or over what period they were collected. The authors note that Urdu's complex script, rich morphology and scarce language resources make the task difficult. The abstract does not describe a follow-up experiment or a next step.
Source: Salah Ud Din et al., “An Automatic Approach for the Identification of Offensive Language in Perso-Arabic Urdu Language: Dataset Creation and Evaluation,” IEEE Access, 2025.