Skip to content

libowen2121/Imitation-Learning-for-Unsup-Parsing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Imitation Learning for Unsupervised Parsing

This release contains the code used for paper An Imitation Learning Approach to Unsupervised Parsing
Code for PRPN and Gumbel Tree-LSTM is borrowed from PRPN codebase and NYU's implementation respectively.

Preparation

Requirements:

  • Python 2.7.5
  • Pytorch 0.3.1

Data to download:

Running

  1. Train PRPN using its original code base
  2. Forward PRPN model on All-NLI data to get predicted trees: ./python/prpn_util/generate_distance.sh
  3. Shuffle the generated training set and then split it to train/dev set
    cat train.json | shuf > train_shuffled.json
    head -n TRAIN_NUM train_shuffled.json > train_shuffled_train.json
    tail -n VALID_NUM train_shuffled.json > train_shuffled_valid.json
  4. Step-by-step supervised learning
    ./python/sl_rl.sh
  5. Policy refinement
    ./python/rl_ft.sh

About

An Imitation Learning Approach to Unsupervised Parsing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published