Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Indonesian Hate Speech Detection using IndoBERT (Accuracy 87.36%)

Python PyTorch HuggingFace Google Colab

📌 Project Overview

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:

  1. Non-Hate Speech (0)
  2. Hate Speech (1)

📂 Dataset

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.

🛠️ Methodology

  1. Data Preprocessing:
    • Case folding & Cleaning (removing special characters, URLs, user mentions).
    • Text Normalization: Converting slang words (e.g., "yg" $\rightarrow$ "yang") using a dictionary.
  2. Tokenization: Using BertTokenizer.
  3. Model Fine-Tuning: Training the IndoBERT model for 3-4 epochs with PyTorch.
  4. Evaluation: Measuring performance using Accuracy, Precision, Recall, F1-Score, and Confusion Matrix.

🚀 How to Run

  1. Clone this repository.
  2. Open the notebook (.ipynb) in Google Colab.
  3. Upload the required datasets (data.csv, new_kamusalay.csv) to the Colab runtime.
  4. Run all cells to train the model and test prediction.

📊 Results (Example)

  • 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)

📚 References

  • 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

About

This program was developed to automatically detect hate speech on Indonesian-language social media. Given the high use of informal language and slang online, the system utilizes the IndoBERT model.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages