0% found this document useful (0 votes)
45 views11 pages

Aiproject Report

The document describes a chatbot project for LPU that allows users to query about college activities. The chatbot can provide date and time information for events like annual day and sports day. It uses techniques like tokenization, lemmatization, and rule-based systems to match queries to responses. The interface is built using Tkinter and responses are stored in files. Individual team members contributed different modules for natural language processing, response generation, navigation, and the graphical user interface. The chatbot demonstrates using Python packages like Tkinter, NumPy, NLTK, and Pickle to build an effective conversational agent.

Uploaded by

ashutosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views11 pages

Aiproject Report

The document describes a chatbot project for LPU that allows users to query about college activities. The chatbot can provide date and time information for events like annual day and sports day. It uses techniques like tokenization, lemmatization, and rule-based systems to match queries to responses. The interface is built using Tkinter and responses are stored in files. Individual team members contributed different modules for natural language processing, response generation, navigation, and the graphical user interface. The chatbot demonstrates using Python packages like Tkinter, NumPy, NLTK, and Pickle to build an effective conversational agent.

Uploaded by

ashutosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Name – Ashutosh Shukla

Registration No. -11803184

Roll No. – A10

Section – K18KH

Github link - https://github.com/AshutoshShukla26/ashutoshukla2000-gmail.com

Q3)chatbot for LPU –


The user can query about the college related activities through online
with the help of this web application. The user can query college related activities such as date
and timing of annual day, sports day and other cultural activities. This system helps the student
to be updated about the college activities. We have developed a chatbot performing these
operations.The individual module developed by our team members :-

i) Anjali- Responsible for using the concepts of Artificial intelligence in project. Operations
performed on the module are tokenization and lemmization, where the chatbot will
disintegrate each word from the given query and then will try to find the best match for the
event using the rule based system. In rule based system ,various steps have been designed to
perform or to get the outcome of a certain problem or query asked by user .The chatbot will
check for the answer of the query using the file class_dict which contains already fed solutions
to the system.

ii) Sudhanshu -Responsible for the functions to produce the response of the request of user. The
chatbot will have to give response from the already saved files under the name annual_day,
sports_day and cultural_fest.The graphical user interface contribution. The first frame
containing date and time about the event asked by user is designed using Tkinter allow the user
to see the response of the quer in attractive and interactive manner. Along with the main
screen where the it is designed using grid .The main menu to fetch the information about the
user.And saving it for future use .
iii) Ashish – Responsible for reopening the files after changes are saved .The chatbot will give
response to the queries whose answer is already present in the system files .But if a query does
not have an answer already present in system.The user can save it in file himself,and the
changes after saving that file are reflected back for future use.The nagivation part where the
user can navigate from one page to another using arrows,png image provided with
files.Framing the entering names for future use.

iv) Ashutosh – Responsible for getting the ‘enter name ‘ page designing.Functions for writing
the new additional responses to the already existing files.Where the user can again ask the
question whose answer was not previously in the system files .The user can append new info in
existing files or create new files.Time option to display time when the user clicks on Time
button .Date option where the user gets the current date .The Graphical user interface
designed for topic selection.The GUI part is designed using Tkinter ,numpy,grids.

INTRODUCTION:-
Chatbot for LPU. The chatbot can answer quires related to cultural
events. The user can inquire about the date and time of certain events planned in LPU. There
are various modules developed by us to ensure that the chatbot works efficiently. The chatbot
application has interactive menu to be able to navigate and get response adequately.

The some package used by us in this project are :-

Tkinter

Tensorflow

Nltk

Numpy

Nltk.downlad()

Grid

Pickle

lancasterStammer
Tkinter ,grid,numpy are used to make interactive Graphical user interface for the chatbot. The
navigational arrows, images are all available in attached files.

Tensorflow, nltk is used for tokenization i.e., to get word by word of entered query to process
the response.The chatbot process each word and tries to find the appropriate response from
the give rules and finally either gives a solution or can ask to save the response in chatbot’s
database.

The user first is introduced to our chatbot. He needs to write his name and can also give
chatbot a name to make it more interactive. Next the user needs to select an event from the
given options to ask a query or can add an event on its own to inquire for future use.

The user can then ask the chatbot about the date and time of the event specified. If the chatbot
does not have the appropriate response for the query. The user can add response itself and
store it in existing files or can make a new file. The changes made by the user are saved and can
be viewed in future if the user have the same query again.

OBJECTIVES and Methodology:-

The objective of the project is to make a chatbot for LPU ,who is capable of answering the
queries related to the date and timing of certain cultural events happening in college.

The chatbot is able to give date and time for the specified event if it is present in its database
otherwise the user can save the answer of the query for future use.

The chatbot uses various features and packages of python like Tkinter, numpy, pandas,
Tensorflow, random to give the user a required output.

