genius Example with Jimi Hendrix and the Beatles

Similar documents
BBC Learning English Face up to Phrasals Bob & Jackie's Chemistry Project

Song Version Year With

The little mermaid lives in a beautiful castle in the deep blue sea. She lives with her five sisters and her father, the Merking.

How To Add Songs To Ipod Without Syncing >>>CLICK HERE<<<

I Remember You By Cathleen Davitt Bell READ ONLINE

Journaling for Memoir Workshop. A Short Course in Writing Deeply. Workbook

EUROPEAN KANGOUROU LINGUISTICS ENGLISH-LEVELS 3-4. Linguistic ENGLISH. LEVEL: 3 4 (Γ - Δ Δημοτικού)

easy english readers The Little Mermaid By Hans Christian Andersen

From video conversation 2. This is a gap fill exercise and can be used as either a quiz/test of

Spam. Time: five years from now Place: England

The End. witch, Ariel embarks on the adventure of a lifetime. After bravely striking a bargain with Ursula, a sneaky sea

Why you should never ask favors from a graphic designer:

ESCAPE. A MINWOO PARK FILM Press Kit

1 Jane s dress is... yours. A the same than B the same to C similar than D similar to

Instructions On How To Use Siri On Iphone 4s First Time >>>CLICK HERE<<<

How to Improve Your Campaign Conversion Rates

QUICK START GUIDE MODEL: WF-1002

The Stack, Free Store, and Global Namespace

Fractions and their Equivalent Forms

SIMPLE PROGRAMMING. The 10 Minute Guide to Bitwise Operators

Post Experiment Interview Questions

BBC Learning English Face up to Phrasals Mark's Mistake

Windows 7 Will Not Install On My Computer Says I'm

Marketing Alliance Pre Built Funnel SWIPES..

Finding Similar Items and Locality Sensitive Hashing. STA 325, Supplemental Material

How Do I Sync My Iphone To Another Computer Without Losing Everything

IAE Professional s (02)

The following content is provided under a Creative Commons license. Your support

Fractions and their Equivalent Forms

Robert Ragan s TOP 3

Wow Voic Number Of Rings Iphone 4 >>>CLICK HERE<<<

Close Your File Template

Chapter One. I m Sorry Gramps

MITOCW ocw f99-lec07_300k

Finally, at the bottom right of the screen the word Fyrsta fades in.

The Tidyverse BIOF 339 9/25/2018

High Frequency Words. Flashcards. 1 st. McGraw-Hill Wonders

6 Stephanie Well. It s six, because there s six towers.

This lesson is part 5 of 5 in a series. You can go to Invoice, Part 1: Free Shipping if you'd like to start from the beginning.

ArcMap Online Tutorial Sarah Pierce How to map in ArcMap Online using the Fresh Prince of Bel Air as an example

An Introduction to R. Ed D. J. Berry 9th January 2017

Sky Broadband Connected Router But Not

The Picture of Dorian Gray

I DO NOT OWN ITUNES OR ANYTHING IN THE THUMBNAIL THIS IS ALL OWNED BY APPLE.

5 R1 The one green in the same place so either of these could be green.

Use Manual Camera Flash On Iphone 4s Not. Working >>>CLICK HERE<<<

Unicorn Tracks By Julia Ember READ ONLINE

Try typing the following in the Python shell and press return after each calculation. Write the answer the program displays next to the sums below.

Usability Testing Review

My alexa dot will not connect to wifi

Fractions and their Equivalent Forms

ProgressTestA Unit 5. Vocabulary. Grammar

Hey there, I m (name) and today I m gonna talk to you about rate of change and slope.

Itunes Manually Delete Songs From Iphone Not

DOWNLOAD OR READ : WHERE ARE YOU BLUE KANGAROO PDF EBOOK EPUB MOBI

Can't Add Songs To Iphone From Itunes 11 >>>CLICK HERE<<<

Instructor (Mehran Sahami): All righty. Welcome back to yet another fun-filled, exciting day of CS106A.

Verizon Wireless Change Number Of Rings Before Voic Picks Up

IPhone 5S And IPhone 5C Portable Genius PDF

mid=81#15143

