🇹🇷 Turkish BPE Tokenizer (65,536 Vocabulary)

Language

Algorithm

Vocabulary

Library

A Turkish Byte Pair Encoding (BPE) tokenizer trained from scratch using the Hugging Face tokenizers library.

Türkçe metinler üzerinde sıfırdan eğitilmiş, 65.536 sözlük boyutuna sahip bir Byte Pair Encoding (BPE) tokenizer'ıdır.


📖 Overview / Genel Bakış

English

This tokenizer was trained from scratch using the Hugging Face tokenizers library and the Byte Pair Encoding (BPE) algorithm. It was trained on a large Turkish synthetic corpus and is intended for educational purposes, language model pretraining, and NLP research.

Türkçe

Bu tokenizer, Hugging Face tokenizers kütüphanesi kullanılarak Byte Pair Encoding (BPE) algoritması ile sıfırdan eğitilmiştir. Büyük ölçekli Türkçe sentetik bir corpus üzerinde eğitilmiş olup eğitim, araştırma ve Türkçe dil modeli geliştirme çalışmaları için hazırlanmıştır.


📚 Dataset / Veri Seti

Dataset:

Uunan/turkish-synthetic-corpus

https://huggingface.co/datasets/Uunan/turkish-synthetic-corpus

Dataset Information

Property Value
Language Turkish
Samples 436,573
Approximate Size ~445 MB
Format Text

The tokenizer was trained using all samples in the dataset.

Tokenizer, veri setindeki 436.573 örneğin tamamı kullanılarak eğitilmiştir.


⚙️ Training Configuration / Eğitim Ayarları

Parameter Value
Algorithm Byte Pair Encoding (BPE)
Vocabulary Size 65,536
Library Hugging Face Tokenizers
Normalizer NFC
PreTokenizer ByteLevel
Decoder ByteLevel
Training Method train_from_iterator()

🏷️ Special Tokens

Token Türkçe English
<pad> Kısa dizileri aynı uzunluğa getirmek için kullanılan dolgu (padding) belirtecidir. Padding token used to make sequences the same length.
<unk> Sözlükte bulunmayan kelimeleri temsil eder. Represents unknown or out-of-vocabulary tokens.
<bos> Dizinin başlangıcını belirtir. Beginning Of Sequence token.
<eos> Dizinin sonunu belirtir. End Of Sequence token.

🚀 Usage / Kullanım

from tokenizers import Tokenizer

tokenizer = Tokenizer.from_file("tokenizer.json")

text = "Türkiye yapay zekâ alanında büyük yatırımlar yapıyor."

encoded = tokenizer.encode(text)

print(encoded.tokens)

print(encoded.ids)

decoded = tokenizer.decode(encoded.ids)

print(decoded)

📂 Repository Contents

.
├── tokenizer.json
└── train_tokenizer.py
  • tokenizer.json → Trained tokenizer
  • train_tokenizer.py → Training script

🧪 Example

Input

Türkiye yapay zekâ alanında büyük yatırımlar yapıyor.

Example Tokens

["<bos>",
"Türkiye",
"Ġyapay",
"Ġzekâ",
"Ġalanında",
"Ġbüyük",
"Ġyatırımlar",
"Ġyapıyor",
".",
"<eos>"]

Decoded

Türkiye yapay zekâ alanında büyük yatırımlar yapıyor.

Note / Not

ByteLevel tokenizer'larında görülen Ġ, Ã, Ä gibi karakterler bir hata değildir. Bunlar tokenizer'ın byte seviyesindeki iç gösterimidir. Encode → Decode işlemi sonunda metin eksiksiz olarak geri elde edilir.


🛠️ Built With

  • Hugging Face Tokenizers
  • Hugging Face Datasets
  • Python

📄 License

MIT License


👤 Author

Created by Uğurhan Çolak.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Uunan/turkish-bpe-tokenizer