Giter Club home page Giter Club logo

bna's Introduction

BNA Parser

parser_overall_img (2)

Requirements

  • python 3.7 or higher
  • To install all the dependency packages, please run:
pip install -r requirements.txt

Training

  • For Penn TreeBank (PTB)

without pre-trained model

python src/main.py train --num-layers 8 --model-path-base models/BNA --use-encoder --use-chars-lstm --use-bdmsa --use-nsa --batch-size 250 --learning-rate 0.0008

with pre-trained model

python src/main.py train --use-pretrained --model-path-base models/BNA_xlnet --use-encoder --use-bdmsa --use-nsa
  • For Chinese Penn TreeBank (CTB)

without pre-trained model

python src/main.py train --num-layers 8 --train-path "data/ctb_5.1/ctb.train" --dev-path "data/ctb_5.1/ctb.dev" --test-path "data/ctb_5.1/ctb.test" --text-processing "chinese" --use-chars-lstm --model-path-base models/BNA_chinese --ngram 3  --batch-size 250 --learning-rate 0.0008 --residual-drop 0.1 --morpho-emb-dropout 0.2 --attention-dropout 0.1 --relu-dropout 0.1 --use-tags --use-encoder --use-bdmsa --use-nsa

with pre-trained model

python src/main.py train --train-path "data/ctb_5.1/ctb.train" --dev-path "data/ctb_5.1/ctb.dev" --test-path "data/ctb_5.1/ctb.test" --text-processing "chinese" --use-pretrained --pretrained-model "bert-base-chinese" --model-path-base models/BNA_bert_chinese --learning-rate 3e-5 --ngram 3 --batch-size 50 --residual-drop 0.1 --morpho-emb-dropout 0.2 --attention-dropout 0.1 --relu-dropout 0.1 --use-tags --use-encoder --use-bdmsa --use-nsa

Test best-performing models

  • PTB
python src/main.py test --model-path models/BNA_xlnet
  • CTB
python src/main.py test --test-path "data/ctb_5.1/ctb.test" --text-processing "chinese" --model-path models/BNA_bert_chinese

bna's People

Contributors

tobesuperior avatar

Watchers

 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.