Checking batch versus single-input BERT encodings
Encode a fixture one by one and as a batch, asserting equality before padding and documenting tensor shape after padding
ReadEach guide explains one thing about tokenizer output, using counts measured against the exact vocabularies this site pins. Every number can be checked in the tool.
Encode a fixture one by one and as a batch, asserting equality before padding and documenting tensor shape after padding
ReadUse composed and decomposed accented strings, inspect tokens and offsets, and explain why display spans cannot be reconstructed from normalized text alone
ReadProbe punctuation, whitespace, and removed characters; handle None safely in annotation pipelines
ReadProbe mixed Chinese and Latin strings under both pinned vocabularies, distinguishing isolated character boundaries from [UNK] coverage
ReadBatch unequal samples with padding and inspect masks and ids; explain why a CLS or SEP is attended while PAD is not
ReadCompare add_special_tokens true/false and print special_tokens_mask; distinguish content count and model-input length
ReadCompare decode output to raw offset slices for cased/uncased inputs; explain lowercasing, whitespace, and special tokens
ReadCompare fixed and longest-in-batch padding, attention masks, and real token counts in an inference fixture
ReadCreate explicit control-character probes and inspect offsets to detect silently removed input without publishing invented output counts
ReadBuild paired uppercase/lowercase probes for the uncased and multilingual cased tokenizer; separate normalization from vocabulary coverage
ReadUse return_overflowing_tokens and stride on a long synthetic input; report mapping and overlap computed by code, not invented results
ReadUse fast-tokenizer overflow mapping and offsets to keep raw-text provenance through overlapping windows
ReadRead configuration and construct a safe assertion before model inference; explain why count alone is not a universal context-window guarantee
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
ReadInspect which side loses tokens under a chosen max_length and contrast only_first/only_second options with printed evidence
ReadEncode a pair and inspect tokens and special_tokens_mask; explain the two SEP markers and counting implications
ReadBuild a raw-span highlighting check for sentences with multiple spaces and punctuation; avoid assuming adjacent offsets
ReadTest punctuation beside words, prices, and paths; explain which differences arise in pre-tokenization rather than the greedy loop
ReadDerive content-token length from the returned mask for single and paired inputs without hardcoding overhead
ReadPrint type ids aligned with actual tokens, including separator positions; describe segment roles and model-specific limits
ReadProbe spaces, tabs, line breaks, and leading whitespace; compare output ids with raw offsets and document data-cleaning implications
ReadCompare token_to_chars with offset_mapping and handle special-token None spans when building a highlighter
ReadTest truncation on a pinned tokenizer with and without special tokens; derive content budget from masks rather than guessing
ReadUse fast BatchEncoding.word_ids for a pre-split fixture and test label alignment across continuation pieces
ReadInspect ordinary and ##-prefixed entries separately and trace a failing lookup without assuming they are interchangeable
ReadInclude raw input, pinned revision, library version, and encoding options; explain privacy and invalidation tradeoffs
ReadLoad both implementations at the same revision, compare token ids, and explain why offset APIs need the fast implementation
ReadTest snake_case, camelCase, package paths, and mixed digits; avoid claiming a code-specialized tokenizer
ReadProbe actual emoji and their ASCII escape spellings; print tokens and unknown rate rather than inferring semantic support from count
ReadRun the same fixture under both pinned commits and report tokens, unknowns, and ids in separate columns
ReadUse a code probe to locate a suffix that cannot be matched; explain whole-word [UNK] fallback instead of partial-prefix output
ReadDefine a corpus-level pieces-per-pretokenized-unit diagnostic with zero-denominator handling and per-model results
ReadSpecify invariants for ids, masks, offsets, and deterministic re-encoding; include generated edge cases without asserting unmeasured output
ReadConstruct a vocabulary-search experiment that compares greedy output with dynamic programming on one pinned BERT vocabulary; explain why the deployed tokenizer must be treated as the oracle
ReadUse raw offsets for display spans, treat [UNK] and special tokens explicitly, and avoid reconstructing display text from token strings
ReadParse JSON to inspect model type, unknown token, prefix, max word length, and vocabulary without treating all JSON fields as tokens
ReadSerialize the same object with different whitespace settings and compare exact BERT encodings; separate serialization differences from tokenizer differences
ReadUse synthetic timestamps and paths; show per-field diagnostics and unknown coverage instead of a blanket efficiency claim
ReadRead max_input_chars_per_word from pinned tokenizer.json; probe the boundary using programmatically generated strings and distinguish pre-tokenized words from whole inputs
ReadBuild a mixed Latin/CJK/Greek fixture and report per-span tokens, unknowns, and effects of pre-tokenization
ReadUse word_ids to assign labels to the first piece and ignore later pieces; document alternate labeling choices
ReadUse unicodedata to compare canonically equivalent strings; discuss accent stripping, cased preservation, and offsets
ReadProbe numeric strings and separators without inventing stable counts; discuss why token counts cannot be inferred from digit length
ReadShow AutoTokenizer.from_pretrained with exact repository revision and a check of name_or_path plus a reproducibility manifest
ReadBuild safe raw-answer-span to token-span logic for a pair encoding, checking sequence ids and special tokens
ReadCreate JSON fixtures of input, ids, tokens, and masks; show how to rerun them after dependency or asset changes
ReadProbe punctuation-heavy URLs with safe example domains and show how to compute counts programmatically
ReadMeasure [UNK] per content token and per input, keeping punctuation and long-word failures distinct
ReadHash downloaded JSON bytes and compare to pinned site asset digests; distinguish model repo revision from local file integrity
ReadHold model revision fixed, record installed Transformers version, and diff fixture outputs before approving an upgrade
ReadMeasured tokens-per-word ratios for plain prose, URLs, code and CJK, and why budgeting a prompt from word count alone is wrong.
ReadWhat a character span in a tokenizer output actually points at, why [CLS] and [SEP] carry [0,0], and how offsets survive accent stripping.
ReadThe greedy longest-match rule behind BERT subword tokens, why continuations carry
ReadWhat an [UNK] token actually means, why one unmatchable character costs a whole word, and how to choose a tokenizer that fits your input.
Read