Use Manual Camera Flash On Iphone 4 Too. Bright >>>CLICK HERE<<<

Contents. Sample. Santa s Christmas (9 12 year olds, 30 minutes, 1 class) Production Notes 8-9 Script 10-20

MOONASSI DRAWINGS - Hand-Drawn Edition

Manual Updating To Ios 7 Ipad 3 Not Working

Hello, and welcome to another episode of. Getting the Most Out of IBM U2. This is Kenny Brunel, and

How To Move Songs In Itunes 11.1 On My Iphone

Iphone 4 Ringer Not Working Headphones Do >>>CLICK HERE<<<

Julia Silge Data Scientist at Stack Overflow

Modeling in the Tidyverse. Max Kuhn (RStudio)

Mathematical Logic Part One

Text Mining in R. Sara Weston and Debbie Yee 03/24/2017

Why and How to Get Your Vanity URLs

Introduction(01-03) / Script(04-05) / Production(06) / Look(07) / Location(08-09) Cast(10-11) / End(12)

CS144 Final Review. Dec 4th, 2009 Tom Wiltzius

CHAPTER 02 No To express feelings is good for your mental health. 054 Cramming for an important exam is never a good idea!

Follow these steps to redeem and use your itunes Gift Card or content code. Menu, Apple Apple Store Mac iphone Watch ipad ipod itunes Support.

Open the Music app to view your itunes Match music in the cloud. You can delete a song or album from your iphone, ipad, or ipod touch at any time.

BBC LEARNING ENGLISH 6 Minute English Wireless furniture for phones

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek

Maximiliano R. Sproviero presents P A R F A I T S C R I P T P R O

Unit 9 Tech savvy? Tech support. 1 I have no idea why... Lesson A. A Unscramble the questions. Do you know which battery I should buy?

AMP 007: The Mother s Day Marketing Playbook

In today s video I'm going show you how you can set up your own online business using marketing and affiliate marketing.

10 Strategies for Effective Marketing Campaigns

BBBT Podcast Transcript

The Definitive Guide to Fractal Awesomeness with J-WildFire!

This Adapted Literature resource is available through the Sherlock Center Resource Library.

CHAPTER 1: INTEGERS. Image from CHAPTER 1 CONTENTS

Indian 78 RPM Single Releases Identification and Price Guide Updated 07 Ja 16 Red Parlophone Label With Trade Mark in Center

Technical Arts 101 Prof. Anupam Saxena Department of Mechanical engineering Indian Institute of Technology, Kanpur. Lecture - 7 Think and Analyze

Finding Aid for the Gogi Grant Collection of Musical Arrangements. No online items

And that is why Marcus was a firm believer in the importance of version control.

iflix is246 Multimedia Metadata Final Project Supplement on User Feedback Sessions Cecilia Kim, Nick Reid, Rebecca Shapley

The Do s and Don ts of Communicating Effectively

Introducing Skype for Business

How to Get Massive YouTube Traffic

A Dangerous Game By ReadWorks

Sync Manually Greyed Out Iphone Options >>>CLICK HERE<<<

Did every one that had outages on verizon get service back

Your s Communicate More Than You Think

Transcription:

genius Example with Jimi Hendrix and the Beatles I read the Medium post Introducing geniusr today. And I read about the genius package today. The genius website can be used to load song lyrics. So I gave it a try. library(genius) library(tidyverse) # For manipulation ## -- Attaching packages ------------------------------------------------------------------ tidyverse 1. ## v ggplot2 3.1.0 v purrr 0.2.5 ## v tibble 1.4.2 v dplyr 0.7.7 ## v tidyr 0.8.2 v stringr 1.3.1 ## v readr 1.1.1 v forcats 0.3.0 ## -- Conflicts --------------------------------------------------------------------- tidyverse_conflict ## x dplyr::filter() masks stats::filter() ## x dplyr::lag() masks stats::lag() library(tidytext) library(tm) ## Loading required package: NLP ## ## Attaching package: 'NLP' ## The following object is masked from 'package:ggplot2': ## ## annotate library(wordcloud) ## Loading required package: RColorBrewer Jimi_Are_You_Experienced <- genius_album(artist = "The Jimi Hendrix Experience", album = "Are You Experi 1

