Professional Documents
Culture Documents
Artificial Intelligence Chatbot in Android System Using Open Source Program-O
Artificial Intelligence Chatbot in Android System Using Open Source Program-O
net/publication/318441756
CITATIONS READS
19 21,792
4 authors, including:
Some of the authors of this publication are also working on these related projects:
Artificial Intelligence Chatbot in Android System using Open Source Program-O View project
All content following this page was uploaded by Sarthak Vikrant Doshi on 26 November 2017.
Abstract: A chatbot is a conversational agent where a computer program is designed to simulate an intelligent
conversation. It can take user input in many formats like text, voice, sentiments, etc. For this purpose, many open
source platforms are available. Artificial Intelligence Markup Language (AIML) is derived from Extensible Markup
Language (XML) which is used to build up a conversational agent (chatbot) artificially. In this paper, we use „program-
o‟ which is an AIML interpreter for the generation of the responses of users input. We have used this method for
developing an android application chatbot which will interact with user using text and voice responses.
I. INTRODUCTION
Over the last few years, Chatbots have played a prominent role as human-computer interfaces. Chatbots are
generallycomposed of three modules: the user interface, an interpreter, and a knowledge base. Laven [6] defines
Chatbot as a program that attempts to simulate typed conversation, with the aim of at least temporarily fooling the
human into thinking they were talking to another person. Basically, chatbot is a conversational agent that can interact
with user in a given subject using the natural language. Many chatbots have been deployed on the internet for the
purpose of education, customer service site, guidance, entertainment. Existing famous chatbots are ALICE [2],
SimSimi and Cleverbot.
Artificial Intelligence Markup Language (AIML) is derived from extensible Markup language (XML) which is used to
build up a conversational agent artificially. The AIML based chatbots are famous because they are light weighted, easy
to configure as well as at minimum cost. AIML has class of data objects called AIML object which describes behaviour
of computer programs.
In our paper, we have used program-o [1] which is an open source AIML engine written in PHP. It is an interpreter for
the AIML scripts of the chatbot. It uses MySQL database to store the chatbot details. Also, we are storing all the AIML
scripts to the database. When user sends message to the chatbot program, then according to matched reply from the
AIML, the answer is formulated and send back to the user. It can bedirectly installed on a local server under the GNU
General Public License.
The chatbots that have been deployed on the internet uses text, voice as well as sentiments as the input. In this paper,
we have used the text and voice as user input. Text I/O is relatively effective as user can review for the input so that it
can be rechecked if there are any mistakes. However, giving text input consumes time. So, the solution is to introducing
voice interface with the speech recognition technology. By these methods, this chatbot application is very able to make
conversation with the user.
Eliza is considered as the first chatbot which works on the pattern matching system. It is developed by Joseph
Weizenbaum in 1964 [2]. ALICE [3] is rule-based chatbot based on the Artificial Intelligence Markup Language
(AIML). It has more than 40,000 categories, where each category has combination of pattern and its response.
Md.Shahriare Satu and Shamim-AI-Mamun [7] showed the review of applications of the Chatbot which are developed
using the AIML scripts. They said that AIML based chatbots are easy to implement, they are lightweight and efficient
to work. Their paper gives the detailed information about the different applications of the chatbots.
Thomas N. T. and Amrita Vishwa [4] designed a AIML and LSA based chatbot to provide the customer care service
over the E- commerce websites. Their approach shows we can improve the chatbot ability by adding other models to it.
In android operating system, we can implement the chatbot using the various approaches. One of the approaches is
shown by Rushabh Jain and BurhanuddinLokhandwala in their Android based Chat-Bot [12] paper.
Here we have our own approach to implement the Chatbot in android operating system that is open source Program - O.
The response generation process is carried out with two phases [2].
IV. IMPLEMENTATION
This section is divided into two parts, first detailed implementation of text based chatbot, second detailed of the
implementation of voice based chatbot.
If bot‟s response is null then set the response to the error string and show it to the user. Repeat the same task for the
continuous chatting with the chatbot.
The following steps explain the implementation details to accomplish the above-mentioned tasks:
1. Read the user input on the onClick event of the send button.
2. Send the user input to the program – o hosted server using the HttpUrlConnection. Here we are dealing with
the internet stuff so we need to call this method in the AsyncTask [8] of the android system. AsyncTask runs in the
background of the app.
3. Wait till getting the reply from the server. OnPostExcute method of the AsyncTask will get the JSON
formatted reply. Then send it to JSON parser [9] to extract the bot‟s response.
4. After extracting the bot‟s response, we need to display it to the user. So, append the response to text view.
5. Then repeat the process for the next user input.
After the conversion of the voice to text the value is sent to the server for the reply. As we have already discussed
server replys in JSON format, so we need to parse [9] it. Get the response of the bot after the parsing. We have taken
the voice input so, here we are giving the voice output. Bot‟s response is converted to voice and played through the
phones speakers. Repeat the steps for continuous chatting with chatbot.
The following steps explain the implementation details to accomplish the above-mentioned tasks:
1. Promote user for the voice input on onCreate method. Record the user voice till the speech end event.
2. Now convert the voice into text using the Google‟s Speech Recognizer API of the android [10]. After getting
result of the conversion send the data to the server.
3. Use the HttpUrlConnection in the AsyncTask for requesting the reply from the server.
4. We will get the reply in the JSON Format [9] Parse it to get the reply of the bot.
5. Here we are implementing the voice based chatbot so reply from the bot must be voice. Convert the bot‟s
reply to the voice using Text to Speech API for the android [11].
6. After complete play of voice, again ask user for new voice input and repeat the steps.
To demonstrate our approach, we have developed an android application. This application can be used to chat with the
bot through voice and text also.
In the home screen, we have navigation option for two different activities, first we can start communication with the bot
using our voice and in the second we can communicate with the bot using text messaging like another messaging apps
we are using.
Here in the voice based chatting, to convert the voice to the text, we have used SpeechRecognizerAPI provide by
Google [10].
Result of the converter is sent to the AI dataset of the bot to get the reply. Then again, the reply from the bot is
converted back to the voice. So, the communication becomes more convenient.
Here in the text based chatting, we have to type our message and send it. On the send button click event our text
message is passed to the AI Dataset of a bot which is hosted on the localserver or on the internet. After getting the reply
from the server, we are printing it on the message view.
This is the working of the android app which is built to demonstrate our approach.
In this paper, we have introduced a chatbot application in android which is able to interact with users. This chatbot can
answer for queries in the textual as well as in voice form of user input. For this purpose, AIML with program-o has
been used.
The chatbot can answer only those questions which he has the answer in its dataset. So, to increase the knowledge of
the chatbot, we can add the APIs of Wikipedia, Weather Forecasting Department, Sports, News, Government Services
and a lot more. In such cases, the user will be able to talk and interact with the chatbot in any domain. Using the APIs
like Weather, Sports, News and Government Services, the chatbot will be able to answer the questions outside of its
dataset and which are currently happening in the real world.
REFERENCES
BIOGRAPHIES
Mr. Sarthak Vikrant Doshi is studying in III year of B.E(CSE) at VidyaPratishthan‟s Kamalnayan Bajaj Institute of
Engineering and Technology, Baramati (Maharastra).His areas of interest are Database Management, Big Data
Processing, Android Development, IOS Development, Programming etc.
Miss. Suprabha Bharat Pawar is pursuing her education at VidyaPratishthan‟s Kamalnayan Bajaj Institute of
Engineering and Technology, Baramati (Maharastra).Currently she is studying in Third Year in Computer
Engineering.Her areas ofinterest are development of Artificial Intelligence, Machine Learning Approch.
Mr. Akshay Gautam Shelar is studying in III year of B.E(CSE) at VidyaPratishthan‟s Kamalnayan Bajaj Institute of
Engineering and Technology, Baramati (Maharastra).His areas of interest are Artificial Intelligence, Networking,
Database Management, Programming etc.
Miss. Shraddha Shrihari Kulkani is pursuing her education at VidyaPratishthan‟s Kamalnayan Bajaj Institute of
Engineering and Technology, Baramati (Maharastra).Currently she is studying in Third Year in Computer
Engineering.Her areas ofinterest are Artificial Intelligence, Natural Language Processing etc.