token
AI ve NLP bağlamında, bir token, işleme ve analiz için kullanılan bir kelime, bir kelimenin bir parçası veya bir noktalama işareti gibi temel bir metin birimidir.
Tokenleştirme, bir metni bu tokenlere ayırma işlemidir. Bu, metin verilerini makine öğrenimi modelleri için hazırlamada, modellerin metni anlamasını ve işlemesini sağlayan çok önemli bir adımdır. Tokenleştirme için özel kurallar, görev ve kullanılan modele bağlı olarak değişebilir ve farklı tokenleştiriciler farklı sonuçlar üretir.
Tokenleştirme yöntemleri, basit boşluk ayırmadan, alt kelime birimlerini veya karakter düzeyinde gösterimleri dikkate alan daha gelişmiş tekniklere kadar uzanır. Tokenleştirici seçimi, DDİ modellerinin performansını önemli ölçüde etkiler. Örneğin, kelime tabanlı bir tokenleştirici 'kedi' ve 'kediler'i ayrı tokenler olarak değerlendirebilirken, bir alt kelime tokenleştirici 'kediler'i 'kedi' ve 'ler' olarak ayırabilir.
graph LR
Center["token"]:::main
Pre_cryptography["cryptography"]:::pre --> Center
click Pre_cryptography "/terms/cryptography"
Rel_machine_learning["machine-learning"]:::related -.-> Center
click Rel_machine_learning "/terms/machine-learning"
Rel_token["token"]:::related -.-> Center
click Rel_token "/terms/token"
Rel_tokenizer["tokenizer"]:::related -.-> Center
click Rel_tokenizer "/terms/tokenizer"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 Bilgi testi
🧒 5 yaşındaki gibi açıkla
A [token](/tr/terms/token) is like a single Lego brick that makes up a sentence. AI breaks sentences into these bricks (words, parts of words, or punctuation) so it can understand and build new sentences.
🤓 Expert Deep Dive
Tokenization is a critical preprocessing step in NLP pipelines. Subword tokenization algorithms like BPE, WordPiece, and SentencePiece have become dominant because they balance vocabulary size with the ability to represent rare words and morphology. BPE iteratively merges frequent pairs of characters or bytes, while WordPiece uses a likelihood-based approach. SentencePiece treats text as a sequence of Unicode characters and learns subword units directly, making it language-agnostic. The choice of tokenizer impacts downstream tasks: a word-level tokenizer struggles with OOV words, while character-level tokenizers result in very long sequences. Subword tokenizers offer a compromise, allowing models to handle morphology (e.g., 'running' -> 'run', '##ing') and unknown words by composing them from known subwords. The mapping from tokens to numerical IDs and then to dense vector embeddings (e.g., Word2Vec, GloVe, or contextual embeddings from Transformers) is where semantic meaning is encoded for the model.