Instructions to use BeitTigreAI/tigre-spm-tokenizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BeitTigreAI/tigre-spm-tokenizer with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BeitTigreAI/tigre-spm-tokenizer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| language: | |
| - tig | |
| license: apache-2.0 | |
| tags: | |
| - tokenizer | |
| - sentencepiece | |
| - ge'ez | |
| - tigre | |
| - beit-tigre-ai | |
| library_name: transformers | |
| # Tigre SentencePiece Tokenizer (16K Vocab) | |
| A standalone **SentencePiece (Unigram/BPE)** subword tokenizer built and optimized for the **Tigre language (α΅αα¬)** written in Ge'ez script. | |
| ## Tokenizer Statistics & Verification | |
| | 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 | | |
| ## Quickstart Usage | |
| ```python | |
| from transformers import AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained("BeitTigreAI/tigre-spm-tokenizer") | |
| text = "α°ααα‘ α₯α αα αα α΅αα¬ αα³α α΅ α±α’" | |
| # Encode to tokens & IDs | |
| tokens = tokenizer.tokenize(text) | |
| input_ids = tokenizer.encode(text) | |
| print("Tokens:", tokens) | |
| print("IDs :", input_ids) | |
| # Lossless Decoding | |
| decoded_text = tokenizer.decode(input_ids, clean_up_tokenization_spaces=False) | |
| print("Decoded:", decoded_text) | |
| assert text == decoded_text | |
| ``` | |
| ## Repository Structure | |
| - `tokenizer.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. | |