Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Chat bot for Windows

                 Creating a chat bot for windows from scratch.

This post is for people who want to create a chat bot from scratch, the basic requirement is only a PC and an internet connection.

The program for chat bot is written in Python and the knowledge base of the bot in AIML, so see that you have a basic knowledge of the two languages. Download Python (3.4), AIML (not required if you don't want to change the knowledge base of the bot)

Before beginning you need to know how AIML is used and how it enables the bot to talk.(Skip this part if you're not much interested with the details)
The bot responds to particular responses, the conversation which trigger the appropriate response are written using aiml, and saved in a file with .aiml extension. It's like instructing the bot to say "hello" only when someone says "hi". Responses are written in the .aiml file, the files can grow in number and require lot's of time to compile and load hence they are all combined into a .brn file(There is a program which does this, here) which is loaded in the beginning.

The basic working of the bot is in this way, first Speech to Text conversion is done(using speech module of python), the text is then sent as input to the bot. The bot sends an appropriate text as output, depending on it's brain file, the text is then converted to speech using the Windows built in text to speech converter. 
Other details are given with the code, in form of comments, which is sufficient to understand the entire program.

Things to download-
1. PyAIML
2. Speech Module(Download the .tar file extract it to the folder where python is installed, open a command prompt there and type the following-python setup.py install)
3. pyttsx(It's installation is similar to that of speech module).

The code is present here, it's only of few lines. The speech to text converter is not that great and hence you'll find the bot responding in a funny way. The solution to this is to use Google Speech to Text converter. I've tried that but i was not able to do it, got stuck with audio and flac file stuff. To change the bot's response just change the .brn file the bot will start interacting in a different way.

It's done, now give the bot a name and start chatting with it.

Hope you enjoy chatting with the bot.
*There is a Omegle Chat bot which i've made, make sure that you check it out, here.


This post first appeared on Know Jugaad, please read the originial post: here

Share the post

Chat bot for Windows

×

Subscribe to Know Jugaad

Get updates delivered right to your inbox!

Thank you for your subscription

×