Converting yourself into a chatbot and let AI version of you talk to your friends on whatsapp.

Do people really need us for some conversation?

Step 1: Extract whatsapp file

Extraction of whatsapp chat can be done by simply clicking on three dots on the top.

Step 2: Create Dataset

The chat history that is extracted is itself a dataset. Usually the chat history with a particular person is not large enough to give good result, so for this project I’ve exported chats of close friends but of-course by taking their permission (Take permission before you use their chat to train your model :P).

Step 3: Tokenize the data set and prepare data for training

The data set needs to be tokenized before feeding it to sequence to sequence model, these tokens are the known words for our application and application can only understand these tokens. Dataset is splitted into training set(70%), test set(15%) and validation set(15%).

Step 4: Train Model

The model is now trained, the value for number of epochs is set as 100, you can change it according to your requirements.

Step 5: Test the model and connect it to whatsapp

The model is connected to whatsapp, here the username of whom the chat bot needs to chat is written, the username is the name of user as stored in your whatsapp contact.

Step 6: Finally! Lets chat :P

I used this chat bot on my friend and the reply given by chat bot was quite satisfying, it is able to create sentence and has copied my texting style but it currently just looks into a sentence and reply accordingly, it has no idea about the context of the chat, for the future development the chatbot can be trained to learn the context and reply accordingly.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Saksham Lakhera

Saksham Lakhera

Exploring and Analysing life with all my tech and soft skills.