Views
No views yet
| Metric | Value | Status |
|---|---|---|
| Vocabulary Size | 16,384 | ✅ Standard |
| Round-Trip Integrity | 100% Lossless | ✅ Verified |
Unknown Token (<unk>) Rate | 0.00% | ✅ Verified |
| Punctuation Isolation | Clean | ✅ Isolated |
Ge'ez Wordspace (፡) Handling | Atomic Token | ✅ Verified |
| Base Architecture | SentencePiece | ✅ Native |
1from transformers import AutoTokenizer
2
3tokenizer = AutoTokenizer.from_pretrained("BeitTigreAI/tigre-spm-tokenizer")
4
5text = "ሰላም፡ እሊ ናይ ሂጋ ትግሬ ክታበት ቱ።"
6
7# Encode to tokens & IDs
8tokens = tokenizer.tokenize(text)
9input_ids = tokenizer.encode(text)
10
11print("Tokens:", tokens)
12print("IDs :", input_ids)
13
14# Lossless Decoding
15decoded_text = tokenizer.decode(input_ids, clean_up_tokenization_spaces=False)
16print("Decoded:", decoded_text)
17assert text == decoded_texttokenizer.model: Native SentencePiece binary model file.tokenizer.json: Serialized fast tokenizer representation for Python/Rust environments.tokenizer_config.json: Metadata and special token configuration mapping.special_tokens_map.json: Explicit <pad>, <s>, </s>, and <unk> assignments.