juliasilge / tidytext

Text mining using tidy tools :sparkles::page_facing_up::sparkles:
https://juliasilge.github.io/tidytext/
Other
1.18k stars 183 forks source link

NRC not found, how to call it in textdata package? #146

Closed Anqi525 closed 5 years ago

Anqi525 commented 5 years ago

Hello,

I was trying to use NRC for emotional analysis, however I found out that NRC had been removed from Tidytext package.

I saw > We have ✨ good news ✨ on this front, as the creators of the NRC lexicon have given permission for us to include their work in the textdata package, the new way we are providing access to datasets like this. Once we add the dataset (tracked in EmilHvitfeldt/textdata#10) I will get this set back up to its original state.

I am wondering, do we use the same method to call NRC when we want to perform text mining project?

Could you provide some details about how to use it?

Best wishes, Angie

juliasilge commented 5 years ago

Thanks for asking this question @Anqi525! 🙌

As of commit 24d6e1bf2010df5992b6401922e486ac8e990e95 the NRC lexicon is available within tidytext again. You will need to install the development versions of both textdata and tidytext, and then all will work again.

library(remotes)
install_github("EmilHvitfeldt/textdata")
install_github("juliasilge/tidytext")

After these are installed, you can access the NRC lexicon the way you did before:

library(tidytext)
get_sentiments("nrc")

We will get both of these updates on CRAN soon. 🎉

Anqi525 commented 5 years ago

Hello Julia,

Thank you for answering my question, I tried the above codes, however, I still got error messages:

Error: Failed to install 'tidytext' from GitHub: (converted from warning) cannot remove prior installation of package 'tibble' Traceback:

  1. install_github("juliasilge/tidytext")
  2. install_remotes(remotes, auth_token = auth_token, host = host, . dependencies = dependencies, upgrade = upgrade, force = force, . quiet = quiet, build = build, build_opts = build_opts, build_manual = build_manual, . build_vignettes = build_vignettes, repos = repos, type = type, . ...)
  3. tryCatch(res[[i]] <- install_remote(remotes[[i]], ...), error = function(e) { . stop(remote_install_error(remotes[[i]], e)) . })
  4. tryCatchList(expr, classes, parentenv, handlers)
  5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  6. value[3L]

Could you help with this?

Best wishes, Angie

Anqi525 commented 5 years ago

Error: Failed to install 'textdata' from GitHub: (converted from warning) cannot remove prior installation of package 'tibble' Traceback:

  1. install_github("EmilHvitfeldt/textdata")
  2. install_remotes(remotes, auth_token = auth_token, host = host, . dependencies = dependencies, upgrade = upgrade, force = force, . quiet = quiet, build = build, build_opts = build_opts, build_manual = build_manual, . build_vignettes = build_vignettes, repos = repos, type = type, . ...)
  3. tryCatch(res[[i]] <- install_remote(remotes[[i]], ...), error = function(e) { . stop(remote_install_error(remotes[[i]], e)) . })
  4. tryCatchList(expr, classes, parentenv, handlers)
  5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  6. value[3L]
juliasilge commented 5 years ago

Ah, installation issues! 😵

For the record, this does not have anything to do with tidytext or textdata, but rather is something that has gone wrong with package installation with your instance of R. Check out a few resources like this, this and this to try out some solutions. Good luck! 💪

fcas80 commented 5 years ago

I got the same errors. I downloaded the NRC_Emotion_Lexicon files from sentiment.nrc.ca/lexicons-for-research, and I used the NRC-Emotion-Lexicon-Wordlevel-v0.92 text file. I subsetted the text file to include only numbers > 0, and now I think my subsetted file has exactly what get_sentiments("nrc") has.

daneshwarsharma commented 4 years ago

If you use this lexicon, then please cite it.

1: Yes 2: No

Selection: 1 Error: 'C:/Users/daneshwar.sharma/AppData/Local/textdata/textdata/Cache/nrc/NRC-Emotion-Lexicon/NRC-Emotion-Lexicon-v0.92/NRC-Emotion-Lexicon-Wordlevel-v0.92.txt' does not exist.

having problem in downloading nrc. even after following -----

library(remotes) install_github("EmilHvitfeldt/textdata") install_github("juliasilge/tidytext")

library(tidytext) library(textdata)

get_sentiments("nrc")

EmilHvitfeldt commented 4 years ago

@daneshwarsharma

Could you try running the following two lines of code for me and show us the full output.

textdata::lexicon_nrc(delete = TRUE)
textdata::lexicon_nrc()
daneshwarsharma commented 4 years ago

Dear, This is the error.

On Sat, Oct 19, 2019, 22:37 Emil Hvitfeldt notifications@github.com wrote:

@daneshwarsharma https://github.com/daneshwarsharma

Could you try running the following two lines of code for me and show us the full output.

textdata::lexicon_nrc(delete = TRUE)textdata::lexicon_nrc()

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/juliasilge/tidytext/issues/146?email_source=notifications&email_token=ANPU4SRIYN2AFVZWZAOVFGTQPM5EBA5CNFSM4H7H7CW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXW4CY#issuecomment-544173579, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPU4SXORKACT7EHUJVDQSTQPM5EBANCNFSM4H7H7CWQ .

github-actions[bot] commented 2 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.