Code for training and evaluating a TempRel classifier on MATRES, UDS-T, and distantly labeled examples.
Before running the model, make sure that the desired data files have been downloaded as per:
timebank/README.md
: MATRES Datasetudst/README.md
: UDS-T Datasetbeforeafter/README.md
: Distantly-labeled BeforeAfter Examplestimex/README.md
: Distantly-labeled Timex-anchored Examples
To train and evaluate on MATRES:
python train.py --lm roberta --data matres --output_dir /PATH/TO/MODEL_CHKPTS/ --epoch 5 --batch 32
python eval.py --lm roberta --data matres_dev matres_test --model_dir /PATH/TO/MODEL_CHKPTS/
To train and evaluate on UDS-T:
python train.py --lm roberta --data udst --output_dir /PATH/TO/MODEL_CHKPTS/ --epoch 5 --batch 32
python eval.py --lm roberta --data udst_dev_maj_conf_nt udst_test_maj_conf_nt --model_dir /PATH/TO/MODEL_CHKPTS/
To train and evaluate on timex train/test split from Goyal and Durrett, 2019:
python train.py --lm roberta --data distant --output_dir /PATH/TO/MODEL_CHKPTS/ --epoch 5 --batch 32
python eval.py --lm roberta --data distant_test --model_dir /PATH/TO/MODEL_CHKPTS/
To train and evaluate on additional timex data, sampled more evenly from sources in the English Gigaword Fifth Edition, specify a dataset from timex/data/*pkl
, e.g.:
python train.py --lm roberta --data timex/data/d1k.pkl --output_dir /PATH/TO/MODEL_CHKPTS/ --epoch 5 --batch 32
For multiple data sources, simply specify as a space-separated list, e.g.:
python train.py --lm roberta --data matres timex/data/d1k.pkl --output_dir /PATH/TO/MODEL_CHKPTS/ --epoch 5 --batch 32
You can download RoBERTa models that have been fine tuned: