Fine Grained Named Entity Recognition

Last updated on Mar 15, 2021

Fine Grained Named Entity Recognition

Parameters 101 Million
Encoder Layers 2
File Size 359.07 MB
Training Data OntoNotes 5.0
Training Resources
Training Time

Architecture CRF, Convolution, Dropout, ELMo, Feedforward Network, Highway Layer, LSTM, Linear Layer, Tanh, Variational Dropout
LR 0.001
Epochs 30
Dropout 0.5
Batch Size 64
Encoder Type stacked_bidirectional_lstm
Encoder Layers 2
Encoder Input Size 1202
Encoder Hidden Size 200
SHOW MORE
SHOW LESS
README.md

Summary

This model identifies a broad range of 16 semantic types in the input text. It is a reimplementation of Lample (2016) and uses a biLSTM with a CRF layer, character embeddings and ELMo embeddings.

Explore live Named Entity Recognition demo at AllenNLP.

How do I load this model?

from allennlp_models.pretrained import load_predictor
predictor = load_predictor("tagging-fine-grained-crf-tagger")

Getting predictions

sentence = "Jobs and Wozniak cofounded Apple in 1976."
preds = predictor.predict(sentence)
for word, tag in zip(preds["words"], preds["tags"]):
    print(word, tag)
# prints:
# Jobs O
# and O
# Wozniak U-PERSON
# cofounded O
# Apple U-ORG
# in O
# 1976 U-DATE
# . O

You can also get predictions using allennlp command line interface:

echo '{"sentence": "Jobs and Wozniak cofounded Apple in 1976."}' | \
    allennlp predict https://storage.googleapis.com/allennlp-public-models/fine-grained-ner.2021-02-11.tar.gz -

How do I evaluate this model?

To evaluate the model on Ontonotes 5.0 run:

allennlp evaluate https://storage.googleapis.com/allennlp-public-models/fine-grained-ner.2021-02-11.tar.gz \
    /path/to/dataset

How do I train this model?

To train this model you can use allennlp CLI tool and the configuration file fine-grained-ner.jsonnet:

allennlp train fine-grained-ner.jsonnet -s output_dir

See the AllenNLP Training and prediction guide for more details.

Citation

@article{Lample2016NeuralAF,
 author = {Guillaume Lample and Miguel Ballesteros and Sandeep Subramanian and K. Kawakami and Chris Dyer},
 journal = {ArXiv},
 title = {Neural Architectures for Named Entity Recognition},
 volume = {abs/1603.01360},
 year = {2016}
}

Results

Named Entity Recognition on Ontonotes v5 (English)

Named Entity Recognition
BENCHMARK MODEL METRIC NAME METRIC VALUE GLOBAL RANK
Ontonotes v5 (English) Fine Grained Named Entity Recognition F1 88 # 1