Enhancing Bible Verse Search Through Topic Modeling: An LDA-Based Approach
Mary Ann E. Ignaco, Melvin A. Ballera · 2025
Keyword-based Bible searches often fail to capture deeper thematic connections between verses. This study presents a Bible search system leveraging Latent Dirichlet Allocation (LDA) to retrieve verses based on topical relevance rather than exact word matches. The system preprocesses Bible passages-primarily from the English Standard Version (ESV)-by tokenizing, removing stop words, and transforming text into a bag-of-words representation. A trained LDA model assigns probabilistic topic distributions, enabling context-aware verse retrieval. The search algorithm balances statistical topic modeling with lexical keyword matching using a weighted scoring function. Evaluation results show a significant advantage of LDA over traditional keyword searches. While keyword methods had 0% accuracy in finding relevant themes like Trustworthiness of God, Money, and Anxiety, the LDA method was better, achieving 33% to 67% accuracy by finding verses that were related to the themes, even if they didn't have the exact keywords. However, this improved relevance comes at the cost of increased retrieval time (17–23 seconds) compared to the much faster keyword search (approximately 0.04 seconds). These findings underscore LDA's strength in uncovering meaningful theological connections that keyword search overlooks. Implemented as a Flask-based web application, the system enables efficient ranking and retrieval of Bible verses for personal study, sermon preparation, and theological research. Future improvements might include using semantic similarity models to make the results more accurate and speed up the retrieval process.