This repository provides datasets and code for preprocessing, training and testing models for style classification with human lexical annotations with the official Hugging Face implementation of the following paper:
StyLEx: Explaining Style Using Human Lexical Annotations
Shirley A. Hayati, Kyumin Park, Dheeraj Rajagopal, Lyle Ungar, Dongyeop Kang
EACL 2023
The following command installs all necessary packages:
pip install -r requirements.txt
The project was tested using Python 3.8.
Model | Style | F1 (Orig) | F1 (Hummingbird) | F1 (OOD) |
---|---|---|---|---|
BERT | Politeness | 0.96 | 0.91 | 0.87 |
BERT | Sentiment | 0.67 | 0.91 | 0.75 |
BERT | Joy | 0.88 | 0.92 | 0.73 |
BERT | Sadness | 0.89 | 0.94 | 0.78 |
BERT | Fear | 0.96 | 0.92 | 0.80 |
BERT | Disgust | 0.86 | 0.81 | 0.74 |
BERT | Anger | 0.89 | 0.82 | 0.78 |
BERT | Offensiveness | 0.97 | 0.87 | 0.88 |
If you find this work useful for your research, please cite our papers:
@article{hayati2022stylex,
title={StyLEx: Explaining Styles with Lexicon-Based Human Perception},
author={Hayati, Shirley Anugrah and Park, Kyumin and Rajagopal, Dheeraj and Ungar, Lyle and Kang, Dongyeop},
journal={arXiv preprint arXiv:2210.07469},
year={2022}
}