WordPiece

A tokenizer needs reusable word parts and a consistent way to find them in new text. We will look at the pair-scoring rule used here to build a WordPiece vocabulary, then its longest-match encoding rule.

14 sections · 15 questions · 4 coding challenges

1 / 14

How Could Speech Recognition Avoid an Endless Word List?

BOTIE

Speech recognition must produce words even when the number of possible word forms makes a complete inventory unwieldy. For languages with productive combinations of stems and endings, treating every surface word as unrelated wastes both vocabulary space and evidence.

Schuster and Nakajima's 2012 work on Japanese and Korean voice search described word pieces as a way to address vocabulary and segmentation difficulties. WordPiece later became familiar through systems such as BERT, which used a subword vocabulary rather than requiring an entry for every complete word.

Reusable pieces allow a word to be represented through parts the model has seen elsewhere. Vocabulary learning decides which parts deserve entries; encoding decides how those entries cover a new word. Those are separate procedures. The association-style merge score in this lesson is the teaching implementation's explicit rule, and should not be mistaken for a complete specification of every historical WordPiece trainer.

Sources for this history