bert_tokenizer
Pure Dart WordPiece tokenizer for BERT NLP models. Completely independent of Flutter.
1.2.0
TheDS-EXE/bert_tokenizer
What this package is like to depend on
Last release 11 days ago
12 Aug 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 7 of 7 stable releases
Nothing withdrawn
no release was ever pulled
2 months old
7 releases · first in 2026
7 releases in the last 12 months
see the full history below
Release timeline
7 releases · Jun 2026 to Aug 2026Releases
latest 7-
1.2.012 Aug 2026Release notes
Open source →- Added batch processing (
prepareBatch) and support for pre‑tokenized input (prepareFromTokens). - Introduced left/right truncation strategy (
TruncationStrategy) and custom segment ID override (per‑token or global). - Exposed special token IDs via getters (
padTokenId,unkTokenId, etc.) for easy access. - Optimised padding with pre‑allocated lists for better performance.
- Preserved leading/trailing whitespace in vocabulary (only strips
\rfor cross‑platform compatibility).
- Added batch processing (
-
1.1.217 Jul 2026Release notes
Open source →- Upgraded the Example Code: Replaced the basic example script with a comprehensive, multi-step version that demonstrates raw string tokenization, ML input preparation, and reversing numerical IDs back to text.
-
1.1.102 Jul 2026Release notes
Open source →-
Resolved regex syntax errors by utilizing raw triple quotes for the punctuation character class.
-
Enforced strict WordPiece standard (entire word becomes [UNK] if any subword fails).
-
Added toLowerCase parameter for cased/uncased model flexibility.
-
Added pre-tokenization stripping of invisible control characters.
-
Robust line ending handling (\r\n and \n) for cross-platform vocab loading.
-
-
1.1.017 Jun 2026Release notes
Open source →-
Fixed Truncation Crash: Rewrote the sequence length handling in prepareNerInput to prevent unhandled StateError exceptions when maxLength is set to small values (like 0 or 1).
-
Preserved Special Tokens: Adjusted the truncation logic to trim the raw word pieces before injecting the [CLS] and [SEP] tokens, ensuring the structural markers required by BERT models are never overwritten.
-
Enforced Minimum Bounds: Added an ArgumentError validation check to prepareNerInput ensuring maxLength is at least 2, which is the mathematical minimum required to contain the mandatory start and end tokens.
-
Added Initialization Validation: Updated fromStringContent to verify that both [UNK] and [PAD] are explicitly defined within the parsed vocabulary map, replacing late-stage runtime crashes (!) with a descriptive FormatException during setup.
-
-
1.0.206 Jun 2026 -
1.0.101 Jun 2026 -
1.0.001 Jun 2026