Majid Al-RaimiThe noisy channel modelنموذج القناة المشوشة (Noisy channel)

ICS 582Lecture 05المحاضرة 05Part 02الجزء 02

The noisy channel modelنموذج القناة المشوشة (Noisy channel)

Treat the misspelling as a correct word sent through a noisy channel, then decode with Bayes' rule: pick the word that maximizes channel probability times prior.نعامل الخطأ الإملائي على أنه كلمة صحيحة أُرسلت عبر قناة مشوشة، ثم نفك الترميز بقاعدة Bayes: نختار الكلمة التي تعظّم احتمال القناة مضروبا في الاحتمال المسبق (prior).

Conceptsالمفاهيم
3
Slidesالشرائح
9-12
Readingمدة القراءة
18 min18 دقيقة
Understoodما فهمته
0/3 conceptsمفاهيم

Why this part mattersلماذا يهمّ هذا الجزء

Part 01 split spelling errors into non-words and real words. This part gives you the single idea that powers almost every correction method in the rest of the lecture: treat the misspelling as a damaged copy of the word the writer meant, and ask which intended word most probably produced that damage.

The ideas build in order. First the picture: a word goes into a noisy channel and comes out wrong, and a decoder works backwards. Second the mathematics: one line of Bayes' rule, one cancellation, and the formula you must be able to derive in an exam. Third the context: who proposed it, and why the very same equation appears in speech recognition and machine translation. Every later part of this lecture (candidate generation, the confusion matrices, the acress scores, real-word errors) is just a way of filling in one factor of this formula.

قسّم الجزء 01 الأخطاء الإملائية إلى أخطاء ينتج عنها ما ليس بكلمة (non-words) وأخطاء ينتج عنها كلمات حقيقية (real words). أما هذا الجزء فيعطيك الفكرة الواحدة التي تقوم عليها تقريبًا كل طرق التصحيح في بقية المحاضرة: تعامل مع الخطأ الإملائي على أنه نسخة تالفة من الكلمة التي قصدها الكاتب، ثم اسأل: أي كلمة مقصودة هي الأرجح أن تكون قد أنتجت هذا التلف؟

تُبنى الأفكار بالترتيب. أولًا الصورة: كلمة تدخل قناة مشوّشة (noisy channel) وتخرج خاطئة، وفاكّ ترميز (decoder) يعمل بالاتجاه المعاكس. ثانيًا الرياضيات: سطر واحد من قاعدة بايز (Bayes' rule)، وحذف واحد، والصيغة التي يجب أن تستطيع اشتقاقها في الاختبار. ثالثًا السياق: من اقترحها، ولماذا تظهر المعادلة نفسها تمامًا في التعرف على الكلام والترجمة الآلية. وكل جزء لاحق في هذه المحاضرة (توليد المرشحين، ومصفوفات الالتباس، ودرجات acress، وأخطاء الكلمات الحقيقية) ما هو إلا طريقة لملء أحد عاملَي هذه الصيغة.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Describe spelling correction as decoding: a correct word w passes through a noisy channel and comes out as the observed string x.أن تصف تصحيح الإملاء بأنه عملية فك ترميز (decoding): كلمة صحيحة w تمر عبر قناة مشوّشة (noisy channel) فتخرج على شكل النص المُلاحَظ x.
  2. Derive the noisy channel rule line by line, from argmax P(w|x) through Bayes' rule to argmax P(x|w) P(w).أن تشتق قاعدة القناة المشوّشة سطرًا بسطر، من argmax P(w|x) مرورًا بقاعدة بايز (Bayes' rule) وصولًا إلى argmax P(x|w) P(w).
  3. Explain exactly why P(x) can be dropped, and why the answer does not change when it is.أن تشرح بدقة لماذا يمكن حذف P(x)، ولماذا لا تتغير الإجابة عند حذفه.
  4. Name the two factors (channel or error model, and language model prior) and say what data each one is learned from.أن تسمّي العاملين (نموذج القناة أو نموذج الخطأ، والاحتمال المسبق من نموذج اللغة) وتذكر من أي بيانات يُتعلَّم كل منهما.
  5. Place the model in history (Kernighan, Church and Gale 1990; Mays, Damerau and Mercer 1991) and recognise it in speech recognition and machine translation.أن تضع النموذج في سياقه التاريخي (Kernighan وChurch وGale سنة 1990؛ Mays وDamerau وMercer سنة 1991) وأن تتعرّف عليه في التعرف على الكلام والترجمة الآلية.

Someone types acress. You know at once that this is not an English word. But what did they mean? Maybe actress with the t dropped, maybe across with an e in place of the o, maybe acres with an extra s. You cannot see inside the writer's head. All you have is the damaged string and your knowledge of how people type and what people usually write.

يكتب شخص ما acress. تعرف فورًا أنها ليست كلمة إنجليزية. لكن ماذا قصد؟ ربما actress وقد سقط منها حرف t، وربما across مع e مكان o، وربما acres مع s زائدة. لا يمكنك أن ترى ما في رأس الكاتب. كل ما لديك هو النص التالف، ومعرفتك بكيف يكتب الناس وبما يكتبونه عادةً.

The channel distorts, the decoder reasons backwardsالقناة تشوّه، وفاكّ الترميز يستنتج بالاتجاه المعاكس

The noisy channel model turns that intuition into a model. Imagine the writer's intended word as a clean message. On its way to the page it passes through a channel: tired fingers, a cramped keyboard, a shaky memory of the spelling. The channel adds noise in the form of substituted, inserted, deleted or swapped letters. What arrives is the observed string, which we call xx. The word that was sent we call ww.

يحوّل noisy channel model (نموذج القناة المشوّشة) هذا الحدس إلى نموذج. تخيّل الكلمة التي قصدها الكاتب رسالةً نظيفة. في طريقها إلى الورق تمر عبر قناة: أصابع متعبة، ولوحة مفاتيح ضيقة، وذاكرة مهزوزة للتهجئة. تضيف القناة تشويشًا على شكل حروف مستبدلة أو مُدرجة أو محذوفة أو متبادلة المواقع. وما يصل هو النص المُلاحَظ، ونسمّيه xx. أما الكلمة التي أُرسلت فنسمّيها ww.

Correction runs the picture in reverse. The decoder takes each hypothesis word from the vocabulary, imagines sending it through a model of the same channel, and asks how likely that word is to come out looking like acress. It also asks how likely the word was to be written in the first place. The hypothesis that best explains the noise, weighed by how common it is, becomes the guess. So there are two directions: the channel runs forward from intention to typing, and the decoder runs backward from the typed string to the intention, pushing every hypothesis through its own copy of the channel to see which noisy output matches.

التصحيح يشغّل الصورة بالعكس. يأخذ decoder (فاكّ الترميز) كل كلمة فرضية من المفردات، ويتخيّل إرسالها عبر نموذج للقناة نفسها، ويسأل: ما مدى احتمال أن تخرج هذه الكلمة على شكل acress؟ ويسأل أيضًا: ما مدى احتمال أن تُكتب هذه الكلمة أصلًا؟ والفرضية التي تفسّر التشويش أفضل تفسير، موزونةً بمدى شيوعها، تصبح هي التخمين. إذن هناك اتجاهان: القناة تسير إلى الأمام من النية إلى الكتابة، وفاكّ الترميز يسير إلى الخلف من النص المكتوب إلى النية، فيدفع كل فرضية عبر نسخته الخاصة من القناة ليرى أي مخرج مشوّش يطابق ما رأيناه.

Original word wالكلمة الأصلية w
actress

What the writer meant. Hidden from us.

ما قصده الكاتب، وهو مخفي عنا.

sentتُرسَل
Noisy channelالقناة المشوِّشة
typing, memory, keyboardالكتابة، الذاكرة، لوحة المفاتيح

Adds noise: a letter is dropped, added, replaced or swapped.

تضيف تشويشًا: يُحذف حرف أو يُضاف أو يُستبدل أو يُبدَّل موضعه مع جاره.

observedتُرصَد
Observed xالمرصود x
acress

The only thing the corrector actually sees.

الشيء الوحيد الذي يراه المصحِّح فعلًا.

decodeفكّ الترميز
Guessed word ŵالكلمة المخمَّنة ŵ
argmax over V

The decoder tries each w in V, scores P(x|w) P(w), and keeps the best: our estimate of the hidden word.

