All Projects → NLPInBLCU → BiaffineDependencyParsing

NLPInBLCU / BiaffineDependencyParsing

Licence: MIT license
BERT+Self-attention Encoder ; Biaffine Decoder ; Pytorch Implement

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to BiaffineDependencyParsing

syntaxdot
Neural syntax annotator, supporting sequence labeling, lemmatization, and dependency parsing.
Stars: ✭ 32 (-52.24%)
Mutual labels:  bert, dependency-parsing
sticker2
Further developed as SyntaxDot: https://github.com/tensordot/syntaxdot
Stars: ✭ 14 (-79.1%)
Mutual labels:  bert, dependency-parsing
ERNIE-text-classification-pytorch
This repo contains a PyTorch implementation of a pretrained ERNIE model for text classification.
Stars: ✭ 49 (-26.87%)
Mutual labels:  bert
BERT-chinese-text-classification-pytorch
This repo contains a PyTorch implementation of a pretrained BERT model for text classification.
Stars: ✭ 92 (+37.31%)
Mutual labels:  bert
bert extension tf
BERT Extension in TensorFlow
Stars: ✭ 29 (-56.72%)
Mutual labels:  bert
AliceMind
ALIbaba's Collection of Encoder-decoders from MinD (Machine IntelligeNce of Damo) Lab
Stars: ✭ 1,479 (+2107.46%)
Mutual labels:  bert
rasa-bert-finetune
支持rasa-nlu 的bert finetune
Stars: ✭ 46 (-31.34%)
Mutual labels:  bert
sister
SImple SenTence EmbeddeR
Stars: ✭ 66 (-1.49%)
Mutual labels:  bert
BERT-QE
Code and resources for the paper "BERT-QE: Contextualized Query Expansion for Document Re-ranking".
Stars: ✭ 43 (-35.82%)
Mutual labels:  bert
datagrand bert
2019达观杯信息提取第5名代码
Stars: ✭ 20 (-70.15%)
Mutual labels:  bert
TabFormer
Code & Data for "Tabular Transformers for Modeling Multivariate Time Series" (ICASSP, 2021)
Stars: ✭ 209 (+211.94%)
Mutual labels:  bert
beir
A Heterogeneous Benchmark for Information Retrieval. Easy to use, evaluate your models across 15+ diverse IR datasets.
Stars: ✭ 738 (+1001.49%)
Mutual labels:  bert
LAMB Optimizer TF
LAMB Optimizer for Large Batch Training (TensorFlow version)
Stars: ✭ 119 (+77.61%)
Mutual labels:  bert
R-AT
Regularized Adversarial Training
Stars: ✭ 19 (-71.64%)
Mutual labels:  bert
embedding study
中文预训练模型生成字向量学习,测试BERT,ELMO的中文效果
Stars: ✭ 94 (+40.3%)
Mutual labels:  bert
korpatbert
특허분야 특화된 한국어 AI언어모델 KorPatBERT
Stars: ✭ 48 (-28.36%)
Mutual labels:  bert
les-military-mrc-rank7
莱斯杯:全国第二届“军事智能机器阅读”挑战赛 - Rank7 解决方案
Stars: ✭ 37 (-44.78%)
Mutual labels:  bert
bert attn viz
Visualize BERT's self-attention layers on text classification tasks
Stars: ✭ 41 (-38.81%)
Mutual labels:  bert
GEANet-BioMed-Event-Extraction
Code for the paper Biomedical Event Extraction with Hierarchical Knowledge Graphs
Stars: ✭ 52 (-22.39%)
Mutual labels:  bert
CheXbert
Combining Automatic Labelers and Expert Annotations for Accurate Radiology Report Labeling Using BERT
Stars: ✭ 51 (-23.88%)
Mutual labels:  bert

BiaffineDependencyParsing

BERT+Transformer+Biaffine dependency parser

Update

[2020-04-23] 修复数据加载中一个bug,在use_cache=True时可大幅度缩短数据加载准备耗时

Result

metrics

以上结果均为在Semeval-2016-Test集上测试得到的LAS

详细结果见: metrics记录

Semeval-2016 Task9数据集

原始评测数据集:HIT-SCIR/SemEval-2016: SemEval-2016 Task 9: Chinese Semantic Dependency Parsing

原始数据集格式不符合conllu格式,你也可以使用我们处理过后的数据集,或者使用脚本自己处理

数据集处理完成之后需要在yaml配置文件中写入,例如:

data_set:

data_dir: 'dataset/sem16'

train_file: 'train/text_news.train.conllu'

dev_file: 'dev/sdp_news_dev.conllu'

test_file: 'test/sdp_news_test.conllu'

同时根据数据集的相关信息合理设置per_gpu_train_batch_sizemax_seq_len等参数

使用

训练Train

查看帮助信息:python main.py train -h

CUDA_VISIBLE_DEVICES=0,1,2,3 python main.py train -c config_files/bert_biaffine.yaml

torch.distributed 分布式训练

distributedDataParallel VS dataParallel

当GPU卡数较多或数据量较大(或者max_seq_len较大时),推荐使用torch.distributed训练

CUDA_VISIBLE_DEVICES=0,1,2,3,5,6 python -m torch.distributed.launch --nproc_per_node=6 main.py -c config_files/bert_biaffine.yaml

验证Dev

查看帮助信息:python main.py dev -h

CUDA_VISIBLE_DEVICES=0 python main.py dev -m <模型保存路径> -i <输入gold conllu文件> -o <输出文件>

推理Inference

查看帮助信息:python main.py infer -h

CUDA_VISIBLE_DEVICES=0 python main.py infer -m <模型保存路径> -i <输入conllu文件> -o <输出文件>

References

[1] Ding, Y., Shao, Y., Che, W., Liu, T., 2014. Dependency Graph Based Chinese Semantic Parsing, in: Sun, M., Liu, Y., Zhao, J. (Eds.), Chinese Computational Linguistics and Natural Language Processing Based on Naturally Annotated Big Data, Lecture Notes in Computer Science. Springer International Publishing, Cham, pp. 58–69. https://doi.org/10.1007/978-3-319-12277-9_6

[2] Wang, Y., Che, W., Guo, J., Liu, T., 2018. A Neural Transition-Based Approach for Semantic Dependency Graph Parsing, in: AAAI.

[3] Dozat, T., Manning, C.D., 2018. Simpler but More Accurate Semantic Dependency Parsing, in: Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). Presented at the ACL 2018, Association for Computational Linguistics, Melbourne, Australia, pp. 484–490. https://doi.org/10.18653/v1/P18-2077

[4] Li, Y., Li, Z., Zhang, M., Wang, R., Li, S., Si, L., 2019. Self-attentive biaffine dependency parsing, in: IJCAI International Joint Conference on Artificial Intelligence. pp. 5067–5073. https://doi.org/10.24963/ijcai.2019/704

[5] Kondratyuk, D., Straka, M., 2019. 75 Languages, 1 Model: Parsing Universal Dependencies Universally. pp. 2779–2795. https://doi.org/10.18653/v1/d19-1279

相关项目:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].