## Joining, by = c("track_title", "track_n", "track_url") Jimi_Are_You_Experienced ## # A tibble: 313 x 4 ## track_title track_n line lyric ## <chr> <int> <int> <chr> ## 1 Purple Haze 1 1 Purple haze all in my brain ## 2 Purple Haze 1 2 Lately things just don't seem the same ## 3 Purple Haze 1 3 Acting funny, but I don't know why ## 4 Purple Haze 1 4 Excuse me while I kiss the sky ## 5 Purple Haze 1 5 Purple haze all around ## 6 Purple Haze 1 6 Don't know if I'm coming up or down ## 7 Purple Haze 1 7 Am I happy or in misery? ## 8 Purple Haze 1 8 Whatever it is, that girl put a spell on me ## 9 Purple Haze 1 9 <NA> ## 10 Purple Haze 1 10 Purple haze all in my eyes ## #... with 303 more rows Jimi_songs <- Jimi_Are_You_Experienced %>% select(track_title) %>% group_by(track_title) %>% summarise(lines = n()) Jimi_songs2 <- Jimi_songs %>% select(track_title) Jimi_songs2 ## # A tibble: 11 x 1 ## track_title ## <chr> ## 1 Are You Experienced? ## 2 Fire ## 3 Foxy Lady ## 4 Hey Joe ## 5 I Don't Live Today ## 6 Love Or Confusion ## 7 Manic Depression ## 8 May This Be Love ## 9 Purple Haze ## 10 The Wind Cries Mary ## 11 Third Stone From The Sun par(mfrow=c(3,4)) 2

Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="are You Experienced?") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="fire") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="foxy Lady") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="hey Joe") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="i Don't Live Today") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="love Or Confusion") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="manic Depression") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="may This Be Love") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="purple Haze") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="the Wind Cries Mary") %>% 3

Jimi_lyric <- Jimi_Are_You_Experienced %>% filter(track_title=="third Stone From The Sun") %>% Jimi_lyric <- Jimi_Are_You_Experienced %>% experienced your and of are i been the have but ever you to ca my live say a you wellnothe don't next only ning my ve have do baby is or the it so got be oh home you've i to do all caress sweetmy going my with old messing your my sto that i sa i'm th don't all i know itis its in a Jimi_lyric <- Jimi_Are_You_Experienced %>% my wind the nd he over to hand ain't sun eel ow world little love home itswish will names uh then got time joe only are ah round e of to m you eet 4

to experienced what won't waterfall in through i around where it ooh world the you you've a about shoot said only desire be her no itstake go wish hey ah hand bottom on kiss shot letup fire sun purpleput are burning for one been run sweet can't this of down live and yesdig as do atow some time little yeahover feeling feel have if life foxy ever hear isuh listen manic tomorrow say caress will just like round or mary gun think lady tell joe haze mine ain't don't it's wind harm nothing music alright way names all know you're caughtmake want maybe give then from mind messing well your ohgoing baby so today old that see confusion better got i'm but home now depression get my stand with me love can next third_stone <- genius_lyrics(artist = "The Jimi Hendrix Experience", song = "Third Stone From The Sun") third_stone ## # A tibble: 18 x 3 ## track_title line lyric ## <chr> <int> <chr> ## 1 Third Stone From Th~ 1 Star fleet to scout ship, please give your ~ ## 2 Third Stone From Th~ 2 Over ## 3 Third Stone From Th~ 3 I am in orbit around the third planet from ~ ## 4 Third Stone From Th~ 4 Over ## 5 Third Stone From Th~ 5 You mean it's the Earth? ## 6 Third Stone From Th~ 6 Over ## 7 Third Stone From Th~ 7 Positive. It is know to have some form of i~ ## 8 Third Stone From Th~ 8 I think we should take a look ## 9 Third Stone From Th~ 9 Strange beautiful grass of green ## 10 Third Stone From Th~ 10 With your majestic silver seas ## 11 Third Stone From Th~ 11 Your mysterious mountains I wish to see clo~ ## 12 Third Stone From Th~ 12 May I land my peeping machine? ## 13 Third Stone From Th~ 13 Although your world wonders me ## 14 Third Stone From Th~ 14 With your majestic and superior Catholic ha~ ## 15 Third Stone From Th~ 15 Your people I do not understand ## 16 Third Stone From Th~ 16 So to you I shall put an end ## 17 Third Stone From Th~ 17 Then you'll never hear surf music again ## 18 Third Stone From Th~ 18 <NA> The_Beatles_td <- genius_album(artist = "The Beatles", album = "Let It Be") 5