يجرّب فاكّ الترميز كل w في V، ويحسب P(x|w) P(w)، ويحتفظ بالأفضل: وهو تقديرنا للكلمة المخفية.

Forward the channel corrupts the word; backward the decoder tries every candidate and keeps the best explanationإلى الأمام تُفسد القناة الكلمة، وإلى الخلف يجرّب فاكّ الترميز كل مرشح ويحتفظ بأفضل تفسير

Notice what the decoder needs. It needs a list of hypotheses to try, which in practice is not the whole vocabulary but a short list of nearby words (that is candidate generation, part 03). It needs a model of the channel, so it can say how likely each hypothesis is to turn into xx. And it needs a sense of which words people actually use. The next concept shows that these last two needs are exactly the two factors that fall out of Bayes' rule.

لاحظ ما يحتاجه فاكّ الترميز. يحتاج قائمة فرضيات يجرّبها، وهي في الواقع ليست المفردات كلها بل قائمة قصيرة من الكلمات القريبة (وهذا هو candidate generation، أي توليد المرشحين، في الجزء 03). ويحتاج نموذجًا للقناة، ليقول ما مدى احتمال أن تتحول كل فرضية إلى xx. ويحتاج إحساسًا بالكلمات التي يستخدمها الناس فعلًا. والمفهوم التالي يبيّن أن هاتين الحاجتين الأخيرتين هما بالضبط العاملان اللذان يخرجان من قاعدة بايز.

Forward through the channel, then back: each hypothesis is pushed through a model of the channel and scored, and the best score becomes ŵإلى الأمام عبر القناة ثم العودة: تُدفع كل فرضية عبر نموذج للقناة وتُعطى درجة، وأفضل درجة تصبح ŵ

Recall

In the noisy channel picture, what is hidden, what is observed, and what does the decoder do?في صورة القناة المشوّشة، ما الخفي، وما المُلاحَظ، وماذا يفعل فاكّ الترميز؟

The intended word w is hidden; the typed string x is observed. The decoder takes each candidate w, runs it through a model of the channel to see how likely it is to produce x, weighs that by how likely w is to be written at all, and returns the best one as ŵ.
الكلمة المقصودة w خفية، والنص المكتوب x مُلاحَظ. يأخذ فاكّ الترميز كل مرشح w، ويمرّره عبر نموذج للقناة ليرى ما مدى احتمال أن ينتج x، ثم يزن ذلك بمدى احتمال أن تُكتب w أصلًا، ويعيد أفضلها على أنه ŵ.

Return to acress. If you could read off, for each candidate word, the probability that it was the intended word given that we saw acress, you would just pick the biggest. That probability is P(w∣x)P(w \mid x), and the whole derivation on slide 11 is about turning it into things we can actually estimate.

عُد إلى acress. لو استطعت أن تقرأ لكل كلمة مرشحة احتمال أن تكون هي الكلمة المقصودة بشرط أننا رأينا acress، لاخترت الأكبر ببساطة. هذا الاحتمال هو P(w∣x)P(w \mid x)، والاشتقاق كله في الشريحة 11 يدور حول تحويله إلى أشياء نستطيع تقديرها فعلًا.

Step 1: state the goalالخطوة 1: حدّد الهدف

Out of every word ww in the vocabulary VV, pick the one with the highest probability given the observation xx. The hat on w^\hat{w} means “our estimate of the correct word”, and argmax means “the argument that makes this largest”, so it returns a word, not a probability.

من بين كل الكلمات ww في المفردات VV، اختر الكلمة ذات الاحتمال الأعلى بشرط الملاحظة xx. القبعة فوق w^\hat{w} تعني «تقديرنا للكلمة الصحيحة»، وargmax تعني «القيمة (المُدخَل) التي تجعل هذا المقدار أكبر ما يمكن»، لذلك فهي تعيد كلمة لا احتمالًا.

w^=argmax⁡w∈VP(w∣x)\hat{w} = \operatorname{argmax}_{w \in V} P(w \mid x)
The goal: the most probable intended word given what was typedالهدف: الكلمة المقصودة الأكثر احتمالًا بمعلومية ما كُتب

Step 2: apply Bayes' ruleالخطوة 2: طبّق قاعدة بايز

