All Projects → felixgwu → FastFusionNet

felixgwu / FastFusionNet

Licence: MIT License
A PyTorch Implementation of FastFusionNet on SQuAD 1.1

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to FastFusionNet

Haystack
🔍 Haystack is an open source NLP framework that leverages Transformer models. It enables developers to implement production-ready neural search, question answering, semantic document search and summarization for a wide range of applications.
Stars: ✭ 3,409 (+8871.05%)
Mutual labels:  squad
QANet-pytorch-
A Pytorch implementation of QANet
Stars: ✭ 91 (+139.47%)
Mutual labels:  squad
MRC Competition Dureader
机器阅读理解 冠军/亚军代码及中文预训练MRC模型
Stars: ✭ 552 (+1352.63%)
Mutual labels:  squad
Allure
Allure of the Stars is a near-future Sci-Fi roguelike and tactical squad combat game written in Haskell; please offer feedback, e.g., after trying out the web frontend version at
Stars: ✭ 149 (+292.11%)
Mutual labels:  squad
R Net
R-net in PyTorch, with ELMo
Stars: ✭ 194 (+410.53%)
Mutual labels:  squad
Transformer-QG-on-SQuAD
Implement Question Generator with SOTA pre-trained Language Models (RoBERTa, BERT, GPT, BART, T5, etc.)
Stars: ✭ 28 (-26.32%)
Mutual labels:  squad
Match Lstm
A PyTorch implemention of Match-LSTM, R-NET and M-Reader for Machine Reading Comprehension
Stars: ✭ 92 (+142.11%)
Mutual labels:  squad
SQUAD2.Q-Augmented-Dataset
Augmented version of SQUAD 2.0 for Questions
Stars: ✭ 31 (-18.42%)
Mutual labels:  squad
Dawn Bench Entries
DAWNBench: An End-to-End Deep Learning Benchmark and Competition
Stars: ✭ 254 (+568.42%)
Mutual labels:  squad
extractive rc by runtime mt
Code and datasets of "Multilingual Extractive Reading Comprehension by Runtime Machine Translation"
Stars: ✭ 36 (-5.26%)
Mutual labels:  squad
Albert Tf2.0
ALBERT model Pretraining and Fine Tuning using TF2.0
Stars: ✭ 180 (+373.68%)
Mutual labels:  squad
X3daudio1 7 hrtf
HRTF for Arma 3, Skyrim, and other titles that use XAudio2 + X3DAudio
Stars: ✭ 192 (+405.26%)
Mutual labels:  squad
Question-Answering-based-on-SQuAD
Question Answering System using BiDAF Model on SQuAD v2.0
Stars: ✭ 20 (-47.37%)
Mutual labels:  squad
Mnemonicreader
A PyTorch implementation of Mnemonic Reader for the Machine Comprehension task
Stars: ✭ 137 (+260.53%)
Mutual labels:  squad
question-answering
No description or website provided.
Stars: ✭ 32 (-15.79%)
Mutual labels:  squad
Bi Att Flow
Bi-directional Attention Flow (BiDAF) network is a multi-stage hierarchical process that represents context at different levels of granularity and uses a bi-directional attention flow mechanism to achieve a query-aware context representation without early summarization.
Stars: ✭ 1,472 (+3773.68%)
Mutual labels:  squad
diwako dui
A UI showing unit positions and names of units in your squad
Stars: ✭ 39 (+2.63%)
Mutual labels:  squad
Medi-CoQA
Conversational Question Answering on Clinical Text
Stars: ✭ 22 (-42.11%)
Mutual labels:  squad
PersianQA
Persian (Farsi) Question Answering Dataset (+ Models)
Stars: ✭ 114 (+200%)
Mutual labels:  squad
Squad
Dockerfile for automated build of a Squad gameserver: https://hub.docker.com/r/cm2network/squad/
Stars: ✭ 21 (-44.74%)
Mutual labels:  squad

FastFusionNet

Overview

This repo contains the code of FastFusionNet: New State-of-the-Art for DAWNBench SQuAD.

News

We now support PyTorch version >=0.4.1 in a new branch. However, it is slightly slower.

Requirements

torch==0.3.1
spacy==1.9.0
numpy
pandas
tqdm
tesnorboardX
oldsru

Please also install the SRU version 1 (oldsru) from here. Please download GloVe (Pennington et al., EMNLP 2014) and CoVe (McCann et al., NIPS 2017) by

bash download.sh

Preprocessing

Preprocessing the data set. This takes about 10 minutes. PATH_TO_SQAUD_TRAIN should be the path to train-v1.1.json and PATH_TO_SQAUD_DEV should be the path to dev-v1.1.json. This will generate the preprocessed data file at data/squad/data-fusion.pth.

mkdir -p data/squad
python prepro.py --train PATH_TO_SQAUD_TRAIN --dev PATH_TO_SQUAD_DEV

Training

To train FastFusionNet (Wu et al., arXiv 2019):

SAVE='save/fastfusionnet'
mkdir -p $SAVE
python train.py --model_type fusionnet --hidden_size 125 --end_gru \
    --dropout_rnn 0.2 --data_suffix fusion --save_dir $SAVE \
    -lr 0.001 -gc 20  -e 100 --batch_size 32 \
    --rnn_type sru --fusion_reading_layers 2 --fusion_understanding_layers 2 --fusion_final_layers 2

To train FusionNet (Huang et al., ICLR 2018):

SAVE='save/fusionnet'
mkdir -p $SAVE
python train.py --model_type fusionnet --hidden_size 125 --end_gru \
    --dropout_rnn 0.4 --data_suffix fusion --save_dir $SAVE \
    -lr 0.001 -gc 20  -e 100 --batch_size 32 \
    --rnn_type lstm --fusion_reading_layers 1 --fusion_understanding_layers 1 --fusion_final_layers 1 --use_cove

To train GLDR-DrQA (Wu et al., arXiv 2017):

python train.py --model_type gldr-drqa --hidden_size 128 \
    --dropout_rnn 0.2 --data_suffix fusion --save_dir $SAVE \
    -lr 0.001 -gc 20  -e 100 --batch_size 32 \
    -doc_layers 17 --question_layers 9

Evalutation

To evaluate the best trained model in 'save/fastfusionnet' and get the latency (batch size=1):

python eval.py --save_dir save/fastfusionnet --resume best_model.pt --eval_batch_size 1

Pre-trained model

FastFusionNet model link dev EM: 73.58 F1: 82.42

Reference

@article{wu2019fastfusionnet,
  title={FastFusionNet: New State-of-the-Art for DAWNBench SQuAD},
  author={Wu, Felix and Li, Boyi and Wang, Lequn and Lao, Ni and Blitzer, John and and Weinberger, Kilian Q.},
  journal={arXiv preprint arXiv:1902.11291},
  url={https://arxiv.org/abs/1902.11291},
  year={2019}
}

Acknowledgement

This is based on the v0.3.1 version of Runqi Yang's excellent DrQA code base as well as the official FusionNet on NLI implementation. Lots of Runqi's code is borrowed from Facebook/ParlAI under an MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].