General purpose English sentiment/emotion lexicon. This lexicon labels words with six possible sentiments or emotions: "negative", "positive", "anger", "anticipation", "disgust", "fear", "joy", "sadness", "surprise", or "trust". The annotations were manually done through Amazon's Mechanical Turk.

lexicon_nrc(
  dir = NULL,
  delete = FALSE,
  return_path = FALSE,
  clean = FALSE,
  manual_download = FALSE
)

Arguments

dir

Character, path to directory where data will be stored. If NULL, user_cache_dir will be used to determine path.

delete

Logical, set TRUE to delete dataset.

return_path

Logical, set TRUE to return the path of the dataset.

clean

Logical, set TRUE to remove intermediate files. This can greatly reduce the size. Defaults to FALSE.

manual_download

Logical, set TRUE if you have manually downloaded the file and placed it in the folder designated by running this function with return_path = TRUE.

Source

http://saifmohammad.com/WebPages/lexicons.html

Value

A tibble with 13,901 rows and 2 variables:

word

An English word

sentiment

Indicator for sentiment or emotion: "negative", "positive", "anger", "anticipation", "disgust", "fear", "joy", "sadness", "surprise", or "trust"

Details

License required for commercial use. Please contact Saif M. Mohammad (saif.mohammad@nrc-cnrc.gc.ca).

Citation info:

This dataset was published in Saif Mohammad and Peter Turney. (2013), ``Crowdsourcing a Word-Emotion Association Lexicon.'' Computational Intelligence, 29(3): 436-465.

article{mohammad13,
author = {Mohammad, Saif M. and Turney, Peter D.},
title = {CROWDSOURCING A WORD–EMOTION ASSOCIATION LEXICON},
journal = {Computational Intelligence},
volume = {29},
number = {3},
pages = {436-465},
doi = {10.1111/j.1467-8640.2012.00460.x},
url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-8640.2012.00460.x},
eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1467-8640.2012.00460.x},
year = {2013}
}

See also

Examples

# \donttest{ lexicon_nrc()
#> Do you want to download: #> Name: NRC Word-Emotion Association Lexicon #> URL: http://saifmohammad.com/WebPages/lexicons.html #> License: License required for commercial use. Please contact Saif M. Mohammad (saif.mohammad@nrc-cnrc.gc.ca). #> Size: 22.8 MB (cleaned 424 KB) #> Download mechanism: http #> Citation info: #> #> This dataset was published in Saif M. Mohammad and Peter Turney. (2013), ``Crowdsourcing a Word-Emotion Association Lexicon.'' Computational Intelligence, 29(3): 436-465. #> #> article{mohammad13, #> author = {Mohammad, Saif M. and Turney, Peter D.}, #> title = {Crowdsourcing a Word-Emotion Association Lexicon}, #> journal = {Computational Intelligence}, #> volume = {29}, #> number = {3}, #> pages = {436-465}, #> doi = {10.1111/j.1467-8640.2012.00460.x}, #> url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-8640.2012.00460.x}, #> eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1467-8640.2012.00460.x}, #> year = {2013} #> } #> If you use this lexicon, then please cite it.
#> Error in menu(choices = c("Yes", "No"), title = title): menu() cannot be used non-interactively
# Custom directory lexicon_nrc(dir = "data/")
#> Do you want to download: #> Name: NRC Word-Emotion Association Lexicon #> URL: http://saifmohammad.com/WebPages/lexicons.html #> License: License required for commercial use. Please contact Saif M. Mohammad (saif.mohammad@nrc-cnrc.gc.ca). #> Size: 22.8 MB (cleaned 424 KB) #> Download mechanism: http #> Citation info: #> #> This dataset was published in Saif M. Mohammad and Peter Turney. (2013), ``Crowdsourcing a Word-Emotion Association Lexicon.'' Computational Intelligence, 29(3): 436-465. #> #> article{mohammad13, #> author = {Mohammad, Saif M. and Turney, Peter D.}, #> title = {Crowdsourcing a Word-Emotion Association Lexicon}, #> journal = {Computational Intelligence}, #> volume = {29}, #> number = {3}, #> pages = {436-465}, #> doi = {10.1111/j.1467-8640.2012.00460.x}, #> url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-8640.2012.00460.x}, #> eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1467-8640.2012.00460.x}, #> year = {2013} #> } #> If you use this lexicon, then please cite it.
#> Error in menu(choices = c("Yes", "No"), title = title): menu() cannot be used non-interactively
# Deleting dataset lexicon_nrc(delete = TRUE)
#> Error: [ENOENT] Failed to search directory '/home/travis/.cache/textdata/nrc': no such file or directory
# Returning filepath of data lexicon_nrc(return_path = TRUE)
#> /home/travis/.cache/textdata/nrc
# }