All Projects → laddie132 → Match Lstm

laddie132 / Match Lstm

Licence: mit
A PyTorch implemention of Match-LSTM, R-NET and M-Reader for Machine Reading Comprehension

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Match Lstm

extractive rc by runtime mt
Code and datasets of "Multilingual Extractive Reading Comprehension by Runtime Machine Translation"
Stars: ✭ 36 (-60.87%)
Mutual labels:  squad
co-attention
Pytorch implementation of "Dynamic Coattention Networks For Question Answering"
Stars: ✭ 54 (-41.3%)
Mutual labels:  squad
Awesome Qa
😎 A curated list of the Question Answering (QA)
Stars: ✭ 596 (+547.83%)
Mutual labels:  squad
question-answering
No description or website provided.
Stars: ✭ 32 (-65.22%)
Mutual labels:  squad
FastFusionNet
A PyTorch Implementation of FastFusionNet on SQuAD 1.1
Stars: ✭ 38 (-58.7%)
Mutual labels:  squad
R Net
A Tensorflow Implementation of R-net: Machine reading comprehension with self matching networks
Stars: ✭ 321 (+248.91%)
Mutual labels:  squad
Question-Answering-based-on-SQuAD
Question Answering System using BiDAF Model on SQuAD v2.0
Stars: ✭ 20 (-78.26%)
Mutual labels:  squad
Qanet
A Tensorflow implementation of QANet for machine reading comprehension
Stars: ✭ 996 (+982.61%)
Mutual labels:  squad
qa
TensorFlow Models for the Stanford Question Answering Dataset
Stars: ✭ 72 (-21.74%)
Mutual labels:  squad
R Net
Tensorflow Implementation of R-Net
Stars: ✭ 582 (+532.61%)
Mutual labels:  squad
PersianQA
Persian (Farsi) Question Answering Dataset (+ Models)
Stars: ✭ 114 (+23.91%)
Mutual labels:  squad
Medi-CoQA
Conversational Question Answering on Clinical Text
Stars: ✭ 22 (-76.09%)
Mutual labels:  squad
Drqa
A pytorch implementation of Reading Wikipedia to Answer Open-Domain Questions.
Stars: ✭ 378 (+310.87%)
Mutual labels:  squad
MRC Competition Dureader
机器阅读理解 冠军/亚军代码及中文预训练MRC模型
Stars: ✭ 552 (+500%)
Mutual labels:  squad
Fusionnet
My implementation of the FusionNet for machine comprehension
Stars: ✭ 29 (-68.48%)
Mutual labels:  squad
Squad
Dockerfile for automated build of a Squad gameserver: https://hub.docker.com/r/cm2network/squad/
Stars: ✭ 21 (-77.17%)
Mutual labels:  squad
Learning to retrieve reasoning paths
The official implementation of ICLR 2020, "Learning to Retrieve Reasoning Paths over Wikipedia Graph for Question Answering".
Stars: ✭ 318 (+245.65%)
Mutual labels:  squad
Bidaf Pytorch
An Implementation of Bidirectional Attention Flow
Stars: ✭ 42 (-54.35%)
Mutual labels:  squad
Reading comprehension tf
Machine Reading Comprehension in Tensorflow
Stars: ✭ 37 (-59.78%)
Mutual labels:  squad
Lambdahack
Haskell game engine library for roguelike dungeon crawlers; please offer feedback, e.g., after trying out the sample game with the web frontend at
Stars: ✭ 439 (+377.17%)
Mutual labels:  squad

Match-LSTM

Here we implement the MatchLSTM (Wang and Jiang 2016) model, R-Net(Wang et al. 2017) model and M-Reader(Hu et al. 2017) on SQuAD (Rajpurkar et al. 2016).

Maybe there are some details different from initial paper.

Requirements

Experiments

The Match-LSTM+ model is a little change from Match-LSTM.

  • replace LSTM with GRU
  • add gated-attention match like r-net
  • add separated char-level encoding
  • add additional features like M-Reader
  • add aggregation layer with one GRU layer
  • initial GRU first state in pointer-net
    • add full-connect layer after match layer

Evaluate results on SQuAD dev set:

model em f1
Match-LSTM+ (our version) 70.2 79.2
Match-LSTM (paper) 64.1 73.9
R-NET-45 (our version) 64.2 73.6
R-NET (paper) 72.3 80.6
M-Reader (our version) 70.4 79.6
M-Reader+RL (paper) 72.1 81.6

'R-NET-45' refers to R-NET with hidden size of 45

Usage

python run.py [preprocess/train/test] [-c config_file] [-o ans_path]
  • -c config_file: Defined dataset, model, train methods and so on. Default: config/global_config.yaml
  • -o ans_path: see in test step

there several models you can choose in config/global_config.yaml, like 'match-lstm', 'match-lstm+', 'r-net' and 'm-reader'. view and modify.

Preprocess

  1. Put the GloVe embeddings file to the data/ directory
  2. Put the SQuAD dataset to the data/ directory
  3. Run python run.py preprocess to generate hdf5 file of SQuAD dataset

Note that preprocess will take a long time if multi-features used. Maybe close to an hour.

Train

python run.py train

Test

python run.py test [-o ans_file]
  • -o ans_file: Output the answer of question and context with a unique id to ans_file.

Note that we use data/model-weight.pt as our model weights by default. You can modify the config_file to set model weights file.

Evaluate

python helper_run/evaluate-v1.1.py [dataset_file] [prediction_file]
  • dataset_file: ground truth of dataset. example: data/SQuAD/dev-v1.1.json
  • prediction_file: your model predict on dataset. you can use the ans_file from test step.

Analysis

python helper_run/analysis_[*].py

Here we provide some scipt to analysis your model output, such as analysis_log.py, analysis_ans.py, analysis_dataset.py and so on. view and explore.

Reference

License

MIT

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].