[Encoder] → → → → [Context] → → → → [Decoder]
⬇️ ⬆️
Input Sentence Translated Output
Imagine you're translating a sentence from English to French.
For example:
👉 Input: "I love cats" 🐱
👉 Output: "J'aime les chats"
A Sequence-to-Sequence (Seq2Seq) model helps computers convert one sequence (English) into another sequence (French, or any other language).
A Seq2Seq model has two main parts:
🔹 Encoder → Understands the input sentence.
🔹 Decoder → Generates the translated output.
💡 Problem: The encoder processes the entire input and gives only one summary (a fixed vector) to the decoder. But what if the sentence is too long? The decoder may forget important details! 😞
✅ Solution: Attention Mechanism helps the decoder focus on important words at each step. 🎯