All Projects → Yifan-Gao → explicit_memory_tracker

Yifan-Gao / explicit_memory_tracker

Licence: other
[ACL 2020] Explicit Memory Tracker with Coarse-to-Fine Reasoning for Conversational Machine Reading

Programming Languages

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

Projects that are alternatives of or similar to explicit memory tracker

Deeppavlov
An open source library for deep learning end-to-end dialog systems and chatbots.
Stars: ✭ 5,525 (+15685.71%)
Mutual labels:  question-answering, dialogue-systems
Anyq
FAQ-based Question Answering System
Stars: ✭ 2,336 (+6574.29%)
Mutual labels:  question-answering, dialogue-systems
Knowledge Graphs
A collection of research on knowledge graphs
Stars: ✭ 845 (+2314.29%)
Mutual labels:  question-answering, dialogue-systems
co-attention
Pytorch implementation of "Dynamic Coattention Networks For Question Answering"
Stars: ✭ 54 (+54.29%)
Mutual labels:  question-answering, reading-comprehension
few shot dialogue generation
Dialogue Knowledge Transfer Networks (DiKTNet)
Stars: ✭ 24 (-31.43%)
Mutual labels:  dialogue-systems, conversational-ai
cdQA-ui
⛔ [NOT MAINTAINED] A web interface for cdQA and other question answering systems.
Stars: ✭ 19 (-45.71%)
Mutual labels:  question-answering, reading-comprehension
Simpletransformers
Transformers for Classification, NER, QA, Language Modelling, Language Generation, T5, Multi-Modal, and Conversational AI
Stars: ✭ 2,881 (+8131.43%)
Mutual labels:  question-answering, conversational-ai
PersianQA
Persian (Farsi) Question Answering Dataset (+ Models)
Stars: ✭ 114 (+225.71%)
Mutual labels:  question-answering, reading-comprehension
cmrc2019
A Sentence Cloze Dataset for Chinese Machine Reading Comprehension (CMRC 2019)
Stars: ✭ 118 (+237.14%)
Mutual labels:  question-answering, reading-comprehension
unsupervised-qa
Template-Based Question Generation from Retrieved Sentences for Improved Unsupervised Question Answering
Stars: ✭ 47 (+34.29%)
Mutual labels:  question-answering, question-generation
text2text
Text2Text: Cross-lingual natural language processing and generation toolkit
Stars: ✭ 188 (+437.14%)
Mutual labels:  question-answering, question-generation
CONVEX
As far as we know, CONVEX is the first unsupervised method for conversational question answering over knowledge graphs. A demo and our benchmark (and more) can be found at
Stars: ✭ 24 (-31.43%)
Mutual labels:  question-answering, conversational-ai
TOEFL-QA
A question answering dataset for machine comprehension of spoken content
Stars: ✭ 61 (+74.29%)
Mutual labels:  question-answering, reading-comprehension
Paper Reading
Paper reading list in natural language processing, including dialogue systems and text generation related topics.
Stars: ✭ 508 (+1351.43%)
Mutual labels:  question-answering, dialogue-systems
Medi-CoQA
Conversational Question Answering on Clinical Text
Stars: ✭ 22 (-37.14%)
Mutual labels:  question-answering, conversational-ai
Conversational Ai
Conversational AI Reading Materials
Stars: ✭ 34 (-2.86%)
Mutual labels:  question-answering, dialogue-systems
ODSQA
ODSQA: OPEN-DOMAIN SPOKEN QUESTION ANSWERING DATASET
Stars: ✭ 43 (+22.86%)
Mutual labels:  question-answering, reading-comprehension
MLH-Quizzet
This is a smart Quiz Generator that generates a dynamic quiz from any uploaded text/PDF document using NLP. This can be used for self-analysis, question paper generation, and evaluation, thus reducing human effort.
Stars: ✭ 23 (-34.29%)
Mutual labels:  question-answering, question-generation
cmrc2017
The First Evaluation Workshop on Chinese Machine Reading Comprehension (CMRC 2017)
Stars: ✭ 90 (+157.14%)
Mutual labels:  question-answering, reading-comprehension
Wisty.js
🧚‍♀️ Chatbot library turning conversations into actions, locally, in the browser.
Stars: ✭ 24 (-31.43%)
Mutual labels:  dialogue-systems, conversational-ai

Explicit Memory Tracker with Coarse-to-Fine Reasoning for Conversational Machine Reading (ACL 2020)

This repository is the official implementation of the ACL 2020 Paper Explicit Memory Tracker with Coarse-to-Fine Reasoning for Conversational Machine Reading.

EMT+entailment achieves new state-of-the-art results on ShARC conversational machine reading benchmark (Mar 2020).

Citation

If you find our code useful, please cite our paper as follows:

