Skip to content

Implementing the Bidirectional Attention Flow model using pytorch

Notifications You must be signed in to change notification settings

ahmedhajyahmed/BiDAF_pytorch

Repository files navigation

BiDAF_pytorch

Implementing the Bidirectional Attention Flow model using pytorch

  1. configure your environment:

     - create a conda env : conda create {"env name"} python= 3.6
     - activate {"env name"}
     - install all requirements 
    
  2. preprocessing your dataset :

     - run  python setup.py
             * this will preprocess SQuAD 2.0 traing , dev , test and my_test datasets ( dataset containing a concrete example) 
             * this will also dowlnlods the Glove 300-dimensional word vectors
    
  3. train your model :

     - create "save" folder
     - run python train.py --name training 
             * this will train your model by reading command line arguments, loading SQuAD dataset
             * you can add --num_epochs argument to specify the number of epochs 
             * with 10 epochs you will have : F1: 58.47 , EM: 55.42 , AvNA: 64.88
    
  4. to test your model with the dev/test SQUAD dataset:

     - run python test.py --name dev/test --split dev/test --load_path ./save/{"your training folder"}/best.pth.tar
    
  5. to visualize the machine learning workflow in tensorboard :

     - run tensorboard --logdir ./save/{"your training folder"}
    
  6. to test your model with your test dataset

     - run python my_test.py -name test --split test  --load_path ./save/{"your training folder"}/best.pth.tar
    

About

Implementing the Bidirectional Attention Flow model using pytorch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages