# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-02-07 20:45 from bertsota.parser.dep_parser import DepParser parser = DepParser() save_dir = 'data/model/ctb-debug' parser.train( train_file='data/ctb5/train.conll', dev_file='data/ctb5/dev.conll', save_dir=save_dir, word_dims=300, # tag_dims=300, # interpolation=0.2, pretrained_embeddings_file='data/embedding/ctb.fasttext.300.txt', root='ROOT') parser.load(save_dir) parser.evaluate('data/ctb5/test.conll', save_dir)
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-02-07 20:45 from bertsota.parser.dep_parser import DepParser parser = DepParser() save_dir = 'data/model/ptb-bert-auto4' parser.train( train_file='data/ptb-dep/train.auto.conllx', dev_file='data/ptb-dep/dev.auto.conllx', save_dir=save_dir, pretrained_embeddings_file='data/embedding/glove/glove.6B.100d.txt', bert_path=[ 'data/embedding/bert_base_sum/ptb.dep.train.bert', 'data/embedding/bert_base_sum/ptb.dep.dev.bert' ], root='root') parser.load(save_dir) parser.evaluate('data/ptb-dep/test.auto.conllx', save_dir, bert_path='data/embedding/bert_base_sum/ptb.dep.test.bert')
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-02-07 20:45 from bertsota.parser.dep_parser import DepParser parser = DepParser() save_dir = 'data/model/ptb-baseline-auto3' parser.train( train_file='data/ptb-dep/train.auto.conllx', dev_file='data/ptb-dep/dev.auto.conllx', save_dir=save_dir, pretrained_embeddings_file='data/embedding/glove/glove.6B.100d.txt', root='root') parser.load(save_dir) parser.evaluate('data/ptb-dep/test.auto.conllx', save_dir)
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-02-07 20:45 from bertsota.parser.dep_parser import DepParser parser = DepParser() save_dir = 'data/model/ctb-bert-notag' parser.train(train_file='data/ctb/train.conllx', dev_file='data/ctb/dev.conllx', save_dir=save_dir, word_dims=300, tag_dims=0, pretrained_embeddings_file='data/embedding/ctb.fasttext.300.txt', bert_path=[ 'data/embedding/bert_base_sum/ctb.train.bert', 'data/embedding/bert_base_sum/ctb.dev.bert' ], root='ROOT') parser.load(save_dir) parser.evaluate('data/ctb/test.conllx', save_dir, bert_path='data/embedding/bert_base_sum/ctb.test.bert')
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-02-07 20:45 from bertsota.parser.dep_parser import DepParser parser = DepParser() save_dir = 'data/model/ctb-old' parser.train( train_file='data/ctb5.1-dep/train.conllx', dev_file='data/ctb5.1-dep/dev.conllx', save_dir=save_dir, word_dims=300, # interpolation=0.2, pretrained_embeddings_file='data/embedding/ctb.fasttext.300.txt', root='ROOT') parser.load(save_dir) parser.evaluate('data/ctb5.1-dep/test.conllx', save_dir)