100% found this document useful (2 votes)
327 views20 pages

AI Chatbot: Green University of Bangladesh

The document describes an AI chatbot project that combines a chatbot with predefined responses stored in a JSON file and OpenAI's question answering capabilities. The project aims to develop an interactive chatbot system that can engage users in conversation while providing accurate answers to questions. It details the motivation, problem definition, design goals, and implementation of integrating the chatbot and OpenAI API, including loading response data, handling user input, generating responses, and the graphical user interface. The overall goal is to create an effective and user-friendly chatbot system that can interact with and assist users across various domains.

Uploaded by

shakib201902002
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
100% found this document useful (2 votes)
327 views20 pages

AI Chatbot: Green University of Bangladesh

The document describes an AI chatbot project that combines a chatbot with predefined responses stored in a JSON file and OpenAI's question answering capabilities. The project aims to develop an interactive chatbot system that can engage users in conversation while providing accurate answers to questions. It details the motivation, problem definition, design goals, and implementation of integrating the chatbot and OpenAI API, including loading response data, handling user input, generating responses, and the graphical user interface. The overall goal is to create an effective and user-friendly chatbot system that can interact with and assist users across various domains.

Uploaded by

shakib201902002
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/ 20

Green University of Bangladesh

Department of Computer Science and Engineering (CSE)


Semester: (Spring, Year: 2023), B.Sc. in CSE (Day)

AI Chatbot

Course Title: Artificial Intelligence


Course Code: CSE 316
Section: PC-201 DA
Students Details
Name ID
Mohamad Shakib Mollah 201902002
Md. Yeasin 201902087

Submission Date: 16/06/2023


Course Teacher’s Name: Rusmita Halim Chaity

[For teachers use only: Don’t write anything inside this box]

Lab Project Status

Marks: Signature:

Comments: Date:
Contents

1 Introduction 2
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Problem Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.2 Complex Engineering Problem . . . . . . . . . . . . . . . . . . 3
1.4 Design Goals/Objectives . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Design/Development/Implementation of the Project 5


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Project Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Performance Evaluation 13
3.1 Simulation Environment/ Simulation Procedure . . . . . . . . . . . . . 13
3.2 Results Analysis/Testing . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.1 Result_1: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.2 Result_2: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.3 Result_3: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 Results Overall Discussion . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Conclusion 18
4.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.3 Scope of Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

1
Chapter 1

Introduction

1.1 Overview
In this project, a chatbot and OpenAI’s question-answering capabilities are combined.
In order to provide relevant responses based on user input, the chatbot uses predefined
responses kept in a JSON file. The OpenAI question-answering feature makes use of
the OpenAI API to produce answers to queries and commands from users. Users can
engage with the chatbot and query the OpenAI API using the project’s graphical user
interface (GUI), which shows a chat log and allows for user interaction. Users can
converse with the chatbot using this combined functionality and get answers from both
the predefined knowledge base and the sophisticated OpenAI API features.

1.2 Motivation
The motivation behind this project is to build a conversational agent that can engage in
intelligent and interactive conversation while utilizing both pre-written responses and
the sophisticated language features offered by the OpenAI API. Users are able to have
fruitful chats and get pertinent answers based on the available data by combining a
chatbot with a knowledge base that is kept in a JSON file. The OpenAI API is another
tool that the chatbot can use to access a wealth of outside knowledge and give precise,
current responses to a variety of queries. The goal of this project is to provide a user-
friendly interface that makes the most of the advantages of both methods, boosting the
conversational experience and giving users useful information.

2
1.3 Problem Definition

1.3.1 Problem Statement


The challenge at hand is to develop an interactive chatbot system that can hold meaning-
ful conversations with users and provide them with precise answers to their questions.
To maintain uniformity and domain-specific data, the system should include pre-defined
responses saved in a JSON file. It should also make use of the OpenAI API for question-
answering, giving it access to a sizable quantity of outside knowledge for current and
correct responses. The objective is to provide a user-friendly graphical interface that en-
ables users to converse naturally with the chatbot, ask questions, and receive answers.
The goal is to develop a reliable and efficient chatbot system that improves the conver-
sational experience for consumers by fusing pre-defined information with sophisticated
language abilities.

