dgrtwo / tidy-text-mining

Manuscript of the book "Tidy Text Mining with R" by Julia Silge and David Robinson
http://tidytextmining.com
Other
1.32k stars 805 forks source link

Sentiment lexicons have changed #74

Closed arencambre closed 4 years ago

arencambre commented 4 years ago

In 02-sentiment-analysis.Rmd, the get_sentiments(...) function barks at you to use textdata. Once you have that, you must work through some interactive prompts the first time you use each lexicon. That is not reflected in the text.

juliasilge commented 4 years ago

Thanks so much @arencambre! I added some clarifying language, including:

These lexicons are available under different licenses, so be sure that the license for the lexicon you want to use is appropriate for your project. You may be asked to agree to a license before downloading data.

arencambre commented 4 years ago

Thanks @juliasilge . While that text helps, the textdata package appears to be required for you to use some (all?) of these lexicons. I think the example code should load the textdata package right after tidyverse.

juliasilge commented 4 years ago

The textdata package is in Suggests for tidytext, so users don't need to load it. None of this code uses textdata functions directly.

arencambre commented 4 years ago

Sorry, I guess I could have worded this differently. I've experienced the rest of your book examples as being pretty turn-key: running the provided code produces the expected result, and if not, there is explanatory text.

In this case, there is a dependency that is not clearly explained in the text or code samples, which is that the textdata library needs to be installed. You are correct that it doesn't need to be loaded using the library() function (sorry for my mis-statement on that above), but it does need to be installed.

juliasilge commented 4 years ago

Thanks so much for this feedback @arencambre; I appreciate it.

I'm going to think about the options here. My current opinion is that the explanatory text the user sees in the situation where they have installed tidytext but not textdata is quite clear about what step they need to take. However, there are changes we could make, such as moving textdata from Suggests to Imports in the way that stopwords for example is Imports. Originally I decided to keep textdata as only Suggests because users of tidytext may not be interested in doing sentiment analysis.

arencambre commented 4 years ago

Interesting question. I haven't seen examples of where a package has a dependency that isn't installed along with the package, so I am shooting from the hip with ideas.

I read your concern being that this is a minor or less common use of tidytext? I checked textdata, and it's only ½ MB, so if it was just me, I'd make it Imports.

Alternatives: