This repository contains the code for ICML 2023 paper Towards Trustworthy Explanation: On Causal Rationalization.
(Notice: we have updated the results of a baseline method folded-rationalisation (FR)) in our most recent version in arxiv)
Firstly, create the Python environment and activate it
conda create --name pytorch_py38 python=3.8
source activate pytorch_py38
To install the dependencies, run the following command
cd rationale-causal
# Install all python dependencies
pip install -r requirements.txt
You can download Beer and Hotel review dataset from https://github.com/YujiaBao/R2A and then put datasets in the data folder.
Before running experiments for Beer review data, utilize cr/data-processing.ipynb to get the short and the noise version data.
Training commands for causal rationalization method:
# real data
./scripts/beer/run_beer_aroma.sh causal-rationale
# synthetic data
./scripts/beer_noise/run_beer_aroma.sh causal-rationale
We thank the authors of Can Rationalization Improve Robustness? for their implementations of the baseline methods