All Projects → THUDM → Cogqa

THUDM / Cogqa

Licence: mit
Source code and dataset for ACL 2019 paper "Cognitive Graph for Multi-Hop Reading Comprehension at Scale"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cogqa

cdQA-ui
⛔ [NOT MAINTAINED] A web interface for cdQA and other question answering systems.
Stars: ✭ 19 (-95.24%)
Mutual labels:  question-answering
gapbug
QA site with Python/Django
Stars: ✭ 28 (-92.98%)
Mutual labels:  question-answering
Node Question Answering
Fast and production-ready question answering in Node.js
Stars: ✭ 294 (-26.32%)
Mutual labels:  question-answering
productqa
Product-Aware Answer Generation in E-Commerce Question-Answering
Stars: ✭ 29 (-92.73%)
Mutual labels:  question-answering
iamQA
中文wiki百科QA阅读理解问答系统,使用了CCKS2016数据的NER模型和CMRC2018的阅读理解模型,还有W2V词向量搜索,使用torchserve部署
Stars: ✭ 46 (-88.47%)
Mutual labels:  question-answering
Ganswer
A KBQA system based on DBpedia.
Stars: ✭ 261 (-34.59%)
Mutual labels:  question-answering
Chinese-Psychological-QA-DataSet
中文心理问答数据集
Stars: ✭ 23 (-94.24%)
Mutual labels:  question-answering
Giveme5w1h
Extraction of the journalistic five W and one H questions (5W1H) from news articles: who did what, when, where, why, and how?
Stars: ✭ 316 (-20.8%)
Mutual labels:  question-answering
AskNowNQS
A question answering system for RDF knowledge graphs.
Stars: ✭ 32 (-91.98%)
Mutual labels:  question-answering
Covid Qa
API & Webapp to answer questions about COVID-19. Using NLP (Question Answering) and trusted data sources.
Stars: ✭ 283 (-29.07%)
Mutual labels:  question-answering
MICCAI21 MMQ
Multiple Meta-model Quantifying for Medical Visual Question Answering
Stars: ✭ 16 (-95.99%)
Mutual labels:  question-answering
squad-v1.1-pt
Portuguese translation of the SQuAD dataset
Stars: ✭ 13 (-96.74%)
Mutual labels:  question-answering
Anspress
AnsPress is the most complete question and answer system for WordPress. AnsPress is made with developers in mind, highly customizable. AnsPress provide an easy to use override system for theme
Stars: ✭ 264 (-33.83%)
Mutual labels:  question-answering
mcQA
🔮 Answering multiple choice questions with Language Models.
Stars: ✭ 23 (-94.24%)
Mutual labels:  question-answering
Spm toolkit
Neural network toolkit for sentence pair modeling.
Stars: ✭ 301 (-24.56%)
Mutual labels:  question-answering
co-attention
Pytorch implementation of "Dynamic Coattention Networks For Question Answering"
Stars: ✭ 54 (-86.47%)
Mutual labels:  question-answering
Bert Squad
SQuAD Question Answering Using BERT, PyTorch
Stars: ✭ 256 (-35.84%)
Mutual labels:  question-answering
Adam qas
ADAM - A Question Answering System. Inspired from IBM Watson
Stars: ✭ 330 (-17.29%)
Mutual labels:  question-answering
Informers
State-of-the-art natural language processing for Ruby
Stars: ✭ 306 (-23.31%)
Mutual labels:  question-answering
Nlu sim
all kinds of baseline models for sentence similarity 句子对语义相似度模型
Stars: ✭ 286 (-28.32%)
Mutual labels:  question-answering

CogQA

Project | arXiv

Source codes for the paper Cognitive Graph for Multi-Hop Reading Comprehension at Scale. (ACL 2019 Oral)

We also have a Chinese blog about CogQA on Zhihu (知乎) besides the paper.

Introduction

CogQA is a novel framework for multi-hop question answering in web-scale documents. Founded on the dual process theory in cognitive science, CogQA gradually builds a cognitive graph in an iterative process by coordinating an implicit extraction module (System 1) and an explicit reasoning module (System 2). While giving accurate answers, our framework further provides explainable reasoning paths.

Preprocess

  1. Download and setup Redis database following https://redis.io/download
  2. Download the dataset, evalute script and fullwiki data (enwiki-20171001-pages-meta-current-withlinks-abstracts) from https://hotpotqa.github.io. Unzip improved_retrieval.zip in this repo.
  3. pip install -r requirements.txt
  4. Run python read_fullwiki.py to load wikipedia documents to redis (check the size of dump.rdb in the redis folder is about 2.4GB).
  5. Run python process_train.py to generate hotpot_train_v1.1_refined.json, which contains edges in gold-only cognitive graphs.
  6. mkdir models

Training

The codes automatic assign tasks on all available devices, each handling batch_size / num_gpu samples. We recommend that each gpu has at least 11GB memory to hold 2 batch.

  1. Run python train.py to train Task #1(span extraction).
  2. Run python train.py --load=True --mode='bundle' to train Task #2(answer prediction).

Evaluation

The cogqa.py is the algorithm to answer questions with a trained model. We split the 1-hop nodes found by another similar model into improved_retrieval.zip for reuse in other algorithm. It can directly improve your result on fullwiki setting by just replacing the original input.

  1. unzip improved_retrieval.zip.

  2. python cogqa.py --data_file='hotpot_dev_fullwiki_v1_merge.json'

  3. python hotpot_evaluate_v1.py hotpot_dev_fullwiki_v1_merge_pred.json hotpot_dev_fullwiki_v1_merge.json

  4. You can check the cognitive graph (reasoning process) in the cg part of the predicted json file.

Notes

  1. The changes of this version from the preview version is mainly about detailed comments.
  2. The relatively sensetive hyperparameters includes the number of negative samples, top K, learning rate of task #2, scale factors between different parts...
  3. If our work is useful to you, please cite our paper or star 🌟 our repo~~
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].