Find the entities by labelling every single word. B starts an entity, I stays inside it, O means it’s nobody.
quiet note — one snag with subwords
Tags are per word, but the model reads subword pieces. Split a name and one tag has to stretch across the leftover scraps:
The fix: tag the first piece of a word and let the rest ride along — or realign the pieces back to whole words afterward.
This is the classic BIO (a.k.a. IOB) scheme. Sentence after J&M, Speech and Language Processing, Ch. 8.