1.3.2 Complex Engineering Problem

Table 1.1: Summary of the attributes touched by the mentioned projects


Name of the P Attributess Explain how to address
P1: Depth of knowledge required Extensive understanding of AI Chatbot de-
velopment and natural language processing is
needed.
P2: Range of conflicting require- Balancing multiple requirements such as ac-
ments curacy, reliability, user-friendliness, scalability,
and modularity.
P3: Depth of analysis required Thorough analysis to match user inputs, evalu-
ate scoring mechanisms, and generate appropri-
ate responses.
P4: Familiarity of issues Knowledge of common challenges in AI Chat-
bot systems, including language understanding
and context retention.
P5: Extent of applicable codes Yes, its ectent applicable codes such as data
loading, user input handling, response scoring,
GUI interaction, and OpenAI integration
P6: Extent of stakeholder involve- No
ment and conflicting requirements
P7: Interdependence Ensuring seamless integration among AI Chat-
bot functionality, OpenAI question-answering,
GUI interface, and data integration.

3
1.4 Design Goals/Objectives
The design goals and objectives of this project can be summarised as follows:

• Enable conversational interaction with the chatbot system.

• Integrate a knowledge base stored in a JSON file for consistent and domain-
specific information.

• Utilize the OpenAI API for advanced question-answering capabilities and access
to external knowledge.

• Provide a user-friendly interface for seamless interaction.

• Ensure accuracy and reliability in the chatbot’s responses.

• Enhance the conversational experience for users.

• Design the system to be scalable and modular for future expansion and feature
integration.

1.5 Application
The AI Chatbot project can be used for language learning, virtual assistance, informa-
tion retrieval, education, content recommendations, and customer service. It can be used
in a variety of businesses and offers intelligent support and automated conversation.

4
Chapter 2

Design/Development/Implementation
of the Project

2.1 Introduction
This project develops an interactive chatbot using the OpenAI API, and pre-defined
replies are combined to create a chatbot system under the AI Chatbot project. It strives
to deliver precise and pertinent answers by matching user input with the existing knowl-
edge base, and it has an intuitive UI. To create an effective and scalable chatbot solution
across many domains, the project focuses on managing competing needs, stakeholder
involvement, and interdependence among components.

2.2 Project Details


The AI Chatbot project is creating an intelligent chatbot system that makes use of pre-
defined responses and the OpenAI API for interactive interactions. The system responds
to user inquiries, offers information, and offers support in a variety of fields. Data
management, user input handling, response generation, OpenAI API integration, GUI
implementation, enhancement, and testing are important components. The project seeks
to produce an effective and user-friendly chatbot system that can provide users with
helpful assistance and accurate responses. Overall of the AI Chatbot project is to create
an effective and user-friendly chatbot system that can interact meaningfully with users,
offer accurate information, and support users across a range of domains and use cases.

5
2.3 Implementation
First Python File

import json
import re
import random
import t k i n t e r as tk
import openai

def load_json ( f i l e ) :
w i t h open ( f i l e ) a s b o t _ r e s p o n s e s :
p r i n t ( f " Loaded ’{ f i l e } ’ s u c c e s s f u l l y ! " )
return json . load ( bo t_ res po ns es )

response_data = load_json ( " bot . json " )

def get _res pons e ( i n p u t _ s t r i n g ) :


s p l i t _ m e s s a g e = re . s p l i t ( r ’ \ s + | [ , ; ? ! . − ] \ s* ’ , i n p u t _ s t r i n g . lower ( ) )
score_list = []

for response in response_data :


response_score = 0
required_score = 0
required_words = response [ " required_words " ]

i f required_words :
f o r word i n s p l i t _ m e s s a g e :
i f word i n r e q u i r e d _ w o r d s :
r e q u i r e d _ s c o r e += 1

i f r e q u i r e d _ s c o r e == l e n ( r e q u i r e d _ w o r d s ) :
f o r word i n s p l i t _ m e s s a g e :
i f word i n r e s p o n s e [ " u s e r _ i n p u t " ] :
r e s p o n s e _ s c o r e += 1

s c o r e _ l i s t . append ( r e s p o n s e _ s c o r e )

b e s t _ r e s p o n s e = max ( s c o r e _ l i s t )
response_index = s c o r e _ l i s t . index ( best_response )

i f i n p u t _ s t r i n g == " " :
r e t u r n " P l e a s e t y p e s o m e t h i n g s o we c a n c h a t : ( "

6
i f b e s t _ r e s p o n s e != 0 :
bot_response = response_data [ response_index ][ " bot_response " ]
i f isinstance ( bot_response , l i s t ) :
b o t _ r e s p o n s e = random . c h o i c e ( b o t _ r e s p o n s e )
return bot_response

r e t u r n random . c h o i c e ( r e s p o n s e _ d a t a ) [ " b o t _ r e s p o n s e " ]

def send_message ( ) :
u s e r _ i n p u t = u s e r _ e n t r y . g e t ( " 1 . 0 " , t k . END ) . s t r i p ( )
bot_response = get_response ( user_input )
c h a t _ l o g . i n s e r t ( t k . END, " You : " + u s e r _ i n p u t + " \ n " )
c h a t _ l o g . i n s e r t ( t k . END, " Bot : " + b o t _ r e s p o n s e + " \ n " )
u s e r _ e n t r y . d e l e t e ( " 1 . 0 " , t k . END)

def g e n e r a t e _ o p e n a i _ r e s p o n s e ( prompt ) :
openai . api_key =
" sk −DUSozR4Z1DOuS7IKaaIfT3BlbkFJSE6lOxbiuZzLV64Na3aZ "
m o d e l _ e n g i n e = " t e x t − d a v i n c i −003 "

completion = openai . Completion . c r e a t e (


engine =model_engine ,
p r o m p t = prompt ,
m a x _ t o k e n s =1024 ,
n =1 ,
s t o p =None ,
temperature =0.5 ,
)

response = completion . choices [ 0 ] . t e x t


return response

def handle_openai_question ( ) :
u s e r _ i n p u t = u s e r _ e n t r y . g e t ( " 1 . 0 " , t k . END ) . s t r i p ( )
bot_response = generate_openai_response ( user_input )
c h a t _ l o g . i n s e r t ( t k . END, " You : " + u s e r _ i n p u t + " \ n " )
c h a t _ l o g . i n s e r t ( t k . END, " Bot : " + b o t _ r e s p o n s e + " \ n " )
u s e r _ e n t r y . d e l e t e ( " 1 . 0 " , t k . END)

# C r e a t e t h e GUI window
window = t k . Tk ( )
window . t i t l e ( " C h a t b o t " )
window . g e o m e t r y ( " 510 x630 " )

7
# Create th e chat log t e x t widget with a colored background
c h a t _ l o g = t k . T e x t ( window , h e i g h t =30 , w i d t h =60 , b a c k g r o u n d = " l i g h t g r a y " )
c h a t _ l o g . pack ( )

# Create the user input entry widget with a


c o l o r e d b a c k g r o u n d and f o r e g r o u n d
u s e r _ e n t r y = t k . T e x t ( window , h e i g h t =3 , w i d t h =50 , b a c k g r o u n d = " b l a c k " ,
f o r e g r o u n d = " w h i t e " , wrap= " none " )
u s e r _ e n t r y . pack ( )

# Create the send b u t t o n f o r the c h a t b o t


s e n d _ b u t t o n _ c h a t b o t = t k . B u t t o n ( window , h e i g h t =2 , w i d t h =5 , t e x t = " Send " ,
command= s e n d _ m e s s a g e , b a c k g r o u n d = " w h i t e " , f o r e g r o u n d = " b l a c k " )
s e n d _ b u t t o n _ c h a t b o t . pack ( )

