This is a Mad Libs generator based on the game Mad Libs in which one person prompts others to fill in the blanks of a passage according to parts of speech. This generator randomly takes out words from a passage for the user to replace.
Python 3
NLTK
Enter 'python main.py' or 'python3 main.py' in your command line to run the program.
Follow the printed prompts for input.
The repository contains the files
main.py
which runs the program and handles user interactiontext_processor.py
which deals with training, tagging, and replacing words in passagespos_tagger_brown.pkl
which stores the POS tagger- the
passages
folder which contains .txt files that can be used to generate Mad Libs (see the Sources section below for the source of each .txt file)
- nltk
- string
- pickle
- io
- os
- contextlib
- random
all_star.txt
: from All Star (by Smashmouth)do_not_go_gentle.txt
: from Do Not Go Gentle Into That Good Night (by Dylan Thomas)doctor_who.txt
: from Doctor Whofamous_blue_raincoat
: from Famous Blue Raincoat (by Leonard Cohen)moana.txt
: from How Far I'll Go (by Lin-Manuel Miranda)pain.txt
: from The Princess Bride (by William Goldman)shia.txt
: from Shia LaBeouf (by Rob Cantor)true_detective.txt
: from True Detectiveunfortunate_events.txt
: from A Series of Unfortunate Events: The Slippery Slope (by Lemony Snicket)zelda.txt
: from The Legend of Zelda: A Link to the Pastzootopia.txt
: from Zootopia