Recipe of Disaster

weird recipe made with bad reviews of the restaurant
Final output is based on the search of curryya from Yelp, which is one of my favorite restaurants.

Final Output:

recipe_final-01 recipe_final-02

 

And what I got from live coding (from presentation):

Screen Shot 2015-05-07 at 8.49.14 PM

How I did :

1. First, by using BeautifulSoup, I scraped 20 worst reviews of Yelp ( by passing URL parameter -> url+ ?sort_by=rating_asc : shows reviews with fewer stars first )
(I was going to mash up best reviews and worst reviews, but I thought it might be interesting just concentrating on one side).

2. Since I am working on reviews of a restaurant, I thought it would be interesting using languages that are using on the recipes. Clearly, it has certain frequent words like words for measurements and certain types of an action verb. I set list of word for measurements and action verbs (which I bring from http://diannej.com/2013/100-verbs-for-recipes-from-julia-child/).

Then, I made a certain pattern (inspired by instructify.py from the class github repository).

A: list of action verbs for recipes
B: amount of the measurement: 1/2, 1, 2, 4, 8
C: words measurements : teaspoon, cup, gallon
D: adjectives that I scraped from reviews
E: noun phrases that I scraped from reviews

F : Ingredient phrase ( that I made by combining (B) + (C) + of + (D) + (E)
ie) 2 cups of teryaki

1) A + F + and + A + F
2) A + F + until it gets + D
3) A + F + with +  D + F
4) A + F
5) Finally, + A + F

 

Midterm

1. poetic form:
On the last couple assignments, I did the mashup of two reviews about one product in Amazon website. For midterm, I wanted to develop this idea. With NLTK libraries, I was able to save all the adjectives and nouns that are used in the positive reviews and negative reviews.

Then I created poetic pattern with combining (randomly picked) adjectives and (randomly picked) nouns from good and bad reviews back and forth :
1. (pos) adj + (neg) noun + (pos) adj + (neg) noun
2. (neg) adj + (pos) noun + (neg) adj + (pos) noun
3. (neg) adj + (neg) adj + (pos) adj + (pos) noun
4. (pos) adj + (pos) adj + (neg) adj + (neg) noun

5. (neg) adj + (pos) noun + (neg) adj + (pos) noun
6. (pos) adj + (neg) noun + (pos) adj + (neg) noun
7. (pos) adj + (pos) adj + (neg) adj + (neg) noun
8. (neg) adj + (neg) adj + (pos) adj + (pos) noun

2. Source code:

3. Output:
For source texts, I used product review of this charger: http://www.amazon.com/Desktop-Charger-PowerIQ-Technology-Samsung/dp/B00IBDOB5I/ref=cm_cr_pr_product_top?ie=UTF8
And I got this output :

light gadgets fail connecting

many chargers 5th devices

first other light disappointment

important cable other swift

other choice other service

fail test more chargers

other more other chargers

later later other devices


another output:
reasonable ports able bliss

first ports later performance

later ridiculous other vendor

able past ridiculous unit

first imagine different replacement

cable ports cable rating

reasonable aware other review

first 3rd more unit


with reviews of this notebook http://www.amazon.com/Leuchtturm-Medium-Notebook-Squared-LBL12/product-reviews/B002CV5H4Y, I got this output:

attractive page thin blog

practical table disappointing gsm

dry disappointing ledgible notebooks

easy easy dry fun

same page elastic nothing

thin features minimal indoors

attractive big same dry

same ball-point big quality

Assignment #3

Since I was having problems with unicode and ascii errors, I just decided to keep my code simpler and use only two very recent lead paragraphs from NY Times Article search. The procedure that I used for here is similar with assignment #2:

1. split them into word and save into different list
2. join words back and forth from those two lists.

the reason that I chose this procedure is English sentence has a common sentence structure: S + V + O or for questions, V+ S + O ? and I got pretty interesting output from here:

It’s popularity season Sonic New Slush the with time, candy the in poop, the cans, looking butts adding unrecognizable second formerly mash-up beneath summer, white company’s are J. visible Hudson, March