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.
python3 server/server.py
npm install
npm run serve
npm run build
npm run lint
Concat all .txt logs into 1 big
ls *.txt | xargs -L 1 cat >> input.txt