All Projects → tangbinh → question-answering

tangbinh / question-answering

Licence: other
No description or website provided.

Programming Languages

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

Projects that are alternatives of or similar to question-answering

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 (+4500%)
Mutual labels:  question-answering, squad, bidaf
Question-Answering-based-on-SQuAD
Question Answering System using BiDAF Model on SQuAD v2.0
Stars: ✭ 20 (-37.5%)
Mutual labels:  question-answering, squad, bidaf
co-attention
Pytorch implementation of "Dynamic Coattention Networks For Question Answering"
Stars: ✭ 54 (+68.75%)
Mutual labels:  question-answering, squad
PersianQA
Persian (Farsi) Question Answering Dataset (+ Models)
Stars: ✭ 114 (+256.25%)
Mutual labels:  question-answering, squad
Medi-CoQA
Conversational Question Answering on Clinical Text
Stars: ✭ 22 (-31.25%)
Mutual labels:  question-answering, squad
extractive rc by runtime mt
Code and datasets of "Multilingual Extractive Reading Comprehension by Runtime Machine Translation"
Stars: ✭ 36 (+12.5%)
Mutual labels:  question-answering, squad
SQUAD2.Q-Augmented-Dataset
Augmented version of SQUAD 2.0 for Questions
Stars: ✭ 31 (-3.12%)
Mutual labels:  question-answering, squad
Awesome Qa
😎 A curated list of the Question Answering (QA)
Stars: ✭ 596 (+1762.5%)
Mutual labels:  question-answering, squad
qa
TensorFlow Models for the Stanford Question Answering Dataset
Stars: ✭ 72 (+125%)
Mutual labels:  question-answering, squad
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 (+10553.13%)
Mutual labels:  question-answering, squad
HHH-An-Online-Question-Answering-System-for-Medical-Questions
HBAM: Hierarchical Bi-directional Word Attention Model
Stars: ✭ 44 (+37.5%)
Mutual labels:  question-answering
TransTQA
Author: Wenhao Yu ([email protected]). EMNLP'20. Transfer Learning for Technical Question Answering.
Stars: ✭ 12 (-62.5%)
Mutual labels:  question-answering
Squad
Dockerfile for automated build of a Squad gameserver: https://hub.docker.com/r/cm2network/squad/
Stars: ✭ 21 (-34.37%)
Mutual labels:  squad
strategy
Improving Machine Reading Comprehension with General Reading Strategies
Stars: ✭ 35 (+9.38%)
Mutual labels:  question-answering
TeBaQA
A question answering system which utilises machine learning.
Stars: ✭ 17 (-46.87%)
Mutual labels:  question-answering
explicit memory tracker
[ACL 2020] Explicit Memory Tracker with Coarse-to-Fine Reasoning for Conversational Machine Reading
Stars: ✭ 35 (+9.38%)
Mutual labels:  question-answering
dialogbot
dialogbot, provide search-based dialogue, task-based dialogue and generative dialogue model. 对话机器人,基于问答型对话、任务型对话、聊天型对话等模型实现,支持网络检索问答,领域知识问答,任务引导问答,闲聊问答,开箱即用。
Stars: ✭ 96 (+200%)
Mutual labels:  question-answering
strategyqa
The official code of TACL 2021, "Did Aristotle Use a Laptop? A Question Answering Benchmark with Implicit Reasoning Strategies".
Stars: ✭ 27 (-15.62%)
Mutual labels:  question-answering
Dynamic-Coattention-Network-for-SQuAD
Tensorflow implementation of DCN for question answering on the Stanford Question Answering Dataset (SQuAD)
Stars: ✭ 14 (-56.25%)
Mutual labels:  question-answering
NCE-CNN-Torch
Noise-Contrastive Estimation for Question Answering with Convolutional Neural Networks (Rao et al. CIKM 2016)
Stars: ✭ 54 (+68.75%)
Mutual labels:  question-answering

Overview

This repository contains curated PyTorch implementations of several question answering systems evaluated on SQuAD:

  • Reading Wikipedia to Answer Open-Domain Questions (DrQA). Compared to the code in facebookresearch/DrQA, the implementation in this repository doesn't have the document retriever, making it cleaner and much more light-weighted. The F1 score on the validation set for this implementation is 77.6% (the official F1 score is 78.8%).

  • Bidirectional Attention Flow for Machine Comprehension (BiDAF). In contrast to the original paper, the BiDAF implementation uses 300-dimensional word embeddings and doesn't have a highway network to combine character embeddings and word embeddings. The embeddings of the most frequent 1000 words are also fine-tuned for better performance, achieving an F1 score of 78.4% and an EM score of 69.3% (the official F1 score and EM score is 77.3% and 67.7%, respectively).

Installation

The code was written for Python 3.6 or higher, and it has been tested with PyTorch 0.4.1. Other dependencies are listed in requirements.txt. Training is only available with GPU. To get started, try to clone the repository

git clone https://github.com/tangbinh/question-answering
cd question-answering
pip install -r requirements.txt

There are two tokenizers included in this implementation, CoreNLPTokenizer and SpacyTokenizer. Although spaCy is faster, its tokenizer actually results in more questions having no answers when mapped from texts to tokens. The default setting therefore requires CoreNLPTokenizer, so please download the Stanford CoreNLP jars and include them in your CLASSPATH by following these commands:

wget "http://nlp.stanford.edu/software/stanford-corenlp-full-2017-06-09.zip"
unzip "stanford-corenlp-full-2017-06-09.zip"
rm "stanford-corenlp-full-2017-06-09.zip"
mv "stanford-corenlp-full-2017-06-09" "corenlp"
export CLASSPATH=corenlp/*:$CLASSPATH

Preprocessing

If you haven't downloaded SQuAD or GloVe, it might be easier for you to just run

bash download.sh

Then, the following command helps tokenize the downloaded datasets, extract features such as part-of-speech tagging, and build a dictionary using all CPUs available in your machine:

python preprocess.py --data data/squad --embed-path wordvec/glove/glove.840B.300d.txt --restrict-vocab --num-characters 300

Training

To get started with training a model on SQuAD, you might find the following commands helpful:

python train.py --arch drqa --embed-path wordvec/glove/glove.840B.300d.txt --checkpoint-dir checkpoints/drqa --log-file logs/drqa.log
python train.py --arch bidaf --embed-path wordvec/glove/glove.840B.300d.txt --checkpoint-dir checkpoints/bidaf --log-file logs/bidaf.log --lr 0.01

Prediction

When the training is done, you can make predictions and run the official evaluation script:

python predict.py --input data/dev.json --output predictions/dev-pred.json --feature-dict data/feature_dict.json --checkpoint checkpoints/drqa/checkpoint_best.pt
python evaluate.py data/dev-v1.1.json predictions/dev-pred.json

Interactive

As in the official implementation, it's possible to have an interactive environment for evaluation:

python interactive.py --checkpoint checkpoints/drqa/checkpoint_best.pt
>>> context = "Mary had a little lamb, whose fleece was white as snow. And everywhere that Mary went the lamb was sure to go."
>>> question = "What color is Mary's lamb?"
>>> answer(context, question)
+------+-------+--------------------+
| Rank |  Span |       Score        |
+------+-------+--------------------+
|  1   | white | 0.8701031804084778 |
+------+-------+--------------------+
Time: 0.2440
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].