tutorials

Named entities

Overview

This lesson provides an introduction to named entities (NEs).

Outcomes

  • identify types of named entities
  • identify two popular tagging formats for named entity labels

Background

What is a named entity?

A named entity (NE) is a textual mention that has a unique/individual identity (ex. "Danny DeVito" but not "actors").

Commonplace examples include mentions of …

  • people

  • Dio Brando, Inigo Montoya, etc.

  • locations

  • Tucson, AZ, Hogwarts, etc.

  • organizations

  • OpenAI, University of Arizona, etc.

  • products

  • RTX Titan, Subaru Forester, etc.

  • Geopolitical entities (GPE)

  • "The White House announced that …"

Other examples include …

  • medical codes1

  • time expressions

  • January, 2020, etc.

  • numerical expressions

  • prices, measurements, etc.

  • $10.99, 23 kg, etc.

Often in the literature, named entities will simply be referred to as entities.

What constitutes a named entity depends on the domain of interest. For example, if you're wanting to identify entities relevant to the biomedical literature, you may wish to include things such as …

  • disease names
  • SARS-CoV-2, melanoma, etc.
  • viruses
  • COVID-19, H1N1, etc.
  • proteins and genes
  • HRAS, FOXP2, etc.

The task of identitifying named entities is known as named entity recognition.

Where are named entities used?

Named entity recognition is a subtask of information extraction called entity extraction. Entity extraction has applications in …

  • question answering
  • "Who was the 16th president of the United States?"
  • content recommendation
  • People who read x tend to enjoy y
  • document summarization
  • who, when, where, what, etc.

… and many other tasks that involve some form of information extraction (chat bots)

Tagging formats for name entities

If you want to develop a named entity recognizer for a new domain, you will likely need to gather and annotate data.

There are a few common tagging formats for entities. Here we'll look at the two most popular formats …

IOB

The Inside-Outside-Beginning (IOB) tagging format is designed to handle multiword entities:

Each entity type serves as a label and is prepended with either B or I depending on whether it starts a mention or continues a mention. If a token is not any kind of an entity, it is assigned the label O:

Vincent van Gogh was born in the Netherlands
B-PER I-PER I-PER O O O O B-LOC

Notes

  • PER in the example refers to a mention of a person (PERSON).
  • LOC in the example refers to a mention of a location (LOCATION).

One variation of the IOB format adds an additional label E for the end of some entity mention:

Vincent van Gogh was born in the Netherlands
B-PER I-PER E-PER O O O O B-LOC

Basic

There is a simpler, alternative format to IOB that is sometimes encountered where just the entity label is used without any prefix and O for non-entities:

Vincent van Gogh was born in the Netherlands
PERSON PERSON PERSON O O O O LOCATION

Proponents of this format argue that immediately adjacent entities are exceedingly rare. As such, IOB adds unnecessary complexity.

In this format, one assumes that any contiguous sequence of the same label constitutes a single entity (i.e., Vincent/PERSON, van/PERSON, Gogh/PERSON \rightarrow <person>Vincent van Gogh</person>).

Next steps

Practice

  • Entity types of interest vary from domain to domain. Imagine your are developing a named entity recognizer to process academic papers about linguistics. Name three entity labels you might want to include.

  • Compose three sentences where each sentence contains a different Geopolitical Entity (GPE).

  • Can you think of any ambiguous cases where a word or phrase could be assigned either one of two (or more) named entity labels?

Footnotes

  1. See https://en.wikipedia.org/wiki/Diagnosis_code