This is a simple implementation of paper Attention-over-Attention Neural Networks for Reading Comprehension. We only use CNN news database to train and test the model. Also, the implementation doesn't consist of N-best Re-ranking Strategy in the paper.
AoaReader
├─
│ .gitignore
│ pre_train.py
│ README.md
│ test.ipynb
│ test.py
│ train.py
│
├─.vscode
│ settings.json
│
├─data
│ Readme.md
│
├─model
│ │ model.py
│ │ __init__.py
│ │
│ └─__pycache__
│ model.cpython-36.pyc
│ __init__.cpython-36.pyc
│
├─temp
│ dictionary.pickle
│ Readme.md
│ test_vec.pickle
│ train_vec.pickle
│ valid_vec.pickle
│
└─utils
│ dataloader.py
│ dict.py
│ __init__.py
│
└─__pycache__
dataloader.cpython-36.pyc
dataloader.cpython-38.pyc
dict.cpython-36.pyc
dict.cpython-38.pyc
__init__.cpython-36.pyc
__init__.cpython-38.pyc
- AoaReader
- data : consists of the dataset.
- cnn : download from here
- model : consists of the model AoaReader.
- model.py
- utils : consists of some tool class the deal with data.
- dict.py
- dataloader.py
- temp : save some temporary files, like the trained model, the prepared data.
- pre_train.py : deal with the origin data
- train.py : train the model
- test.py : predict on the test data with the trained model
- data : consists of the dataset.
- Download the dataset from here.
- Run
rm ./temp/*.pickle
to delete the temp files generate by us. Also, you can choose to use them instead of deleting. (It will save several minutes to deal with the data). Attention, if you choose to use our temp files, you can skip step 1 but you should change some lines in thepre_train.py
to stop accessing dataset files. - Run
python pre_train.py
. - Run
python train.py
. - Run
python test.py
.