Seq2Seq Model-Based Chatbot with LSTM and Attention Mechanism for Enhanced User Interaction
Lamya Benaddi, Charaf Ouaddi, Adnane Souha, Abdeslam Jakimi, Mohamed Rahouti, Mohammed Aledhari, Diogo Oliveira, Brahim Ouchao
TL;DR
The paper addresses the need for domain-specific, cost-effective chatbots in niche sectors by proposing a Seq2Seq chatbot based on LSTM with attention for tourism in Draa-Tafilalet, Morocco, avoiding reliance on predefined APIs. It collects a curated dataset of 3,700 utterances across six tourism dimensions and uses GloVe embeddings, with data split into 98% train, 1% val, 1% test. Three hyperparameter configurations are tested; the best configuration (C2) yields training accuracy 99.58%, validation 98.98%, and test 94.12%, demonstrating strong generalization. The work demonstrates that a domain-focused, API-free chatbot can deliver coherent, contextually appropriate responses and offers a scalable approach for niche markets.
Abstract
A chatbot is an intelligent software application that automates conversations and engages users in natural language through messaging platforms. Leveraging artificial intelligence (AI), chatbots serve various functions, including customer service, information gathering, and casual conversation. Existing virtual assistant chatbots, such as ChatGPT and Gemini, demonstrate the potential of AI in Natural Language Processing (NLP). However, many current solutions rely on predefined APIs, which can result in vendor lock-in and high costs. To address these challenges, this work proposes a chatbot developed using a Sequence-to-Sequence (Seq2Seq) model with an encoder-decoder architecture that incorporates attention mechanisms and Long Short-Term Memory (LSTM) cells. By avoiding predefined APIs, this approach ensures flexibility and cost-effectiveness. The chatbot is trained, validated, and tested on a dataset specifically curated for the tourism sector in Draa-Tafilalet, Morocco. Key evaluation findings indicate that the proposed Seq2Seq model-based chatbot achieved high accuracies: approximately 99.58% in training, 98.03% in validation, and 94.12% in testing. These results demonstrate the chatbot's effectiveness in providing relevant and coherent responses within the tourism domain, highlighting the potential of specialized AI applications to enhance user experience and satisfaction in niche markets.
