Skip to main content

An affect generator based on TextBlob and the NRC affect lexicon. Note that lexicon license is for research purposes only.

Project description

NRCLex

(C) 2019 Mark M. Bailey

About

NRCLex will generate an affect list from a body of text. Affect dictionary is based on the National Research Council Canada (NRC) affect lexicon (see link below).

Lexicon source is (C) 2016 National Research Council Canada (NRC) and this package is for research purposes only. Source: [lexicons for research] (http://sentiment.nrc.ca/lexicons-for-research/)

Affects

Emotional affects measured include the following:

  • fear
  • anger
  • anticipation
  • trust
  • surprise
  • positive
  • negative
  • sadness
  • disgust
  • joy

Sample Usage

#Instantiate text object. text_object = NRCLex('text')

#Return words list. text_object.words

#Return sentences list. text_object.sentences

#Return affect list. text_object.affect_list

#Return affect dictionary. text_object.affect_dict

#Return affect frequencies. text_object.affect_frequencies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NRCLex-0.0.2.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

NRCLex-0.0.2-py2-none-any.whl (3.2 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page