# C r e a t e t h e s e n d b u t t o n f o r t h e OpenAI q u e s t i o n −a n s w e r i n g w i t h c o l o r
s e n d _ b u t t o n _ o p e n a i = t k . B u t t o n ( window , h e i g h t =2 , w i d t h =10 ,
t e x t = " Ask OpenAI " ,
command= h a n d l e _ o p e n a i _ q u e s t i o n , b a c k g r o u n d = " b l a c k " , f o r e g r o u n d = " w h i t e " )
s e n d _ b u t t o n _ o p e n a i . pack ( )

# S t a r t t h e GUI e v e n t l o o p
window . m a i n l o o p ( )

Second Python File

import random

def random_string ( ) :
random_list = [
" P l e a s e t r y w r i t i n g s o m e t h i n g more d e s c r i p t i v e . " ,
"Oh ! I t a p p e a r s you w r o t e s o m e t h i n g I don ’ t u n d e r s t a n d y e t " ,
"Do you mind t r y i n g t o r e p h r a s e t h a t ? " ,
" I ’m t e r r i b l y s o r r y , I d i d n ’ t q u i t e c a t c h t h a t . " ,
" I can ’ t answer t h a t yet , p l e a s e t r y a s k i n g something e l s e . "
]

l i s t _ c o u n t = len ( random_list )
r a n d o m _ i t e m = random . r a n d r a n g e ( l i s t _ c o u n t )

return r a n d o m _ l i s t [ random_item ]

Json File

