Implementation of A Chatbot System (College Enquiry)
Implementation of A Chatbot System (College Enquiry)
Abstract:- The rapid advancement of artificial intelligence In the original version of this chatbot, text input was the
has led to the development of more sophisticated chatbots only mode of interaction. In this revised version, we have
capable of enhancing user interactions. This project extended the functionality by incorporating speech recognition,
presents a chatbot system that integrates speech recognition allowing users to interact with the bot through voice input. By
with traditional text input, enabling users to interact integrating Speech Recognition along with the existing NLP
through both voice and text. Using NLP techniques such as pipeline (lemmatization, tokenization, stopword removal, and
tokenization, lemmatization, and part-of-speech tagging, the POS tagging), this enhancement provides a more natural and
system effectively processes user inputs to match predefined flexible user experience.
intents stored in a JSON file. By integrating Google’s
Speech-to-Text API, this chatbot dynamically processes The chatbot’s purpose is to assist users by responding to
voice commands, offering an improved, flexible user specific queries that are categorized into various intents. These
experience. The system is easily adaptable to various intents are predefined in a JSON file, which includes multiple
domains through the update of intents, providing a robust examples of user queries and corresponding bot responses. The
solution for dynamic, real-time conversational agents. system is designed to be extensible and can be easily adapted to
different domains by updating the intents file. The focus in this
I. INTRODUCTION iteration is to improve the interaction flexibility by supporting
both text and voice input modes.
The field of artificial intelligence has revolutionized many
areas of modern life, and one such application is in the In today’s fast-evolving digital landscape, providing
development of conversational agents, or chatbots. Chatbots are multiple interaction modes is increasingly essential for
designed to replicate human conversation and engage users in accessibility and usability. Voice-based interactions, in
meaningful dialogues. This project focuses on developing a particular, have gained popularity with the rise of virtual
chatbot using Natural Language Processing (NLP) techniques, assistants like Siri, Alexa, and Google Assistant. By integrating
which allows the bot to process and understand human inputs speech recognition, the chatbot not only enhances user
and generate appropriate responses based on predefined intents. convenience but also keeps pace with the growing trend toward
hands-free and voice-driven applications. This dual-input
approach makes the system more versatile and responsive to
varied user preferences, ensuring broader adoption in practical
use cases.
B. Speech Input Processing and corresponding responses. When a user inputs a query
A major improvement in this project is the introduction of (either by typing or speaking), the following steps occur:
speech input. Using the SpeechRecognition library, the bot can The query is preprocessed and tokenized.
now capture and process voice commands from users. The The system compares the user’s input with the preprocessed
integration works as follows: patterns from the intents.
The bot uses a microphone to listen to the user’s input. Using set intersection, the bot identifies the intent that best
The captured speech is converted into text using Google’s matches the user’s query.
speech-to-text service. Once an intent is matched, the system randomly selects a
response from the predefined options for that intent.
The resulting text is passed through the same preprocessing
pipeline as typed input, ensuring consistency across both
If no match is found, the bot defaults to an invalid intent,
input modes.
which contains generic responses for unrecognized inputs.
This feature allows users to choose between typing their
D. Response Generation
queries or speaking them aloud, making the chatbot more
Responses are generated based on the matched intent. The
versatile and user-friendly.
system selects one of several possible responses associated with
the intent, ensuring that interactions feel dynamic and less
C. Intent Recognition
repetitive. For example, if the user asks about college timings,
The bot uses a JSON file to store multiple user intents.
the bot might respond with one of several variations of the
Each intent contains a list of potential user queries (patterns)
answer, making the conversation feel more natural.
IV. IMPLEMENTATION
The project is implemented in Python using several Machine Learning Models: Implementing a machine
libraries, including: learning-based approach for intent classification (e.g., using
NLTK (Natural Language Toolkit) for text preprocessing a neural network or transformer-based model) could
(tokenization, lemmatization, stopword removal). improve the bot’s accuracy in understanding user input,
SpeechRecognition for handling voice input and converting especially for more complex queries.
speech to text. Voice Synthesis: The next logical step would be to integrate
JSON for storing predefined intents and responses. text-to-speech functionality so that the chatbot can respond
verbally to user queries, completing the voice interaction
Key Steps: loop.
Loading and Preprocessing Intents: When the chatbot starts,
Domain Expansion: The chatbot could be expanded to
it loads the intents from a JSON file. The patterns for each
handle queries in other domains (e.g., healthcare, finance, or
intent are preprocessed in advance to optimize performance
customer service) by simply updating the intents JSON file.
during conversations.
Handling Voice and Text Input: The bot prompts users to REFERENCES
select between voice and text input at the beginning of the
conversation. If the user selects voice input, the bot uses the [1]. Ms. Ch.Lavanya Susanna, R.Pratyusha, P.Swathi, P.Rishi
SpeechRecognition library to listen to the user's speech and Krishna & V.Sai Pradeep. (2020). College enquiry chatbot.
convert it to text. International Research Journal of Engineering and
Matching Intent: The chatbot matches the preprocessed user Technology (IRJET), 07(3), 784-788.
input against the patterns stored in the intents JSON file. [2]. Karanvir Singh Pathania. (2019). College enquiry chatbot.
The matching is performed using set intersections, ensuring Jaypee University of Information and Technology
that the bot can recognize variations of user inputs Waknaghat, Solan– 173234, Himachal Pradesh, Issue-
efficiently. May 2019.
Generating a Response: Once an intent is matched, the bot [3]. Ali Jboor & Maher Salaminon. (2021). Admission chatbot.
generates a response by selecting a random reply from the International Journal of Research and Development,
options stored for that intent. If no match is found, the bot Palestine Polytechnic University, College of IT and
falls back to the default "invalid" intent. Computer Engineering.
[4]. College enquiry chatbot using iterative model.
V. CONCLUSION International Journal of Scientific Engineering and
Research (IJSER), 7(1), 80-83.
The enhanced chatbot system presented here represents a [5]. Sagar Pawar, Omkar Rane, Ojas Wankhade & Pradnya
significant improvement over the initial design by adding Mehta. (2018). A web based college enquiry chatbot with
speech recognition capabilities to the existing text-based results. International Journal of Innovative Research in
interaction model. Users can now interact with the bot through Science, Engineering and Technology, 7(4), 3874-3880.
either typing or speaking, making the chatbot more flexible and [6]. Harsh Pawar, Pranav Prabhu, Ajay Yadav, Vincent
accessible in various use cases. The preprocessing pipeline Mendonca & Joyce Lemos. (2018). College enquiry
ensures that both text and voice inputs are handled consistently, chatbot using knowledge in database. International
providing robust intent recognition and response generation. Journal for Research in Applied Science & Engineering
Technology (IJRASET), 6(IV), 2494- 2496.
This project demonstrates how combining NLP and speech [7]. Jincy Susan Thomas & Seena Thomas. (2018). Chatbot
recognition technologies can create an engaging and dynamic using gated end-to-end memory networks. International
conversational agent. By incorporating additional features such Research Journal of Engineering and Technology (IRJET),
as machine learning-based intent classification and contextual 05(03), 3730- 3735.
memory for multi-turn dialogues, future iterations of this [8]. Prof. Suprita Das & Prof. Ela Kumar. (2018). Determining
chatbot could become even more sophisticated. accuracy of chatbot by applying algorithm design and
defined process. In: 4th International Conference on
VI. FUTURE SCOPE Computing Communication and Automation (ICCCA),
pp.1-6.
While the current system provides basic functionality for [9]. Prof. K.Bala, Mukesh Kumar ,Sayali Hulawale & Sahil
both text and speech interaction, there is potential for future Pandita (2017). Chatbot for college management system
improvements: using A.I. International Research Journal of Engineering
Contextual Understanding: Adding support for context and Technology (IRJET), 04(11), 2030-2033.
tracking could enable the chatbot to handle multi-turn [10]. Nitesh Thakur, Akshay Hiwrale, Sourabh Selote, Abhijeet
conversations more effectively. The bot could remember the Shinde & Prof. Namrata Mahakalkar. (2017). Artificially
context of previous exchanges and build on them in future intelligent chatbot. Universal Research Reports, 04(06),
interactions. 43-47.