203t1a0431 1
203t1a0431 1
On
CREATING OF CHAT BOT USING PYTHON
Submitted in partial fulfillment of requirements for the award of Degree of
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted By
Regd.No:203T1A0431
Dr.B.MADHUSUDHANA REDDY
CERTIFICATE OF COMPLETION
This is to certify that, Miss ms.navya sai lakshmi a student of Bachelor Of Engineering (ECE) from
Ravindra College Of Engineering, Kurnool, AP has successfully completed her Internship at Canopus-
GBS Private Limited from 02nd of May 2023 to 24th of June, 2023.
During this period Ms. M.s.navya sai lakshmi has completed a project titled “Chatbot at Canopus- GBS”
under the guidance of Company guide Mr. M.S. Satyanarayana, Manager-Custom Application Development.
She has exhibited high enthusiasm, sincerity, innovation, interest, and hard work during this period.
Sincerely,
(Authorized Signature)
Name: George Baji Philip Title : BU Head- CSS
CANOPUSGBS Private LimitedWS-03 & 04, Ground Floor, E-1 Block, Manyata Embassy Business park
Phone: (+91) 080-49595366 | info@canopusgbs.com | www.canopusgbs.com
DECLARATION
3
I, MS.navya sai lakshmi, bearing admission number 203T1A0431, hereby solemnly
affirm that the summer internship project titled "Chat-bot at Canopus- GBS"is the
authentic and original work carried out by me. The findings and results presented in this
internship report have been diligently produced and are not a product of replication or
imitation from any external source.
I further declare that the content of this report has not been duplicated or submitted in part
or in its entirety to any other University or Institution for the purpose of obtaining any
degree or diploma.
This endeavor has been a testament to my commitment to excellence and a sincere pursuit
of knowledge in the field of Android application development. The project represents a
unique contribution to the domain, driven by a dedication to innovation and a passion for
advancing the capabilities of technology.
I take full responsibility for the accuracy and authenticity of the information presented in
this report. Any external contributions have been duly acknowledged in the appropriate
sections.
I appreciate the guidance and support received during the course of this internship, and I
am confident that the skills and insights gained will significantly contribute to my
professional growth.
MS. NAVYA SAI LAKSHMI
Reg. No: 203T1A0431
Place: Kurnool
Date:18-12-2023
ACKNOWLEDGEMENT
It is a great pleasure in expressing deep sense of gratitude and veneration to the internship
provider canopus gbs private limited, for giving this internship opportunity.
4
I would like to express special gratitude to Dr.K.E. SRINIVASA MURTHY Principal,
Ravindra College of engineering for women, for his co-operation and timely help in successful
completion of the project.
I would like to express my gratitude to Dr.B. MADHUSUDHANA REDDY, Head of
Department, Department of Electronics and Communication Engineering, Ravindra College of
engineering for women, for the co-operation, encouragement and valuRable support in completion of
the project.
I would like to express my gratitude to DR.M.JAYA LAKSHMI Department of
Computer Science and Engineering, Ravindra College of engineering for women, for constant
guidance and valuable support on completion of this project.
TABLE OF CONTENTS
S.NO LIST OF CONTENTS
Chapter 1 Introduction
Chapter 3 System
Requirements
Chapter 5 System
Demonstration
5
Chapter 6 Testing
Chapter 7 Conclusion
ABSTRACT
As a result of the rapid technological development and the development of the chat-bot concept and the time
and effort it can save. Many specialized frameworks have emerged to undertake chatbot creation and
development. By relying on artificial intelligence, the chatbot has integrated machine learning within it, and it
has become more comprehensive and wider for various technological fields. Therefore, we will create a chatbot
for the University's Admission and Registration, the project aims to build a chatbot to facilitate the process of
accessing information related to students' inquiries towards admissions, Registration and the university itself.
The motivation for the work of this project is that there is no university-level equivalent from previous
graduation projects, as this project mainly targets all palestinian tawjihi students and other palestinians, non
palestinian students . As a conclusion, it lies in answering frequent and common questions by people and
providing the answer to these questions at any time the person wants.What is natural language processing
(NLP)? Natural language processing, which evolved from computational linguistics, uses methods from various
disciplines, such as computer science, artificial intelligence, linguistics, and data science, to enable computers
to understand human language in both written and verbal forms.What is natural language understanding
(NLU)? Natural language understanding is a subset of natural language processing, which uses syntactic and
semantic analysis of text and speech to determine the meaning of a sentence.
6
CHAPTER 1:-INTRODUCTION
1.1 Introduction :-
Chatbot is a computer program that humans will interact with in natural spoken language and
including artificial intelligence techniques such as NLP (Natural language processing) that
makes the chatbot more interactive and more reliable. Based on the recent epidemiological
situation, the increasing demand and reliance on electronic education has become very difficult
to access to the university due to the curfew imposed, and this has led to limited access to
information for academics at the university. This project aims to build a chatbot for Admission
and Registration to answer every person who asks about the university, colleges, majors and
admission policy.
1.2 Objectives:-
● Save effort and time for both the Admission and registration staff and students who wish to
enroll.
2.1 Chatbot : A chatbot is a computer program that can simulate a conversation or chat
with a user in natural language through messaging applications, website, or mobile
7
applications and interact with users according to their input and should be available 24/7.
Chatbots are developed and became so popular due to the increased use of smart devices and
IoT technology.
2.2 Types of chatbots :-a. Base-line chatbot: It is a chatbot that is based on a database and
uses if / then logic to create a conversation flow and that takes a lot of time to ensure the
understanding of the question and the answer needed.[1] b. AI chatbot: This type of chatbot is
more complex than base-line but it is more interactive and personalized and needs big data
training to be impressive if the problem is matched to their capabilities.[2] c. Hybrid Model: A
hybrid approach mixes the Base-line & AI chatbot to make it smart and his behavior more
expected by depending on database and Ai algorithm to work together.[3] 2.3 How do chatbots
work? Briefly and as mentioned in the definition, humans interact with chatbots. There are two
ways to interact with a chatbot: a. Text chatbot analyzes the inputted text and matches the text
with predefined data called intents which are categorized to manage the conversation. The user
utterance is tagged with one of these intents, even if what the user says stretches over two or
more intents. Most chatbots will take the intent with the highest score and take the conversation
down that avenue
b. Voice :-
Some chatbots can interact and understand the voice of the user using a set of application
programming interfaces (api’s) that converts the recorded voice to the language and then
convert the voice to words of that language and then deal with the transformed text as mentioned
above. 2.4 Options to build a chatbot. a. From Scratch At first we have to identify the
opportunities for our chatbot and decide its field and scope to achieve efficiency and accuracy.
and a precise understanding of the customer needs is required to solve the operational
challenges. Then the design of the bot comes to be a significant stage to decide the user
engagement with your app or website. and we can categorize chatbot interactions as structured
and unstructured interactions. ❏ Structured interaction. You already know about this kind of
interaction. You know what your customers will ask and can design it easily — it's just like an
FAQ section of your app or website[4] . This information will link to your contact information,
services, products, etc. ❏ Unstructured interaction. The unstructured conversation flow
includes freestyle plain text. It's hard to predict what queries will emerge and it looks like an
extempore speech competition for your chatbot. the role of AI comes to lights here, it decodes
the context of the text based on NLP analysis. while the same NLP will provide a voice to the
chatbot.[5] The later choice will need specialized chatbot developers with an understanding of
programming languages, machine learning, and AI. We can use some of the code-based
frameworks to build and handle the chatbot like wit.ai and api.ai. b. Using platforms It is similar
to scratch chatbots but the only difference is that you do not have to hire a specialized developer
and use the chatbot builder platforms like Chatfuel,Botsify .
2.5 Chatbot Platforms alternatives:
a. IBM Watson: is touted as a question-and-answer system that can be used to build
applications and chatbots. The IBM Watson platform allows us to create an application that
shares a dialog interaction between our chatbot and users on Quick n’ Easy Projector Rentals.
The IBM interface is simple to use, and no back-end coding is shown at first glance. The
chatbot can be easily integrated into other applications such as Slack, Facebook, and Twilio.
8
b. Google Dialogflow: is an easy to understand conversational agent. Theoretically, we
can have a bot up and running by understanding 3 core concepts: intents, entities, and dialog
control. As stated earlier, these general concepts are followed across a majority of the chatbot
platforms we played with. c. Rasa: is an open source chatbot that is equipped with a natural
language processing tool. The open source tool is called Rasa NLU. You can tweak and
customize the machine learning algorithm that Rasa uses so that you can create a model that
provides the results you desire. Rasa NLU can be run wherever you want it to, and none of
your training data has to be passed over to Google, Microsoft, Amazon, or Facebook to train
your chatbot.
2.4 Options to build a chatbot:- a. From Scratch At first we have to identify the
opportunities for our chatbot and decide its field and scope to achieve efficiency and accuracy.
and a precise understanding of the customer needs is required to solve the operational
challenges. Then the design of the bot comes to be a significant stage to decide the user
engagement with your app or website. and we can categorize chatbot interactions as structured
and unstructured interactions. ❏ Structured interaction. You already know about this kind of
interaction. You know what your customers will ask and can design it easily — it's just like an
FAQ section of your app or website[4] . This information will link to your contact information,
services, products, etc. ❏ Unstructured interaction. The unstructured conversation flow
includes freestyle plain text. It's hard to predict what queries will emerge and it looks like an
extempore speech competition for your chatbot. the role of AI comes to lights here, it decodes
the context of the text based on NLP analysis. while the same NLP will provide a voice to the
chatbot.[5] The later choice will need specialized chatbot developers with an understanding of
programming languages, machine learning, and AI. We can use some of the code-based
frameworks to build and handle the chatbot like wit.ai and api.ai. b. Using platforms It is similar
to scratch chatbots but the only difference is that you do not have to hire a specialized developer
and use the chatbot builder platforms like Chatfuel, Botsify and Rasa, it’s not hard or
impossible to achieve it. but it’s not possible to create a NLPenabled chatbot that can deal with
unstructured data.
● First, we have to know that Rasa needs python to work, so we’ll install python and the
version should be from 3.6 to 3.8 at maximum.
Figure 2.1:Python main screen in microsoft store. Go to Microsoft Store and search for python
3.8. Then,Check if your Python environment is already configured by opening the
9
CHAPTER 3:System Requirements
3.1 Requirements:
● Functional Requirements:
1. The system must provide clear information about Admission policy.
2. The system must provide clear and fully detailed information about university
colleges. 3. The system must provide clear and fully detailed information about colleges’
programs. 4. The system must provide clear and fully detailed information about colleges’
majors. 5. The system should clarify information about the permitted secondary school
branch for each major.
6. The system should clarify the minimum GPA in high school for each major.
7. The system should clarify the duration of study for each major.
8. The system should clarify the parallel study policy for each major.
9. The system should provide the graduation plans for each major.
10. The system should provide information about placement tests.
11. The system should provide information about first installment costs for each major and the
credit hour price.
● Non-Functional :
1. The system shall handle multiple users inputs, If two or more students are chatting with the
bot, none of the students has to wait too long to be answered by the system.
10
2. The bot should have a delay in response, to let the student feel like he/she is talking to a human
instead of a bot. A little late response from the chatbot makes the student feel as though he is
talking to a human.
3. The system should have the appropriate data set. The correct data set is the basis for the
chatbot, when the data set is correct and tuned, the chatbot will be trained on it to give the
best possible result.
4. The system should have Data Training. Data training mainly depends on the content targeted
at Admission and Registration deanship.
5. The system should prevent abusive language.
6. The system should be used on http://reg.ppu.edu/ website.
7. Ability to extend the project to include all colleges.
11
Chapter 4: Models and interfaces
4.1 Basics Of Rasa Open Source Conversational AI:
The diagram below shows the general rasa open source conversational associated with machine
learning. [5]
12
4.3 Rasa framework files:
At the moment of writing this report, we have been using the latest version of the Rasa
framework
v2.x and in this release the existing file structure and file extensions have changed from
previous
versions. Dealing with the framework changed and became better and smoother by using files
with .yml extensions.
● Domain.yml: Defines the environment in which the assistant operates, including:
What the user means: specifically, what intents and entities the model can understand.
○ What responses the model can provide: such as utterances or custom actions.
○ What to say next: what the model should be ready to respond with.
○ What info to remember: what information an assistant should remember and use
throughout the conversation.
● Tracker: A tracker object maintains the current state of the conversations. It keeps track of
the events that have happened so far, such as utterances and actions, as well as other data
such as the slots and entities.
13
● Slots: Slots are variables a Chatbot requires to perform a specific task. Slots are essential to
interpret a user’s input and adequately execute the action. Slots are commonly filled using
Entities. Slots serve as the building block for a Chatbot’s context manager
.
● processing pipeline/Config.yml: The configuration file defines the components and policies
that the model will use to make predictions based on user input.
machine-learning friendly. “The most widely used method in literature is the word vector
embedding.This method represents words as vectors in a high dimensional space with the
proposition that semantically similar words would fall closer to each other in terms of distance
in this high dimensional space. Thus, the first step of the NLU pipeline is to tokenize the input
Following that, the input is passed to a regex featurizer which extracts features that match
predefined regular expressions, such as dates and numbers, as part of a simple entity detection
algorithm. The next component in the pipeline runs a Conditional Random Field model for
entity extraction based on Scikit Learn. The next component maps the extracted entities to
their synonyms provided by a training file. The following component converts the data to a
bag of words, suitable for intent classification. The final component of the pipeline does intent
classification using a model based on StarSpace.”[7]
14
15
Chapter 5:- System demonstration
Implementation issues: We did not face many problems while developing this panel due
to our prior knowledge and ability to develop websites using this combination of PHP
with HTML, CSS, Bootstrap, and a little Javascript. However, some of the problems that
we encountered made us go through a difficult time sometimes, which is also difficult to
track, because we did not use a framework to implement this panel and no error log is
referred to when encountering some problems.
5.1.3.
● Dashboard: This page will be the first thing that appears to the user when he logs into the
site correctly, whether he is an administrator or a viewer.
16
● Colleges menu: This page displays all the colleges in the university, and it appears for both
the viewer and the administrator. The administrator can add a new college, remove a pre-
existing college, or modify pre-existing college data.
● College data: This page displays the fields assigned to each college, name, and description.
Only an administrator can access this page.
● Majors menu: On this page, all the majors that the student can study on the campus of
Palestine Polytechnic University are displayed, and both the viewer and the
● Major data: Only administrators can view this page, this page contains all necessary fields
for majors at Palestine Polytechnic University. Starting with the title of the major to the
program attached to this major through each of the collegesupervising this specialization and
17
each of the total credit hours, the hourly rate specified in JOD, the value of the first
installment, minimum GPA, duration of the assigned study and the approved guideline
branches for each major
● Branch menu: Here all the branches of the Tawjihi that its students can enroll in the colleges'
majors are displayed. Can be viewed by the viewer and administrator.
● Admin page: All users of the site are shown on this page. Both the viewer and the
administrator can access this page.
● Admin data: On this page, special data is added to create a new user for the site.
Only an administrator can access this page.
5.2. Chat-bot
5.2.1. Implementation details:
The project consists of several parts, the most important of which are:
1- Actions section, which is the folder that contains 3 files in the Python programming
language.The most important file is the Actions file, which contains custom Actions
that are built according to the need and purpose of the chatbot.
2- The data section and contains 3 important files that cannot be dispensed with: the
natural language understanding file, which contains the training data necessary for the
bot, which it is expected to receive during its operation from the user, and the rules file,
which contains a certain structure that makes the bot act obligatory according to what
exists, regardless of the circumstances in terms of the received data, and the story file,
which contains scenarios of conversations with users, and all conversations are
recorded within this file in .yml extension.
3- There is also a very important file, which is the domain that defines the universe in
which your assistant operates. It specifies the intents, entities, slots, responses, forms,
and actions your bot should know about. It also defines a configuration for conversation
sessions.
4- There is also the Models section, in which all models are stored after each bot
training.Every model we can say is like the nucleus or brain of the bot. The bot cannot
work and listen to the user’s messages and respond to them without the model
18
6- After each bot training process, and to get the latest results, you must choose the newest
model. Older models can be selected so that they can be compared with the new model in
terms of additions.
19
CHAPTER 6:- TESTING
""" IMPORTS """ from random
import randint import time
import requests import json
# Chatbot name variable (you can change it to your liking) chatbotName = 'xyz'
""" FUNCTIONS """
# Send the chatbot's message with a delay of 0.2s so that it feels real
def sendBotMsg(message):
time.sleep(0.2)
print(f'{chatbotName}: {message}')
# Random function for returning random response from the given dictionary arrray. # noqa def
random(array): arrayLength = len(array) rand = randint(0, arrayLength-1) return array[rand]
chatbot():
20
'triggers': ['bye', 'cya', 'gtg', 'ttyl', 'i gtg', 'gtg bye'],
'responses': [f'See you later, {name}!', f'Bye, {name}!', f'Cya later, {name}!'], # noqa
},
'thankyou': {
'triggers': ['ty', 'tysm', 'thanks', 'thank you'],
'responses': ['No problem!', 'You\'re welcome!', 'Welcome!'], },
'good': {
'triggers': ['good', 'great', 'nice', 'noice', 'cool'],
'responses': ['Awesome!', 'Great!'], },
'ok': {
'triggers': ['ok', 'okay', 'aight', 'ight', 'k', 'kk', 'alright'],
'responses': ['Are you sure?', 'Ok.', 'Okay.'], },
'yes': {
'triggers': ['yes', 'yeah', 'ye', 'yea', 'yep', 'ya'], 'responses':
['Fine.', 'Ok.'],
},
'no': {
'triggers': ['no', 'nope', 'nah', 'na'],
'responses': ['Why not?', 'Okay.'], },
'bored': {
'triggers': ['i\'m bored', 'im bored', 'i am bored'],
'responses': ['Say goodbye to your boredom and chat with me!', 'Why are you bored?'], # noqa
}, 'nameask': {
'triggers': ['what\'s your name?', 'whats your name?', 'what\'s your name', 'whats your name',
'whats ur name', 'whats ur name?'], # noqa
'responses': f'My name is {chatbotName}, the awesome chatbot! Nice to meet you, {name}', #
noqa
},
'noyou': {
'triggers': ['no u', 'no you'], 'responses':
['no u', 'no you'],
},
'stutterwords': {
'triggers': ["uh", "uhm", "uh-", "uhm-", "uhh"],
'responses': ["Hm?", "?", "What?"], },
'lol': {
'triggers': ['lol', 'lmao', 'haha', 'hahaha', 'hehe', 'xd'], 'responses':
['Haha!', 'Funny, right?', 'xD'],
},
'wish': {
'triggers': ["ur name"], 'responses':
["i am satya"],
},
'pl': {
'triggers': ['clg','knl','3'],
'responses': ["ravindra"],
21
}
}
if userinput in db['greetings']['triggers']:
sendBotMsg(random(db['greetings']['responses'])) elif userinput in db['bye']['triggers']:
sendBotMsg(random(db['bye']['responses'])) elif userinput in
db['thankyou']['triggers']: sendBotMsg(random(db['thankyou']['responses']))
22
CHAPTER 7 :- CONCLUSION
interesting decisions:
1- The idea of the project itself was very interesting. We considered this project and set it as
a challenge to our abilities and ourselves. To be based on learning to use and implement
programs using a non-renowned framework for a project that is the most important in a
university student's career.
2-The idea of changing the operating system used to run the bot was one of the most crucial
decisions in the workflow of the project. Windows was the best and most worthy on paper,
according to the sources. But there was one problem that we had encountered for such a
long time that made an operating system change necessary.
Recommendations: It is possible to modify and increase the efficiency of the bot to the
fullest extent if the time factor and the human factor are available. Unfortunately, we were
not able to deliver the bot to the maximum extent that we drew and expected due to the
circumstances that befell us. Additional matters necessary for students related to registration,
student status, and forms to official documents can be added. The project scope may be
expanded to include all corners of the university, including faculties and deanships of
registration and follow-up of all matters that the student is interested in during their academic
life. The ability to communicate using voice messages.
23
PROJECT TIMESHEET
1
Internship Bangalore 2-May-23 Tuesday Installation of python 9 Learner
2
Internship Bangalore 3-May-23 Wednesday Working with IDLE 9 Learner
3
Internship Bangalore 4-May-23 Thursday Basic syntax,variables 9 Learner
4
Internship Bangalore 5-May-23 Friday Data types,opeartors 9 Learner
5 Bangalore 6-May-23 Saturday
7
Internship Bangalore 8-May-23 Monday Basic programs Learner
8
Internship Bangalore 9-May-23 Tuesday Control and lopping 9 Learner
10-May-
9
Internship Bangalore 23 Wednesday List and sets 9 Learner
10
Internship Bangalore 11-May-23 Thursday arrays and strings 9 Learner
12-May-
11
Internship Bangalore 23 Friday Revision of the concepts 9 Learner
12 Bangalore 13-May- Saturday
23
13 Bangalore 14-May- Sunday
23
15-May-
14
Internship Bangalore 23 Monday Programs of all concepts 9 Learner
16-May-
15
Internship Bangalore 23 Tuesday Assingnment 9 Learner
17-May-
16
Internship Bangalore 23 Wednesday Installation of pycharm 9 Learner
18-May-
17
Internship Bangalore 23 Thursday Installation of packages 9 Learner
24
19-May-
18
Internship Bangalore 23 Friday Pandas(packages) 9 Learner
19 Bangalore 20-May- Saturday
23
25
20 Bangalore 21-May- Sunday
23
22-May-
21
Internship Bangalore 23 Monday Pandas(packages) 9 Learner
23-May-
22
Internship Bangalore 23 Tuesday Pandas(packages) 9 Learner
24-May-
23
Internship Bangalore 23 Wednesday Numpy(packages) 9 Learner
25-May-
24
Internship Bangalore 23 Thursday Numpy(packages) 9 Learner
T
26
26-May- Revision of the concepts
25
Internship Bangalore 23 Friday and programs 9 Learner
26 Bangalore 27-May- Saturday
23
27 Bangalore 28-May- Sunday
23
29-May-
28
Internship Bangalore 23 Monday Project dicussion 9 Learner
30-May-
29
Internship Bangalore 23 Tuesday Demo of chatbot project 9 Learner
31-May- Preparation for
30
Internship Bangalore 23 Wedesday assignment 9 Learner
31
Internship Bangalore 1-Jun-23 Thursday Assignment 9 Learner
32
Internship Bangalore 2-Jun-23 Friday Testing of chatbot 9 Learner
33 Bangalore 3-Jun-23 Saturday
Understanding of the
35
Internship Bangalore 5-Jun-23 Monday requirement 9 Learner
Understanding of the
36
Internship Bangalore 6-Jun-23 Tuesday requirement 9 Learner
Gathering the
37
Internship Bangalore 7-Jun-23 Wednesday requirement 9 Learner
Analysing the
38
Internship Bangalore 8-Jun-23 Thursday requirement 9 Learner
39
Internship Bangalore 9-Jun-23 Friday Project / Design plan 9 Learner
40
Bangalore 10-Jun-23 Saturday
41 Bangalore 11-Jun-23 Sunday
42
Internship Bangalore 12-Jun-23 Monday Coding and Debugging 9 Learner
43
Internship Bangalore 13-Jun-23 Tuesday Coding and Debugging 9 Learner
44
Internship Bangalore 14-Jun-23 Wednesday Coding and Debugging 9 Learner
45
Internship Bangalore 15-Jun-23 Thursday Coding and Debugging 9 Learner
46
Internship Bangalore 16-Jun-23 Friday Coding and Debugging 9 Learner
27
47 Bangalore 17-Jun-23 Saturday
Deploying the
49
Internship Bangalore 19-Jun-23 Monday application on server 9 Learner
28
Testing of the application
50
Internship Bangalore 20-Jun-23 Tuesday 9 Learner
Identifing the errors and
51
Internship Bangalore 21-Jun-23 Wednesday redevelopment 9 Learner
Testing of the application
52
Internship Bangalore 22-Jun-23 Thursday 9 Learner
Final application
53
Internship Bangalore 23-Jun-23 Friday demonstration 9 Learner
29