alfonsosemeraro / emoatlas

A Python library for the detection and visualization of emotions in texts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Python library for the detection and visualization of emotions in texts, coming soon with the first release ✨

Description

EmoAtlas is a Python library that checks against the input text, after having enriched it and structured as a semantic network, against the multilingual NRC Lexicon. The library is built upon the Formamentis Networks from Stella et al. and the PyPlutchik library (paper here).

It has already been used for our analysis of the semantic and emotional frames around COVID-19 vaccines, repository here.

Installation

emolib installs with pip:

~$ pip install emoatlas

then install the relevant language using:

~$ python -m spacy download en_core_web_lg

the command above installs English, but a list of possible language codes can be found here, and different languages installed by changing en in the final argument to one of the listed language codes.

This library uses Natural Language Toolkit (NLTK) as a core dependency. If this is the first time you're using NLTK, you need to download its data depending on the language you are interested in.

import nltk
nltk.download('wordnet') #English

Usage and Guides

See the Jupyter notebooks in demos/ for examples of how to use emoatlas (Jupyter notebook required). Guides and other information about the package are also available in that folder.

Google Colab

A Google Colab simple demo is also available here.

It is suggested to refer to the guides of the demos/ folder to understand how to use the package.

Acknowledgements

Thanks to @FinleyGibson and @GiulioRossetti for their contribution to the testing, debugging and refactoring this library.

About

A Python library for the detection and visualization of emotions in texts

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%