Alexis : A Voicebased Chatbot using Natural Language Processing

DOI : 10.17577/IJERTV11IS040155

Download Full-Text PDF Cite this Publication

Text Only Version

Alexis : A Voicebased Chatbot using Natural Language Processing

Meet Popat

IT Department

St. Francis Institute of Technology Mumbai, India

Aayush Doshi

IT Department

St. Francis Institute of Technology Mumbai, India

Yashraj Rai

IT Department

St. Francis Institute of Technology Mumbai, India

Deep Vakharia

IT Department

St. Francis Institute of Technology Mumbai, India

Grinal Tuscano

IT Department

St. Francis Institute of Technology Mumbai, India

AbstractThe goal of this Chatbot that uses Speech Recogni- tion in educational institutions is to automate and simplify the user experience by doing duties such as asking users what theyre looking for and providing the information they require.The necessary software and hardware are readily available and simple to use. Using a chatbot on a college website can result in error-free and faster responses to user queries. As it is both voice and text based, it assists the user as a human assisting with their questions. Using Python language and specifically using natural language toolkit (nltk) the chatbot has been developed. Without having to physically visit the campus, visitors to the college website can enjoy a user-like inquiry experience.

Index Terms:- Chatbot; Natural language processing; Artificial Intelligence


    Today in this world, many chatbots are deployed on the Internet for the purpose of seeking information, site guidance or Frequently Asked Questions (FAQ) answering in different domains such as customer service, education, website help, and entertainment. Traditional interfaces have been changed into Conversational Interfaces as a result of the advancement of this technology (CI). The term chatbot, spread from the Nineties, indicates a software system that aims at simulating and reproducing an intelligent conversation with a user. Chat- bots are also called conversational agent, because they interact with user turn by turn using natural language. Conversation occurs through written messages or vocal commands in the second case, the software is called voicebot. This paper will primarily focus on chatbots even if what emerges from this work could be also applied to voicebots. Despite chatbot technology being of recent development, the idea of simulating a conversation similar to human talk, dating back to the sixties, when Joseph Weizenbaum implemented ELIZA to emulate a psychotherapist. Various types of chatbots can be identified,based on their learning capacity, the way in which they interact with the user, and the contest of application. [1]

    Chatbots are just one of many exciting ideas in the field of information technology. Chatbots were conceived as a new interface to replace or complement applications or website visits by allowing users to simply communicate with a service via a chat window. To deliver reliable information, chatbots use a knowledge base and the institutional documentation. They respond to prospective student questions with automatic responses and assist them with simple chores on the college website. Chatbots use natural discussions to help students find answers to their problems. Visitors will have fast access to academic course specifics, college maps, financial assistance information, and the mountains of information held on a website thanks to a college chatbot.

    Natural Language Processing (NLP) is a powerful tool with huge benefits, but there are still a number of NLP limitations and problems:

    1)Contextual words and phrases and homonyms. 2)Errors in text and speech.

    3)Colloquialisms and slang. 4)Domain- specific language.

    5)Lack of research and development.

    The goal of the project is to develop an educational chatbot for the institute that interacts with users through voice and text input and uses natural language processing (NLP) in the form of Python code that integrates with the universitys website using the Flask framework to enhance self-learning and 24/7 resource availability.


    In [1], Here the chatbot has been developed using AIML(Artificial Intelligence Markup Language) which, is an XML dialect for creating natural language software which ap- plies the technique of pattern recognition or pattern matching where a test of an expression is used to determine if it has certain characteristics.

    In [2], The paper mainly focuses on the Analytic Hierarchy Process can be described as a method of decomposition of unstructured situations into a simpler one.

    In [3], The DialogFlow technology, sometimes known as Speaktoit, is used to construct chatbots, Speaktoit is a Google development platform for building Natural Language Processing-based human-computer interface solutions.

    In [4], This paper is based on speech intelligence conversa- tion. The goal of the bots testing is to determine the accuracy of speech recognition, chatbot system capability, and answer generation capability.

    In [5],In this work interesting approach of bayesian network was being used where Chatbot agent accepts to students answers and extracts the keywords from the question using a lexical parser, then the keywords are compared with the category list database.

    In [6],In this Work, a Raspberry pi single board computer is utilised as the medium of communication between the user and the chatbot. Development of a Voice Chatbot for Payment Using Amazon Lex Service with Eyowo as the Payment Platform is being used.

    A. Gap identified

    Observations on existing work/Gap identified In [1]:Problem of recognizing human emotions.

    In [2]:Chatbot cannot be integrated with various platforms. In [3]:The main drawback of dialog flow is that it cannot handle number of intents at a same time rather than grouping it.

    In[4]:System is time consuming, as it is unable to process the requests within the desired time.

    In[5]:Because unexpected results are being fetched, accuracy is not up to par.

    In[6]:Language specific chatbot.


    1. Problem Definition

      The aim of this project is to develop a Chatbot interacting via voice input like popular personal assistant apps like Siri and Alexa using python. We will define it as a computer program that impersonates human conversations in its natural format.

    2. Proposed Solution

      To use NLP for creating a conversational chatbot for educational institutes. Implementing a Chatbot, as proposed in this work, allows establishing an appropriate pedagogical model where students address different topics and accordingly can get reply from the chatbot.

    3. Features of proposed System

      1. Works in 2 modes:

        • Text (speech-to-text)

        • Speech(text-to-speech)

      2. Will appear as a small icon in the bottom right corner. 3)Will search answers from google if permitted.

    4)Send query to professionals.


    1. Functional Requirements

      1. Computer program that impersonates human conversa- tions in its natural format, which may include text (since the advent of bots) or spoken language using artificial intelligence (AI) techniques such as Natural Language Processing (NLP) and audio analysis.

      2. Well-designed user interfaces and experiences (UI

        / UX). 3)Complex dialogues- In addition to understanding and

        interacting within conversations, our chatbot software should have NLU (Natural Language Understanding) functions to analyze the context of a conversation.

    2. Non-Fnctional Requirements

      1. Chatbot should communicate seamlessly across multiple channels such as websites used by phones or laptops

      2. Accuracy: The overall accuracy of the web APIs re- sponse will be measured using a developer made testing set.

      3. Availability:The system will be available 24/7 for all users.


    1. Working of the Project

      Fig. 1. Directive flow of the software.

      1. Speech Recognition

        First, the computer must take natural language and convert it into artificial language. This is what speech recognition, or speech-to-text, does. This is the first step of NLU. Most speech recognition systems today are based on Hidden Markov Models(HMMs). These are statistical models that turn your speech to text by making mathematical calculations to determine

        what you said. HMMs do this by listening to you speak, breaking it down into small units (usually 10-20 milliseconds), then comparing it to pre- recorded speech to determine the phoneme you said in each unit of your speech. [12]

      2. Natural Language Understanding (NLU)

        The next, and hardest step of NLU, is the actual understanding part. First, the computer must understand what each word is. It tries to understand if its a noun or a verb, if its past or present tense, and so on. This is called Part-of-Speech tagging (POS).NLP systems also have a lexicon (a vocabulary) and a set of grammar rules coded into the system. The most difficult part of NLP is understanding. By the end of the process, the computer should understand the meaning of what you said. [12]

        The Natural Language Toolkit (NLTK):

        The Natural Language Toolkit, or more commonly NLTK, is a suite of libraries and programs for symbolic and statistical natural language processing (NLP) for English written in the Python programming language. sent.tokens = nltk.sent.tokenize(raw)

        word.tokens = nltk.word.tokenize(raw) sent.tokensone = nltk.sent.tokenize(rawone) word.tokensone = nltk.word.tokenize(rawone)

        TfidfVectorizer is a fundamental component of many NLP pipelines. Its a basic method for vectorizing text documents that is, converting sentences into numeric arrays and and use them in subsequent tasks.

        TfidfVec = TfidfVectorizer(tokenizer=LemNormalize) tfidf =

        vals = cosine.similarity(tfidf[-1], tfidf) idx=vals.argsort()[0][-2] flat =

        vals.flatten() flat.sort() reqtfidf = flat[-2]

      3. Natural Language Generation (NLG)

    NLG is much simpler to accomplish. NLG translates a computers artificial language into text, and can also go a step further by translating that text into audible speech with text-to-speech. [12]


    A. Application Performance

    The software was designed as described in the previous section of the projects workings, and it was thoroughly tested iteratively and in a variety of settings. Speech Recognition, or text-to-speech, was done in the first stage

    using the Pythons SpeechRecognition 3.8.1 module. It takes about 5-7 seconds or depending on the speech service for the users voice to be recognised. CMU Sphinx, Google Speech Recognition, Google Cloud Speech API,, Microsoft Bing Voice Recognition, Houndify API, IBM Speech to Text, Snowboy Hotword Detection are some of the engines/APIs supported by the SpeechRecognition library. We may detect noise with the SpeechRecognition library and throw a UnknownValueError, as well as a RequestError if the speech service is unavail- able. Then, based on frequently asked questions (FAQ), pre- determined responses were provided.Any information needed from the web can be obtained using the WebBrowser library by attaching the query to the provided url. Fig. 2 depicts all of the libraries in action using Spyder IDE with sample inputs.

    Fig. 2. Response given by the Chatbot..

    The Chatbot icon is displayed using a javascript as shown in the below figure. An Event Listener has been added to action on Send, Record and Open buttons.

    Fig. 3. Displaying Chatbot Icon.

    Next, The Natural Language Toolkit (NLTK) library was used to comprehend user input. Results are returned using two datasets i.e. AICTE.txt and SFIT.txt. Tokenization was done first on all of the data in the datasets and on the user input. The practice of breaking a large sample of text into words or a long paragraph into smaller sentences is known as tokenization. A

    tfidfvectorizer is then used which is the base building block of many NLP pipelines. It is a simple technique to vectorize text documents which transform sentences into arrays of numbers and use them in subsequent tasks. tf-idf is an important measure and is used by algorithms like cosine similarity to find documents that are similar to a given search query. The cosine similarity measures the similarity between vector lists by calculating the cosine angle between the two vector lists. So that the most accurate result is obtained using the number of keywords present in the vector list given by the voice data. Accuracy was tested and it was shown that 8 out of 10 times matches the correct keyword.

    Fig. 4. Displaying chatbot on website.

    The last stage is to convert our text back into speech. We have made use of the pyttsx3 which is a text- to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python 2 and

    3. Voice output is generated within 500-1000 milliseconds. Pyttsx3 also helped us to customize the properties of volume range and speaking rate.

    Fig. 5. Displaying the output generated by the chatbot.


  1. Conclusion

    This chatbot can be used in various application areas to help those who are associated with the institute in some way such as you are a teacher or a student to get some information which they need to know about the institute which is related to that and use of chatbots in this area

    will help us to provide quality, range and depth to the conversations going on. Furthermore, creating a chatbot to imitate the conversational skills and patterns of a human will be a form of digital uploading of human character in a model which will help to make the conversation more clearer in near future.

  2. Future Scope