## Joining, by = c("track_title", "track_n", "track_url") The_Beatles_td ## # A tibble: 335 x 4 ## track_title track_n line lyric ## <chr> <int> <int> <chr> ## 1 Two of Us 1 1 I Dig a Pygmy by Charles Hawtrey and the Dea~ ## 2 Two of Us 1 2 Phase one, in which Doris gets her oats ## 3 Two of Us 1 3 Two of us riding nowhere, spending someone's ## 4 Two of Us 1 4 Hard earned pay ## 5 Two of Us 1 5 You and me Sunday driving, not arriving ## 6 Two of Us 1 6 On our way back home ## 7 Two of Us 1 7 We're on our way home ## 8 Two of Us 1 8 We're on our way home ## 9 Two of Us 1 9 We're going home ## 10 Two of Us 1 10 Two of us sending postcards, writing letters ## #... with 325 more rows The_Beatles_td %>% filter(track_n == 6) ## # A tibble: 36 x 4 ## track_title track_n line lyric ## <chr> <int> <int> <chr> 6

## 1 Let It Be 6 1 When I find myself in times of trouble, Moth~ ## 2 Let It Be 6 2 Speaking words of wisdom, let it be And in ~ ## 3 Let It Be 6 3 Speaking words of wisdom, let it be ## 4 Let It Be 6 4 Let it be, let it be ## 5 Let It Be 6 5 Let it be, let it be ## 6 Let It Be 6 6 Whisper words of wisdom ## 7 Let It Be 6 7 Let it be ## 8 Let It Be 6 8 And when the brokenhearted people living in ~ ## 9 Let It Be 6 9 There will be an answer, let it be ## 10 Let It Be 6 10 For though they may be parted, there is stil~ ## #... with 26 more rows The_Beatles_Let_It_be <- genius_lyrics(artist = "The Beatles", song = "Let It Be") The_Beatles_Let_It_be ## # A tibble: 36 x 3 ## track_title line lyric ## <chr> <int> <chr> ## 1 Let It Be 1 When I find myself in times of trouble, Mother Mary ~ ## 2 Let It Be 2 Speaking words of wisdom, let it be And in my hour ~ ## 3 Let It Be 3 Speaking words of wisdom, let it be ## 4 Let It Be 4 Let it be, let it be ## 5 Let It Be 5 Let it be, let it be ## 6 Let It Be 6 Whisper words of wisdom ## 7 Let It Be 7 Let it be ## 8 Let It Be 8 And when the brokenhearted people living in the worl~ ## 9 Let It Be 9 There will be an answer, let it be ## 10 Let It Be 10 For though they may be parted, there is still a chan~ ## #... with 26 more rows The_Beatles_Let_It_be_td <- The_Beatles_Let_It_be %>% select(lyric, track_title) %>% unnest_tokens(word, The_Beatles_Let_It_be_td ## # A tibble: 245 x 2 ## track_title word ## <chr> <chr> ## 1 Let It Be when ## 2 Let It Be i ## 3 Let It Be find ## 4 Let It Be myself ## 5 Let It Be in ## 6 Let It Be times ## 7 Let It Be of ## 8 Let It Be trouble ## 9 Let It Be mother ## 10 Let It Be mary ## #... with 235 more rows The_Beatles_Let_It_be_sentiments <- The_Beatles_Let_It_be_td %>% inner_join(get_sentiments("bing"), by = c(word = "word")) The_Beatles_Let_It_be_sentiments ## # A tibble: 12 x 3 7

