library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidytext)
rests<-read.csv("/Users/hannahpeterson/Documents/R stuff/Yelp Reviews Fall2017.csv")
rests
## Restauraunt X5StarRating
## 1 O\xd5Gara\xd5s Bar And Grill 4
## 2 O\xd5Gara\xd5s Bar And Grill 2
## 3 O\xd5Gara\xd5s Bar And Grill 1
## 4 O\xd5Gara\xd5s Bar And Grill 3
## 5 O\xd5Gara\xd5s Bar And Grill 1
## 6 O\xd5Gara\xd5s Bar And Grill 4
## 7 O\xd5Gara\xd5s Bar And Grill 4
## 8 Butcher & The Boar 5
## 9 Butcher & The Boar 5
## 10 Butcher & The Boar 4
## 11 Butcher & The Boar 5
## 12 Butcher & The Boar 3
## 13 Butcher & The Boar 5
## 14 Butcher & The Boar 5
## 15 112 Eatery 5
## 16 112 Eatery 4
## 17 112 Eatery 5
## 18 112 Eatery 5
## 19 112 Eatery 4
## 20 112 Eatery 5
## 21 112 Eatery 5
## 22 Hell's Kitchen 5
## 23 Hell's Kitchen 1
## 24 Hell's Kitchen 2
## 25 Hell's Kitchen 4
## 26 Hell's Kitchen 2
## 27 Hell's Kitchen 4
## 28 Hell's Kitchen 5
## 29 Bar La Grassa 5
## 30 Bar La Grassa 5
## 31 Bar La Grassa 4
## 32 Bar La Grassa 5
## 33 Bar La Grassa 4
## 34 Bar La Grassa 5
## 35 Bar La Grassa 5
## 36 The Lowry 5
## 37 The Lowry 5
## 38 The Lowry 5
## 39 The Lowry 4
## 40 The Lowry 3
## 41 The Lowry 5
## 42 The Lowry 5
## 43 Brasa Rotiserrie 5
## 44 Brasa Rotiserrie 2
## 45 Brasa Rotiserrie 4
## 46 Brasa Rotiserrie 5
## 47 Brasa Rotiserrie 2
## 48 Brasa Rotiserrie 3
## 49 Brasa Rotiserrie 4
## 50 Brasa Rotiserrie 5
## Review
## 1 "My hubbie and I walked over after a long day of work in and out of the house. I was hungry for a burger. I almost never have a burger. When I do I'm often disappointed. Not tonight. I had the jalapeno business. It was juicy and delicious. The waiter was attentive, nice looking too :) It's a bit expensive, but most places are for someone who usually cooks"
## 2 "It's ok. Been there three times, and underwhelmed with their food. Nice tap beer selection however."
## 3 "Nasty rude staff. I was recently accosted by a woman who came outside while I was taking a smoke break from my overpriced drink"
## 4 "\xcaI had fish and chips the first time that I was there and corned beef and cabbage the second time...both were ehhh. Fish and chips were crispy though which is a plus, not greasy, and the corned beef and cabbage was a little blah. Keep in mind that this was during their week of specials, so maybe it wasn't typical of their regular "
## 5 "It smells like a porta potty inside. The staff comes off very dull and lifeless. But I got to meet the local drunk! That was definitely the only highlight of this place. Typical bad Irish bar."
## 6 "I was surprised by how good the food was - I honestly expected some boring bar food, but the Jalapeno Business burger was killer good. I don't even like french fries, but I loved these."
## 7 "I did not notice the smell. The shepherds pie was great. \xcaBeer selection phenomenal. \xcaThis place had a sense of being a neighborhood bar."\nService was good.
## 8 "I've eaten here several time over the years. Always go back when downtown for an event or when the weather starts to cool down and I need to warm up!"
## 9 "We had a really great dining experience here. A few of us out-of-towners met up with some local friends at Butcher & The Boar (their recommendation). We were among the first few people to walk in just after they opened and the place filled up fast."
## 10 "I'd give this place 5 stars, except in a week moment I ordered the crab legs. They looked impressive when the arrived at the table, but they were not tasty: my colleagues said, Who orders crab in Minneapolis anyway? They're right, but still ..."
## 11 "I had my own combo with a group here. Service was \xcaawesome. And the cap of smoked beef I had was one of the finest things I've ever tasted. Ever. Really. We had virtually every side as well. All of them were fine, but that beef! And we did indulge in a few sausage plates for our group to share. They were spicy and salty and delicious. I'm glad I don't live in Minneapolis nor can I afford this place often. I'd be dead from overeating. But I'd be a smiling corpse!"
## 12 "Charcuterie plate: this felt like a deconstructed banh mi (Vietnamese baguette sandwich), minus the bread. Nothing really stuck out as special. The head cheese had little flavor. The smoked turkey pate was not too bad. The elk was not memorable. Glad I tried, but probably wouldn't recommend this as it fell short of expectations.. Especially with all these reviews and high ratings.."
## 13 "Finally had the chance to visit this iconic restaurant in downtown Minneapolis. Butcher & The Boar was a solid, American restaurant. Followed recommendations of fellow Yelpers and had a great experience.\xca"
## 14 "Beer-battered french fries and ultra cheesy croquettes. What better late-night snack food is there? We sat at the bar last Saturday night, had some wine, met a few, friendly regulars and made jokes with the bartenders. I would love to go back for a full meal, but the french fries and croquettes were divine."
## 15 "I came here for a birthday celebration while in town. Everything was spectacular. We got three dishes to split among two people and it was the perfect amount. We ordered the lamb pasta dish, fried bread with prosciutto, and gnocchi. It was all delicious, but especially the lamb and the gnocchi."
## 16 "Food was 5 stars but service was only 3. Loved the food but disappointed in the service. I felt like the waitress treated us like we weren't good enough to be there."
## 17 "This place was really cool - ambience was very romantic and intimate - the place is smaller than I expected which was lovely. Now, onto the good stuff - good! Olives and candied almonds greeted us - tasty. The menu is similar to Bar LaGrassa - smaller plates, then a few main courses, then sides."\xca
## 18 "It has been way too long since I have enjoyed this spot. I went recently to celebrate my wedding anniversary with my husband. I have not been here for a few years as I have been making my way around town tasting what Minneapolis & St. Paul chefs have to offer. But, my fond memories of this place brought me back here and they did not disappoint tonight!"
## 19 "Really great food and terrific service. The pasta is freshly made and definitely on point. Fresh and yummy ingredients. The ambience is a bit cramped. Definitely didn't feel like fine dining but more than a decent option in Minneapolis. Not sure why it gets such glowing reviews however."
## 20 "We had the Scallops and Tagliatelle with Foie Gras Meatballs and it was all DELICIOUS! We are at the upstairs bar and the old fashioned' Swede delicious as well!"
## 21 "I've eaten here many times but not in several years. I have always loved this place and about 7-8 years ago it was the hottest place in town and hard to get a reservation. Now that's a little easier but it's still bustling."
## 22 "Hell yes! Great vibe, live music, amazing menu. No brainer, definitely come for brunch or grab a sandwich. Make a reservation for the weekends or try your luck grabbing a stool at the bar for one or two. I'm in Minneapolis in Business and was tired of strip mall food. And Hell answered my prayers. Haha."\xca
## 23 "Place smells like old bar smell.... So why didn't we walk out? The reviews, people were nice and the menu was intriguing so had to stick it out. Benefit of the doubt sort of thing."\xca
## 24 "While the staff were great, the food really did not leave up to its hype, as is the story with many of these highly-reviewed restaurants. I got the Juicy Loosy burger which Minneapolis is known for, the lemon ricotta pancakes and the Caesar salad. The burger was SO disappointing - the patty was so dry! The pancakes were forgetful. Gotta say though that I was impressed with the salad. It tasted super fresh and the Caesar dressing was incredibly flavorful with a hints of lemon and anchovies."
## 25 "I enjoyed the theme and ambiance. Food was really good also. We went at around 12pm brunch time on a Sunday on the weekend before Halloween!"
## 26 "But the food was unsatisfactory. \xcaI ordered the Bison Egg Benedict and substituted the hashbrowns for a mixed greens salad. \xcaThe bison benedict was drowning in the lukewarm jalapeno-hollandaise sauce, so was hard to eat, but I was mostly disappointed with the bison itself. \xcaThe menu indicated that it would be cooked to medium-rare, which is how I prefer my meat, but it unfortunately, was overcooked - so the texture was rough to cut and chew. \xcaI was not impressed. \xcaAt least the poached egg had that runny yolk once I cut into it, and did like the greens with a pear vinaigrette, making the dish lighter. \xcaBut I would not recommend this dish, given the overcooked bison, drenched in the hollandaise sauce. "
## 27 "Tried this spot after the \xcaVikings game this past weekend on the recommendation of a friend who raved about it. And it didn't disappoint. Cool spot underground in downtown Minneapolis. We sat on the bar side. Really cool d\x8ecor. They have a good tap selection of local Minnesota craft beers, and a special "secret beer" for $2 each day where you don't know what you are getting until it is served. My buddy Bob tried ordering it but was swayed not to by our waiter as he noted "it wasn't very good and your not going to like it". Cheers to honesty!"
## 28 "Stopped in for Saturday breakfast on recommendation from Renaissance hotel staff. \xcaWait time was 30 min, but they do take reservations. They had great live music, patrons clapping and dancing, the waitress was very nice and attentive, the food was really good (4 stars) but the overall experience was 5 star all the way. \xcaIt's a fun place with quirky decor. \xcaWould go back again without hesitating."
## 29 "I had an excellent time here with great service and delicious food. Only downside was waiting 45 minutes for a table but that's gonna happen when the food is THIS GOOD."
## 30 "If you're in the mood for a calm place to sit down, relax and enjoy some exquisite Italian food then Bar La Grassa is one establishment that will not disappoint. The cozy and modern atmosphere with its warm lighting sets the stage to loosen up and enjoy a fabulous night with dinner and drinks. A perfect setting for those on a first date (where I saw a couple tables way too tense and clearly on a first date....yea I like to people watch. So?"
## 31 "I see the hype surrounding Bar La Grassa - their food is fantastic! To start, we had the Soft Eggs & Lobster Bruschetta and my God- that ish was so damn good. It was as soft as I'd imagine the clouds in heaven would be. It's quite pricy for the size (and as an app in general) to be honest, but if you're willing to splurge, you'll be well rewarded for it. For dinner, I had the Gnocchi with cauliflower and orange. Loved it! Great texture, soft, and flavorful- though I wish it had weaker notes of the orange to it, but that's just me. For dessert, we had the salted caramel crespelle (good, but overly heavy on the caramel flavor) and the coconut lime panna cotta (lets just say it wasn't for me. Too tart). We'll probably skip dessert next time, but the pasta (and the soft eggs and lobster)!? Oooooh wwweeeee. We'll be back."
## 32 "Amazing atmosphere and food! Great spot for a date night or for a group dinner. This spot is so good I CRAVE their pasta. You must get the Tuna calamarata and you can't get anything like the orange gnocchi anywhere else. Service is top notch. If you're going with a group you'll definitely need to make a reservation.\xca"
## 33 "I was very excited to try Bar La Grassa and was impressed by the food and our server. The other staff seemed a bit cold. My husband liked the pork and I enjoyed the eggs and lobster although there wasn't much lobster for the $20. The entrees were all excellent and for dessert we enjoyed the Crespelle the best. The Bellinis were also excellent. Pricey dinner for the amount of food."
## 34 "This place is incredible - from the ambience to the wait staff to the food you just can't go wrong! The soft egg and lobster bruschetta is just plain stupid good - seriously it's like heaven on a plate. The spaghetti with brown butter and lobster can't be described you just have to come and taste it. The salted caramel crepes are literally everything you could want in a dessert - come here - right now!"
## 35 "Ummm if you don't eat here when you're in Minneapolis, you're definitely missing out. Make sure to order the pasta negra! DELICIOUS. I have to say the pasta here is on par, if not, better than what I've had in Italy! Needless to say, pretty impressed. Also tried the bruschetta with carpaccio--amazing. Never had steak carpaccio sliced so thick; they literally give you slabs!"
## 36 "This is my favorite brunch venue. \xcaI don't think there is a single breakfast item on the menu that I dislike. \xcaBut I still always order the oatmeal pancakes. They are THE BEST.\xcaThey are also super yummy as cold leftovers, FYI."
## 37 "Great all around restaurant to bring friends and family. \xcaI've had both brunch and dinner here and were very much pleased both times by the food and service. \xcaTheir bloody marys are perfection here with their great blend of seasonings, alcohol, and fixings (that jalapeno cheese cube... yasss). \xcaI'm keto/low carb and they were able to substitute the hashbrowns and toast with a delicious side salad with no extra charge alongside my Denver frittata which was also full of cheesy goodness."
## 38 "New to the Minneapolis area and it was our first time here! Absolutely wonderful! They were so helpful and brought us their favorite things to try! Honestly I'm so relieved to find a place so welcoming and delicious close to our new home! Special shout out to our waiter JJ!! Thank you"
## 39 "I liked my food and the service was great. Too often you have to ask for your free refills of Diet Coke, and that's not right. Here, that's not the case. I ordered the beet salad and found it spot on. Great flavors, fresh, and delightful! We ordered the deviled eggs as an appetizer, which were good (if you're a fan of curry)."\xca
## 40 "Service is great. Food is subpar. I was here a few weeks ago and had their eggs Benedict which I enjoyed. This time around I had their chicken and waffles and it was good if you like chicken nuggets and waffles which is pretty basic. The "gravy" was basically a house sauce that was complimentary and would've been better on the side or not on the dish at all. I'm from the south and keeping it simple makes chicken and waffles that much better. Also had the deviled eggs which I thought was extra as far as what was on it and the side sauce that they spread on the side. Felt like they were trying to hard to make something simple into something unique. Beer selection is good. Very accommodating for larger parties. Waiters/waitresses are polite and professional. I probably won't come back for food but that's just my opinion. Service is great if that's what you're looking for."
## 41 "If you want a good, classic brunch or breakfast this is the place to go in Uptown! The entire Blue Plate chain of restaurants knows how to have their own twist on their menus and The Lowry is definitely feel-good-food meets home cooking."
## 42 "It's been a year. \xcaBut we came back for a wedding anniversary lunch. \xcaThe food was SO great!!! \xcaAnd we really like the casual atmosphere so you can relax, kick back, and enjoy yourself. \xcaI also like that you can always find off-street parking, despite being so close to Uptown and Downtown."
## 43 "Can we all take some time to truly appreciate the beauty of this food, y'all!\xcaOk just 2 more seconds...... *exhales* Ok, now let's talk!Parking at this location leaves a lot to desired but once you do and enter those doors, it will be worth the strife. The food is just so good! Straight out of grandma's kitchen, good! I go with a friend/relative and order the rotisserie chicken. Then I add small little sides to create a party in my mouth. Prime sides are are the rice and brisket beans, plantains, creamed jalape\x96o spinach and the yuca fries (). I wouldn't recommend tackling this restaurant in any other way but those who have were all extremely impressed and happy with the different menu items!"
## 44 "It was a great restaurant with very delicious Caribbean style food and great dining experience in North East. But unfortunately I wish the waiter who severed us could have been a little bit more helpful guiding us through the menu. I understand it was one of the busiest time dining and he was serving multiple tables at the same time. A little bit of courtesy to check in on us who were exploring the restaurant for the first time would have been very appreciated and helpful guiding us through many unfamiliar dished on the menu. He was definitely capable of providing the great service, offering the desert menu after the meal to the table right next to us was a great demonstration. Maybe he just had a long day or bad at work or maybe the half empty soda we accidentally brought into the restaurant was upsetting to him. We were disappointed by his service. But the food was definitely great."
## 45 "This is the silverware they give you good assortment and good usage but they could be nicer maybe real silver\xcaI would like to see more specialized forks in the future thank you"
## 46 "As I write this, I am dreaming of my leftovers. We went here last night as a group of eight. Our server was awesome and we left our order in her hands to bring out an array of family style dishes. Best part about it is she didn't ask any questions. So many times I ask a server for their recommendation and they ask me 20 questions. She was a gem and she did not disappoint! I highly recommend family style. The wait for the food was pretty brief which was great because it was 9:00 and I was hungry. The food was great! So many different dishes with such great flavors. We had the chicken, beef, pork, ribs, plantains, yuca, rice, beans, and corn bread. Come here for a laid back atmosphere and amazing food! Oh and maybe wear stretch pants!"
## 47 "I'm clearly not of the majority opinion here. I guess I'll be that one whiny teammate on this one. My first visit I had the pulled chicken plate, spicy masa corn cakes, and collard greens. My chicken that was smothered in a light peppered gravy was somehow dry and tasteless. It was like chewing on a wad of paper. The corn cake was also dry. I've had better collard greens for sure. The place was small and packed, we waited for over an hour for a group of 7. I don't think anyone in my group was impressed. The server was nice though.
## 48 "Good eats but small meat portions! \xcaVery reasonable prices too! \xcaShowed up at about 9 PM on a Friday with another couple. \xcaWaited about 20 min which is right where we were told. \xcaWalked right up to the counter, ordered a PBR tall boy and waited at the bonfire crackling away on their patio. \xcaCool atmosphere and very necessary because the restaurant is on the small side with above average noise. \xcaWe waited about 10 min for a server to come refill drinks and give us menus. \xcaService was just average. \xcaOur server didn't explain any of the specialties or make recommendations. We got chips, salsa and guac for a starter. Their tortilla chips are made in-house and the guac is fresh and chunky. Sangria was sweet and tart with real fruit in it. The menu here is smaller but easy to navigate. We ordered 3 meat plates and a sandwich. We were somewhat disappointed with the meat portions. Probably 2 oz or less on each plate. 3/4 of each plate was beans and rice and the rest the meats. We tried pork and bbq beef. They were all tender and flavorful. We wanted more! My rice was a little crusty like it had been sitting for a few. The red beans and rice with brisket was amazing! Vegetarian red beans had too much cumin/seasoning for my taste. Other sides we tried were the fried yucca and corn bread. Both great! Yucca was a lot like a starchier potato. The cilantro dipping sauce with it was easily the best part! So fresh, herbaceous and bright-tasting."
## 49 "You really can't go wrong at Brasa, everything is good. The menu is set up to order something individually or family style, which is fun. The entire menu, minus two or three items, is gluten free. I feel fortunate to live in a city that has so many great gluten free options. They even have gluten free beer from a local brewery. The dulce de leche coffee is amazing. I usually get the pulled chicken but recently tried the chicken curry bowl, would definitely get that again. I recommend sharing items so you can try more of the menu!"
## 50 "This joint is awesome. \xcaGreat meat, delicious side dishes, it's so good. \xcaGet there early, because they do not take reservations or call aheads, and the line can get long. \xcaThe service is spot on and I highly recommend giving Brasa a shot!"
dim(rests)
## [1] 50 3
head(rests)
## Restauraunt X5StarRating
## 1 O\xd5Gara\xd5s Bar And Grill 4
## 2 O\xd5Gara\xd5s Bar And Grill 2
## 3 O\xd5Gara\xd5s Bar And Grill 1
## 4 O\xd5Gara\xd5s Bar And Grill 3
## 5 O\xd5Gara\xd5s Bar And Grill 1
## 6 O\xd5Gara\xd5s Bar And Grill 4
## Review
## 1 "My hubbie and I walked over after a long day of work in and out of the house. I was hungry for a burger. I almost never have a burger. When I do I'm often disappointed. Not tonight. I had the jalapeno business. It was juicy and delicious. The waiter was attentive, nice looking too :) It's a bit expensive, but most places are for someone who usually cooks"
## 2 "It's ok. Been there three times, and underwhelmed with their food. Nice tap beer selection however."
## 3 "Nasty rude staff. I was recently accosted by a woman who came outside while I was taking a smoke break from my overpriced drink"
## 4 "\xcaI had fish and chips the first time that I was there and corned beef and cabbage the second time...both were ehhh. Fish and chips were crispy though which is a plus, not greasy, and the corned beef and cabbage was a little blah. Keep in mind that this was during their week of specials, so maybe it wasn't typical of their regular "
## 5 "It smells like a porta potty inside. The staff comes off very dull and lifeless. But I got to meet the local drunk! That was definitely the only highlight of this place. Typical bad Irish bar."
## 6 "I was surprised by how good the food was - I honestly expected some boring bar food, but the Jalapeno Business burger was killer good. I don't even like french fries, but I loved these."
length(rests$Review)
## [1] 50
rest_df<- data_frame(line=1:50,text=as.character(rests$Review))
rest_df
## # A tibble: 50 x 2
## line
## <int>
## 1 1
## 2 2
## 3 3
## 4 4
## 5 5
## 6 6
## 7 7
## 8 8
## 9 9
## 10 10
## # ... with 40 more rows, and 1 more variables: text <chr>
yelp <- rest_df %>% unnest_tokens (word,text)
yelp
## # A tibble: 3,460 x 2
## line word
## <int> <chr>
## 1 1 my
## 2 1 hubbie
## 3 1 and
## 4 1 i
## 5 1 walked
## 6 1 over
## 7 1 after
## 8 1 a
## 9 1 long
## 10 1 day
## # ... with 3,450 more rows
data(stop_words)
yelp <- yelp %>% anti_join (stop_words)
## Joining, by = "word"
yelp
## # A tibble: 1,273 x 2
## line word
## <int> <chr>
## 1 1 hubbie
## 2 1 walked
## 3 1 day
## 4 1 house
## 5 1 hungry
## 6 1 burger
## 7 1 burger
## 8 1 disappointed
## 9 1 tonight
## 10 1 jalapeno
## # ... with 1,263 more rows
By using the stop words function, we are clearing out a large portion of junk words that are unnecessary. It brought our rows down by about a third.
yelp %>% count(word,sort=TRUE)
## # A tibble: 742 x 2
## word n
## <chr> <int>
## 1 food 33
## 2 service 15
## 3 menu 13
## 4 time 13
## 5 bar 12
## 6 delicious 11
## 7 minneapolis 10
## 8 chicken 9
## 9 restaurant 8
## 10 spot 7
## # ... with 732 more rows
yelp_joy <- get_sentiments("nrc") %>%
filter(sentiment=="joy")
yelp_joy
## # A tibble: 689 x 2
## word sentiment
## <chr> <chr>
## 1 absolution joy
## 2 abundance joy
## 3 abundant joy
## 4 accolade joy
## 5 accompaniment joy
## 6 accomplish joy
## 7 accomplished joy
## 8 achieve joy
## 9 achievement joy
## 10 acrobat joy
## # ... with 679 more rows
yelp %>% inner_join(yelp_joy) %>% count(word,sort=TRUE)
## Joining, by = "word"
## # A tibble: 48 x 2
## word n
## <chr> <int>
## 1 food 33
## 2 delicious 11
## 3 beer 6
## 4 enjoy 3
## 5 excellent 3
## 6 helpful 3
## 7 pretty 3
## 8 special 3
## 9 favorite 2
## 10 friend 2
## # ... with 38 more rows
This command simplifies the data even more by looking at words that are only associated with joy. After the previous cut, this command cuts it in half.
library(wordcloud)
## Loading required package: RColorBrewer
yelp %>% anti_join(stop_words) %>% count(word) %>% with(wordcloud(word,n,max.words=51))
## Joining, by = "word"
This graph shows the 51 most commonly used words. The bigger and bolder the word, the more it was used.
library(reshape2)
yelp %>%
inner_join(get_sentiments("bing")) %>%
count(word,sentiment,sort=TRUE) %>%
acast(word~sentiment,value.var="n",fill=0) %>%
comparison.cloud(colors=c("gray20","gray80"),max.words=100)
## Joining, by = "word"
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): recommendation could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): disappointing could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): drowning could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): forgetful could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): greasy could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): killer could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): lifeless could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): lukewarm could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): needless could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): noise could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): overpriced could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): pricey could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): rough could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): smoke could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): split could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): strife could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): stuck could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): tense could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): tired could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): twist could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): unfamiliar could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): unsatisfactory could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): upsetting could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): weaker could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): whiny could not be fit on page. It will not be plotted.
## Warning in comparison.cloud(., colors = c("gray20", "gray80"), max.words =
## 100): recommendations could not be fit on page. It will not be plotted.
yelp_bigrams <- rest_df %>% unnest_tokens(bigram,text,token="ngrams",n=2)
yelp_bigrams
## # A tibble: 3,410 x 2
## line bigram
## <int> <chr>
## 1 1 my hubbie
## 2 1 hubbie and
## 3 1 and i
## 4 1 i walked
## 5 1 walked over
## 6 1 over after
## 7 1 after a
## 8 1 a long
## 9 1 long day
## 10 1 day of
## # ... with 3,400 more rows
This graph separates the words into negative and positive sections. The black font words at the top are all associated with negative connotation and the gray font words at the bottom are associated with positive connotation.
library(tidyr)
##
## Attaching package: 'tidyr'
## The following object is masked from 'package:reshape2':
##
## smiths
bigrams_separated <- yelp_bigrams %>% separate(bigram,c("word1","word2") ,sep=" ")
bigrams_separated
## # A tibble: 3,410 x 3
## line word1 word2
## * <int> <chr> <chr>
## 1 1 my hubbie
## 2 1 hubbie and
## 3 1 and i
## 4 1 i walked
## 5 1 walked over
## 6 1 over after
## 7 1 after a
## 8 1 a long
## 9 1 long day
## 10 1 day of
## # ... with 3,400 more rows
bigrams_filtered=bigrams_separated %>%
filter(!word1 %in% stop_words$word) %>%
filter(!word2 %in% stop_words$word)
bigrams_filtered
## # A tibble: 418 x 3
## line word1 word2
## <int> <chr> <chr>
## 1 1 jalapeno business
## 2 1 attentive nice
## 3 1 bit expensive
## 4 2 food nice
## 5 2 nice tap
## 6 2 tap beer
## 7 2 beer selection
## 8 3 nasty rude
## 9 3 rude staff
## 10 3 recently accosted
## # ... with 408 more rows
bigram_counts <- bigrams_filtered %>%
count(word1,word2,sort=TRUE)
bigram_counts
## # A tibble: 387 x 3
## word1 word2 n
## <chr> <chr> <int>
## 1 bar la 3
## 2 beer selection 3
## 3 family style 3
## 4 french fries 3
## 5 gluten free 3
## 6 la grassa 3
## 7 5 stars 2
## 8 collard greens 2
## 9 corn bread 2
## 10 corned beef 2
## # ... with 377 more rows
bigrams_united<-bigrams_filtered %>%
unite(bigram,word1,word2,sep=" ")
bigrams_united
## # A tibble: 418 x 2
## line bigram
## * <int> <chr>
## 1 1 jalapeno business
## 2 1 attentive nice
## 3 1 bit expensive
## 4 2 food nice
## 5 2 nice tap
## 6 2 tap beer
## 7 2 beer selection
## 8 3 nasty rude
## 9 3 rude staff
## 10 3 recently accosted
## # ... with 408 more rows
All of this is looking at common 2 word phrases in the reviews. First, it is just pulling out the common phrases. Next, we are filtering them to take out the junk words. After that, we get the words separated by word 1 and word 2. Then, unite them together to make it a phrase again and not looking at the specific words in the phrase.