Future research will be separated into two categories. The first area focuses on developers assistance in creating and offering technologies that allow any instructor to easily inte- grate chatbots into their classes. The second field is a content analysis of actual student conversations. From both macro and micro perspectives, it is technically conceivable to preserve, gather, and analyse interactions as data.


We are extremely grateful to our college St. Francis Institute of Technology for the confidence bestowed in us and entrust- ing out project entitled CHATBOT FOR EDUCATIONAL INSTITUTIONS. We owe our

profound gratitude to our project guide Ms. Grinal Tuscano, who introduced us to the methodology of work and timely completion of various stages of our project.


[1] Yogi Wisesa Chandraa Suyanto (2019) Indonesian Chatbot of Uni- versity Admission Using a Question Answering System Based on SequencetoSequence Model, 4th International Conference on Computer Science and Computational Intelligence ,Elsevier BV, 2019.

[2] Pavel Smutny,Petra Schreiberova Chatbots for learning: A review of educational chatbots for the Facebook Messenger, Research and Development of Advanced Methods in the Area of Machines and Process Control supported by the Ministry of Education, Youth and Sports, Czechia 2019.

[3] Omar Zahour,El Habib Benlahmar,Ahmed Eddaoui,Hafsa

Ouchra,Oumaima HourraneA system for educational and vocationalguidance in Morocco:

Chatbot E-Orientation International Workshop on Artificial Intelligence and Internet f Things (A2IoT),August 9-12, 2020, Leuven, Belgium.

[4] Yushendri, Jefri Hanif, Alvian Siswadi, Anneke Musa, Purnawar- man Kusuma, Tubagus Prasetyo, EriA speech intelligence con- versation bot for interactive media information Research Gate,1- 6.10.1109/IAC.2017.8280651,2017.

[5] Francesco Colace, Massimo De Santo, Marco Lombardi, Francesco Pascale, and Antonio PietrosantoChatbot for E- Learning: A Case of StudyInternational Journal of Mechanical Engineering and Robotics, Research Vol.7,No.5,September 2018.

[6] Samuel, Isaac Ogunkeye, Fiyinfoba Olajube, Ayobami Awelewa,Ayokunle.Development of a Voice

Chatbot for Payment Using Amazon Lex Service with Eyowo as the Payment Platform, 104- 108.10.1109/DASA51403.2020.9317214,2020.

[7] Punith,Chaitra,Veeranna Kotagi,Chethana R:Research Paper on Chatbot for Student Admission Enquiry.

[8] Sandu,Raj.Adoption of AI-Chatbots to Enhance Student Learning Ex- perience in Higher Education in India.

[9] Godson Michael Dsilva,Sanket Thakare,Shraddha More and Jeril Kuri- akose,Real World Smart Chatbot for Customer Care using a Software as a Service (SaaS) Architecture IEEE Feb 2018,International Conference on I-SMAC(IoT in Social,Mobile,Analytics and Cloud).

[10] Guruswami Hiremath,Aishwarya Hajare,Priyanka Bhosale,Rasika Nanaware and Dr. K. S. Wagh Chatbot for education system, International Symposium on Computers in Education.

[11] Prof.Vishal.R.Shinde,Anagha Bagul,Amit Gupta,Sneha Javeri Chatbot for college related FAQsIEEE,International Conference on I-SMAC.

[12] overview/

Leave a Reply