Yolo فيجن شنتشن
شنتشن
انضم الآن
مسرد المصطلحات

رمز

Explore how tokens act as the atomic units of AI processing. Learn how the [Ultralytics Platform](https://platform.ultralytics.com) uses tokens for NLP and computer vision.

In the sophisticated architecture of modern artificial intelligence, a token represents the fundamental, atomic unit of information that a model processes. Before an algorithm can interpret a sentence, analyze a software script, or recognize objects in an image, the raw input data must be broken down into these discrete, standardized elements. This segmentation is a pivotal step in data preprocessing, transforming unstructured inputs into a numerical format that neural networks can efficiently compute. While humans perceive language as a continuous stream of thoughts or images as seamless visual scenes, computational models require these granular building blocks to perform operations like pattern recognition and semantic analysis.

الرمز مقابل الترميز

To grasp the mechanics of machine learning, it is essential to distinguish between the data unit and the process used to create it. This differentiation prevents confusion when designing data pipelines and preparing training material on the Ultralytics Platform.

  • Tokenization: This is the algorithmic process (the verb) of splitting raw data into pieces. For text, this might involve using libraries like the Natural Language Toolkit (NLTK) to determine where one unit ends and another begins.
  • Token: This is the resulting output (the noun). It is the actual chunk of data—such as a word, a subword, or an image patch—that is eventually mapped to a numerical vector known as an embedding.

الرموز المميزة في مجالات الذكاء الاصطناعي المختلفة

The nature of a token varies significantly depending on the modality of the data being processed, particularly between textual and visual domains.

الرموز النصية في البرمجة اللغوية العصبية

In the field of Natural Language Processing (NLP), tokens are the inputs for Large Language Models (LLMs). Early approaches mapped strictly to whole words, but modern architectures utilize subword algorithms like Byte Pair Encoding (BPE). This method allows models to handle rare words by breaking them into meaningful syllables, balancing vocabulary size with semantic coverage. For instance, the word "unhappiness" might be tokenized into "un", "happi", and "ness".

الرموز المرئية في الرؤية الحاسوبية

The concept of tokenization has expanded into computer vision with the advent of the Vision Transformer (ViT). Unlike traditional convolutional networks that process pixels in sliding windows, Transformers divide an image into a grid of fixed-size patches (e.g., 16x16 pixels). Each patch is flattened and treated as a distinct visual token. This approach enables the model to use self-attention mechanisms to understand the relationship between distant parts of an image, similar to how Google Research originally applied transformers to text.

تطبيقات واقعية

تعمل الرموز المميزة كجسر بين البيانات البشرية والذكاء الاصطناعي في عدد لا يحصى من التطبيقات.

  1. الكشف عن الكائنات ذات المفردات المفتوحة: تستخدم النماذج المتقدمة مثل YOLO نهجًا متعدد الوسائط حيث تتفاعل الرموز النصية مع الميزات المرئية. يمكن للمستخدم إدخال مطالبات نصية مخصصة (على سبيل المثال، "خوذة زرقاء")، والتي يقوم النموذج بترميزها ومطابقتها مع الكائنات الموجودة في الصورة. وهذا يتيح التعلم الفوري، مما يسمح بالكشف عن الكائنات التي لم يتم تدريب النموذج عليها بشكل صريح.
  2. الذكاء الاصطناعي التوليدي: في أنظمة توليد النصوص مثل روبوتات الدردشة، يعمل الذكاء الاصطناعي عن طريق توقع احتمالية الرمز التالي في التسلسل. من خلال الاختيار المتكرر للرمز التالي الأكثر احتمالية ، يقوم النظام ببناء جمل وفقرات متماسكة، مما يدعم أدوات تتراوح من خدمة العملاء الآلية إلى المساعدين الافتراضيين.

Python : استخدام الرموز النصية للكشف

يوضح مقتطف الشفرة التالي كيفية عمل ultralytics package uses text tokens to guide اكتشاف الأجسام. While the state-of-the-art يولو26 is recommended for high-speed, fixed-class inference, the YOLO-World architecture uniquely allows users to define classes as text tokens at runtime.

from ultralytics import YOLO

# Load a pre-trained YOLO-World model capable of understanding text tokens
model = YOLO("yolov8s-world.pt")

# Define specific classes; these text strings are tokenized internally
# The model will look specifically for these "tokens" in the visual data
model.set_classes(["bus", "backpack"])

# Run prediction on an image using the defined tokens
results = model.predict("https://ultralytics.com/images/bus.jpg")

# Display the results showing only the tokenized classes
results[0].show()

Understanding tokens is fundamental to navigating the landscape of generative AI and advanced analytics. Whether enabling a chatbot to converse fluently or helping a vision system distinguish between subtle object classes, tokens remain the essential currency of machine intelligence used by frameworks like PyTorch and TensorFlow.

انضم إلى مجتمع Ultralytics

انضم إلى مستقبل الذكاء الاصطناعي. تواصل وتعاون وانمو مع المبتكرين العالميين

انضم الآن