Tokenization is a very common task in natural language processing, It is basically a task of


chopping a character into pieces, called as token , and throwing away the certain characters at
the same time, like punctuation.Tokenization is used to split a sentence or paragraph into
smaller units called tokens.The meaning of the text could easily be interpreted by analysing the
words present in the text . Tokenization can be done as :-

1. Count the number of words in the text


2. Count the frequency of the word,that is the number of times a particular word is
present.
NLTK ,the natural language toolkit ,is a library written in python for symbolic and statistical
Natural language processing.

Lemmatization and stemming both generate the root form of the inflected words. The
difference is that stem might not be an actual language word. Stemming follows an algorithm
with steps to perform on the words which makes it easier .

Stemming is the process of reducing a word to its word stem that affixes to suffixes and
prefixes or to the roots of the words known as a lemma. This is proved very useful when we can
get the answer by focusing on the main root word rather than focusing on prefix and suffixes
which only increase the storage space and are not actually helping to find an optimal solution .

The rules for answering a query is already specified in rule_based.py file.

LancasterStemmer is an iterative algorithm with rules saved externally . one table containing
about 120 rules indexed by the last letter of a suffix. On each iteration ,it tries to find tan
applicable rule by the last character of the word.Each rule specifies either a deletion or
replacement of an ending. If there is no such rule ,it terminates .

Bag of words model is a way of representing text data when modelling text with machine
learning algorithm. As machine learning cannot work directly on raw text .The system requires a
fixed length inputs and outputs. The system works on numbers ,specifically , vectors of
numbers . So in natural language processing we use feature extraction. Bag of words involves
two things :-

1. A vocabulary of known words.


2. A measure of the presence of known words.

Steps involved :-

1. Collect data
2. Design the vocabulary
3. Create document vectors

After this we get a sparse vector or sparse representation .A more sophisticated approach is to
create a vocabulary of grouped words This both changes the scope of the vacbulary and allows
the bag-of-words to capture a little bit more meaning from the document.

In above mentioned approach each word or token is called a ‘gram’ . Creating a vocabulary of
two words is called bigram model.
RESULT:-

This is the First page of chatbot made by using Tkinter and numpy.Here the current date and
time is displayed.
Here user can select any topic ,he wants to inquire about .The user can also add new events
for future use .
The chatbot can answer the questions whose answers are already present in the file. If the
query is not matched with any answer ,the user can write the answer and save it for future
use .

If next time the user asks the same question again , the chatbot can answer the question now
because it has saved the previous answer in the memory.
Now the answer written by the user is saved in existing file and if now the user asks the same
question again to the chatbot. The chatbot can answer the it effectively by reading from the
file where we have appended the new data.
Images used :-
Conclusion :-

We were able to come up with a solution for our project by combining different concepts of
Artificial intelligence and implementing them with the help of packages in python. The pacakges
used are :-

Tkinter :- Thinter is the python interface to the Tk GUI toolkit shipped with python. Tkinter
provides various controls, such as buttons, labels and text boxes used in a GUI application.
These controls are commonly called widgets. This package makes GUI implementation very
easy in python ,it supports almost 15 types of widgets .

Numpy :- NumPy is a Python package which stands for ‘Numerical Python’ . it is core library for
scientific computing , which contains a powerful n-dimensional array object, provide tools for
integreating C ,C++.

LancasterStemmer is an iterative algorithm with rules saved externally. One table containing
about 120 rules indexed by the last letter of a suffix. On each iteration ,it tries to find tan
applicable rule by the last character of the word.Each rule specifies either a deletion or
replacement of an ending. If there is no such rule ,it terminates. It also terminates if a word
starts with a vowel and there are only two letters left or if a word starts with a consonant and
there is three characters left.Otherwise , the rule is applied .

Pickle :- python pickle module is used for serializing and de-serializing a python object structure.
Any object in python can be pickled so that it can be saved on disk . What pickle does is that it
‘serializes’ the object first before writing it to file.

NLTK :- NLTK is a leading platform for building python programs to work with human language
data. NLTK has been called “a wonderful tool for teaching and working in, computational
linguistics using python , : and “ an amazing library to play with natural language “.

And some more packages.


NLTK and LancasterStemmer is basically used for implementing artificial intelligence concepts
on which the chatbot is working like tokenization , Stemming, Lemmatization and bag of words .

Tkinter and numpy is basically used to making the Graphical user interface of the project .
Along with grid .Various features of Tkinter like canvas, text boxes, background color has been
used in the project to make it more interactive .

Future Scope :-

The future scope of the project is that as the new information will be updated and added to the
existing files or maybe in new files ,the chatbot’s ability to answer the queries of the user will
become more effective. As one of the major feature of Artificial Intelligence is that a system’s
ability is increased as more and more information and rules are fed to its inferential engine .
Hence increasing the performance of the system.

You might also like