8 min read
Debugging char_to_token gaps in BERT encodings
Probe punctuation, whitespace, and removed characters; handle None safely in annotation pipelines
Read6 guides on offsets.
Probe punctuation, whitespace, and removed characters; handle None safely in annotation pipelines
ReadShow fast-only offset return, raw string slicing, and handling of zero-length special-token offsets
ReadUse a cased/uncased pair with accented input; inspect raw slices versus normalized token strings
ReadBuild a raw-span highlighting check for sentences with multiple spaces and punctuation; avoid assuming adjacent offsets
ReadCompare token_to_chars with offset_mapping and handle special-token None spans when building a highlighter
ReadUse fast BatchEncoding.word_ids for a pre-split fixture and test label alignment across continuation pieces
Read