AI Glossary / Natural language and speech / Advanced
BIOES
Definition
BIOES is a token-labeling scheme that represents the boundaries and types of contiguous text spans. B marks the beginning of a multi-token span, I an internal token, O a token outside the annotated spans, E the final token of a multi-token span, and S a complete single-token span. Type suffixes such as PER, ORG and LOC specify the category. BIOES makes endings and single-token spans explicit.
What it means
A span-recognition task needs to identify where an expression starts, where it ends and what category it belongs to. BIOES places those decisions into token labels. It can represent a one-token name differently from the first token of a longer name, rather than relying on the following label to reveal that distinction.
Compared with BIO, this changes how boundary information is encoded. It does not automatically add new entity types or make the same annotations more informative about the underlying world. For valid flat, contiguous annotations with the same tokenization, BIO and BIOES can describe the same spans using different label sequences.
How it works
Choose the tokenization and type inventory. Assign S-type to a one-token span. For a span of two or more tokens, assign B-type to the first and E-type to the last. Any intervening tokens receive I-type. Tokens outside the chosen spans receive O.
With n types, the standard inventory contains 4n + 1 tags: B, I, E and S for each type, plus one O. This is larger than BIO's 2n + 1 inventory. The number describes available tag categories, not the number of entities in a sentence.
A valid multi-token span follows B-type, zero or more matching I-type tags, and E-type. A single-token span uses S-type. Invalid sequences require an explicit rejection or repair policy. Training labels, decoder constraints and evaluation should use compatible conventions so that a boundary is not silently reinterpreted between stages.
Three practical examples
- A named-entity recognizer uses S-PER for a one-token person mention and B-PER followed by E-PER for a two-token mention. The labels distinguish the two boundary patterns.
- An annotation converter changes BIO data into BIOES. It inspects each span's end before choosing E or S, then checks that decoding both versions recovers identical spans.
- A document-processing team validates predicted tag sequences before extracting fields. It flags an unfinished B-type span rather than assuming that every sequence of individually valid tag names is structurally valid.
Think of it this way
Think of marking passages with separate opening and closing brackets, plus a special mark for a passage containing just one token. BIOES writes those roles into labels on the tokens themselves. The marks tell a reader where passages begin and end, while the type suffix explains what each passage represents in the annotation task.
Worked example
Use the invented sentence “Aster Research Group hired Lina in New Harbor.” Split off the period, producing nine tokens: Aster, Research, Group, hired, Lina, in, New, Harbor, and the period. Assume the annotation defines Aster Research Group as an organization, Lina as a person and New Harbor as a location.
The BIOES sequence is Aster/B-ORG, Research/I-ORG, Group/E-ORG, hired/O, Lina/S-PER, in/O, New/B-LOC, Harbor/E-LOC, and period/O. The three-token organization uses B, I and E. The two-token location uses B and E, with no I token between them. The one-token person uses S.
There are three entity types, so the full available inventory has 4 × 3 + 1 = 13 tags. Counting B tags alone gives two, but the sentence contains three entity mentions. Under valid BIOES encoding, the mention count is the number of B tags plus the number of S tags: 2 + 1 = 3.
To convert to the BIO convention where every span begins with B, change E-type to I-type and S-type to B-type. The sequence becomes B-ORG, I-ORG, I-ORG, O, B-PER, O, B-LOC, I-LOC, O. Decoding still yields the same three spans.
For the reverse conversion, a B-type immediately followed by a matching I-type remains B; otherwise it becomes S. An I-type followed by another matching I-type remains I; the final I becomes E. Applying these rules to this valid BIO sequence exactly reconstructs the original BIOES labels. The conversion depends on neighboring labels, not just replacing each tag independently.
Illustrative case study
In a fictional extraction pipeline, one component emits BIOES labels while a reporting component assumes BIO. Its entity-count routine counts only B tags and reports two mentions for the worked sentence, overlooking Lina's S-PER tag.
The team corrects the interface documentation and updates the counting rule. It also tests the conversion by decoding both formats into typed token spans and comparing the results. Agreement of the original text alone would not establish that entity boundaries were preserved.
A second test deliberately changes Lina's label to B-PER while leaving the following in/O unchanged. Under strict BIOES this is an unfinished multi-token span, because no E-PER closes it. Under BIO, the same B-PER followed by O would describe a valid one-token span. The team therefore validates according to the declared scheme instead of treating similar tag names as interchangeable.
Common misconceptions and mistakes
E is not an extra token after an entity; it labels the entity's final token. S is not a sentence-start marker. It labels an entire one-token span. A two-token span has no I label, while a one-token span has neither B nor E.
The larger tag inventory does not guarantee better predictions. Performance depends on the task, data and model. BIOES also does not make a single flat label sequence capable of representing arbitrary nested or overlapping spans without additional machinery.
Business use
Specify the labeling scheme at every dataset and model interface. Verify conversions by comparing decoded boundaries and types, including one-token and two-token cases. Report extraction quality using the spans required by the downstream task, and document how malformed predictions are handled before those spans enter a workflow.
People also ask
What does S mean?
A single-token span.
How is a two-token entity represented?
B-type followed by E-type.
Does BIOES change the words being annotated?
No; it changes the labels attached to the selected tokens.
Check your understanding
Why does Research receive I-ORG?
Answer: It lies between the first and last tokens of the organization span.
Why are there three mentions but only two B tags?
Answer: Lina is represented by S-PER.
Can reverse conversion from BIO use each tag in isolation?
Answer: No; it must identify the span endings and single-token spans.
Related terms
- BIO tagging
- Sequence labeling
- Named entity recognition
- Tokenization
- span boundary
- tag inventory
- annotation conversion
- structured decoding
Learn next
Validate BIOES transitions and compare decoded spans before and after conversion, then examine subword alignment and nested-entity representations.
More in Natural language and speech
- Best-worst scaling - Best-worst scaling is a comparative annotation method in which a person selects the highest and lowest items on a specified property from a small group.
- Bilabial - Bilabial describes a speech sound whose primary constriction is made using both lips.
- Binary branching - Binary branching describes a tree structure in which a branching node has two immediate children.
- Bitext word alignment - Definition: Bitext word alignment identifies corresponding words or tokens in two texts that express substantially the same content in different languages.
- Bound pronoun - A bound pronoun is a pronoun interpreted as a variable whose value depends on a binding expression, often a quantified noun phrase.
- Boundary tones - Boundary tones are tonal events associated with the edges of prosodic phrases in speech.
Sources
Jurafsky and Martin, Speech and Language Processing, chapter 18, section 18.3: BIO and BIOES boundary-labeling schemes. https://web.stanford.edu/~jurafsky/slp3/18.pdf The nine-token example, conversion calculation and fictional interface case are original teaching illustrations.
Previous: BIO tagging Next: Biometric data