Notes

BILOU Tagging Scheme

A sequence labeller can attach exactly one tag to one token, yet the things worth finding in text — a person, a drug, a company — usually run across several tokens in a row. BILOU is the small alphabet that lets per-token tags carry that span structure without changing the model underneath.

The five letters
Every token receives one tag, and every tag but O also names the span's type:

  • B — the first token of a span two or more tokens long.
  • I — a token inside that span.
  • L — its last token.
  • U — a span that is a single token, a unit on its own.
  • O — outside any span.

So Martin Luther King reads B-PER I-PER L-PER, while Chicago standing alone reads U-LOC.

Why not simply BIO
BIO marks where a span begins and continues, leaving the far boundary to be inferred from whatever comes next. BILOU states the ending outright and gives the very common single-token case a class of its own, so the classifier learns a clean distinction rather than a leftover one. Ratinov and Roth measured a consistent gain from the switch on CoNLL-2003 entity recognition. The price is arithmetic: four tags per type plus O instead of two plus O, thinning the examples available per class on a small annotated corpus.

Where it goes wrong
Nothing stops a per-token classifier emitting an I with no B before it. Such output is illegal and must be repaired — by a CRF layer whose transition scores forbid the move, or by a decoding pass that patches it — before spans can be read back. Skip that step and span F1 charges you twice, once for the entity missed and once for the garbage produced.

The BILOU scheme encodes multi-token spans as per-token labels: Beginning, Inside and Last for a span of two or more tokens, Unit for a single-token span, and O for everything outside. Against BIO it marks span endings explicitly and gives single-token entities their own class, which measurably improves named entity recognition. The cost is four label classes per entity type instead of two, so more annotated data is needed per class.

Imagine highlighting every person's name in a long printed list. Colouring the words is not enough — you also have to show where one name stops and the next begins, or two names sitting side by side merge into one.

BILOU is a simple code for doing exactly that, one word at a time. Each word gets a letter saying whether it starts a name, sits in the middle of one, ends it, is a name all by itself, or is not part of one at all. Software reads the letters back and knows precisely which words belong together. It is bookkeeping rather than intelligence, but without it a computer has no way to see where a name's edges are.