You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that this repository uses hydra for managing hyperparameters and experiments. The configs we use for training can be found under config. hydra creates unique outputs for every experiment under the directory output.
Creating Patch Finetuning Data
To start, create synthetic data for patch finetuning using the yaml format (some examples are in the PATCH_DIR folder), and then use convert_yaml_to_data.py to create json files. The JSON files used in our experiments can be found in the PATCH_DIR folder.
Training Patchable Models
The entry script for training patchable models is train_models.py. Run it as:
{SAVE_PATH}: path where the patchable model will be saved
{protocol}: can be one of
simple: If you want to train a model on just the task ("Task Finetuning")
patch_finetuning_conds: train a patchable model for Sentiment Classification
patch_re: to train a patchable model for Relation Extraction
{SUB_FOLDER}: one of the folders in the PATCH_DIR directory. To train models with override patches, use override_patch_data and to train a model with feature based patches, use feature_based_patch_data.
learnt_interpreter: set this to True to train feature based patches.
Model Checkpoints
Checkpoints for models used in this work can be found at this link. We also provide notebooks to reproduce various Tables in the paper. To reproduce results:
For Table-2, see the notebooks with checklist in the name
For Table-3,4,5 please follow the instructions in the notebook override_patches_sentiment.ipynb and orig_model_results.ipynb
For Figure-4, use finetuning_experiments.py
To cite this paper, use:
@inproceedings{murty2022patches,
title = "Fixing Model Bugs with Natural Language Patches",
author = "Murty, Shikhar and
Manning, Christopher and
Lundberg, Scott and
Ribeiro, Marco Tulio",
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
year = "2022",
}
About
Code for our EMNLP '22 paper "Fixing Model Bugs with Natural Language Patches"