Home

Awesome

Dictionary Definition Models

A recurrent neural network that learns to define words from dictionaries. This repository is for AAAI2017 paper: "Definition Modeling: Learning to define word embeddings in natural language" along with the preporcessing scripts.

Dependencies

CUDA Libraries

Skip this if you do not have a GPU.

Torch Libraries

Most of the libraries will come with Torch if you install from their installation script. You can use luarocks to install additional packages. For examples, luarocks install dp. The additional packages are:

If you are planing to use GPU (CUDA), you will need the following packages:

To install from source, go to the source code directory and run luarocks install.

Python Libraries

Word Embedding

You will also need a set of word embeddings in torch binary format of an object:

{
  M, -- 2D tensor where each row is an embedding
  v2wvocab, -- index-to-word map
  w2vvocab -- word-to-index map
}

You can download embeddings from Word2Vec and use word2vec.torch to convert them into torch binary file.

Usage

In most of the scripts, there will be a help message which can be accessed by

th script.lua --help

Preparing data

We include our dataset (data/commondefs). If you want to use other dataset, please check the file format. For dictionary parsing scripts, check out dict-definition (only support WordNet and GCIDE for now).

Main scripts

Please see the option within the help message of the scripts.

To-do