Natural Language Processing

معالجة اللغات الطبيعية (Natural Language Processing)

Midterm study guide

دليل المذاكرة للاختبار النصفي

Lectures 02, 03, and 04المحاضرات 02 و03 و04

Thirty pages, one concept block each. Every page has an explanation, a diagram, a worked example with all the arithmetic, and multiple-choice questions at the bottom.

ثلاثون صفحة، كل صفحة لكتلة مفاهيم واحدة. في كل صفحة شرح، ورسم توضيحي، ومثال محلول بكل خطواته الحسابية، وأسئلة اختيار من متعدد في الأسفل.

How to use thisطريقة الاستخدام

Read in order. Each page ends with questions, so answer them before clicking next: the answer only reveals after you commit to an option. Use the left and right arrow keys to move between pages.

اقرأ بالترتيب. كل صفحة تنتهي بأسئلة، فأجب عنها قبل أن تضغط "التالي": الجواب لا يظهر إلا بعد أن تلتزم بخيار. واستخدم مفتاحَي السهم الأيسر والأيمن للتنقل بين الصفحات.

Every page carries a priority badge. The ranking rests on one assumption: what can be computed by hand is what gets examined. Conceptual prose makes good distractors, but the marks live in the calculations.

كل صفحة تحمل شارة أولوية. ويقوم الترتيب على افتراض واحد: ما يمكن حسابه باليد هو ما يُمتحن. الشرح المفاهيمي يصنع مشتتات جيدة في الأسئلة، لكن الدرجات تسكن في الحسابات.

P1 MUST 11 pages. Work these with a pen, not by reading.11 صفحة. اشتغل عليها بالقلم، لا بالقراءة. P2 SHOULD 11 pages. One key idea each.11 صفحة. فكرة أساسية واحدة في كل منها. P3 SKIM 8 pages. Read the callouts only.8 صفحات. اقرأ الملاحظات المؤطّرة فقط.

معنى الشارات: P1 MUST تعني 11 صفحة، اشتغل عليها بالقلم لا بالقراءة. وP2 SHOULD تعني 11 صفحة، فكرة أساسية واحدة في كل منها. وP3 SKIM تعني 8 صفحات، اقرأ الصناديق التنبيهية فقط.

Two things that change the prioritiesأمران يغيّران الأولويات

Regex is P1, not optional. Two questions on the last quiz were regex, so wt-06 has to be worked rather than skimmed. Practise writing patterns, not just reading them.

الـ regex أولوية P1، وليس اختيارياً. سؤالان في الاختبار القصير الأخير كانا عن regex، لذلك يجب أن تشتغل على wt-06 لا أن تتصفحها. تدرّب على كتابة الأنماط، لا على قراءتها فقط.

Edit distance substitution cost is ambiguous in the slides. Slide 85's text implies unit cost, which gives 5. Slide 88's table and slide 90's backpointers require cost 2, which gives 8. These pages teach 8. State your assumption in the margin and you protect the mark either way.

تكلفة الاستبدال في edit distance غامضة في الشرائح. نص الشريحة 85 يوحي بتكلفة 1، وهذا يعطي 5. وجدول الشريحة 88 والمؤشرات الخلفية (backpointers) في الشريحة 90 تتطلب تكلفة 2، وهذا يعطي 8. هذه الصفحات تعلّم 8. اكتب افتراضك في الهامش فتحمي الدرجة في الحالتين.

Lecture 02 · Words and Tokens

المحاضرة 02 · الكلمات والـ Tokens

Lecture 03 · N-gram Language Models

المحاضرة 03 · نماذج اللغة N-gram

Lecture 04 · Word Embeddings

المحاضرة 04 · تضمينات الكلمات (Word Embeddings)

The six formulas you must be able to write coldالمعادلات الست التي يجب أن تكتبها من الذاكرة
  1. Bigram MLE: P(wn | wn−1) = C(wn−1 wn)C(wn−1)
  2. Perplexity: PP(W) = P(W)−1/N
  3. Add-one bigram: C(wn−1 wn) + 1C(wn−1) + V
  4. Interpolation: λ1P(wn|wn−2wn−1) + λ2P(wn|wn−1) + λ3P(wn), with Σλ = 1
  5. Cosine: a · b|a| |b|
  6. PPMI: max(0, log₂(P(w,c)P(w)P(c)))

المعادلات الست بالترتيب: Bigram MLE هي عدّ الزوج C(wn−1 wn) على عدّ السياق C(wn−1). وPerplexity هي P(W)−1/N. وAdd-one bigram تضيف 1 إلى البسط وV إلى المقام. وInterpolation مجموع مرجّح لاحتمالات trigram وbigram وunigram بأوزان λ مجموعها 1. وCosine هو a · b على |a| |b|. وPPMI هي max(0, log₂(P(w,c) / (P(w)P(c)))).