Académique Documents
Professionnel Documents
Culture Documents
MESSENGER PLATFORM
B.Tech.
by
2016
i
CANDIDATES DECLARATION
We hereby certify that the work, which is being presented in the report, entitled Li-
brary Information Chatbot on Messenger Platform, in partial fulfillment of the re-
quirement for the award of the Degree of Bachelor of Technology and submitted to
the institution is an authentic record of our own work carried out during the period May
2016 to October 2016 under the supervision of Dr. Vinay Singh . We also cited the
reference about the text(s)/figure(s)/table(s) from where they have been taken.
This is to certify that the above statement made by the candidates is correct to the best
of my knowledge.
ABSTRACT
This project aims to provide a way to avail library and its resources information readily
through a chatbot. The chatbot was developed on messenger platform using Facebook
for developers. It has SQL database to store the data pertaining to library. The open
source PHP program is used to communicate database to the user interface data. The
user interface are templates provided by messenger platform for developing messenger
chatbot. Sample data are crawled from various web pages. Users directly knew infor-
mation regarding library and its resources. It has eased the efforts students had to make
to get library information. It has been information on-the-go, you need it and you get
it instantly. Since the chatbot is made on messenger platform, it is readily available to
most of the students. It provides crucial information that students require. It lessens the
burden to login to ones account to get the information by being a handy solution to all
facebook connected users.
ACKNOWLEDGEMENTS
We are highly indebted to Dr. Vinay Singh and are obliged for giving us the autonomy
of functioning and experimenting with ideas. We would like to take this opportunity to
express our profound gratitude to them not only for their academic guidance but also
for their personal interest in our project and constant support coupled with confidence
boosting and motivating sessions which proved very fruitful and were instrumental in
infusing self-assurance and trust within us. The nurturing and blossoming of the present
work is mainly due to their valuable guidance, suggestions, astute judgment, construc-
tive criticism and an eye for perfection. Our mentor always answered myriad of our
doubts with smiling graciousness and prodigious patience, never letting us feel that we
are novices by always lending an ear to our views, appreciating and improving them
and by giving us a free hand in our project. Its only because of their overwhelming
interest and helpful attitude, the present work has attained the stage it has.
Finally, we are grateful to our Institution and colleagues whose constant encouragement
served to renew our spirit, refocus our attention and energy and helped us in carrying
out this work.
ABSTRACT ii
LIST OF TABLES v
LIST OF FIGURES v
iv
TABLE OF CONTENTS v
REFERENCES xxxiv
LIST OF FIGURES
vi
LIST OF FIGURES vii
ABBREVIATIONS
INTRODUCTION AND
LITERATURE SURVEY
1.1 General
Today the world is all about smart users and smart services one provides. Every inch
of life moves with the existing technologies available in the world. Things have turned
out to be faster, smarter and easier. Social networking has become a part of ones life
and students thrive on it. Every month, over 900 million people around the world com-
municate with friends, families and businesses on Messenger(Facebook, 2016).People
are now spending more time in messaging apps than in social media and that is a huge
turning point. Messaging apps are the platforms of the future and bots will be how their
users access all sorts of services(Reading About Chatbot 1, n.d.).Now-a-days, these
messenger apps are providing platform to develop chatbots for anyone who wants to
reach out to people to solve their problems either by providing services or sugges-
tions(Readings About Chatbot 2., 2016)(Readings About Chatbot 3., 2016)(Readings
About Chatbot 4., 2016). Chatbots engage users with an automated interactive inter-
face which turn out to be interesting way of getting information.
1.2 Objective
Purpose of the project is to make library information readily available to one. It is to
put the use of social networking attachment of students to give them useful information
regarding library. It is to ease out the difficulties a student face while procuring the
information related to library and its resources. Integrating this library chatbot within
the messenger doesnt ask one to install anything. Its simple and easy to use with a
sequence of questions and answers.
viii
CHAPTER 1. INTRODUCTION AND LITERATURE SURVEY ix
2.1.1 Data
2.1.1.1 Data Extraction
Sample Data was extracted using open source tool Import.io which helps to crawl data
from web pages. Sample Data extracted consisted of book images, book details, au-
thor names and publishers. Random numbers were also generated using PHP scripting
language for indexing books to give identity to each. Around 10,000 books details was
procured as sample data from (Sample Data., 2016).
[
{
"_id": 1,
"bookname": "Fundamentals of Data Structures in C",
"author": "Sahni Horowitz",
"total": 48,
"available": 48,
"barcode": "YFLAN7334",
"library_index": "6.002",
"image_url":http:ecx.images-amazon.comimagesI51jaORoxq+L._AC_US160_.jpg",
"price": 244
}
]
x
CHAPTER 2. DESIGN DETAILS AND IMPLEMENTATION xi
Extracted sample data using web crawler had many false and irrelevant data. PHP
scripting language was used to remove these unwanted dataset. Desired dataset was
also generated using the language(Allison, 2012).
<?php
$Param = $_POST;
$json = file_get_contents(php://input);
$j = json_decode($json);
//var_dump($j);
$purpose=$j->purpose;
//echo $purpose;
//require("api.php");
if(empty($purpose))
{
echo "$"."purpose not set ";
die();
}
switch ($purpose)
{
case books_json:
header(Content-Type: application/json);
$i=0;
$response=array();
$x=(float)006.001;
foreach ($j->data as $books)
{
$id=$books->_num;
$bookname=$books->bookname[0];
$author=$books->author[0];
$book_img=$books->book_img[0];
$author=substr($author,3);
{
$price=($books->price[0]);
if($price==Paperback or $price==Hardcover or $price==0.00)
{
$price=mt_rand(300,1000);
}
$price=(int)$price;
if($price<=100)
{
$price=mt_rand(300,1000);
}
}
else
{
$price=mt_rand(300,1000);
}
if($x<=$x+999)
{
$x=$x+0.001;
}
else
{
$x-=0.999;
$x++;
}
CHAPTER 2. DESIGN DETAILS AND IMPLEMENTATION xiii
$x=number_format($x,3);
$barcode=$result.(string)$barcode;
$response[$i][_id]=$id;
$response[$i][bookname]=$bookname;
$response[$i][author]=$author;
$response[$i][total]=$total;
$response[$i][available]=$available;
$response[$i][barcode]=$barcode;
$response[$i][library_index]=$x;
$response[$i][image_url]=$book_img;
$response[$i][price]=$price;
$i++;
// break;
}
echo json_encode($response,JSON_PRETTY_PRINT);
Text Message Template: This features how a developer can send plain text mes-
sages using API provided by facebook for developers (Fb Chatbot Text Template.,
2016).
Button Template: This takes inputs of the user through button click (Fb Chatbot
Button Template., 2016).
// create a schema
var userSchema = new Schema({
facebookId:{ type: String,unique: true },
currentNode:Number,
first_name: String,
last_name:String,
roll_number:String,
otp_number:String,
gender:String,
admin:Number
});
2.2 Implementation
Greeting Text
Enter Roll No
Send OTP On
Webmail
Send Profile
Details Search
By
Input For
Search Query
More Result
2.2.3 Track the users action what he is doing currently and respond
according to actions:
2.2.4 Function to send relevant match results to chat bot user ac-
cording to his query:
2.3 Testing :
User make requests to chatbot and responses are given by the Node.js server using
MongoDB in a chat session. Server also tracks users current actions.
CHAPTER 3
Responses to users requests are delivered to the users using facebook APIs. Initially,
a user needs to get authenticated to get started with the chatbot. Once, the user is
verified using OTP verification, user is allowed to avail the features of chatbot. A
persistent menu is always present to provide users shortcuts to directly get started with
the features.
xxvii
CHAPTER 3. RESULTS AND DISCUSSION xxviii
4.1 CONCLUSION
We implemented information based system on a chatbot efficiently which gives easier
availability of the information to the end users. The chatbot is integrated on the popular
Facebook messenger platform does not ask users to install any app, not asking any extra
space.
xxxiv
REFERENCES
[1] Allison, D.: 2012, Chatbots in the library: is it time?, Library Hi Tech 30(1), 95
107.
[9] Leonhardt, M. D., Tarouco, L., Vicari, R. M., Santos, E. R. and da Silva, M.
d. S.: 2007, Using chatbots for network management training through problem-
based oriented education, Seventh IEEE International Conference on Advanced
Learning Technologies (ICALT 2007), IEEE, pp. 845847.
xxxv
REFERENCES xxxvi
[10] McNeal, M. L. and Newyear, D.: 2013a, Introducing chatbots in libraries, Library
Technology Reports 49(8), 510.
[11] McNeal, M. and Newyear, D.: 2013b, Chatbots: Automating reference in public
libraries, Robots in Academic Libraries: Advancements in Library Automation:
Advancements in Library Automation p. 101.
[19] Troy, R. et al.: 2012, Designing an embodied conversational agent for a self-
access center, lA
d aTl
C
T Z u 23, 171182.