GithubHelp home page GithubHelp logo

stevenzhb / pointer-generator-transformer-inflection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from assafsinger94/pointer-generator-transformer-inflection

0.0 0.0 0.0 14.04 MB

Pointer-generator transformer model and transformer model for the morphological inflection task. custom to the SIGMORPHON 2019 shared task.

Python 73.18% Augeas 26.82%

pointer-generator-transformer-inflection's Introduction

Pointer-Generator-Transformer-Inflection-2019

Transformer model and pointer-generator transformer for the morphological inflection task

MEDIUM RESOURCE TRAINING FILE - ENGLISH EXAMPLE

Data augmentation for dataset - python augment.py --src "data/english-train-medium" --out "data/english-train-medium-aug"

Create vocabulary for dataset - python vocabulary.py --src "data/english-train-medium" --vocab "data/english-train-medium-vocab"

Train model - python train.py
--train "data/english-train-medium" --dev "data/english-dev" --vocab "data/english-train-medium-vocab" checkpoints-dir "checkpoints" \ --batch-size 128 --epochs 200 --eval-every 1 --resume True
--arch transformer --embed-dim 64 --fcn-dim 256 --num-heads 4 --num-layers 2 --dropout 0.2 \ --lr 0.001 --beta2 0.98
--scheduler warmupinvsqr --patience 10 --min-lr 1e-5 --warmup-steps 4000

Generate Predictions with model - python generate.py
--model-checkpoint "checkpoints/model_best.pth"
--arch transformer --embed-dim 64 --fcn-dim 256 --num-heads 4 --num-layers 2 --dropout 0.2
--test "data/english-covered-test"
--vocab "data/english-train-medium-vocab"
--pred "data/english-test-pred-medium"

Compute accuracy of test set predictions - python evaluate.py
--pred "data/english-test-pred-medium" --target "data/english-test"

LOW RESOURCE TRAINING FILE - ENGLISH EXAMPLE

Data augmentation for dataset - python augment.py --src "data/english-train-low" --out "data/english-train-low-aug"

Create vocabulary for dataset - python vocabulary.py --src "data/english-train-low" --vocab "data/english-train-low-vocab"

Train model - python train.py
--train "data/english-train-low" --dev "data/english-dev" --vocab "data/english-train-low-vocab" checkpoints-dir "checkpoints" \ --batch-size 128 --epochs 200 --eval-every 1 --resume True
--arch transformer --embed-dim 64 --fcn-dim 256 --num-heads 4 --num-layers 2 --dropout 0.2 \ --lr 0.001 --beta2 0.98
--scheduler warmupinvsqr --patience 10 --min-lr 1e-5 --warmup-steps 4000

Generate Predictions with model - python generate.py
--model-checkpoint "checkpoints/model_best.pth"
--arch transformer --embed-dim 64 --fcn-dim 256 --num-heads 4 --num-layers 2 --dropout 0.2
--test "data/english-covered-test"
--vocab "data/english-train-low-vocab"
--pred "data/english-test-pred-low"

Compute accuracy of test set predictions - python evaluate.py
--pred "data/english-test-pred-low" --target "data/english-test"

pointer-generator-transformer-inflection's People

Contributors

assafsinger94 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.