Context-Aware Urdu Language Chatbot Using LSTM Based Autoencoder Attention Mechanism

Authors

  • Sharaf Hussain Department of Computer Science, IQRA University, Karachi, 75500, Pakistan
  • Saad Ahmed Department of Computer Science, IQRA University, Karachi, 75500, Pakistan
  • Muhammad Noman Department of Computer Science, IQRA University, Karachi, 75500, Pakistan

DOI:

https://doi.org/10.54692/lgurjcsit.2025.09274

Abstract

Urdu is a widely spoken language in Pakistan and the surrounding regions of India, Bangladesh, and Afghanistan. It uses the Nastaliq calligraphy style of the Perso-Arabic script and has evolved from Hindi, Arabic, and Persian vocabulary. Despite the prevalence of chatbot technologies for high-resource languages, there is a significant gap in developing context-aware chatbots for low-resource languages like Urdu, particularly for domain-specific applications such as university information systems. This study develops an Urdu chatbot using LSTM autoencoder architecture with Bahdanau attention mechanism to provide relevant university information. The chatbot is tailored to address inquiries about courses, admissions, faculty, facilities, and other relevant details about universities in Urdu-speaking areas. The system utilizes bidirectional LSTM for query encoding alongside an attention mechanism that focuses on key elements within input questions to generate meaningful replies in Urdu. The model was trained using a comprehensive corpus of university-related data collected from multiple sources including Kaggle, Iqra University's official website, and faculty profiles. The chatbot's performance was assessed based on its comprehension of
queries, provision of accurate responses, and ability to engage in natural language conversations. The LSTM-based approach achieved 75% accuracy with an F1-score of 0.857. For comparison, the XLM-RoBERTa model demonstrated better performance with 85% accuracy and an F1-score of 0.919, highlighting the advantages of transformer-based pre-trained models for Urdu language understanding. This research demonstrates the feasibility of developing context-aware Urdu chatbots for educational domains using deep learning architectures. While transformer-based models show superior performance, LSTM with attention mechanisms provides a computationally efficient alternative for resource-constrained environments. The study contributes to the advancement of natural language processing for low-resource languages and provides a framework for developing domain-specific conversational agents in Urdu.

Downloads

Published

31-12-2025

Issue

Section

Articles