## track_title word sentiment ## <chr> <chr> <chr> ## 1 Let It Be trouble negative ## 2 Let It Be wisdom positive ## 3 Let It Be darkness negative ## 4 Let It Be right positive ## 5 Let It Be wisdom positive ## 6 Let It Be wisdom positive ## 7 Let It Be wisdom positive ## 8 Let It Be wisdom positive ## 9 Let It Be cloudy negative ## 10 Let It Be shine positive ## 11 Let It Be wisdom positive ## 12 Let It Be wisdom positive The_Beatles_Let_It_be_sentiments %>% count(sentiment, word) %>% ungroup() %>% mutate(n = ifelse(sentiment == "negative", -n, n)) %>% mutate(word = reorder(word, n)) %>% ggplot(aes(word, n, fill = sentiment)) + geom_bar(stat = "identity") + ylab("contribution to sentiment") + coord_flip() wisdom shine word right trouble sentiment negative positive darkness cloudy 0.0 2.5 5.0 Contribution to sentiment The_Beatles_Let_It_be_dtm <- The_Beatles_Let_It_be_td %>% count(track_title, word) %>% cast_dtm(track_title, word, n) 8

The_Beatles_Let_It_be_dtm ## <<DocumentTermMatrix (documents: 1, terms: 63)>> ## Non-/sparse entries: 63/0 ## Sparsity : 0% ## Maximal term length: NA ## Weighting : term frequency (tf) Terms(The_Beatles_Let_It_be_dtm) ## [1] "a" "agree" "an" "and" ## [5] "answer" "be" "brokenhearted" "chance" ## [9] "cloudy" "comes" "darkness" "find" ## [13] "for" "front" "hour" "i" ## [17] "in" "is" "it" "let" ## [21] "light" "living" "mary" "may" ## [25] "me" "mother" "music" "my" ## [29] "myself" "night" "of" "on" ## [33] "parted" "people" "right" "see" ## [37] "she" "shine" "shines" "sound" ## [41] "speaking" "standing" "still" "that" ## [45] "the" "there" "they" "though" ## [49] "til" "times" "to" "tomorrow" ## [53] "trouble" "up" "wake" "when" ## [57] "whisper" "will" "wisdom" "words" ## [61] "world" "yeah" NA tidy(the_beatles_let_it_be_dtm) ## # A tibble: 63 x 3 ## document term count ## <chr> <chr> <dbl> ## 1 Let It Be a 2 ## 2 Let It Be agree 1 ## 3 Let It Be an 4 ## 4 Let It Be and 3 ## 5 Let It Be answer 4 ## 6 Let It Be be 41 ## 7 Let It Be brokenhearted 1 ## 8 Let It Be chance 1 ## 9 Let It Be cloudy 1 ## 10 Let It Be comes 2 ## #... with 53 more rows # Example with 2 different artists and albums artist_albums <- tribble( ~artist, ~album, "The Beatles", "Let It Be", "The Jimi Hendrix Experience", "Are You Experienced [US Version]" ) artist_albums ## # A tibble: 2 x 2 ## artist album ## <chr> <chr> ## 1 The Beatles Let It Be 9

## 2 The Jimi Hendrix Experience Are You Experienced [US Version] albums_td <- artist_albums %>% add_genius(artist, album) ## Joining, by = c("track_title", "track_n", "track_url") 10

## Joining, by = c("track_title", "track_n", "track_url") ## Joining, by = c("artist", "album") albums_td ## # A tibble: 648 x 6 ## artist album track_title track_n line lyric ## <chr> <chr> <chr> <int> <int> <chr> ## 1 The Beat~ Let It~ Two of Us 1 1 I Dig a Pygmy by Charles H~ ## 2 The Beat~ Let It~ Two of Us 1 2 Phase one, in which Doris ~ ## 3 The Beat~ Let It~ Two of Us 1 3 Two of us riding nowhere, ~ ## 4 The Beat~ Let It~ Two of Us 1 4 Hard earned pay ## 5 The Beat~ Let It~ Two of Us 1 5 You and me Sunday driving,~ ## 6 The Beat~ Let It~ Two of Us 1 6 On our way back home ## 7 The Beat~ Let It~ Two of Us 1 7 We're on our way home ## 8 The Beat~ Let It~ Two of Us 1 8 We're on our way home ## 9 The Beat~ Let It~ Two of Us 1 9 We're going home ## 10 The Beat~ Let It~ Two of Us 1 10 Two of us sending postcard~ ## #... with 638 more rows 11