All commands should be used from root directory.
Stats csv files are saved in stats-results/
folder, run this command before running the notebooks:
### Example on our best BasicLSTM trained model
python -m src.evaluation.test_save_stats --model BasicLSTM --saved_model_path saved-models/BasicLSTM_2021-12-08_01-04-25_trained_testAcc=0.7107.pth --loss_criterion bcelosswithlogits --only_test 0 --stats_label 1
We provide two notebooks to visualize which parts of the input sentence are used for an inference of a trained model.
In the current state, we use Integrated Gradients from Captum library to obtain the attribution scores for each word in a given sentence.
-
For CNN/RNN-based models, please use this XAI LSTM notebook (Example on our best BasicLSTM trained model).
-
For BERT-based models, please use this XAI Bert notebook (Example on our best DistillBert trained model).
Here is the Confusion Matrix of our best trained model DistillBert_2021-12-08_16-39-08_trained_testAcc=0.7960.pth
used in the XAI Bert notebook: