Smart Sustainable Cities: A Chatbot Based on Question Answering System Passing by a Grammatical Correction for Serving Citizens Bghiel Afrae, Ben Ahmed Mohamed, and Boudhir Anouar Abdelhakim Abstract The smart city concept has been developed as a strategy for working with cities as they become systematically more complex through interconnected frameworks and increasingly rely on the use of Information and Commu- nication Technology to meet the needs of their citizens. At this end, as users struggle to navigate the wealth of on-line information now available, the need for automated question answering systems becomes more urgent. Most QA systems use a wide variety of linguistic resources. We focus instead on the redundancy available in large corpora as an important resource. QA System that described in this paper, built using a seq2seq model, BiLSTM as encoder, a LSTM as decoder, and Attention mechanism for boosting the model performance whether Grammatical Correction Model or Question Answering Model, we have proposed to build a grammatical model rst to pass a corrected question to the second system in order to improve QA system results. Keywords Sustainability Á Chatbot Á Question and answer Á Grammatical correction Á Seq2Seq Á BiLSTM Á Attention mechanism Á Natural language Á Bleu score Á Smart city 1 Introduction Sustainability and sustainable development concepts gener- ate awareness of the production and use of resources required for residential, industrial, transportation, commer- cial, or recreational processes. Applying sustainable devel- opment in a strategic manner is achieved through systems thinking approach, in order to build an intelligent environ- ment for serving citizens basing on their needs, where communication and searching are the most important things that can be serving people to reach informations; chatbots and question answering systems can help citizens to reach answers and informations they need just by click, where they can write their question in natural language and wait QA System to generate the answer. A.I. scientists have, for decades, underestimated the complexity of human language, in both comprehension and generation. The obstacle for computers is not just under- standing the meanings of words, but understanding the end-less variability of expression in how those words are collocated in language use to communicate meaning. Nonetheless, decades later, we can nd an abundance of natural language interaction with intelligent agents on the Internet, where dialogue or conversational systems including chatbots, and personal assistants are becoming ubiquitous in modern society. Conversation is dened as an exchange between two or more sides in which thoughts, feelings, and ideas are expressed, questions are asked and answered, or news and information are exchanged, and while many Chatbots today offer the possibility of answering question, and attending customersrequests, few of them are able to provide these services without the need to limit user s input by command-based UI menus. Thanks to the big data revolution and advanced compu- tational capabilities, companies have never had such a deep access to customer data. This is allowing organizations to interpret, understand, and forecast customer behaviors as B. Afrae (&) Á B. A. Mohamed Á B. A. Abdelhakim List Laboratory FSTT UAE, Tangier, Morocco e-mail: afraebghiel1995@gmail.com B. A. Mohamed e-mail: mbenahmed@uae.ac.ma B. A. Abdelhakim e-mail: boudhir.anouar@gmail.com © The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG 2021 M. Ben Ahmed et al. (eds.), Emerging Trends in ICT for Sustainable Development, Advances in Science, Technology & Innovation, https://doi.org/10.1007/978-3-030-53440-0_34 329