JackieXuu / pytorch-machine-reading-comprehension

CS382 Natural Language Processing Project: Machine Reading Comprehension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloze form QA

Contents

  1. Installation
  2. Preparation
  3. Training
  4. Evaluation

Installation

  1. This is implemented in PyTorch with Python 2.7. The CUDA version is 8.0. You can simply run this script.

    pip install http://download.pytorch.org/whl/cu80/torch-0.1.12.post2-cp27-none-linux_x86_64.whl 

Preparation

  1. Put the given dataset train.txt, dev.txt, test.txt in the data folder.
  2. You can download Glove pretraining embedding here, and put it in the data folder.
  3. Make sure some python packages are installed.

Training

  1. Simply run the following script.

    python train.py
  2. If you want to fine-tune your model. You can run the following script.

    python train.py --resume_model=best_model_nlp.pth

Evaluation

  1. Simply run the following script. This will create a file named result.txt.

    python test.py
    

About

CS382 Natural Language Processing Project: Machine Reading Comprehension

License:MIT License


Languages

Language:Python 100.0%