Skip to content
pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference
Branch: master
Clone or download
Mandar Joshi
Latest commit 0922b8f May 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
embeddings remove unused options Jan 17, 2019
endtasks move variational dropout to common May 3, 2019
experiments rename namespace May 3, 2019
.gitignore ignore cache files Jul 25, 2018
README.md Fix README Jan 18, 2019
download_corpus.sh move scripts outside Jan 17, 2019
download_pair2vec.sh move scripts outside Jan 17, 2019
requirements.txt requirements Jan 9, 2019

README.md

pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference

Introduction

This repository contains the code for replicating results from

Getting Started

  • Install python3 requirements: pip install -r requirements.txt

Using pretrained pair2vec embeddings

  • Download pretrained pair2vec: ./download_pair2vec.sh
    • If you want to reproduce results from the paper on QA/NLI, please use the following:
      • Download and extract the pretrained models tar file
      • Run evaluation:
    python -m allennlp.run evaluate [--output-file OUTPUT_FILE]
                                 --cuda-device 0
                                 --include-package endtasks
                                 ARCHIVE_FILE INPUT_FILE
    
    • If you want to train your own QA/NLI model:
    python -m allennlp.run train <config_file> -s <serialization_dir> --include-package endtasks
    

See the experiments directory for relevant config files.

Training your own embeddings

  • Download the preprocessed corpus if you want to train pair2vec from scratch: ./download_corpus.sh
  • Training: This starts the training process which typically takes 7-10 days. It takes in a config file and a directory to save checkpoints.
python -m embeddings.train --config experiments/pair2vec_train.json --save_path <directory>

Miscellaneous

  • If you use the code, please cite the following paper
@article{DBLP:journals/corr/abs-1810-08854,
  author    = {Mandar Joshi and
               Eunsol Choi and
               Omer Levy and
               Daniel S. Weld and
               Luke Zettlemoyer},
  title     = {pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference},
  journal   = {CoRR},
  volume    = {abs/1810.08854},
  year      = {2018},
  url       = {http://arxiv.org/abs/1810.08854},
  archivePrefix = {arXiv},
  eprint    = {1810.08854},
  timestamp = {Wed, 31 Oct 2018 14:24:29 +0100},
  biburl    = {https://dblp.org/rec/bib/journals/corr/abs-1810-08854},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
You can’t perform that action at this time.