This project aims to detect Hate Speech in Indonesian social media comments using Deep Learning. We utilize IndoBERT (indobenchmark/indobert-base-p1), a BERT model pre-trained specifically on the Indonesian language dataset. The model is fine-tuned to classify text into two categories:
- Non-Hate Speech (0)
- Hate Speech (1)
The dataset used in this project is the "Indonesian Abusive and Hate Speech Twitter Text" (Ibrohim & Budi, 2019).
- Source: Twitter
- Total Data: ~13,000 tweets
- Features: The project also utilizes a dictionary of slang words (
new_kamusalay.csv) to normalize informal Indonesian language (slang/alay) into formal text before processing.
-
Data Preprocessing:
- Case folding & Cleaning (removing special characters, URLs, user mentions).
-
Text Normalization: Converting slang words (e.g., "yg"
$\rightarrow$ "yang") using a dictionary.
-
Tokenization: Using
BertTokenizer. - Model Fine-Tuning: Training the IndoBERT model for 3-4 epochs with PyTorch.
- Evaluation: Measuring performance using Accuracy, Precision, Recall, F1-Score, and Confusion Matrix.
- Clone this repository.
- Open the notebook (
.ipynb) in Google Colab. - Upload the required datasets (
data.csv,new_kamusalay.csv) to the Colab runtime. - Run all cells to train the model and test prediction.
- Accuracy: ~85-90% (Dependent on training)
- F1-Score: High capability in detecting the minority class (Hate Speech). (Detailed confusion matrix and charts are available inside the notebook)
- Model: IndoBERT by IndoBenchmark
- Dataset: Ibrohim, M.O., & Budi, I. (2019). Multi-label Hate Speech and Abusive Language Detection in Indonesian Twitter.
made with love by HERZBAY for this life