All Projects → castorini → NCE-CNN-Torch

castorini / NCE-CNN-Torch

Licence: other
Noise-Contrastive Estimation for Question Answering with Convolutional Neural Networks (Rao et al. CIKM 2016)

Programming Languages

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

Projects that are alternatives of or similar to NCE-CNN-Torch

Question-Answering-based-on-SQuAD
Question Answering System using BiDAF Model on SQuAD v2.0
Stars: ✭ 20 (-62.96%)
Mutual labels:  question-answering
BERT-for-Chinese-Question-Answering
No description or website provided.
Stars: ✭ 75 (+38.89%)
Mutual labels:  question-answering
explicit memory tracker
[ACL 2020] Explicit Memory Tracker with Coarse-to-Fine Reasoning for Conversational Machine Reading
Stars: ✭ 35 (-35.19%)
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 (-74.07%)
Mutual labels:  question-answering
HHH-An-Online-Question-Answering-System-for-Medical-Questions
HBAM: Hierarchical Bi-directional Word Attention Model
Stars: ✭ 44 (-18.52%)
Mutual labels:  question-answering
calcipher
Calculates the best possible answer for multiple-choice questions using techniques to maximize accuracy without any other outside resources or knowledge.
Stars: ✭ 15 (-72.22%)
Mutual labels:  question-answering
KitanaQA
KitanaQA: Adversarial training and data augmentation for neural question-answering models
Stars: ✭ 58 (+7.41%)
Mutual labels:  question-answering
QA HRDE LTC
TensorFlow implementation of "Learning to Rank Question-Answer Pairs using Hierarchical Recurrent Encoder with Latent Topic Clustering," NAACL-18
Stars: ✭ 29 (-46.3%)
Mutual labels:  question-answering
TransTQA
Author: Wenhao Yu ([email protected]). EMNLP'20. Transfer Learning for Technical Question Answering.
Stars: ✭ 12 (-77.78%)
Mutual labels:  question-answering
verseagility
Ramp up your custom natural language processing (NLP) task, allowing you to bring your own data, use your preferred frameworks and bring models into production.
Stars: ✭ 23 (-57.41%)
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 (-50%)
Mutual labels:  question-answering
TeBaQA
A question answering system which utilises machine learning.
Stars: ✭ 17 (-68.52%)
Mutual labels:  question-answering
Shukongdashi
使用知识图谱,自然语言处理,卷积神经网络等技术,基于python语言,设计了一个数控领域故障诊断专家系统
Stars: ✭ 109 (+101.85%)
Mutual labels:  question-answering
Instahelp
Instahelp is a Q&A portal website similar to Quora
Stars: ✭ 21 (-61.11%)
Mutual labels:  question-answering
gated-attention-reader
Tensorflow/Pytorch implementation of Gated Attention Reader
Stars: ✭ 37 (-31.48%)
Mutual labels:  question-answering
pair2vec
pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference
Stars: ✭ 62 (+14.81%)
Mutual labels:  question-answering
FreebaseQA
The release of the FreebaseQA data set (NAACL 2019).
Stars: ✭ 55 (+1.85%)
Mutual labels:  question-answering
strategy
Improving Machine Reading Comprehension with General Reading Strategies
Stars: ✭ 35 (-35.19%)
Mutual labels:  question-answering
extractive rc by runtime mt
Code and datasets of "Multilingual Extractive Reading Comprehension by Runtime Machine Translation"
Stars: ✭ 36 (-33.33%)
Mutual labels:  question-answering
QANet
A TensorFlow implementation of "QANet: Combining Local Convolution with Global Self-Attention for Reading Comprehension"
Stars: ✭ 31 (-42.59%)
Mutual labels:  question-answering

Noise-Contrastive Estimation for Answer Selection with Convolutional Neural Networks

This repo contains the Torch implementation of noise-contrastive estimation approach for answer selection in question answering with Convolutional Neural Networks, described in the following paper:

Our model was evaluated on two standard QA datasets: TrecQA and WikiQA. On TrecQA, we achieved the best reported results at that time. Another contribution of this paper is to clarify the distinction between the raw and clean versions of the TrecQA test set.

Getting Started

1. Please install the Torch library by following instructions here: https://github.com/torch/distro

2. Checkout our repo:

git clone https://github.com/Jeffyrao/pairwise-neural-network.git

3. Using following script to download and preprocess the Glove word embedding:

$ sh fetch_and_preprocess.sh

Please make sure your python version >= 2.7, otherwise you will encounter an exception when unzip the downloaded embedding file.

4. Currently our tool only supports running on CPUs.

5. Before you run our model, please set the number of threads >= 5 for parallel processing. This is because our model need a large number of computation resource for training.

$ export OMP_NUM_THREADS=5

Running

1. There are several command line paramters to specify for running our model:

-dataset, the dataset you want to evaluate, which can be TrecQA and WikiQA. 
-version, the version of TrecQA dataset, which can be raw and clean. 
-neg_mode, the negative sampling strategy, 1 is for Random sampling, 2 is for MAX sampling, 3 is for MIX sampling 
-num_pairs, the number of negative samples, can be any reasonable value, by default it's set to 8

2. To evaluate on the TrecQA raw dataset, with MAX sampling and number of negative pairs as 8, run:

$ th PairwiseTrainQA.lua -dataset TrecQA -version raw -neg_mode 2 -num_pairs 8

To evaluate on the TrecQA clean dataset, simply change -version to clean. Similarly, if you want to evaluate on the WikiQA dataset, change -dataset to WikiQA (don't need to set the -version). You can also change the -neg_mode and -num_pairs to select different sampling strategies or negative pairs.

3. To run the base convolutional neural network model in [2], please follow the same parameter setting:

$ th trainQA.lua -dataset TrecQA -version raw

Results

You should be able to reproduce some scores close to the numbers in tables below (-num_pairs is set to 8 by default):

1. TrecQA raw

TrecQA raw MAP MRR
SentLevel [2] 0.762 0.830
Pairwise(Random) 0.765 0.810
Pairwise(MAX) 0.780 0.835
Pairwise(MIX) 0.763 0.813

2. TrecQA clean

TrecQA clean MAP MRR
SentLevel [2] 0.777 0.836
Pairwise(Random) 0.768 0.831
Pairwise(MAX) 0.801 0.877
Pairwise(MIX) 0.798 0.872

3. WikiQA

WikiQA MAP MRR
SentLevel [2] 0.693 0.709
Pairwise(Random) 0.677 0.697
Pairwise(MAX) 0.681 0.705
Pairwise(MIX) 0.682 0.697

Though the numbers above don't outperform the base ConvNet model [2] in WikiQA dataset, still they are close. Our best scores in WikiQA dataset are 0.701(MAP), 0.718(MRR), which were obtained in the setting of MAX sampling and num_pairs as 10.

Reference

[1]. Noisy-Contrastive Estimation for Answer Selection with Deep Neural Networks, Jinfeng Rao, Hua He, Jimmy Lin, CIKM 2016

[2]. Multi-Perspective Sentence Similarity Modeling with Convolutional Neural Networks, Hua He, Kevin Gimpel, and Jimmy Lin, EMNLP 2014

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