All Projects → Hanlard → Transformer Based Pretrained Model For Event Extraction

Hanlard / Transformer Based Pretrained Model For Event Extraction

使用基于Transformer的预训练模型在ACE2005数据集上进行事件抽取任务

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Transformer Based Pretrained Model For Event Extraction

Transformer Dynet
An Implementation of Transformer (Attention Is All You Need) in DyNet
Stars: ✭ 57 (-35.23%)
Mutual labels:  transformer
Presento
Presento - Transformer & Presenter Package for PHP
Stars: ✭ 71 (-19.32%)
Mutual labels:  transformer
Awesome Typescript Ecosystem
😎 A list of awesome TypeScript transformers, plugins, handbooks, etc
Stars: ✭ 79 (-10.23%)
Mutual labels:  transformer
Deeplearning Nlp Models
A small, interpretable codebase containing the re-implementation of a few "deep" NLP models in PyTorch. Colab notebooks to run with GPUs. Models: word2vec, CNNs, transformer, gpt.
Stars: ✭ 64 (-27.27%)
Mutual labels:  transformer
Mixture Of Experts
A Pytorch implementation of Sparsely-Gated Mixture of Experts, for massively increasing the parameter count of language models
Stars: ✭ 68 (-22.73%)
Mutual labels:  transformer
Dialogpt
Large-scale pretraining for dialogue
Stars: ✭ 1,177 (+1237.5%)
Mutual labels:  transformer
Vietnamese Electra
Electra pre-trained model using Vietnamese corpus
Stars: ✭ 55 (-37.5%)
Mutual labels:  transformer
Typescript Transform Macros
Typescript Transform Macros
Stars: ✭ 85 (-3.41%)
Mutual labels:  transformer
Openasr
A pytorch based end2end speech recognition system.
Stars: ✭ 69 (-21.59%)
Mutual labels:  transformer
Multimodal Toolkit
Multimodal model for text and tabular data with HuggingFace transformers as building block for text data
Stars: ✭ 78 (-11.36%)
Mutual labels:  transformer
Gpt2
PyTorch Implementation of OpenAI GPT-2
Stars: ✭ 64 (-27.27%)
Mutual labels:  transformer
Kaggle Quora Insincere Questions Classification
Kaggle新赛(baseline)-基于BERT的fine-tuning方案+基于tensor2tensor的Transformer Encoder方案
Stars: ✭ 66 (-25%)
Mutual labels:  transformer
Nlp Tutorial
Natural Language Processing Tutorial for Deep Learning Researchers
Stars: ✭ 9,895 (+11144.32%)
Mutual labels:  transformer
Viewpagertransformer
Viewpager动画,包括渐变,旋转,缩放,3D,立方体等多种酷炫效果动画,实现原理是自定义ViewpagerTransformer,当然你也可以自定义多种动画
Stars: ✭ 62 (-29.55%)
Mutual labels:  transformer
Transformers without tears
Transformers without Tears: Improving the Normalization of Self-Attention
Stars: ✭ 80 (-9.09%)
Mutual labels:  transformer
Laravel Graphql
GraphQL implementation with power of Laravel
Stars: ✭ 56 (-36.36%)
Mutual labels:  transformer
Se3 Transformer Pytorch
Implementation of SE3-Transformers for Equivariant Self-Attention, in Pytorch. This specific repository is geared towards integration with eventual Alphafold2 replication.
Stars: ✭ 73 (-17.05%)
Mutual labels:  transformer
Pytorch Openai Transformer Lm
🐥A PyTorch implementation of OpenAI's finetuned transformer language model with a script to import the weights pre-trained by OpenAI
Stars: ✭ 1,268 (+1340.91%)
Mutual labels:  transformer
Gpt2 Chitchat
GPT2 for Chinese chitchat/用于中文闲聊的GPT2模型(实现了DialoGPT的MMI思想)
Stars: ✭ 1,230 (+1297.73%)
Mutual labels:  transformer
Distre
[ACL 19] Fine-tuning Pre-Trained Transformer Language Models to Distantly Supervised Relation Extraction
Stars: ✭ 75 (-14.77%)
Mutual labels:  transformer

Transformer-based-pretrained-model-for-event-extraction

使用BERT/OpenAI-GPT2/ALBERT/XLM/Roberta/XLNet/Ctrl/DistilBert/TransfoXL等预训练语言模型在ace2005数据集上进行事件抽取任务。

代码在nlpcl-lab / bert-event-extraction框架上修改,使用transformers包和CRF模型替换了原项目的模型构建部分。

模型整体采用序列标注的方式,未使用任何辅助信息。 先用crf做触发词识别,再根据触发词识别结果再用crf进行论元识别。

预训练模型选用xlm-roberta-large时,trigger-f1=0.72; argument-f1=0.45。argument提升了0.05。

说明:当前是按照一个事件类型使用一个CRF进行识别论元,这会造成一定程度的数据稀疏问题,可以在consts.py中修改,将多种事件类型合并为一个CRF识别

trigger classification

P=0.677 R=0.754 F1=0.713

argument classification

P=0.588 R=0.384 F1=0.464

trigger identification

P=0.723 R=0.805 F1=0.762

argument identification

P=0.617 R=0.403 F1=0.488

超参如下

==================== 超参 ====================

可选预训练模型:

PreTrainModel = ['Bert_large', 'Gpt', 'Gpt2', 'Ctrl', 'TransfoXL',

'Xlnet_base', 'Xlnet_large', 'XLM', 'DistilBert_base', 'DistilBert_large',

'Roberta_base', 'Roberta_large', 'XLMRoberta_base', 'XLMRoberta_large',

'ALBERT-base-v1', 'ALBERT-large-v1', 'ALBERT-xlarge-v1', 'ALBERT-xxlarge-v1',

'ALBERT-base-v2', 'ALBERT-large-v2', 'ALBERT-xlarge-v2', 'ALBERT-xxlarge-v2']

       early_stop = 5
               lr = 1e-05
               l2 = 1e-05
         n_epochs = 50
           logdir = logdir
         trainset = data/train.json
           devset = data/dev.json
          testset = data/test.json
       LOSS_alpha = 1.0        
   PreTrain_Model = XLMRoberta_large
       model_path = /Transformer-based-pretrained-model-for-event-extraction-master/save_model/latest_model.pt
       batch_size = 16

运行

  1. 在LDC网站获取ACE2005数据集,企业和学校购买后方可获取(LDC2006T06): https://catalog.ldc.upenn.edu/byyear#2005

  2. 按照 https://github.com/nlpcl-lab/ace2005-preprocessing 的方法,将ACE2005数据处理为json格式的train/dev/test后放入\data文件夹,处理后的格式应该和\data中sample.json一致

  3. 安装依赖环境

  4. 训练评估:python DataLoadAndTrain.py --LOSS_alpha=1 --lr=1e-5 --l2=1e-5 --early_stop=5 --PreTrain_Model="XLMRoberta_large" --batch_size=16

我的邮箱:[email protected]

我的知乎主页:https://www.zhihu.com/people/zhang-han-32-13-81

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