Giter Site home page Giter Site logo

adaxry / gcdt Goto Github PK

View Code? Open in Web Editor NEW
68.0 4.0 15.0 1.63 MB

Code for the paper: GCDT: A Global Context Enhanced Deep Transition Architecture for Sequence Labeling

License: BSD 3-Clause "New" or "Revised" License

Perl 1.06% PLSQL 76.91% C 0.01% CWeb 14.20% Python 7.69% Shell 0.12%

gcdt's Introduction

GCDT: A Global Context Enhanced Deep Transition Architecture for Sequence Labeling

Contents

Introduction

The code of our proposed GCDT, which deepens the state transition path at each position in a sentence, and further assign every token with a global representation learned from the entire sentence. [paper]. The implementation is based on THUMT.

Usage

  • Trim Glove
sh trim_glove.sh path_to_glove

path_to_glove is the path of your decompressed Glove embedding.

  • Training
sh train.sh task_name

task_name is the name of tasks between ner and chunking.

  • Evaluation and Testing
sh test.sh task_name test_type

Set test_type to testa for evaluation and testb for testing. Please note there is no evaluation set for the chunking task.

Requirements

  • tensorflow 1.12
  • python 3.5

Citation

Please cite the following paper if you use the code:

@InProceedings{Liu:19,
  author    = {Yijin Liu, Fandong Meng, Jinchao Zhang, Jinan Xu, Yufeng Chen and Jie Zhou},
  title     = {GCDT: A Global Context Enhanced Deep Transition Architecture for Sequence Labeling},
  booktitle = {Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics},
  year      = {2019}
}

FAQ

  • Why not evaluate along with training?

    For training efficiency, we firstly train a model for specified steps, and restore checkpoints for evaluation and testing. For the CoNLL03, we compute the score on the test set at the best-performing checkpoints on the evaluation set. For the CoNLL2000, we compute the score on the test set directly.

  • How to get BERT embeddings?

    We provide a simple tool to gennerate the BERT embedding for sequence labeling tasks. And then assign bert_emb_path with correct path and set use_bert to True in train.sh.

gcdt's People

Contributors

adaxry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gcdt's Issues

Why do you choose this kind of GRU variants, instead of LSTM?

Hi~

I tried a similar architecture, with all your GRU variants replaced with standard LSTMs/BiLSTM, and it reached 91.96 (compared with your model in Figure 1, w/o BERT) on CoNLL 2003 NER task.

Yes, I know you mentioned this kind of thing in Section 1,

While in BiLSTMs, even stacked BiLSTMs, the transition depth between consecutive hidden states are inherently shallow

But I don't know what do you mean by transition depth and how do you measure it? Could you give me more details about this? And have you tried LSTM before? If yes, could you please show me your experimental results? If no, could you explain why you need to design this kind of GRU variants?

Thanks~

Let's beat the state of the art on NER once again!

Hi Adaxry!

You have used BERT large which at the time was the state of the art pre trained transformer.
But nowadays is had been succeeded by XLnet which is a major improvement.
Very often switching from BERT large to XLnet large give multiple percents accuracy gains "for free"!

https://paperswithcode.com/paper/xlnet-generalized-autoregressive-pretraining
You could either use the official implementation (not actively maintained) or the one maintained by tensorflow.
But I believe the most actively maintained is
https://github.com/huggingface/transformers which allow you through the same API to switch to another transformer easily.

I and Humanity really needs more accurate named entity recognition! :m

您好。请问Conll03的testb测试结果里,某些句子会出现Predict标签数和Gold标签数不一致,会是什么原因呢?

我试用了GCDT代码,训练了5个模型,有3个模型会出现预测标签缺失的情况(bad data生成,样例如下)。
打印了预测值的输出,发现模型的预测值提前生成了标签,导致预测值的输出被截断。
这是什么原因呢?可以修复吗?


原文: ['Pace', 'outdistanced', 'three', 'senior', 'finalists', '--', 'Virginia', 'Tech', 'defensive', 'end', 'Cornell', 'Brown', ',', 'Arizona', 'State', 'offensive', 'tackle', 'Juan', 'Roque', 'and', 'defensive', 'end', 'Jared', 'Tomich', 'of', 'Nebraska', '.']

Gold: ['S-PER', 'O', 'O', 'O', 'O', 'O', 'B-ORG', 'E-ORG', 'O', 'O', 'B-PER', 'E-PER', 'O', 'B-ORG', 'E-ORG', 'O', 'O', 'B-PER', 'E-PER', 'O', 'O', 'O', 'B-PER', 'E-PER', 'O', 'S-ORG', 'O']
Gold token数:27

Predicted:['S-PER', 'O', 'O', 'O', 'O', 'O', 'B-ORG', 'E-ORG', 'O']
Predicted token数:9

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.