← BackGrades 5-6 | Chapter 2: AI in Action

How AI Understands Language 🗣️

Natural Language Processing

Session 6: AI & Communication

Natural Language Processing (NLP) 🤖

Natural Language Processing is how AI learns to understand and use human language - the words we speak and write.

NLP Examples:

  • ChatGPT and Chatbots answering your questions
  • Google Translate converting between languages
  • Siri/Alexa understanding voice commands
  • Email spam filters detecting junk mail
  • Social media removing hate speech

Tokenization: Breaking Down Words 🔪

AI can't understand "hello world" as words like you do. First, it must break language into pieces called tokens.

How Tokenization Works:

Sentence: "Can't believe it's Friday!"

  • Token 1: "Can't" (contract + apostrophe)
  • Token 2: "believe"
  • Token 3: "it's" (contraction)
  • Token 4: "Friday"
  • Token 5: "!" (punctuation)

Word Embeddings: AI's Number System 🔢

After tokenizing, AI converts each word into a series of numbers. This is called a word embedding.

The Concept:

  • "cat" might become [0.2, -0.5, 0.8, 0.1...]
  • "kitten" might be [0.25, -0.48, 0.75, 0.12...]
  • Similar words have similar number patterns
  • This lets AI understand that "cat" and "kitten" are related

Context: The Secret Sauce 🍯

The biggest challenge: the same word means different things in different contexts!

Example: The word "bank"

  • "I went to the bank" = financial institution
  • "We sat on the bank of the river" = riverside
  • "The plane banked left" = tilted

Modern AI models look at surrounding words to understand which meaning is correct!

Sarcasm, Jokes & Slang 😅

This is where AI fails most often! Humor requires understanding what ISN'T said.

Why AI Struggles:

  • Sarcasm: "Oh great, another Monday!" (means the opposite)
  • Slang: "That's fire!" (means "good", not literally burning)
  • Jokes: Require background knowledge and cultural understanding
  • Double meanings: Puns rely on multiple meanings of one word
  • Idioms: "It's raining cats and dogs" (doesn't mean pets falling from sky)

Translation Challenges 🌍

Not all languages work the same way! Direct translation often fails.

Translation Problems:

  • Word order: English: "I like cats". Japanese: "I cats like"
  • Grammar: Spanish has gendered nouns (el/la). English doesn't
  • Cultural context: Jokes, idioms, references don't translate
  • Missing concepts: Some languages have words English doesn't have

Bias in Language AI 🎭

Language AI learns bias from the text it's trained on - which reflects human prejudices.

Real Examples:

  • AI associates "male" with engineering jobs, "female" with nurse jobs
  • Autocomplete suggests gender stereotypes
  • AI learned racist and sexist language from internet text
  • Translation tools have different accuracy for different languages

How AI Improves Language Understanding 🚀

Modern Techniques:

  • Transformer Models: Better at understanding context
  • Attention Mechanisms: Focus on important words
  • Pre-training: Learning from billions of words first
  • Fine-tuning: Learning specific tasks after basic training

What We Learned 🎓

  • AI breaks language into tokens (word pieces)
  • Words become numbers (embeddings) AI can understand
  • AI needs context to understand word meanings
  • Sarcasm, jokes, slang are AI's biggest challenges
  • AI has language bias from training data
  • Translation is hard because languages work differently

AI Language Explained! 🎉

AI understands language through numbers and patterns, but still struggles with human complexity

Next Session: AI & Privacy