HANA: An AI Chatbot for Islamic Jurisprudence on Menstruation using SBERT and TF-IDF
Open Access
- 10 June 2025
- journal article
- Published by Politeknik Negeri Batam in JOURNAL OF APPLIED INFORMATICS AND COMPUTING
- Vol. 9 (3) , 1013-1024
Abstract
The advancement of Artificial Intelligence (AI), particularly in Natural Language Processing (NLP), has opened new opportunities for religious technological innovation, especially in addressing practical Islamic jurisprudence issues such as menstruation (fiqh haid). This research proposes and implements HANA, an AI chatbot developed for Telegram, utilizing a hybrid approach combining Term Frequency-Inverse Document Frequency (TF-IDF) and Sentence-BERT (SBERT) models. A curated dataset of over 1000 question-answer pairs from classical and contemporary Islamic literature was used, primarily based on the Shafi'i school of thought. The chatbot matches user queries through a two-stage retrieval: initial keyword matching via TF-IDF and deeper semantic matching via SBERT embeddings. Evaluations were conducted by comparing TF-IDF, SBERT, and hybrid approaches using cosine similarity, precision, recall, and F1-score metrics, focused on top-1 retrieval accuracy. HANA achieved an average cosine similarity score of 0.6581 and a semantic relevance rating of 87% based on expert validation, while User Acceptance Testing (UAT) involving 15 respondents indicated 86.7% satisfaction. Although the system is deployed as a proof-of-concept on Google Colab without persistent hosting, it demonstrates the viability of lightweight AI chatbots for Shariah consultation services. Future improvements include multi-turn conversation handling and integration with large language models for better context understanding. This research contributes to expanding NLP applications within techno-dakwah initiatives, providing a scalable approach to enhance women's access to Islamic jurisprudence knowledge.Keywords
This publication has 13 references indexed in Scilit:
- Opini Publik Pasca-Pemilihan Presiden: Eksplorasi Analisis Sentimen Media Sosial X Menggunakan SVMSINTECH (Science and Information Technology) Journal, 2024
- Revolutionary text clustering: Investigating transfer learning capacity of SBERT models through pooling techniquesEngineering Science and Technology, an International Journal, 2024
- Is Cosine-Similarity of Embeddings Really About Similarity?2024
- APLIKASI TANYA JAWAB TENTANG FIQIH BERSUCI BERBASIS WEBZONAsi: Jurnal Sistem Informasi, 2024
- Aplikasi Layanan dan Informasi Akademik Berbasis Chatbot Telegram Menggunakan Natural Language ProcessingJurnal JTIK (Jurnal Teknologi Informasi dan Komunikasi), 2024
- BERT-Based Medical Chatbot: Enhancing Healthcare Communication through Natural Language UnderstandingExploratory Research in Clinical and Social Pharmacy, 2024
- Evolving Conversations: A Review of Chatbots and Implications in Natural Language Processing for Cultural Heritage EcosystemsInternational Journal of Robotics and Control Systems, 2023
- Open Artificial Intelligence Analysis using ChatGPT Integrated with Telegram BotJurnal ELTIKOM, 2023
- Implementasi Chatbot Sebagai Virtual Assistant di Universitas Panca Marga Probolinggo menggunakan Metode TF-IDFJurnal Teknologi Informasi dan Multimedia, 2022
- Recommendation System from Microsoft News Data using TF-IDF and Cosine Similarity MethodsBuilding of Informatics, Technology and Science (BITS), 2022