Bayes' rule rewrites any conditional probability by flipping it: P(a∣b)=P(b∣a) P(a)/P(b)P(a \mid b) = P(b \mid a)\,P(a) / P(b). With a=wa = w and b=xb = x, the posterior we cannot estimate directly becomes a product of two things we can, divided by a third.

تعيد Bayes' rule (قاعدة بايز) كتابة أي احتمال شرطي بقلبه: P(a∣b)=P(b∣a) P(a)/P(b)P(a \mid b) = P(b \mid a)\,P(a) / P(b). ومع a=wa = w وb=xb = x، يصبح الاحتمال اللاحق (posterior) الذي لا نستطيع تقديره مباشرةً حاصلَ ضرب شيئين نستطيع تقديرهما، مقسومًا على شيء ثالث.

w^=argmax⁡w∈VP(w∣x)=argmax⁡w∈VP(x∣w) P(w)P(x)=argmax⁡w∈VP(x∣w) P(w)\hat{w} = \operatorname{argmax}_{w \in V} P(w \mid x) = \operatorname{argmax}_{w \in V} \frac{P(x \mid w)\,P(w)}{P(x)} = \operatorname{argmax}_{w \in V} P(x \mid w)\,P(w)
The noisy channel rule, exactly as derived on slide 11قاعدة القناة المشوشة، تمامًا كما اشتُقت في الشريحة 11

Step 3: drop P(x), and know whyالخطوة 3: احذف P(x)، واعرف السبب

The denominator P(x)P(x) is the probability of the observed string itself. When we compare candidates, we compare them for the same xx: we are always asking which word best explains acress, never a different string. So P(x)P(x) is one fixed positive number, shared by every candidate. Dividing every score by the same positive number shrinks or stretches all of them equally; it cannot change which one is largest. The argmax is unchanged, so we drop the denominator.

المقام P(x)P(x) هو احتمال النص المُلاحَظ نفسه. عندما نقارن المرشحين، نقارنهم على xx نفسه: نحن نسأل دائمًا أي كلمة تفسّر acress أفضل تفسير، ولا نسأل أبدًا عن نص آخر. إذن P(x)P(x) عدد موجب ثابت واحد يشترك فيه كل المرشحين. وقسمة كل الدرجات على العدد الموجب نفسه تصغّرها أو تكبّرها جميعًا بالنسبة نفسها، ولا يمكن أن تغيّر أيّها الأكبر. قيمة argmax لا تتغير، لذلك نحذف المقام.

There is a practical bonus. Computing P(x)P(x) properly would mean summing P(x∣w) P(w)P(x \mid w)\,P(w) over every possible ww. Dropping it saves that whole sum. The price is that the remaining scores are no longer probabilities that add to one; they are only useful for ranking. That is all the corrector needs.

وهناك فائدة عملية إضافية. حساب P(x)P(x) بشكل صحيح يعني جمع P(x∣w) P(w)P(x \mid w)\,P(w) على كل ww ممكنة. وحذفه يوفّر هذا المجموع كله. والثمن أن الدرجات المتبقية لم تعد احتمالات مجموعها واحد؛ فهي مفيدة للترتيب فقط. وهذا كل ما يحتاجه المصحّح.

Dividing every candidate's score by the same P(x) rescales the bars but leaves the tallest bar, and the whole order, unchangedقسمة درجة كل مرشح على P(x) نفسه تغيّر مقياس الأعمدة، لكنها تُبقي العمود الأطول، والترتيب كله، دون تغيير

Worked exampleمثال محلول

