Detection of Suicidal Intent in Tweets based on Machine Learning and Natural Language Processing
Abstract
In this research, detection of suicidal intent in tweets based on machine learning and natural language processing (NLP) is considered to be an early detection system for vulnerable individuals and to facilitate early intervention. Social media websites are also a popular medium for the expression of feelings like distress and suicide, and therefore detection with the support of automation is the starting point towards monitoring mental health. The article employs an open-source collection of 9,119 pre-processed tweets that are labelled as suicidal or non-suicidal, removing special characters, emails, and tokenization to give the data cleanliness. Text data were numerically represented using TF-IDF vectorization in which unigram and bigram features were preserved in order to facilitate correct training of the model. Four supervised models, including Logistic Regression, Naive Bayes, Decision Tree, and Linear Support Vector Classifier (Linear SVC), were trained on 80% of data and evaluated on 20% of data using accuracy, precision, recall, and F1-score measures. Confusion matrices were calculated to determine true positives, false positives, and other outcomes of the classifications across all models, and a straightforward demo prediction was added to test tweets to illustrate real-world application. Among models tested, Linear SVC performed best overall at 92%, followed by the Logistic Regression model, then the Naive Bayes and the Decision Tree model with lower though still superior performance. Ethical concerns were noted, including anonymization, privacy, and handling sensitive data. The study presents a reproducible and feasible method for auto-detection of suicidal tweets from Twitter and proves the effectiveness of NLP and machine learning methods in supporting mental health interventions, reducing harm, and facilitating timely intervention of vulnerable groups.
Keywords
- Suicide Detection
- Machine Learning
- NLP
- TF-IDF
- Mental Health
How to cite
Md Asadul Islam, Nusrat Jahan, Sumiya Haque, Md Shawon Ali (2026). Detection of Suicidal Intent in Tweets based on Machine Learning and Natural Language Processing. Sonargaon University Journal, 6(I), 53–62.
@article{islam20265,
title = {Detection of Suicidal Intent in Tweets based on Machine Learning and Natural Language Processing},
author = {Md Asadul Islam and Nusrat Jahan and Sumiya Haque and Md Shawon Ali},
journal = {Sonargaon University Journal},
volume = {6},
number = {I},
pages = {53--62},
year = {2026},
issn = {2518-3125},
url = {https://su.edu.bd/journal/volume-6-issue-1/detection-of-suicidal-intent-in-tweets-based-on-machine-learning-and-natural}
}
