This repo contains Tensorflow implementation of Distribution Matching Rationalization(DMR),Distribution Matching Rationalization
prepare review data For the original beer review dataset has been removed by the dataset’s original author, at the request of the data owner, BeerAdvocate. We use hotel review dataset in the demo. To prepare data, runing the scripts as the following
sh download_data.sh
build environment
pip install -r requirements.txt
training Taking appearance aspect of beer review dataset as example
#beer review dataset, aspect=0 appearance
scripts/run_hotel_0.sh
Testing result is
The annotation performance: sparsity: 10.6281, precision: 47.8882, recall: 59.9924, f1: 53.2612
It is worth mentioning that the result would vary even when you use a fixed seed. This is likely due to the non-deterministic problem of Tensorflow, CuDNN, and the low-level implementation of the cudnngru module (at least for the version we used and tested on). To eliminate such failure cases, for a given parameter setting, it is important to run the model learning procedure multiple times with different initializations.
./beer_results/aspect0/visual_ann.txt
using the others scprit in the scripts
can obtain the following results.