Giter Club home page Giter Club logo

prpn's Introduction

PRPN

Parsing Reading Predict Network

This repository contains the code used for word-level language model and unsupervised parsing experiments in Neural Language Modeling by Jointly Learning Syntax and Lexicon paper, originally forked from the PyTorch word level language modeling example. If you use this code or our results in your research, we'd appreciate if you cite our apper as following:

@inproceedings{
shen2018neural,
title={Neural Language Modeling by Jointly Learning Syntax and Lexicon},
author={Yikang Shen and Zhouhan Lin and Chin-wei Huang and Aaron Courville},
booktitle={International Conference on Learning Representations},
year={2018},
url={https://openreview.net/forum?id=rkgOLb-0W},
}

Software Requirements

Python 2.7, NLTK and PyTorch 0.2 are required for the current codebase.

Steps

  1. Install PyTorch 0.2 and NLTK

  2. Download PTB data. Note that the two tasks, i.e., language modeling and unsupervised parsing share the same model strucutre but require different formats of the PTB data. For language modeling we need the standard 10,000 word Penn Treebank corpus data, and for parsing we need Penn Treebank Parsed data.

  3. Scripts and commands

    • Language Modeling python main_LM.py --cuda --tied --hard --data /path/to/your/data

    The default setting in main_LM.py achieves a test perplexity of approximately 60.97 on PTB test set.

    • Unsupervised Parsing python main_UP.py --cuda --tied --hard

    The default setting in main_UP.py achieves an unlabeled f1 of approximately 0.70 on the standard test set of PTB WSJ10 subset. For visualizing the parsed sentence trees in nested bracket form, and evaluate the trained model, please run

    test_phrase_grammar.py

prpn's People

Contributors

yikangshen avatar hantek avatar

Watchers

Shubham Pachori avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.