Check the cancellation with real numbers for acressتحقّق من الحذف بأرقام حقيقية لـ acress

  1. Take three candidates and their scoresخذ ثلاثة مرشحين ودرجاتهم

    Jurafsky and Martin (Appendix D, Fig. D.5) give, for acress with a unigram prior: actress has P(x∣w)=0.000117P(x \mid w) = 0.000117 and P(w)=0.0000231P(w) = 0.0000231, so the product is 2.7 × 10⁻⁹. across has 0.0000093 × 0.000299 ≈ 2.8 × 10⁻⁹. access has 0.000000209 × 0.0000916 ≈ 0.019 × 10⁻⁹.
    يعطي Jurafsky وMartin (الملحق D، الشكل D.5) القيم التالية لـ acress مع احتمال مسبق أحادي (unigram prior): actress لها P(x∣w)=0.000117P(x \mid w) = 0.000117 وP(w)=0.0000231P(w) = 0.0000231، فحاصل الضرب 2.7 × 10⁻⁹. وacross لها 0.0000093 × 0.000299 ≈ 2.8 × 10⁻⁹. وaccess لها 0.000000209 × 0.0000916 ≈ 0.019 × 10⁻⁹.
  2. Rank by the product aloneرتّب بحاصل الضرب وحده

    2.8 > 2.7 > 0.019, so the ranking is across, then actress, then access.
    2.8 > 2.7 > 0.019، إذن الترتيب: across أولًا، ثم actress، ثم access.
  3. Now divide by P(x)الآن اقسم على P(x)

    Restrict attention to these three words for illustration, so P(x) ≈ 2.7 + 2.8 + 0.019 = 5.519 × 10⁻⁹. The posteriors become 2.7 / 5.519 ≈ 0.489, 2.8 / 5.519 ≈ 0.507 and 0.019 / 5.519 ≈ 0.003.
    اقصر الانتباه على هذه الكلمات الثلاث للتوضيح، فيكون P(x) ≈ 2.7 + 2.8 + 0.019 = 5.519 × 10⁻⁹. وتصبح الاحتمالات اللاحقة 2.7 / 5.519 ≈ 0.489 و2.8 / 5.519 ≈ 0.507 و0.019 / 5.519 ≈ 0.003.
  4. Resultالنتيجة

    The posteriors sum to one and are easier to read, but the order is identical: across still wins. Dividing by P(x)P(x) changed every number and no ranking. (That across beats the intended actress here is a weakness of the unigram prior, not of the rule; part 05 fixes it with context.)
    مجموع الاحتمالات اللاحقة واحد، وهي أسهل في القراءة، لكن الترتيب مطابق تمامًا: across ما زالت تفوز. القسمة على P(x)P(x) غيّرت كل الأرقام ولم تغيّر أي ترتيب. (وفوز across هنا على الكلمة المقصودة actress نقطة ضعف في الاحتمال المسبق الأحادي unigram، لا في القاعدة؛ والجزء 05 يصلح ذلك بالسياق.)

Name the two factorsسمِّ العاملين

What survives is a product of two very different pieces of knowledge. Learn the names; exams use all of them interchangeably.

ما يتبقى هو حاصل ضرب نوعين مختلفين جدًا من المعرفة. احفظ الأسماء؛ فالاختبارات تستخدمها كلها بالتبادل.

FactorالعاملNamesالأسماءWhat it knowsما الذي يعرفهLearned fromيُتعلَّم من
P(x | w)P(x | w)Channel model, also called the error model or likelihoodنموذج القناة، ويسمّى أيضًا نموذج الخطأ (error model) أو الاحتمال الشرطي (likelihood)How the writer turns an intended word into typed letters: slips, swapped keys, dropped lettersكيف يحوّل الكاتب الكلمة المقصودة إلى حروف مكتوبة: الزلّات، والمفاتيح المتبادلة، والحروف الساقطةError corpora, such as lists of misspellings paired with their correctionsمدوّنات الأخطاء (error corpora)، مثل قوائم الأخطاء الإملائية مقرونةً بتصحيحاتها
P(w)P(w)Language model, the priorنموذج اللغة، أي الاحتمال المسبق (prior)How often the word, or the word in this context, appears in the languageمدى تكرار الكلمة في اللغة، أو مدى تكرارها في هذا السياقPlain text, for example unigram or bigram counts from a large corpusالنص العادي، مثل أعداد unigram أو bigram من مدوّنة نصية كبيرة
The two factors of the noisy channel ruleعاملا قاعدة القناة المشوّشة

P(x∣w)P(x \mid w) is the channel model, also called the error model, and in Bayesian language the likelihood. It is about typing: how likely is a writer who meant actress to produce acress? Part 04 estimates it from a confusion matrix of real typing mistakes. P(w)P(w) is the prior probability, supplied by a language model. It is about the language: how common is actress as a word, or after the word that precedes it? This is exactly the n-gram machinery of lecture 03; a unigram prior uses single-word counts, a bigram language model brings in the previous word.

