README
Implements a trigger-aware lattice neural network for event detection as a sequence labeling task, reproducing the EMNLP 2019 paper.
What this file does
Implements a trigger-aware lattice neural network for event detection as a sequence labeling task, reproducing the EMNLP 2019 paper.
When to use it
- You are reproducing the TLNN paper results
- You need a baseline for event detection on ACE2005 or KBP 2017
- You want to adapt a lattice-based model for sequence labeling
Assumes this stack
README
This is the source code of the EMNLP 2019 paper Event Detection with Trigger-Aware Lattice Neural Network . TLNN model aims to address the issues of trigger-word mismatch and trigger polysemy. In this project, the event detection is a sequence labeling task. For more information, please read the paper.

Requirements
-
Python 3.6
-
Pytorch 0.3.0
-
CUDA 0.9
-
Numpy
Datasets
Datasets in our paper is ACE2005 and KBP Eval 2017. According to terms of LDC, we can not share the data to the third party. But if you have LDC license, you can obtain the two datasets with the LDC numbers:
-
ACE 2005: LDC2006T06

-
KBP Eval 2017: LDC2017E55

Data Format
train/dev/test
The task is regarded as a sequence labeling task. The training, dev 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 line of each sentence is the document id corresponding to golden set.
for each word, the first column is the token, the second column is the character index, the last column is the tag of event type. For example:
sid:CTS20001223.1300.0809
歹 297 O
徒 298 O
抢 300 B-Conflict:Attack
得 301 O
实 302 O
在 303 O
Pretrained Character embedding
One character per line. For each line, the first column is the character, the rest columns is the value of the embedding of the character.
Pretrained Sense (Chars & Words) embedding
Similar to character embedding but for word senses. For example:
苹果#1 0.304095 ...
苹果#2 -0.175496 ...
香蕉 -0.230772 ...
where Word#n means that it is the n-th sense of word A, The pretrained word senses embedding could be obtained by SAT.
Sense map
Records all senses for each polysemous word, corresponding to the word sense embedding. One word per line, for each line, the first column is the word, and the rest columns are all the senses of it ( if exits ). For example:
苹果 苹果#1 苹果#2
香蕉
test.golden.dat
Recodes the answer of all triggers with location and event types for evaluations. One trigger per line, the columns are doucment id, start index of character, trigger word length, trigger word and event type. For example:
CTV20001227.1330.0447 57 2 宣判 Justice:Sentence
CTV20001227.1330.0447 131 2 判处 Justice:Sentence
CTV20001227.1330.0447 110 2 判处 Justice:Sentence
CTV20001227.1330.0447 51 2 上诉 Justice:Appeal
CTV20001227.1330.0447 288 2 上诉 Justice:Appeal
How to Run
Arguments of the code are set in config.py, which contains
status = 'train' Status of the program
savemodel = 'data/model/test' Path of the saved model
savedset = 'data/model/test.dset' Path of the saved data settings
TRAIN = 'trainid_BIO.txt' Path of the training data
dev = 'devid_BIO.txt' Path of the dev data
test = "testchrid_BIO.txt" Path of the test data
loadmodel = 'data/model/test.model' Path of the model to load
output = 'data/test.output' Path of the output
lr = 0.015 Learning rate
maxlen = 300 Max length of each sequence
dataset = 'ace' Dataset name
pretrain_char_emb = 'char.vec' Pre-trained character embeddings
pretrain_sense_emb = 'sense.vec' Pre-trained sense embeddings
pretrain_word_emb = 'word.vec' Pre-trained word embeddings
With appropriate data settings, you could run the code with:
python train.py
Citation
@inproceedings{ding2019event,
title={Event Detection with Trigger-Aware Lattice Neural Network},
author={Ding, Ning and Li, Ziran and Liu, Zhiyuan and Zheng, Haitao and Lin, Zibo},
booktitle={Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)},
pages={347--356},
year={2019}
}
Contact
For any questions, please contact:
What's inside
6 sections: requirements, datasets, data format (5 file types), run instructions, config.py arguments, citation
Change this for your project
- Replace
'trainid_BIO.txt'with your own training data path - Replace
'char.vec'with your own pretrained character embedding file - Replace
'sense.vec'with your own pretrained sense embedding file - Replace
'word.vec'with your own pretrained word embedding file
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Uses a config.py file to centralize all hyperparameters and paths
- Defines a golden test file format separate from the BIO-annotated data for evaluation
Related Documents
📈 Trading RAG Mentor
Answers trading questions using your own video transcripts via a RAG pipeline with ChromaDB, LangChain, and a choice of Groq or Ollama LLMs.
AI Tester Interview Preparation Guide
Prepares candidates for an AI Tester interview focused on LLM, API, and automation testing in the pharmaceutical industry.
AWS Certified Generative AI Developer – Professional (AIP-C01)
Provides study notes and prep guidance for the AWS Certified Generative AI Developer, Professional (AIP-C01) exam, including exam style, prerequisites, and service summaries.
IR-Copilot — Incident Response AI Assistant
Serves as a reference implementation for an agentic RAG system with multi-tenant chat, document ingestion, hybrid search, and subagent delegation.