Universe

eMFDscore : Extended Moral Foundation Dictionary Scoring for Python

Extended Moral Foundation Dictionary Scoring for Python

eMFDscore is a library for the fast and flexible extraction of various moral information metrics from textual input data. eMFDscore is built on spaCy for faster execution and performs minimal preprocessing consisting of tokenization, syntactic dependency parsing, lower-casing, and stopword/punctuation/whitespace removal. eMFDscore lets users score documents with multiple Moral Foundations Dictionaries, provides various metrics for analyzing moral information, and extracts moral patient, agent, and attribute words related to entities.

Example

from emfdscore.scoring import score_docs import pandas as pd template_input = pd.read_csv('emfdscore/template_input.csv', header=None) DICT_TYPE = 'emfd' PROB_MAP = 'single' SCORE_METHOD = 'bow' OUT_METRICS = 'vice-virtue' OUT_CSV_PATH = 'single-vv.csv' df = score_docs(template_input,DICT_TYPE,PROB_MAP,SCORE_METHOD,OUT_METRICS,num_docs)
Author info

Media Neuroscience Lab

GitHubmedianeuroscience/emfdscore

Categories research teaching

Submit your project

If you have a project that you want the spaCy community to make use of, you can suggest it by submitting a pull request to the spaCy website repository. The Universe database is open-source and collected in a simple JSON file. For more details on the formats and available fields, see the documentation. Looking for inspiration your own spaCy plugin or extension? Check out the project idea label on the issue tracker.

Read the docsJSON source