Simple tool to get the Moral Foundations counts of a given text.
pip install moralizer
SpaCy requires the following add-on.
python -m spacy download en_core_web_sm
Moralizer returns word counts of a text based on the Moral Foundations Vocabulary 2.0 in a neat and organized JSON object or Python dictionary.
from moralizer import *
- moralizer
- read_json(reads in a json file)
- read_file(input_file)
- moralize(text, output_format=default is Python dictionary, add ".json" for output in JSON).
Moralizer only uses one outside dependency, the delightfully opinionated spaCy.
- Tests
- Documentation