Skip to content

Implementation of Incorporating Priors with Feature Attribution on Text Classification (ACL2019)

License

Notifications You must be signed in to change notification settings

frederick0329/Incorporating-Priors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Incorporating-Priors

This repository contains implementation of paper -- Incorporating Priors with Feature Attribution on Text Classification (ACL2019)

How to train a model

python train.py --num_classes=2 --output_dir='/tmp/attr/' --target_words_file='./data/wiki/identity.txt'

By default, the command trains the model with joint loss (attribution + classification) on ./data/wiki/wiki_train.txt.

Check

python train.py -h

for other settings.

How to predict and generate global attributions (average of local attributions).

python explain.py --model_dir=/tmp/attr --pred_output=/tmp/pred.txt

Check

python explain.py -h

for other settings.

About

Implementation of Incorporating Priors with Feature Attribution on Text Classification (ACL2019)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published