Khazanah Journal of Religion and Technology
Vol. 4 No. 1 (2026): June

Hadith Topic Modeling Based on Theme Similarity with the BERTopic Algorithm

Irma Dwiyanti (Sekolah Budaya Adhikari (SBA), Bandung)
Gevira Zahra Shofa (Dicoding Akademi Indonesia Ltd., Bandung)
Muhammad Alfiyan Nurwahibulloh Rohayana (Cyber Technology Integration Ltd., Jakarta)
Muhammad Ahsani Taqwim (LEN Persero Ltd., Bandung)
Idfa Billati Hiya Ahsan (Center for Standardization and Industrial Services for Engineering Materials and Goods, Bandung)



Article Info

Publish Date
14 Jul 2026

Abstract

This study aims to develop a hadith topic modeling system based on thematic similarity using the BERTopic algorithm to support more structured and efficient Islamic studies. The research method uses a data exploration-based approach with the BERTopic algorithm that combines BERT semantic representation, UMAP dimensionality reduction, and HDBSCAN clustering. The dataset used is sourced from Kaggle containing thousands of hadith texts in English from various books, which are processed through the stages of data pre-processing, embedding transformation, and evaluation using topic coherence metrics and interactive visualization. The results show that BERTopic successfully identified 292 topics with clear visualization through the Intertopic Distance Map and Topic Similarity Heatmap; however, approximately 55.4% of documents are categorized as outliers due to high semantic variation and limited context. Despite the challenges in handling outlier documents, this study proves that BERTopic is effective in clustering hadith based on thematic similarity and producing semantically coherent topics. The resulting model can be the basis for the development of a hadith recommendation system, classification of da'wah content, and a theme-based religious learning curriculum, as well as opening up opportunities for the application of NLP technology in Islamic studies more broadly.

Copyrights © 2026






Journal Info

Abbrev

kjrt

Publisher

Subject

Religion Computer Science & IT Engineering Languange, Linguistic, Communication & Media Social Sciences

Description

The Khazanah Journal of Religion and Technology is dedicated to advancing the understanding of the complex relationship between religion and technology. The journal aims to serve as a platform for publishing original research that explores the intersection of these two domains, focusing on recent ...