RepositoryPythonUSUnited States
INK-USC

INK-USC/TriggerNER

TriggerNER: Learning with Entity Triggers as Explanations for Named Entity Recognition (ACL 2020)

170stars
18forks
1issues
2views

TriggerNER

Code & Data for ACL 2020 paper:

TriggerNER: Learning with Entity Triggers as Explanations for Named Entity Recognition

Authors: Bill Yuchen Lin*, Dong-Ho Lee*, Ming Shen, Ryan Moreno, Xiao Huang, Prashant Shiralkar, Xiang Ren

We introduce entity triggers, an effective proxy of human explanations for facilitating label-efficient learning of NER models. We crowd-sourced 14k entity triggers for two well-studied NER datasets. Our proposed model, name Trigger Matching Network, jointly learns trigger representations and soft matching module with self-attention such that can generalize to unseen sentences easily for tagging. Expriments show that the framework is significantly more cost-effective such that usinng 20% of the trigger-annotated sentences can result in a comparable performance of conventional supervised approaches using 70% training data.

If you make use of this code or the entity triggers in your work, please kindly cite the following paper:

@inproceedings{TriggerNER2020,
  title={TriggerNER: Learning with Entity Triggers as Explanations for Named Entity Recognition},
  author={Bill Yuchen Lin and Dong-Ho Lee and Ming Shen and Ryan Moreno and Xiao Huang  and Prashant Shiralkar and Xiang Ren}, 
  booktitle={Proceedings of ACL},
  year={2020}
}

Trigger Dataset

The concept of entity triggers, a novel form of explanatory annotation for named entity recognition problems.
We crowd-source and publicly release 14k annotated entity triggers on two popular datasets: CoNLL03 (generic domain), BC5CDR (biomedical domain).

dataset/ saves CONLL, BC5CDR, and Laptop-Reviews dataset. For each directory,

  • train.txt, test.txt, dev.txt are original dataset
  • train_20.txt is for cutting out the original train dataset into 20% for baseline setting. The dataset is used in naive.py
  • trigger_20.txt is trigger dataset. The dataset is used in supervised.py and semi_supervised.py.

To enable 3% of original training dataset, you should use --percentage 15 since the dataset we used for supervised.py and semi_supervised.py is 20% of original training data with triggers.

Requirements

Python >= 3.6 and PyTorch >= 0.4.1

python -m pip install -r requirements.txt

Train and Test

  • Train/Test Baseline (Bi-LSTM / CRF with 20 % of training dataset) :
python naive.py --dataset CONLL
python naive.py --dataset BC5CDR
  • Train/Test Trigger Matching Network in supervised setting :
python supervised.py --dataset CONLL
python supervised.py --dataset BC5CDR
  • Train/Test Trigger Matching Network in semi-supervised setting (self-training) :
python semi_supervised.py --dataset CONLL
python semi_supervised.py --dataset BC5CDR

Our code is based on https://github.com/allanj/pytorch_lstmcrf.

INK Lab at USC

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
zjunlp/DeepKE

[EMNLP 2022] An Open Toolkit for Knowledge Graph Extraction and Construction

4.5k
Jul 13, 2026
RepositoryPython
public-apis/public-apis

A collective list of free APIs

502.6k
Nov 30, 2026
RepositoryPython
urchade/GLiNER

Generalist and Lightweight Model for Named Entity Recognition (Extract any entity types from texts)

4.3k
Nov 11, 2026
RepositoryPython
juand-r/entity-recognition-datasets

A collection of corpora for named entity recognition (NER) and entity recognition tasks. These annotated datasets cover a variety of languages, domains and entity types.

1.6k
Jul 2, 2026
RepositoryPython
lemonhu/NER-BERT-pytorch

PyTorch solution of named entity recognition task Using Google AI's pre-trained BERT model.

445
Mar 30, 2023
Modeltext-generation
XingChen-AGI/Xing4.0-29B-Intent

Xing4.0-29B-Intent 🦉 GitHub • 🤗 Hugging Face • 🤖 ModelScope • 🪐 Modelers • 📚 Dataset For full project documentation, deployment instructions, SDK usage, and data details, visit the GitHub repository(https://github.com/XingChen-AGI/Xing4.0-29B-In...

♥0
2.2k
Nov 18, 2026
Repository
gkiril/oie-resources

A curated list of Open Information Extraction (OIE) resources: papers, code, data, etc.

509
Oct 25, 2022
Repository
guhhhhaa/wula-scifi

chinese NLP corpus of chinese science fiction, chinese science fiction corpus: Archive of the Ark Plan of Ula Science Fiction Website 乌拉科幻小说网方舟计划存档,中文科幻小说自然语言处理语料库,中文科幻小说文本语料库,中文科幻小说文本数据库,科幻小说语料

141
Oct 22, 2022
Repository
AndyTheFactory/romanian-nlp-datasets

A list of Romanian NLP Datasets

63
Sep 21, 2026