Simple character recommender for story writing. Built at Hack@Brown 2018.
- Training data comes from Nate the Snake
- Label is each character in the text
- Features are the previous
num_previous
characters (defined inutils.py
)
- Logistic regression model trained on data using one-hot encodings for the characters
- Flask server allows user to interact with the trained model
- Create a virtualenv (
virtualenv env
) - Activate virtualenv (
source env/bin/activate
) - Download dependencies (
pip install -r requirements.txt
)
- Paste training data into
text.txt
- Change paramters in
utils.py
- Run
python fileparse.py
to generate the csv intraining_data.csv
- Run
python train_model.py
to train and save model tomodel.pkl
- Run
python web.py
- Go to
localhost:5000
- Webcrawl wikipedia for more training data