Create twitter bots in-browser using Tensorflow.js and transfer learning with a pre-trained Keras RNN model from brangerbriz/char-rnn-text-generation
.
# clone the project, including submodules
git clone --recursive https://github.com/brangerbriz/twitter-transfer-learning
cd twitter-transfer-learning
# if you have an NVIDIA graphics card and CUDA installed, replace all instances
# of "tfjs-node" with "tfjs-node-gpu" in package.json, src/*, and bin/*
# If you do not, or don't know what this means, skip this step...
sed -i "s/tfjs-node/tfjs-node-gpu/g" package.json src/* bin/*
# install dependencies
npm install
This project relies on brangerbriz/tweet-server
. To run it, you must have an instance of tweet-server
running on localhost port 3000, which will facilitate the downloading of twitter data for this application.
# clone the repo
git clone https://github.com/brangerbriz/tweet-server
cd tweet-server
# install the dependencies
npm install
# rename the example env file
cp .env-example .env
# ... edit .env using your own twitter API credentials
# start the server
npm start
cd twitter-transfer-learning
npm start
This will launch an electron application that you can use to:
- Download twitter data for a user
- Train a model using that user's twitter data, leveraging a pre-trained keras "base-model" that's been trained on > 9,000,000 tweets.
- Generate new tweets with your trained model.
WARNING: Model training and tweet generation can a while depending on your computer's resources.
Copyright (C) 2018 Branger_Briz
Licensed under the GPL v3 or any later version.