SkyAICampus
HomePracticeLearnCode LabFocus
SkyAICampus
PrivacyTermssupport@skyaicampus.com© 2026 SkyAI Campus
Log inSign up

Learn

HomePracticeConcept cardsCode LabSky Tutor

Review

Revise todayMistake notebookProgress

Focus

Campus ForestFocus roomsSquads

Questions or feedback?
support@skyaicampus.com

  1. 1Text preprocessing
  2. 2Text as numbers
  3. 3Transformers
  4. 4NLP tasks
← Natural language processing

Lesson 2 of 4

Text as numbers

Watch, read the card, then practise. Bag of words and TF-IDF · Word embeddings

Video coming soon

The video for this lesson is being recorded.

Meanwhile, the notes below and the 60-second cards cover the same ideas.

Practise this topic
  • Bag of words and TF-IDF

    Bag-of-words counts each word in a document. TF-IDF also lowers the weight of words that appear everywhere.

    Remember: TF-IDF + logistic regression is a strong, cheap baseline.

  • Word embeddings

    Embeddings turn words into vectors, so words with similar meanings sit close together.

    Remember: Close vectors = similar meaning.

Try the example in Code Lab

import math
tf = 2 / 10                  # 2 times in a 10-word document
idf = math.log10(100 / 10)   # in 10 of 100 documents
print(round(tf * idf, 2))
← Text preprocessingNext: Transformers →

In this lesson

  • Bag of words and TF-IDF
  • Word embeddings

Practise this topic

5 questions at your level. The best way to make it stick.

Practise 5 questions