@article{gao-etal-2020-explicit,
  title={Explicit Memory Tracker with Coarse-to-Fine Reasoning for Conversational Machine Reading},
  author={Yifan Gao and Chien-Sheng Wu and Shafiq R. Joty and Caiming Xiong and Richard Socher and Irwin King and Michael R. Lyu and Steven C. H. Hoi},
  journal={ArXiv},
  year={2020},
  volume={abs/2005.12484}
}

Model Architecture

Image of EMT

Requirements

Main environment (PYT_EMT)

conda create -n emt python=3.6
conda install pytorch==1.0.1 cudatoolkit=10.0 -c pytorch
conda install spacy==2.0.16 scikit-learn
python -m spacy download en_core_web_lg && python -m spacy download en_core_web_md
pip install pytorch-pretrained-bert==0.4.0 editdistance==0.5.2

UniLM question generation environment (PYT_QG)

# create conda environment
conda create -n qg python=3.6
conda install pytorch==1.1 cudatoolkit=10.0 -c pytorch
conda install spacy==2.0.16 scikit-learn
python -m spacy download en_core_web_lg && python -m spacy download en_core_web_md
pip install editdistance==0.5.2

# install apex
git clone -q https://github.com/NVIDIA/apex.git
cd apex
git reset --hard 1603407bf49c7fc3da74fceb6a6c7b47fece2ef8
python setup.py install --cuda_ext --cpp_ext
cd ..

# setup unilm
cd qg
pip install --editable .

Download ShARC data

mkdir data
cd data
wget --quiet https://sharc-data.github.io/data/sharc1-official.zip
unzip sharc1-official.zip
rm sharc1-official.zip
mv sharc1-official sharc

Download BERT, UniLM

mkdir pretrained_models
# BERT
wget --quiet https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased.tar.gz -O pretrained_models/bert-base-uncased.tar.gz
wget --quiet https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt -O pretrained_models/bert-base-uncased-vocab.txt
wget --quiet https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-cased-vocab.txt -O pretrained_models/bert-large-cased-vocab.txt
wget --quiet https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-cased.tar.gz -O pretrained_models/bert-large-cased.tar.gz
# UniLM
wget --quiet https://unilm.blob.core.windows.net/ckpt/unilm1-large-cased.bin -O pretrained_models/unilmv1-large-cased.bin
cd pretrained_models
tar -zxvf bert-large-cased.tar.gz
rm bert-large-cased.tar.gz

You can also download our pretrained models and our dev set predictions:

We would now set up our directories like this:

.
└── dm
    └── ...
└── qg
    └── ...
└── README.md
└── preprocess_dm.py
└── preprocess_qg.py
└── train_dm.sh
└── train_qg.sh
└── inference_e2e.sh
└── inference_oracle_qg.sh
└── data
    └── sharc ...
└── pretrained_models
    └── bert/unilm ...
    └── dm.pt
    └── qg.bin
    └── dev.preds.json

Preprocessing

preprocess decision making

PYT_EMT preprocess_dm.py

preprocess question generation

PYT_QG preprocess_qg.py

Training

Decision Making + Underspecified Span Extraction

Configue PYT_EMT in train_dm.sh first, and run

mkdir -p saved_models
./train_dm.sh <GPU_ID>

The trained decision making model should be at saved_models/lew_10_lsw_0.6/seed_28/best.pt by default.

The decision making predictions should be at saved_models/lew_10_lsw_0.6/seed_28/dev.preds.json by default.

Question Generation

Configue PYT_QG in train_qg.sh first, and run

mkdir -p saved_models
./train_qg.sh <GPU_ID>

The trained question generation model should be at saved_models/unilm_16_0.00002_20/model.20.bin by default.

Note: Because the dataset is relatively small (~20k), the results are highly dependent on your environment and the random seed. To replicate our results in the paper, you can use our pretrained models.

Evaluation

End-to-End Task

To evaluate EMT on the end-to-end task, configue PYT_QG in inference_e2e.sh, and run

./inference_e2e.sh <GPU_ID> pretrained_models/dm.pt pretrained_models/qg.bin path/to/bert/base/uncased/pt

Our model achieves the following performance on the development set using our pre-trained models:

Micro Acc. Macro Acc. BLEU1 BLEU4
73.22 78.28 67.48 53.2

You can replace dm.pt & qg.bin with your trained models to get your own results.

Oracle Question Generation Task

To evaluate EMT on the oracle QG task, configue PYT_QG in inference_oracle_qg.sh, and run,run

./inference_oracle_qg.sh <GPU_ID> <path-to-dev.preds.json> <path-to-trained-qg-model>
# OR, use our pretrained QG model and our dev predicted data
./inference_oracle_qg.sh <GPU_ID> pretrained_models pretrained_models/qg.bin

Oracle question generation results on the Dev. set:

BLEU1 BLEU4
63.50 48.65

Acknowledgements

Portions of the source code are based on the E3 project.

The work was done when the first author was an intern at Salesforce Research.

If you have any issue, please open an issue or contact [email protected]

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