-
The source code is built aroud PyTorch, and has the following main dependencies:
- Python 3.8
- PyTorch 1.12.1
- transformers 4.22.2
For more extensive dependencies, see
requirements.txt
. A recommended way to install the dependencies is via Anaconda:conda create -n cobra python=3.8 conda activate cobra conda install -c conda-forge pip # make sure pip is installed python -m pip install -r requirements.txt # make sure the packages are installed in the specific conda environment python -m pip install -e .
-
We use
pre-commit
hooks to unify the code style, please refer to https://pre-commit.com/ for installation and usage.
Please refer to scripts/explain_model/train_explain_model.sh
and scripts/predict_explain_model.sh
for training and evaluation scripts.
If you find this repository useful in your research, please cite the following paper:
@inproceedings{zhou2023cobraframes,
title={COBRA Frames: Contextual Reasoning about Effects and Harms of Offensive Statements},
author={Zhou, Xuhui and Zhu, Hao and Yerukola, Akhila and Davidson, Thomas and Hwang, Jena D. and Swayamdipta, Swabha and Sap, Maarten},
year={2023},
booktitle={Findings of ACL},
url={http://arxiv.org/abs/2306.01985}
}