الحد P(x∣w)P(x \mid w) هو channel model (نموذج القناة)، ويسمّى أيضًا نموذج الخطأ (error model)، وفي لغة بايز هو الاحتمال الشرطي (likelihood). موضوعه الكتابة: ما مدى احتمال أن يكتب شخص قصد actress النص acress؟ والجزء 04 يقدّره من confusion matrix (مصفوفة الالتباس) لأخطاء كتابة حقيقية. أما P(w)P(w) فهو prior probability (الاحتمال المسبق)، ويوفّره نموذج لغة. موضوعه اللغة: ما مدى شيوع actress كلمةً، أو بعد الكلمة التي تسبقها؟ وهذه بالضبط آلية n-gram من المحاضرة 03؛ فـ unigram prior يستخدم أعداد الكلمات المفردة، وbigram language model يُدخل الكلمة السابقة في الحساب.

Two independent sources of evidence: a model of typing slips supplies P(x|w), a model of written text supplies P(w), and the score is their productمصدران مستقلان للدليل: نموذج لزلّات الكتابة يوفّر P(x|w)، ونموذج للنص المكتوب يوفّر P(w)، والدرجة هي حاصل ضربهما

Recall

Which factor knows about typing, and which knows about the language?أي العاملين يعرف عن الكتابة على لوحة المفاتيح، وأيهما يعرف عن اللغة؟

P(x|w), the channel or error model, knows about typing: which letters get dropped, added, swapped or replaced. P(w), the language model prior, knows about the language: how frequent the word is, or how well it fits its context.
P(x|w)، أي نموذج القناة أو نموذج الخطأ، يعرف عن الكتابة: أي الحروف تُحذف أو تُضاف أو تتبادل مواقعها أو تُستبدل. وP(w)، أي الاحتمال المسبق من نموذج اللغة، يعرف عن اللغة: ما مدى تكرار الكلمة، أو ما مدى ملاءمتها لسياقها.

Recall

Without looking, derive ŵ from argmax P(w|x) and justify each step.دون أن تنظر، اشتقّ ŵ من argmax P(w|x) وبرّر كل خطوة.

ŵ = argmax over w in V of P(w|x). By Bayes' rule this is argmax P(x|w) P(w) / P(x). The observation x is the same for every candidate, so P(x) is a shared positive constant; dividing all scores by it cannot change the winner. Therefore ŵ = argmax P(x|w) P(w).
ŵ = argmax over w in V of P(w|x). وبقاعدة بايز يساوي هذا argmax P(x|w) P(w) / P(x). الملاحظة x هي نفسها لكل مرشح، إذن P(x) ثابت موجب مشترك؛ وقسمة كل الدرجات عليه لا يمكن أن تغيّر الفائز. لذلك ŵ = argmax P(x|w) P(w).

Quick checkاختبار سريع

Why can P(x) be dropped when choosing the best correction for a typo?لماذا يمكن حذف P(x) عند اختيار أفضل تصحيح لخطأ إملائي؟

Quick checkاختبار سريع

A phone keyboard replaces a laptop keyboard. Which term of ŵ = argmax P(x|w)P(w) must be re-estimated?استُبدلت لوحة مفاتيح الحاسوب المحمول بلوحة مفاتيح هاتف. أي حد في ŵ = argmax P(x|w)P(w) يجب إعادة تقديره؟

The noisy channel did not start with spelling. Shannon modelled communication as a source passing through a noisy channel in 1948, and IBM researchers combined a prior with a likelihood for optical character recognition in the 1960s. Spelling correction adopted the full prior times likelihood recipe around 1990, at two labs almost at the same time.

