Skip to content

Latest commit

 

History

History
44 lines (23 loc) · 2.58 KB

README.md

File metadata and controls

44 lines (23 loc) · 2.58 KB

franken-poster

FrankenPoster generates a movie poster based on dialogue snippets from that movie. The background of the poster shows a gradient of colors, where each strip corresponds to the sentiment (negative through positive) of one of the conversations in the movie, and the entire background represents the sentiments of the movie conversations over the course of the movie. A 50 word poem is also displayed on each poster generated based on the dialogue and conversation content.

The dataset that we use for this is the Cornell movie dialogs corpus by Cristian Danescu-Niculescu-Mizil and Lillian Lee.

To run

Make sure you have all dependencies installed as listed in requirements.txt by running:

pip install -r requirements.txt

To generate two movie posters for a movie, run:

python poster.py

If a model for the chosen movie exists, it will load that model. Otherwise, it will create and train a new model.

Models used

Sentiment Analysis

See sentiment_analyzer.py

We use two models for sentiment analysis. FrankenPoster generates two posters for each movie, one using NLTK's VADER sentiment analyzer, and one using TextBlob's Naive Bayes sentiment analyzer. TextBlob is written on top of NLTK, so both models were pre-trained on NLTK's movie review corpus.

Text generation

See poem.py

We use Keras with SpaCy's medium English model en_core_web_md for pre-trained word embeddings to train an RNN on the movie's dialogue. This model is used for generating the poem on the poster.

Sample content

text/

We have already trained and saved a few models in the text/ folder. Generating new posters with these existing models will be much faster, and will still generate different poems each time. If a movie without an existing model is chosen, the model will be trained from scratch and saved to this folder for future use. These models are trained with 20 epochs. The existing sample models are labeled by their movie IDs.

img/

This folder contains SVGs for just the backgrounds generated by the two sentiment analyzers for the first 50 movies. Each is named with its movie ID and model it was trained with. The archive folder contains previous iterations of our poster background experiments, where the color of the background is the overall sentiment score of all conversations in the movie, and the opacity of each stripe is based on the individual score of that conversation. The bolder the stripe, the more positive the conversation was.

posters/

Sample movie posters generated using our models.