/self-portrait

An ML model-chatbot trained on all my WhatsApp messages

Primary LanguageVueGNU General Public License v3.0GPL-3.0

self-portrait I

Mobile phone with chat window

This project consists of two parts: a front-end interface built using Vue.js, and a back-end that generates the text messages. Initially I tried using ml5.js to generate the messages on the front-end, but these were of rather low quality. That is why I decided to use the textgenrnn Python module together with flask to create a simple API server that just returns one generated message every time it's called on the route /message.

To train my model, I started off by manually exporting all of my WhatsApp chats and putting them together in one text file. Subsequently, I wrote a simple Python script to filter out the meta-data and all the messages sent by others. I used the output file as input for textgenrnn and wrapped it in a server using Flask. The input from the user is solely used to create a more engaging experience, the messages generated by the model are not in any way context aware. Life is a lie.

Back-end startup

python3 server/server.py

Front-end setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Concat all .txt logs into 1 big

ls *.txt | xargs -L 1 cat >> input.txt