لم تبدأ القناة المشوّشة مع الإملاء. فقد نمذج Shannon الاتصال على أنه مصدر يمر عبر قناة مشوّشة سنة 1948، وجمع باحثو IBM بين احتمال مسبق واحتمال شرطي في التعرف الضوئي على الحروف (OCR) في 1960s (الستينيات). وتبنّى تصحيح الإملاء الوصفة الكاملة، الاحتمال المسبق مضروبًا في الاحتمال الشرطي، نحو سنة 1990، في مختبرين في الوقت نفسه تقريبًا.

  • AT&T Bell Labs. Kernighan, Church and Gale, “A spelling correction program based on a noisy channel model”, COLING 1990. They scored candidates for non-word errors with a channel model built from confusion counts, the Kernighan, Church and Gale channel model you will compute in part 04 for the acress example.AT&T Bell Labs. Kernighan وChurch وGale، «A spelling correction program based on a noisy channel model»، COLING 1990. أعطوا درجات للمرشحين في أخطاء الكلمات غير الموجودة (non-word errors) باستخدام نموذج قناة مبني من أعداد الالتباس (confusion counts)، وهو Kernighan, Church and Gale channel model الذي ستحسبه في الجزء 04 لـ acress example.
  • IBM. Mays, Damerau and Mercer, “Context based spelling correction”, Information Processing and Management 27(5), 517 to 522, 1991. They generated candidate sentences by editing each word, scored them with a word language model as the prior, and so applied the channel idea to every word in a sentence. That is how real-word errors are handled in part 06.IBM. Mays وDamerau وMercer، «Context based spelling correction»، Information Processing and Management 27(5), 517 to 522، 1991. ولّدوا جملًا مرشحة بتعديل كل كلمة، وأعطوها درجات باستخدام نموذج لغة على مستوى الكلمات بوصفه الاحتمال المسبق، فطبّقوا بذلك فكرة القناة على كل كلمة في الجملة. وهكذا تُعالَج real-word errors (أخطاء الكلمات الحقيقية) في الجزء 06.

One equation, three fieldsمعادلة واحدة، ثلاثة مجالات

Strip away the word “spelling” and the rule says: to recover a hidden source from a noisy observation, multiply a model of how the source gets distorted by a model of what sources are likely. That recipe is the backbone of classical speech recognition and of the IBM statistical machine translation models. Brown, Della Pietra, Della Pietra and Mercer (1993) call e^=argmax⁡ePr⁡(e) Pr⁡(f∣e)\hat{e} = \operatorname{argmax}_e \Pr(e)\,\Pr(f \mid e) the Fundamental Equation of Machine Translation, derived exactly as on slide 11: Bayes' rule, then drop the denominator because it does not depend on ee.

انزع كلمة «إملاء» وستجد القاعدة تقول: لاستعادة مصدر خفي من ملاحظة مشوّشة، اضرب نموذجًا لكيفية تشوّه المصدر في نموذج لما هو مرجّح من المصادر. هذه الوصفة هي العمود الفقري للتعرف على الكلام الكلاسيكي ولنماذج الترجمة الآلية الإحصائية من IBM. ويسمّي Brown وDella Pietra وDella Pietra وMercer (1993) الصيغة e^=argmax⁡ePr⁡(e) Pr⁡(f∣e)\hat{e} = \operatorname{argmax}_e \Pr(e)\,\Pr(f \mid e) «المعادلة الأساسية للترجمة الآلية» (Fundamental Equation of Machine Translation)، وتُشتق تمامًا كما في الشريحة 11: قاعدة بايز، ثم حذف المقام لأنه لا يعتمد على ee.

TaskالمهمةObservedالمُلاحَظHidden sourceالمصدر الخفيChannel modelنموذج القناةPriorالاحتمال المسبق
Spelling correctionتصحيح الإملاءTyped string xالنص المكتوب xIntended word wالكلمة المقصودة wP(x | w)P(x | w)P(w)P(w)
Speech recognitionالتعرف على الكلامAudio signalالإشارة الصوتيةWord sequenceتسلسل الكلماتAcoustic model P(audio | words)النموذج الصوتي P(audio | words)Language model P(words)نموذج اللغة P(words)
Machine translationالترجمة الآليةFrench sentence fالجملة الفرنسية fEnglish sentence eالجملة الإنجليزية eTranslation model Pr(f | e)نموذج الترجمة Pr(f | e)Language model Pr(e)نموذج اللغة Pr(e)
The same noisy channel decomposition in three tasksتفكيك القناة المشوّشة نفسه في ثلاث مهام

In all three, the prior is a language model, the very n-gram model from lecture 03. That is why one good language model can be reused across spelling, speech and translation, while each task brings its own channel. It also explains how this lecture is organised: parts 03 and 04 build the channel side, parts 04 and 05 the language model side, and parts 06 to 08 extend the same product to context and to real systems.

