Code Monkey home page Code Monkey logo

hieraparser's Introduction

HieraParser v2.0 - a parallel implementation of top-down BTG-based preorderer

HieraParser is a fast and parallel implementation of Top-down Bracketing Transduction Grammar (BTG)-based preordering, extended to support multi-threading, parallel training and parallel parsing.

For the online training algorithm for Top-down BTG-based parser, please refer to the following paper, Tetsuji Nakagawa: Efficient Top-Down BTG Parsing for Machine Translation Preordering , ACL-2015

Differing from Nakagawa's implementation in which using the online Passive-Aggressive (PA) algorithm to train preorderer, we adopt several parallel techniques to parallelise the PA algorithm and train the preorderer in parallel. This application is more fast and robust when training on automatically aligned datasets.

Compiling and Installation

Building HieraParser requires a modern C++ (>=C++11) compiler and the CMake build system. Please make sure your complier version (gcc/clang) supports "pthread" before compiling.

To compile, do the following

mkdir build

cd build/

cmake ..

make

Usage:

1. training the model

./bin/train -input data/train.en.annot -align data/train.en.aligned -model hierp.model
    [main arguments]:
        -beam: maximum beam size during parsing (default 20)
        -batch: batch size of training examples.
        -shuffle: shuffle the training examples during each iteration, recommended
        -iterations: maximum iteration to training the reordering model (default 20)
        -input: path to input file of the source language.
        -align: path to alignment file.
        -model: path to model file [output].
        -threads: the number of threads used for training.
        -kbest: using k-best derivations, it should be a number smaller than beam size. (default: 5)
        -strategy: which parallel strategy to use
            [ 1. mini-batch learning, 
              2. distributed averaging,
              3. iteratively distributed averaging ]
    1. is avaliable for test (online training)

2. parsing with the model

./bin/parse -input data/train.en.annot -align data/train.en.aligned -model hierp.model
    [main arguments]:
        -beam: maximum beam size during parsing (default 20)
        -input: path to input file of the source language.
        -model: path to model file [input].
        -threads: the number of threads to use for parsing (default : auto detected).

Features:

  1. It was implemented with (C++11 STL) built-in multi-threading library.
  2. farmhash is used, instead of boost::hash_combine or std::hasher in STL.
  3. Added the multi-threading support for parsing.

Comparison:

Compared to TD-BTG-Preorderer, HieraParser is faster (4~6 times) and more accurate.

If you have any problem, please contact the author.

Copyright (C) 2017 Hao WANG, Waseda University.

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.