Skip to content
M.U.N.U.O.Data × AI × Systems

Artificial Intelligence Foundations

Tokens and Embeddings

Module 6 of 10

Learning objectives

  • Explain the ideas behind tokens and embeddings.
  • Apply the ideas to the example and identify how you would check the result.

Concepts

A tokenizer turns text into units such as words, subwords or punctuation. An embedding represents an item as a vector. Cosine similarity compares the vectors' directions.

Practical example

Tokenize a Swahili greeting and compare illustrative vectors for payment, transfer and weather.

Try the exercise
  1. Define the task. Tokenize a Swahili greeting and compare illustrative vectors for payment, transfer and weather.
  2. Identify the key idea. A tokenizer turns text into units such as words, subwords or punctuation.
  3. Check your decision. Describe an alternative and how you would compare its results.
Open the interactive lab

Knowledge check

Can different models tokenize the same text differently?

What does cosine similarity compare?

Does geometric similarity guarantee factual equivalence?