في المهام الثلاث كلها، الاحتمال المسبق نموذج لغة، وهو نموذج n-gram نفسه من المحاضرة 03. ولهذا يمكن إعادة استخدام نموذج لغة جيد واحد في الإملاء والكلام والترجمة، بينما تأتي كل مهمة بقناتها الخاصة. وهذا يفسّر أيضًا تنظيم هذه المحاضرة: الجزآن 03 و04 يبنيان جانب القناة، والجزآن 04 و05 جانب نموذج اللغة، والأجزاء من 06 إلى 08 توسّع حاصل الضرب نفسه ليشمل السياق والأنظمة الحقيقية.

Recall

In speech recognition, what plays the role of P(x|w) and what plays the role of P(w)?في التعرف على الكلام، ما الذي يؤدي دور P(x|w)، وما الذي يؤدي دور P(w)؟

The acoustic model, P(audio | words), is the channel: it says how a word sequence sounds once spoken. The language model, P(words), is the prior. The recogniser picks the word sequence that maximises their product.
النموذج الصوتي (acoustic model)، P(audio | words)، هو القناة: يقول كيف يبدو تسلسل الكلمات صوتيًا عند نطقه. ونموذج اللغة، P(words)، هو الاحتمال المسبق. ويختار المُعرِّف تسلسل الكلمات الذي يجعل حاصل ضربهما أكبر ما يمكن.

Quick checkاختبار سريع

In statistical translation from French f into English e, what plays the role of P(w)?في الترجمة الإحصائية من الفرنسية f إلى الإنجليزية e، ما الذي يؤدي دور P(w)؟

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • The noisy channel view: the writer meant a correct word w, the typing process distorted it, and we observe x. Correction means recovering w from x.منظور القناة المشوّشة: قصد الكاتب كلمة صحيحة w، فشوّهتها عملية الكتابة، ونحن نلاحظ x. التصحيح يعني استعادة w من x.
  • The decoder runs every hypothesis w through a model of the channel and keeps the one most likely to have produced x.يمرّر فاكّ الترميز (decoder) كل فرضية w عبر نموذج للقناة، ويحتفظ بالفرضية الأرجح أن تكون قد أنتجت x.
  • Start from ŵ = argmax over w in V of P(w|x). Bayes' rule rewrites P(w|x) as P(x|w) P(w) / P(x).نبدأ من ŵ = argmax على كل w في V لـ P(w|x). قاعدة بايز تعيد كتابة P(w|x) على شكل P(x|w) P(w) / P(x).
  • P(x) is the same number for every candidate, because x is fixed. Dividing every score by the same positive number cannot change which one is largest, so P(x) is dropped.قيمة P(x) هي العدد نفسه لكل مرشح، لأن x ثابت. وقسمة كل الدرجات على العدد الموجب نفسه لا يمكن أن تغيّر أيّها الأكبر، لذلك نحذف P(x).
  • Final rule: ŵ = argmax P(x|w) P(w). P(x|w) is the channel or error model (likelihood, knows about typing). P(w) is the language model (prior, knows about the language).القاعدة النهائية: ŵ = argmax P(x|w) P(w). الحد P(x|w) هو نموذج القناة أو نموذج الخطأ (الاحتمال الشرطي likelihood، ويعرف عن الكتابة على لوحة المفاتيح). والحد P(w) هو نموذج اللغة (الاحتمال المسبق prior، ويعرف عن اللغة).
  • We estimate the two factors separately because each is learned from different data: error corpora for P(x|w), plain text for P(w).نقدّر العاملين كلًّا على حدة لأن كل واحد منهما يُتعلَّم من بيانات مختلفة: مدوّنات الأخطاء (error corpora) لـ P(x|w)، والنص العادي لـ P(w).
  • The same decomposition drives speech recognition and statistical machine translation. For spelling it was proposed around 1990 at AT&T Bell Labs and IBM.التفكيك نفسه هو ما يقود التعرف على الكلام والترجمة الآلية الإحصائية. وفي الإملاء اقتُرح نحو سنة 1990 في مختبرات AT&T Bell Labs وفي IBM.

Sourcesالمصادر