This project aims to use advanced machine learning techniques, specifically Recurrent Neural Networks (RNNs) and Transformers, to detect potential suicide risk from social media posts. The goal is to categorize posts into 'Suicide' and 'Non-Suicide' to facilitate timely intervention for individuals in distress.
Link to colab: https://colab.research.google.com/drive/1WClnZj4et4F0AAcM_tJ3vMMGPLCEb7d3#scrollTo=hHo__q6vN-jx
The data is from kaggle suicide detection dataset. The dataset includes anonymized social media posts labeled for suicide risk. https://www.kaggle.com/datasets/nikhileswarkomati/suicide-watch
The model employs a two-step approach:
- RNN Layer: For capturing temporal dependencies within texts.
- Transformer Encoder: For applying self-attention mechanisms, enhancing contextual understanding.
Preprocessing steps include cleaning, tokenization, and vectorization, preparing raw text for the model.
Note: Download pickled glove from here https://www.kaggle.com/datasets/authman/pickled-glove840b300d-for-10sec-loading
- TensorFlow
- Keras
- NLTK
- NumPy
Refer to requirements.txt for a full list.
- Clone the repository: git clone https://github.com/your-repository.githttps://github.com/Mehrads/NLP-method
- Install dependencies: pip install -r requirements.txt
- Run the model: python quick-start.py
I highly recommend you use google colab to see the outcome of my model.