This program is written in Python 3 with the following packages:
PyGI
NLTK
requests
PRAW (optional, used for Reddit scraper)
ProgressBar (optional, used for Reddit scraper)
- From the terminal
cd
to the poem-bot directory. mkdir data
- Fill the data directory with more directories. For example: create separate directories for individual poets, or for styles of poetry.
- Fill these directories with poems in text files that have the
.txt
extension. - From the command line you can use
python poembot.py
to start the GUI. - On the left select 1 or more training sets and 1 or more poetic forms.
- Hit the "Train" and wait for it to finish training.
- Hit the "Generate" button to generate a poem.
A basic markov model for training and generating poems from input. Some GUI elements for configuring the bot.
- More models to incorporate into the pipeline such as part-of-speech tagging, poetic forms to enforce meter and rhyme, etc.
- Integration with the Datamuse API for rhymes and synonyms and other enhancements it can provide.
- Integration with the Wordnik API for information on word syllables and stresses for tracking meter and syllable counts.
- GUI features for examining a poem and looking at why the bot chose each word and third-party API outputs for each word.
Just fork and submit a pull request. I'll review it and if it looks good, then merge it in.
MIT