Official Code Implementation of The Paper : XAI for Transformers: Better Explanations through Conservative Propagation
For the SST-2 and IMDB expermints follow the following instructions :
- The PreTrained models of SST-2 and IMDB can be found at:
1 - SST-2 : https://drive.google.com/file/d/1h6tWtZ-y5KkBiNok4qXZcr8YQaMHKRQ0/view
2 - IMDB : https://drive.google.com/file/d/1v7wO1QYuWsS08kuiEhQLT5ofuzw2JhfZ/view
- For reproducing the results over SST-2 dataset , please run the following :
$ python /sst2/run_sst.py
- This will yield the following files:
- all_flips_pruning.p , all_flips_generate.p
- These pickle files can be loaded inside the notebook "paper_plots" to generate the pertubation plots reported in the paper.
- all_flips_pruning.p , all_flips_generate.p
- For IMDB dataset, the starting code can be found at /imdb/run_imdb.py
- Follow the same instructions of SST-2 dataset above.