aprirachmadi/Indonesian-Political-News-Hoax

1

stars

9

commits

Jupyter Notebook

primary language

Jul 31, 2026

updated

README

Indonesian Political News Hoax Detection

A hoax/fact classifier for Indonesian political news built on IndoBERT. The project includes a Colab training notebook that fine-tunes indobenchmark/indobert-base-p1 on a public Indonesian fact-vs-hoax political news dataset, and a Streamlit web app that lets you classify any Indonesian text as Hoax or Non Hoax.

Model

ItemValue
Base modelindobenchmark/indobert-base-p1
Fine-tuned modelrachmadiapri/IndoBERT-PoliticsHoaxDetection-base-p1
TaskBinary sequence classification (0 = Non Hoax, 1 = Hoax)

Dataset

The model is trained on the Indonesian Fact and Hoax Political News dataset (Kaggle), a collection of Indonesian political news articles from CNN Indonesia, Kompas, Tempo, and TurnBackHoax.

Citation

@inproceedings{wilie2020indonlu,
  title={IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding},
  author={Bryan Wilie and Karissa Vincentio and Genta Indra Winata and Samuel Cahyawijaya and X. Li and Zhi Yuan Lim and S. Soleman and R. Mahendra and Pascale Fung and Syafri Bahar and A. Purwarianti},
  booktitle={Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing},
  year={2020}
}

Repository structure

Indonesian-Political-News-Hoax/
├── app.py                                  # Streamlit web app for text classification
├── notebook/
│   └── politics_hoax_classifier (1).ipynb  # Training pipeline (data prep, fine-tuning, eval)
├── requirements.txt                        # Python dependencies
└── README.md

Setup

pip install -r requirements.txt

Run the web app

streamlit run app.py

The app loads the fine-tuned model from Hugging Face, applies the same text preprocessing used during training (whitespace normalization, parenthesis removal, lowercasing, punctuation spacing), and classifies the entered text as Hoax or Non Hoax.

Training overview (notebook)

  1. Load and merge cleaned news data (CNN, Kompas, Tempo, TurnBackHoax).
  2. Preprocess text (remove non-breaking spaces, collapse repeated spaces, strip parentheticals, lowercase, space out punctuation).
  3. Balance the classes with random undersampling.
  4. Split into train/eval/test (80/10/10).
  5. Tokenize with the IndoBERT tokenizer (max_length=512).
  6. Fine-tune indobert-base-p1 with the Hugging Face Trainer (AdamW, lr=2e-5, 5 epochs, batch size 16).
  7. Evaluate accuracy and inspect the confusion matrix on the held-out test set.

Contributors

aprirachmadi

9 commits

aprirachmadi/Indonesian-Political-News-Hoax

1

stars

9

commits

Jupyter Notebook

primary language

Jul 31, 2026

updated

README

Indonesian Political News Hoax Detection

A hoax/fact classifier for Indonesian political news built on IndoBERT. The project includes a Colab training notebook that fine-tunes indobenchmark/indobert-base-p1 on a public Indonesian fact-vs-hoax political news dataset, and a Streamlit web app that lets you classify any Indonesian text as Hoax or Non Hoax.

Model

ItemValue
Base modelindobenchmark/indobert-base-p1
Fine-tuned modelrachmadiapri/IndoBERT-PoliticsHoaxDetection-base-p1
TaskBinary sequence classification (0 = Non Hoax, 1 = Hoax)

Dataset

The model is trained on the Indonesian Fact and Hoax Political News dataset (Kaggle), a collection of Indonesian political news articles from CNN Indonesia, Kompas, Tempo, and TurnBackHoax.

Citation

@inproceedings{wilie2020indonlu,
  title={IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding},
  author={Bryan Wilie and Karissa Vincentio and Genta Indra Winata and Samuel Cahyawijaya and X. Li and Zhi Yuan Lim and S. Soleman and R. Mahendra and Pascale Fung and Syafri Bahar and A. Purwarianti},
  booktitle={Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing},
  year={2020}
}

Repository structure

Indonesian-Political-News-Hoax/
├── app.py                                  # Streamlit web app for text classification
├── notebook/
│   └── politics_hoax_classifier (1).ipynb  # Training pipeline (data prep, fine-tuning, eval)
├── requirements.txt                        # Python dependencies
└── README.md

Setup

pip install -r requirements.txt

Run the web app

streamlit run app.py

The app loads the fine-tuned model from Hugging Face, applies the same text preprocessing used during training (whitespace normalization, parenthesis removal, lowercasing, punctuation spacing), and classifies the entered text as Hoax or Non Hoax.

Training overview (notebook)

  1. Load and merge cleaned news data (CNN, Kompas, Tempo, TurnBackHoax).
  2. Preprocess text (remove non-breaking spaces, collapse repeated spaces, strip parentheticals, lowercase, space out punctuation).
  3. Balance the classes with random undersampling.
  4. Split into train/eval/test (80/10/10).
  5. Tokenize with the IndoBERT tokenizer (max_length=512).
  6. Fine-tune indobert-base-p1 with the Hugging Face Trainer (AdamW, lr=2e-5, 5 epochs, batch size 16).
  7. Evaluate accuracy and inspect the confusion matrix on the held-out test set.

Contributors

aprirachmadi

9 commits

Languages

Jupyter Notebook

98.7%

Python

1.3%