[go: nahoru, domu]

Skip to content

Fast, flexible extraction of moral information from textual input data.

License

Notifications You must be signed in to change notification settings

RakerZh/emfdscore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emfd

made-with-python Open Source Love png2

  • This is forked version from emfdscore.

Changes

  • compatible with latest spacy and pandas package
  • score_docs using column index for scoring
  • Only support bow score type

Before install

  • make sure your python version >=3.12 in your environment. The another might work
    • python3 --version
  • install spacy and en_core_web_sm, see spacy usage

Install

pip install emfd

Usage

  • emfd
import pandas as pd
from emfd.scoring import score_docs
df = pd.read_csv("your_data_set.csv")
num_docs = len(df)
DICT_TYPE = 'emfd'
PROB_MAP = 'all' # or single
SCORE_METHOD = 'bow' # or more options see documents, only bow tested currently
OUT_METRICS = 'sentiment' # or vice-virtue
OUT_CSV_PATH = './your_file_output.csv'
column_index = 0 # the columen number of content for scoring 
df = score_docs(df,DICT_TYPE,PROB_MAP,SCORE_METHOD,OUT_METRICS,num_docs,column_index)
df.to_csv(OUT_CSV_PATH, index=False)

Future

  • polars implementations
  • vectorized operations

Other

When using eMFDscore, please consider giving this repository a star (top right corner) and citing the following article:
Hopp, F. R., Fisher, J. T., Cornell, D., Huskey, R., & Weber, R. (2020). The extended Moral Foundations Dictionary (eMFD): Development and applications of a crowd-sourced approach to extracting moral intuitions from text. Behavior Research Methods, https://doi.org/10.3758/s13428-020-01433-0

eMFDscore is dual-licensed under GNU GENERAL PUBLIC LICENSE 3.0, which permits the non-commercial use, distribution, and modification of the eMFDscore package. Commercial use of the eMFDscore requires an application.

Applications

The eMFD has been used in the following applications (ordered by date of publication):

About

Fast, flexible extraction of moral information from textual input data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%