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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2

File details

Details for the file NRCLex-0.0.2.tar.gz.

File metadata

  • Download URL: NRCLex-0.0.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.13

File hashes

Hashes for NRCLex-0.0.2.tar.gz
Algorithm Hash digest
SHA256 cdec4776feb286552ac2258ad68de220095314a0b0101645582ca4794c2229ab
MD5 c55a7a11beae638ffd198bc4f2b2eb99
BLAKE2b-256 7a8a58a54839b13514187191018be10eda294d4c565ab0bafc9d50f36c2bec74

See more details on using hashes here.

File details

Details for the file NRCLex-0.0.2-py2-none-any.whl.

File metadata

  • Download URL: NRCLex-0.0.2-py2-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.13

File hashes

Hashes for NRCLex-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 c7b906c29b40bccba6a03ad1f4a65c9b39edac0c2dfbfc3530f5d6bcf23a6f34
MD5 debc0e542be6d9ce08f0b243c94c176b
BLAKE2b-256 de7e140f0ff64bce896ac098dc9f7750ef88a4df50e4922df9ea942121c83af1

See more details on using hashes here.

Supported by

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