You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run `sh data/download_data.sh` to download the data needed for the experiments.
5
+
This will download the preprocessed IMDB dataset, the word embeddings for the neural network and for the adversarial attack, and dictionaries of cached nearest neighbors.
6
+
7
+
### Download StanfordCoreNLP
8
+
Run `sh download_stanfordcorenlp.sh` to download the Standford CoreNLP parser.
9
+
10
+
### Train LSTM model
11
+
Run `python train_lstm_model.py` to train an LSTM model for sentiment classification on the IMDB dataset.
12
+
13
+
14
+
### Perform verification using DeepGo
15
+
Run `python verification.py` to perform robustness analysis using [DeepGo](https://arxiv.org/abs/1805.02242) on the LSTM.
16
+
17
+
### Obtain explanations for sentiment analysis.
18
+
Run the code in `sbe_examples.ipynb` to generate explanations for sentiment analysis, using the adaptation of [Spectrum-Based Explanations](https://arxiv.org/abs/1908.02374v1) to text classification.
19
+
20
+
### Generate adversarial examples
21
+
Run the code in `attack.ipynb` to generate adversarial examples for sentiment analysis.
22
+
To visualize the generated adversarial examples run the code in `visualize_attack.ipynb`.
23
+
Some examples of adversarial examples are already shown in `visualize_attack.ipynb`.
24
+
25
+
### Fix the classification
26
+
Run the code in `fix_classification.ipynb` to generate suggestions that change the classification
27
+
of a text to the correct class. To visualize the suggestions run the code in `visualize_fixing.ipynb`.
0 commit comments