Git Product home page Git Product logo

nbtngma4ed's Introduction

NBTNGMA4ED

This is the source code for the paper ''Collective Event Detection via a Hierarchical and Bias Tagging Networks with Gated Multi-level Attention Mechanisms'' accepted by EMNLP2018.

Requirements

Usage

Download datasets

The ACE 2005 dataset can be download from:https://catalog.ldc.upenn.edu/LDC2006T06

Default parameters:

  • batch size: 20
  • gradient clip: 5
  • embedding size: 100
  • optimizer: Adam
  • dropout rate: 0.5
  • learning rate: 0.001
  • seg_dim: 20,
  • subtype_dim: 20,
  • num_steps: 40,
  • lstm_dim1: 100
  • lstm_dim2: 100
  • seq_size: 8
  • alpha: 5

Document

  • doc_data: train\test\dev data
  • doc_dict: document information and its corresponding ID
  • 100.utf8: pretrained word embedding
  • doc_id: document id of train\test\dev data

Data format

The training and test data is expected in standard tab-separated format. One word per line, separate column for token and label, empty line between sentences. The first column is assumed to be the token and the last column is the label. The second column is the current document ID.The third column is the type of the entity. The fourth column is the entity subtyp of the entity. For example:

by CNN_IP_20030405.1600.01-1 O O O
coalition CNN_IP_20030405.1600.01-1 B-1_GPE B-2_Nation O
air CNN_IP_20030405.1600.01-1 O O B-Conflict_Attack
strikes CNN_IP_20030405.1600.01-1 O O I-Conflict_Attack

Train and test the model

  • $ train - python3 main.py --train=True
  • $ test - python3 main.py --train=False

Citation

If you use the code, please cite this paper:

Yubo Chen, Hang Yang, Kang Liu, Jun Zhao, Yantao Jia. Collective Event Detection via a Hierarchical and Bias Tagging Networks with Gated Multi-level Attention Mechanisms. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP2018).

nbtngma4ed's People

Contributors

yanghang111 avatar yubochen 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

Watchers

 avatar  avatar  avatar  avatar

nbtngma4ed's Issues

Question about max length of sentence

Thank you very much for your open-sourced code. I noticed that you set the max length of sentence to 40 by cutting sentences longer than 40 as follows:

class BatchManager(object):

Is the comparison fair considering many sentences are longer than 40? For example, the longest sentence in train/dev/test contains 228/154/84 tokens respectively. The triggers are also dropped and not counted when calculating F1.

Thank you and look forward to your reply.

Could you tell me how is TLSTM2 implemented?

There is only one deconder function in the model.py and the tag_attention function is commented out...It seems like the deconder function is the TLSTM1...So, how is the TLSTM2 implemented?

lstm decoder : dimension must be equal

If i'm using tensorflow-gpu 1.8.0, the other issue I raised (concerning AUTO_REUSE) doesn't appear.
Yet I have another error in lstm_decoder():
ValueError: Dimensions must be equal, but are 740 and 640 for 'LSTMD/basic_lstm_cell/MatMul' (op: 'MatMul') with input shapes: [?,740], [640,400].

It occurs at
(cell_output, (c_state, h_state)) = lstm_cell(lstm_outputs[:, time_step, :], (c_state, h_state))
because it's expecting h_state to be of dimension (?,100) but it is in fact of dimension (?,200) because of the concatenation with the previous prediction at the preceding line
h_state = tf.concat([h_state, tag_pre], -1) # (?, 200)

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.