Skip to content

kochsnow/distribution-matching-rationality

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distribution Matching Rationalization

This repo contains Tensorflow implementation of Distribution Matching Rationalization(DMR),Distribution Matching Rationalization

Getting Started

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

Extracted rationale example: image

using the others scprit in the scripts can obtain the following results. image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published