8
[
{
" response_type " : " greeting " ,
" u s e r _ i n p u t " : [ " h e l l o " , " hey " , " h i " , " good day " ,
" G r e e t i n g s " , " what ’ s up ? " , " how i s i t g o i n g ? " ] ,
" b o t _ r e s p o n s e " : [ " H e l l o ! " , " Hey ! " , " What c a n I do f o r you ? " ] ,
" required_words " : []
},
{
" response_type " : " greeting " ,
" u s e r _ i n p u t " : [ " n i c e " , " t o " , " meet " , " you " ] ,
" b o t _ r e s p o n s e " : " The p l e a s u r e i s a l l mine ! " ,
" r e q u i r e d _ w o r d s " : [ " n i c e " , " meet " , " you " ]
},
{
" response_type " : " question " ,
" u s e r _ i n p u t " : [ " how " , " t o " , " l e a r n " , " c o d e " ,
" coding " , " apps " ] ,
" b o t _ r e s p o n s e " : " S t a r t by t y p i n g :
’How t o l e a r n c o d i n g ’ on Google . " ,
" r e q u i r e d _ w o r d s " : [ " l e a r n " , " code " ]
},
{
" response_type " : " question " ,
" u s e r _ i n p u t " : [ " r e f u n d " , " how " , " c a n " ,
" I " , " get " ] ,
" b o t _ r e s p o n s e " : "We don ’ t o f f e r r e f u n d s
for free education . " ,
" required_words " : [ " refund " , " i " ]
},
{
" response_type " : " question " ,
" u s e r _ i n p u t " : [ " how " , " a r e " , " you " ] ,
" b o t _ r e s p o n s e " : " I ’m g r e a t ! Thanks f o r a s k i n g . " ,
" r e q u i r e d _ w o r d s " : [ " how " , " a r e " , " you " ]
},
{
" response_type " : " question " ,
" u s e r _ i n p u t " : [ " who " , " a r e " , " you " ] ,
" b o t _ r e s p o n s e " : " I ’m Ai Based C h a t b o t ! " ,
" r e q u i r e d _ w o r d s " : [ " who " , " a r e " , " you " ]
},
{
" response_type " : " information " ,
" u s e r _ i n p u t " : [ " I n f o r m a t i o n " , " a b o u t " , " Green " ,
" U n i v e r s i t y " , " of " , " Bangladesh " ] ,
" b o t _ r e s p o n s e " : " Green U n i v e r s i t y o f B a n g l a d e s h

9
i s a renowned p r i v a t e u n i v e r s i t y l o c a t e d i n Dhaka ,
B a n g l a d e s h . I t o f f e r s a wide r a n g e o f u n d e r g r a d u a t e
and p o s t g r a d u a t e p r o g r a m s i n v a r i o u s d i s c i p l i n e s
i n c l u d i n g B u s i n e s s A d m i n i s t r a t i o n , Computer S c i e n c e ,
E l e c t r i c a l and E l e c t r o n i c E n g i n e e r i n g , E n g l i s h ,
Economics , and many more . The u n i v e r s i t y i s c o m m i t t e d
to providing quality education , f o s t e r i n g research
and i n n o v a t i o n , and p r e p a r i n g s t u d e n t s t o become
s k i l l e d p r o f e s s i o n a l s in t h e i r r e s p e c t i v e f i e l d s . I t has a
s t a t e − of − t h e − a r t campus w i t h modern f a c i l i t i e s and
a d e d i c a t e d f a c u l t y team . To know more , you c a n v i s i t
t h e o f f i c i a l w e b s i t e o f Green U n i v e r s i t y o f B a n g l a d e s h . " ,
" required_words " : [ " Information " , " green " , " u n i v e r s i t y " ,
" bangladesh " ]
},

{
" response_type " : " course " ,
" user_input " : [ " courses " ] ,
" b o t _ r e s p o n s e " : " Green U n i v e r s i t y o f B a n g l a d e s h o f f e r s
a d i v e r s e range of courses across various d i s c i p l i n e s .
\ nSome o f t h e p o p u l a r c o u r s e s i n c l u d e B a c h e l o r o f : \ n B u s i n e s s
A d m i n i s t r a t i o n (BBA) , \ n B a c h e l o r o f S c i e n c e i n Computer S c i e n c e ,
\ nBachelor of Arts in English ,
\ n B a c h e l o r o f S c i e n c e i n E l e c t r i c a l and E l e c t r o n i c E n g i n e e r i n g ,
\ n B a c h e l o r o f S o c i a l S c i e n c e i n Economics , and many more .
\ nThe u n i v e r s i t y e n s u r e s t h a t t h e c o u r s e s a r e d e s i g n e d t o meet
i n d u s t r y demands and p r o v i d e s t u d e n t s w i t h t h e n e c e s s a r y s k i l l s
and k n o w l e d g e f o r t h e i r c h o s e n c a r e e r p a t h s . " ,
" required_words " : [ " courses " ]
},
{
" response_type " : " course_duration " ,
" user_input " : [ " course " , " duration " ] ,
" b o t _ r e s p o n s e " : " The d u r a t i o n o f c o u r s e s a t t h e Green
U n i v e r s i t y o f B a n g l a d e s h v a r i e s d e p e n d i n g on t h e p r o g r a m .
I t c a n r a n g e from 3 t o 4 y e a r s f o r u n d e r g r a d u a t e p r o g r a m s . " ,
" required_words " : [ " course " , " duration " ]
},
{
" response_type " : " locations " ,
" user_input " : [ " green " , " u n i v e r s i t y " , " l o c a t i o n " ] ,
" b o t _ r e s p o n s e " : " The Green U n i v e r s i t y o f B a n g l a d e s h i s
l o c a t e d i n Dhaka , t h e c a p i t a l c i t y o f B a n g l a d e s h . " ,
" required_words " : [ " location " ]
},
{
" response_type " : " semester " ,

10
" user_input " : [ " semesters " ] ,
" b o t _ r e s p o n s e " : " The Green U n i v e r s i t y o f B a n g l a d e s h
follows a semester system . " ,
" required_words " : [ " semesters " ]
},
{
" response_type " : " semester_duration " ,
" user_input " : [ " semester " , " duration " ] ,
" b o t _ r e s p o n s e " : " Each s e m e s t e r a t t h e Green U n i v e r s i t y o f
B a n g l a d e s h l a s t s f o r a r o u n d 4 months . " ,
" required_words " : [ " semester " , " duration " ]
},
{
" response_type " : " student_requirements " ,
" user_input " : [ " student " , " requirements " ] ,
" b o t _ r e s p o n s e " : " To be e l i g i b l e f o r a d m i s s i o n t o t h e Green
U n i v e r s i t y o f B a n g l a d e s h , s t u d e n t s must meet c e r t a i n a c a d e m i c
c r i t e r i a and p a s s t h e a d m i s s i o n t e s t . " ,
" required_words " : [ " student " , " requirements " ]
},
{
" response_type " : " classes " ,
" user_input " : [ " classes " ] ,
" b o t _ r e s p o n s e " : " The c l a s s e s a t t h e Green U n i v e r s i t y
o f B a n g l a d e s h a r e c o n d u c t e d on weekdays . " ,
" required_words " : [ " classes " ]
},
{
" response_type " : " teach_style " ,
" user_input " : [ " teaching " , " style " ] ,
" b o t _ r e s p o n s e " : " The t e a c h i n g s t y l e a t t h e Green U n i v e r s i t y
o f B a n g l a d e s h f o c u s e s on a c o m b i n a t i o n o f t h e o r e t i c a l k n o w l e d g e
and p r a c t i c a l a p p l i c a t i o n . " ,
" required_words " : [ " teaching " , " s t y l e " ]
},
{
" response_type " : " examination " ,
" u s e r _ i n p u t " : [ " exams " ] ,
" b o t _ r e s p o n s e " : " The Green U n i v e r s i t y o f B a n g l a d e s h c o n d u c t s
r e g u l a r exams t o a s s e s s t h e s t u d e n t s ’ p r o g r e s s and u n d e r s t a n d i n g
of the s u b j e c t s . " ,
" r e q u i r e d _ w o r d s " : [ " exams " ]
},
{
" response_type " : " class_hours " ,
" user_input " : [ " hours " ] ,
" b o t _ r e s p o n s e " : " The number o f c l a s s h o u r s p e r week a t t h e
Green U n i v e r s i t y o f B a n g l a d e s h v a r i e s d e p e n d i n g on t h e p r o g r a m

11
and c o u r s e l o a d . " ,
" required_words " : [ " hours " ]
},
{
" response_type " : " university_question " ,
" u s e r _ i n p u t " : [ " fun " , " a c t i v i t i e s " ] ,
" b o t _ r e s p o n s e " : " The Green U n i v e r s i t y o f B a n g l a d e s h o r g a n i z e s
v a r i o u s f u n a c t i v i t i e s and e v e n t s t h r o u g h o u t t h e y e a r t o p r o m o t e
s t u d e n t e n g a g e m e n t and r e c r e a t i o n . " ,
" required_words " : [ " fun " , " a c t i v i t i e s " ]
},
{
" response_type " : " f a c i l i t y " ,
" user_input " : [ " f a c i l i t i e s " ] ,
" b o t _ r e s p o n s e " : " The Green U n i v e r s i t y o f B a n g l a d e s h p r o v i d e s
modern f a c i l i t i e s i n c l u d i n g w e l l − e q u i p p e d c l a s s r o o m s , l a b o r a t o r i e s ,
l i b r a r y , s p o r t s f a c i l i t i e s , and s t u d e n t common a r e a s . " ,
" required_words " : [ " f a c i l i t i e s " ]
},
{
" response_type " : " fees " ,
" user_input " : [ " fee " ] ,
" b o t _ r e s p o n s e " : " The t u i t i o n f e e s a t Green U n i v e r s i t y o f
B a n g l a d e s h may v a r y d e p e n d i n g on t h e p r o g r a m and l e v e l o f s t u d y .
\ n A d m i s s i o n Fee : Tk . 2 0 , 0 0 0 / − \ n
BSc i n EEE : Tk . 5 , 2 8 , 5 0 0 / − \ n
BSc i n CSE : Tk . 6 , 5 8 , 1 0 0 / − \ n
BSc i n T e x t i l e : Tk . 5 , 0 7 , 0 5 0 / − \ n
BBA: Tk . 5 , 3 0 , 5 0 0 / − \ n
LL . B ( Hons ) : Tk . 6 , 5 6 , 5 0 0 / − \ n
BA ( Hons ) i n JMC : Tk . 4 , 0 6 , 7 0 0 / − \ n
BA ( Hons ) i n E n g l i s h : Tk . 4 , 2 0 , 8 0 0 / − \ n
BSS ( Hons ) i n S o c i o l o g y : Tk . 2 , 8 5 , 5 0 0 / − . " ,
" required_words " : [ " fee " ]
},
{
" response_type " : " thanks " ,
" u s e r _ i n p u t " : [ " Thanks " , " Thank you " , " T h a t ’ s h e l p f u l " ,
" Awesome , t h a n k s " , " Thanks f o r h e l p i n g me" ] ,
" b o t _ r e s p o n s e " : [ " Happy t o h e l p ! " , " Any t i m e ! " , "My p l e a s u r e " ] ,
" required_words " : []
}
]

12
Chapter 3

Performance Evaluation

3.1 Simulation Environment/ Simulation Procedure


The AI Chatbot System project uses a Python language for implementation. The sim-
ulation environment for the AI chatbot project involves setting up the development en-
vironment, preparing the data with pre-defined responses, and developing the graphical
user interface (GUI) using Tkinter. The response generation logic is implemented to
match user input with pre-defined responses, and the OpenAI API is integrated for en-
hanced question-answering capabilities. The GUI is connected with the response gen-
eration logic to capture user input and display generated responses. Thorough testing,
debugging, and refinement are conducted to ensure the chatbot functions accurately.
Once validated, the chatbot system is deployed in the desired environment, monitored
for performance, and updated based on user feedback.

13
3.2 Results Analysis/Testing

3.2.1 Result_1:

Figure 3.1: GUI Interface

14
3.2.2 Result_2:

Figure 3.2: User Defined AIC hatbot

15
3.2.3 Result_3:

Figure 3.3: Open AIC hatbot

16
3.3 Results Overall Discussion
The AI Chatbot project output produced promising results, creating an interactive chat-
bot system capable of engaging in conversations, providing accurate information, and
offering assistance across various domains. Integration with the OpenAI API enhanced
question-answering capabilities. The chatbot demonstrated good understanding of user
queries and offered relevant answers. Limitations include reliance on pre-defined data
and challenges in handling complex queries. Future improvements involve expanding
the knowledge base, refining the matching algorithm, and exploring advanced natural
language processing techniques. The project lays a foundation for intelligent conver-
sational agents and provides insights for further research and development in chatbot
technology.

17
Chapter 4

Conclusion

4.1 Discussion
This AI chatbot project using Tkinter for the GUI and the OpenAI API for generating
responses. It follows a modular structure with functions for loading data, generating
responses, and handling user interactions. The integration of the OpenAI API enhances
response generation. The GUI includes a chat log, user input, and send button. Further
improvements could include refining the response algorithm, expanding data, improv-
ing error handling, and enhancing the user interface. Thorough testing, updates, and
maintenance are essential for optimal performance.

4.2 Limitations
• Lack of real-time learning capability.

• Limited understanding of context

• Reliance on external APIs.

• Potential bias in responses.

These limitations should be taken into account when evaluating the AI Chatbot’s per-
formance and considering its application in specific contexts.

4.3 Scope of Future Work


• Implement real-time learning and user feedback integration.

• Improve context maintenance and conversation flow.

• Enhance user interface for better engagement.

• Address ethical considerations and mitigate biases.

18
• Expand knowledge base for improved response coverage.

• Enable multi-platform deployment for wider accessibility.

• Enhance natural language processing techniques.

These future work areas will enhance the AI Chatbot’s capabilities, user experience,
and overall performance, paving the way for continued development and advancement
in the field of AI chatbots.

19

You might also like