Majid Al-RaimiScoring acress: unigram vs bigram contextتقييم acress: سياق unigram مقابل bigram

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

Scoring acress: unigram vs bigram contextتقييم acress: سياق unigram مقابل bigram

Multiply channel and prior for every candidate, see the unigram model pick across, then watch a bigram context flip the answer to actress, and how such systems are evaluated.نضرب احتمال القناة في الاحتمال المسبق لكل مرشح، فنرى نموذج unigram يختار across، ثم نشاهد سياق bigram يقلب الإجابة إلى actress، وكيف تُقيَّم مثل هذه الأنظمة.

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

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

Parts 03 and 04 built the two halves of the noisy channel for the misspelling acress: a list of six candidate words, a channel probability for each edit, and a prior for each word. This part finally multiplies them together. The result is a lesson every NLP student remembers: the model, done carefully, picks the wrong word, and a single bigram of context is enough to fix it.

The ideas come in three steps. First, score every candidate with a unigram prior and see across beat actress by a hair. Second, swap the unigram for a bigram language model and watch the context word whose pull actress far ahead. Third, see how such correctors are measured on public lists of real misspellings. For the exam, the skill is arithmetic with very small numbers: write every factor, multiply, keep the powers of ten straight, and compare.

بنى الجزءان 03 و04 نصفَي القناة المشوشة للخطأ الإملائي acress: قائمة من ستة مرشّحين، واحتمال قناة لكل تعديل، واحتمال مسبق لكل كلمة. وفي هذا الجزء نضربهما معًا أخيرًا. والنتيجة درس يتذكره كل طالب NLP: النموذج، حتى حين يُطبَّق بعناية، يختار الكلمة الخاطئة، وbigram واحد من السياق يكفي لإصلاح ذلك.

تأتي الأفكار في ثلاث خطوات. أولًا، نقيّم كل مرشّح باحتمال مسبق أحادي الكلمة (unigram) فنرى across تتفوق على actress بفارق شعرة. ثانيًا، نستبدل الـ unigram بنموذج لغة ثنائي الكلمات (bigram) ونشاهد كلمة السياق whose تسحب actress بعيدًا إلى الأمام. ثالثًا، نرى كيف تُقاس هذه المصحّحات على قوائم عامة من أخطاء إملائية حقيقية. والمهارة المطلوبة في الامتحان هي الحساب بأعداد صغيرة جدًا: اكتب كل عامل، واضرب، وحافظ على قوى العشرة صحيحة، ثم قارن.

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

  1. Fill in the noisy channel table for acress: multiply P(x|w) by P(w) for every candidate and rank them.تملأ جدول القناة المشوشة للكلمة acress: تضرب P(x|w) في P(w) لكل مرشّح ثم ترتّب المرشّحين.
  2. Explain why the unigram model picks across, and why that answer is wrong in context.تشرح لماذا يختار النموذج أحادي الكلمة (unigram) الكلمة across، ولماذا تكون هذه الإجابة خاطئة في السياق.
  3. Replace the unigram prior with bigram probabilities on both sides of the error and recompute the decision.تستبدل الاحتمال المسبق أحادي الكلمة باحتمالات ثنائية الكلمات (bigram) على جانبي الخطأ وتعيد حساب القرار.
  4. Combine channel and bigram scores into one product, state by what factor actress wins, and avoid counting P(w) twice.تجمع درجة القناة ودرجة الـ bigram في حاصل ضرب واحد، وتذكر بأي عامل تفوز actress، وتتجنب احتساب P(w) مرتين.
  5. Name the standard spelling error test sets and explain how to split them for training, tuning and testing.تسمّي مجموعات الاختبار القياسية لأخطاء الإملاء وتشرح كيف تُقسَّم للتدريب والضبط والاختبار.

Take the acress example. Candidate generation gave us actress, cress, caress, access, across and acres, each one edit away from the typed string. Two candidates look strong to a human: actress, if a t was dropped, and across, if an o was typed as an e. Which one should a machine choose?

خذ مثال acress. أعطانا توليد المرشّحين الكلمات actress وcress وcaress وaccess وacross وacres، وكل منها على بُعد تعديل واحد من السلسلة المكتوبة. يبدو مرشّحان قويين للإنسان: actress إذا سقط حرف t، وacross إذا كُتب حرف o على أنه e. فأيهما يجب أن تختار الآلة؟

The score is a product of two columnsالدرجة حاصل ضرب عمودين

The noisy channel model answers by Bayes. For each candidate w it multiplies two numbers. The channel model P(x|w) says how likely the typist was to produce acress when they meant w; it comes from the Kernighan, Church and Gale confusion matrices. The prior P(w) says how likely w is in the first place. Here the prior is a unigram prior: the word's count in COCA divided by the corpus size. The decision is the argmax of the product.

يجيب نموذج القناة المشوشة (noisy channel model) بقاعدة بايز. فلكل مرشّح w يضرب عددين. نموذج القناة (channel model) P(x|w) يقول ما مدى احتمال أن يكتب الكاتب acress وهو يقصد w، ويأتي من مصفوفات الالتباس (confusion matrices) عند Kernighan, Church and Gale. أما الاحتمال المسبق (prior) P(w) فيقول ما مدى احتمال w أصلًا. والاحتمال المسبق هنا احتمال مسبق أحادي الكلمة (unigram prior): عدد مرات ظهور الكلمة في COCA مقسومًا على حجم المدوّنة. والقرار هو argmax لحاصل الضرب.

w^=argmax⁡w∈C  P(x∣w) P(w)\hat{w} = \operatorname*{argmax}_{w \in C} \; P(x \mid w)\, P(w)
Unigram noisy channel decision over the candidate set Cقرار القناة المشوشة بنموذج unigram على مجموعة المرشحين C

The table below is that product for every candidate. The edit column uses the slide's x|w notation: typed letters on the left, intended letters on the right. So c|ct is a deletion (the t after c was lost), e|o is a substitution, ac|ca is a transposition, and both acres rows are an insertion of an extra s. The last column is multiplied by 10⁹ only to make the tiny products readable.

الجدول التالي هو حاصل الضرب هذا لكل مرشّح. يستخدم عمود التعديل ترميز الشريحة x|w: الحروف المكتوبة على اليسار والحروف المقصودة على اليمين. فـ c|ct هو حذف (deletion) (ضاع حرف t بعد c)، وe|o هو استبدال (substitution)، وac|ca هو تبديل مواقع (transposition)، وكلا صفَّي acres هما إدراج (insertion) لحرف s زائد. والعمود الأخير مضروب في 10⁹ فقط لتسهيل قراءة حواصل الضرب الصغيرة جدًا.

CandidateالمرشّحEdit x|wالتعديل x|wP(x|w)P(x|w)P(w)P(w)10⁹ × product10⁹ × حاصل الضرب
actressactressc|ctc|ct.000117.000117.0000231.00002312.702.70
cresscressa|#a|#.00000144.00000144.000000544.000000544.00078.00078
caresscaressac|caac|ca.00000164.00000164.00000170.00000170.0028.0028
accessaccessr|cr|c.000000209.000000209.0000916.0000916.019.019
acrossacrosse|oe|o.0000093.0000093.000299.0002992.782.78
acresacreses|ees|e.0000321.0000321.0000318.00003181.021.02
acresacresss|sss|s.0000342.0000342.0000318.00003181.091.09
Noisy channel scores for acress with a unigram prior (last column is 10⁹ × P(x|w) P(w), recomputed to three figures)درجات القناة المشوشة للكلمة acress مع احتمال مسبق أحادي الكلمة (العمود الأخير هو 10⁹ × P(x|w) P(w)، مُعاد حسابه بثلاثة أرقام)

Worked exampleمثال محلول

The two leaders, multiplied outالمتصدّران، بعد إجراء الضرب

  1. actressactress

    P(x|w) × P(w) = .000117 × .0000231. Write both in scientific form: 1.17 × 10⁻⁴ × 2.31 × 10⁻⁵ = 2.70 × 10⁻⁹. The channel term is large (dropping a t after c is a common slip) but actress is a fairly rare word.
    P(x|w) × P(w) = .000117 × .0000231. اكتب العددين بالصيغة العلمية: 1.17 × 10⁻⁴ × 2.31 × 10⁻⁵ = 2.70 × 10⁻⁹. حدّ القناة كبير (إسقاط حرف t بعد c زلّة شائعة)، لكن actress كلمة نادرة نسبيًا.
  2. acrossacross

    .0000093 × .000299 = 9.3 × 10⁻⁶ × 2.99 × 10⁻⁴ = 2.78 × 10⁻⁹. The channel term is about 12 times smaller than actress's, but across is about 13 times more frequent, so the prior almost exactly cancels the channel.
    .0000093 × .000299 = 9.3 × 10⁻⁶ × 2.99 × 10⁻⁴ = 2.78 × 10⁻⁹. حدّ القناة أصغر بنحو 12 مرة من حدّ actress، لكن across أكثر شيوعًا بنحو 13 مرة، فيكاد الاحتمال المسبق يلغي أثر القناة تمامًا.
  3. Compareالمقارنة

    2.78 / 2.70 ≈ 1.03. across leads by about 3%. Every other row scores less than half of across, so the race is between these two.
    2.78 / 2.70 ≈ 1.03. تتقدم across بنحو 3%. وكل صف آخر يحصل على أقل من نصف درجة across، فالسباق محصور بين هاتين الكلمتين.
  4. Resultالنتيجة

    The unigram noisy channel chooses across, with actress a close second.
    القناة المشوشة أحادية الكلمة تختار across، وتأتي actress في المرتبة الثانية بفارق ضئيل.
A photo finish on a log scale: across and actress end almost at the same line, acres trails at about 1, and access, caress and cress are two to three orders of magnitude behind.نهاية متقاربة على مقياس لوغاريتمي: تنتهي across و actress تقريبًا عند الخط نفسه، وتتأخر acres عند نحو 1، بينما تتأخر access و caress و cress بمرتبتين إلى ثلاث مراتب عشرية.

Why the answer is wrong, and what the model could not seeلماذا الإجابة خاطئة، وما الذي لم يستطع النموذج رؤيته

The sentence this misspelling came from reads "a stellar and versatile acress whose combination of sass and glamour". Any reader knows the writer meant actress. The model chose across because its prior asks only how common a word is in general, and across is a very common word. Nothing in P(w) looks at the neighbors. The two factors also see different evidence: the channel looks at letters, the prior at word frequency, and neither one looks at the sentence.

الجملة التي جاء منها هذا الخطأ الإملائي هي "a stellar and versatile acress whose combination of sass and glamour". وأي قارئ يعرف أن الكاتب قصد actress. اختار النموذج across لأن احتماله المسبق لا يسأل إلا عن مدى شيوع الكلمة عمومًا، وacross كلمة شائعة جدًا. لا شيء في P(w) ينظر إلى الكلمات المجاورة. كما أن العاملين يريان أدلة مختلفة: القناة تنظر إلى الحروف، والاحتمال المسبق إلى تكرار الكلمة، ولا أحد منهما ينظر إلى الجملة.

Recall

Compute 10⁹ × P(x|w)P(w) for actress and for across, and say which the unigram model picks.احسب 10⁹ × P(x|w)P(w) لكل من actress و across، وقل أيهما يختار النموذج أحادي الكلمة.

actress: .000117 × .0000231 = 2.70 × 10⁻⁹, so 2.70. across: .0000093 × .000299 = 2.78 × 10⁻⁹, so 2.78. The unigram model picks across by about 3%.
actress: .000117 × .0000231 = 2.70 × 10⁻⁹، أي 2.70. across: .0000093 × .000299 = 2.78 × 10⁻⁹، أي 2.78. يختار النموذج أحادي الكلمة across بفارق نحو 3%.

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

Using only the unigram prior, which candidate does the noisy channel choose for acress?باستخدام الاحتمال المسبق أحادي الكلمة وحده، أي مرشّح تختاره القناة المشوشة للكلمة acress؟

Put acress back in its sentence: "versatile acress whose". Ask two questions a reader asks without thinking. Does the candidate follow versatile naturally? Does whose follow the candidate naturally? A versatile actress whose career is a normal phrase. A versatile across whose is not English.

أعد acress إلى جملتها: "versatile acress whose". واطرح سؤالين يطرحهما القارئ دون تفكير. هل يأتي المرشّح بعد versatile بشكل طبيعي؟ وهل تأتي whose بعد المرشّح بشكل طبيعي؟ عبارة "a versatile actress whose career" عبارة عادية، أما "a versatile across whose" فليست إنجليزية.

Replace P(w) with the bigrams on both sidesاستبدل P(w) بالـ bigrams على الجانبين

A bigram language model turns those two questions into numbers. The candidate sits between two bigrams, one with the word before it and one with the word after it, so the prior for the candidate in this position is P(w | versatile) × P(whose | w). The counts come from COCA with add-1 smoothing, so a bigram never seen in the corpus still gets a small nonzero probability.

يحوّل نموذج اللغة ثنائي الكلمات (bigram language model) هذين السؤالين إلى أرقام. يقع المرشّح بين اثنين من الـ bigrams: واحد مع الكلمة التي قبله وواحد مع الكلمة التي بعده، لذا فإن الاحتمال المسبق للمرشّح في هذا الموضع هو P(w | versatile) × P(whose | w). وتأتي الأعداد من COCA مع التنعيم بإضافة واحد (add-1 smoothing)، فيحصل حتى الـ bigram الذي لم يظهر قط في المدوّنة على احتمال صغير غير صفري.

w^=argmax⁡w∈C  P(x∣w)  P(wi=w∣wi−1)  P(wi+1∣wi=w)\hat{w} = \operatorname*{argmax}_{w \in C} \; P(x \mid w)\; P(w_i = w \mid w_{i-1})\; P(w_{i+1} \mid w_i = w)
Bigram noisy channel: the channel term times the bigrams into and out of the corrected positionالقناة المشوشة بنموذج bigram: حد القناة مضروبًا في bigrams الداخلة إلى الموضع المصحَّح والخارجة منه
  • P(actress | versatile) = .000021 and P(across | versatile) = .000021. The left bigram is a tie, so it tells the two candidates apart not at all.P(actress | versatile) = .000021 وP(across | versatile) = .000021. الـ bigram الأيسر متعادل، فلا يميّز بين المرشّحين على الإطلاق.
  • P(whose | actress) = .0010 and P(whose | across) = .000006. The right bigram is where the evidence lives: whose follows a person noun often and follows a preposition almost never.P(whose | actress) = .0010 وP(whose | across) = .000006. الـ bigram الأيمن هو مكان الدليل: تأتي whose كثيرًا بعد اسم يدل على شخص، ولا تأتي تقريبًا أبدًا بعد حرف جر.
Both candidates connect to versatile equally well. Only actress connects to whose: its right arc is thick (.0010) while across has a hairline (.000006).يرتبط المرشّحان بـ versatile بالقدر نفسه. وحدها actress ترتبط بـ whose: قوسها الأيمن سميك (.0010) بينما لـ across خيط رفيع (.000006).

Worked exampleمثال محلول

Language model alone, as on the slideنموذج اللغة وحده، كما في الشريحة

  1. actress in contextactress في السياق

    P("versatile actress whose") = .000021 × .0010 = 2.1 × 10⁻⁸ = 210 × 10⁻¹⁰.
    P("versatile actress whose") = .000021 × .0010 = 2.1 × 10⁻⁸ = 210 × 10⁻¹⁰.
  2. across in contextacross في السياق

    P("versatile across whose") = .000021 × .000006 = 1.26 × 10⁻¹⁰, which the slide rounds to 1 × 10⁻¹⁰.
    P("versatile across whose") = .000021 × .000006 = 1.26 × 10⁻¹⁰، وتقرّبها الشريحة إلى 1 × 10⁻¹⁰.
  3. Resultالنتيجة

    The context alone favors actress by 2.1 × 10⁻⁸ / 1.26 × 10⁻¹⁰ ≈ 167 times.
    السياق وحده يرجّح actress بـ 2.1 × 10⁻⁸ / 1.26 × 10⁻¹⁰ ≈ 167 مرة.

The slides stop at the language model numbers. Jurafsky and Martin's appendix, where this example comes from, adds one sentence: combining the language model with the error model, the bigram noisy channel now chooses actress. That combining step multiplies by the channel term P(x|w). Here it is.

تتوقف الشرائح عند أرقام نموذج اللغة. أما ملحق Jurafsky and Martin، الذي أُخذ منه هذا المثال، فيضيف جملة واحدة: بدمج نموذج اللغة مع نموذج الخطأ، تختار القناة المشوشة ثنائية الكلمات الآن actress. وخطوة الدمج هذه تعني الضرب في حدّ القناة P(x|w). وإليك هذه الخطوة.

Worked exampleمثال محلول

Full bigram noisy channel score, the step the slides skipالدرجة الكاملة للقناة المشوشة ثنائية الكلمات، الخطوة التي تتخطاها الشرائح

  1. actressactress

    P(x|w) × P(actress | versatile) × P(whose | actress) = .000117 × .000021 × .0010. In scientific form: 1.17 × 10⁻⁴ × 2.1 × 10⁻⁸ = 2.46 × 10⁻¹².
    P(x|w) × P(actress | versatile) × P(whose | actress) = .000117 × .000021 × .0010. وبالصيغة العلمية: 1.17 × 10⁻⁴ × 2.1 × 10⁻⁸ = 2.46 × 10⁻¹².
  2. acrossacross

    .0000093 × .000021 × .000006 = 9.3 × 10⁻⁶ × 1.26 × 10⁻¹⁰ = 1.17 × 10⁻¹⁵.
    .0000093 × .000021 × .000006 = 9.3 × 10⁻⁶ × 1.26 × 10⁻¹⁰ = 1.17 × 10⁻¹⁵.
  3. Compareالمقارنة

    2.46 × 10⁻¹² / 1.17 × 10⁻¹⁵ ≈ 2,100. That is the context ratio (≈167) times the channel ratio (.000117 / .0000093 ≈ 12.6).
    2.46 × 10⁻¹² / 1.17 × 10⁻¹⁵ ≈ 2,100. وهذا هو نسبة السياق (≈167) مضروبة في نسبة القناة (.000117 / .0000093 ≈ 12.6).
  4. Resultالنتيجة

    The bigram noisy channel chooses actress by about 2,100 times. The 3% unigram lead of across is gone.
    القناة المشوشة ثنائية الكلمات تختار actress بنحو 2,100 مرة. وقد اختفى تقدّم across البالغ 3% في النموذج أحادي الكلمة.
SimulatorمحاكيScore acress with a unigram or a bigram priorقيّم acress باحتمال مسبق unigram أو bigram

Score P(x|w) × P(w) for every candidate. Each row lists its factors, and the bar is on a log scale.احسب الدرجة P(x|w) × P(w) لكل مرشح. يعرض كل صف عوامله، والشريط على مقياس لوغاريتمي.

  1. acrosse|o2.78 × 10-9.00000930 × .000299
  2. actressc|ct2.70 × 10-9.000117 × .0000231
  3. acresss|s1.09 × 10-9.0000342 × .0000318
  4. acreses|e1.02 × 10-9.0000321 × .0000318
  5. accessr|c1.91 × 10-11.000000209 × .0000916
  6. caressac|ca2.79 × 10-12.00000164 × .00000170
  7. cressa|#7.83 × 10-13.00000144 × .000000544
Winneracross2.78 × 10-9
Runner-upactress2.70 × 10-9
Margin1.03×winner score ÷ runner-up scoreدرجة الفائز ÷ درجة الوصيف
Unigram priorالاحتمال المسبق أحادي الكلمة (unigram)Bigram contextسياق ثنائي الكلمات (bigram)
Prior factorعامل الاحتمال المسبقP(w)P(w)P(w | versatile) × P(whose | w)P(w | versatile) × P(whose | w)
What it knowsما الذي يعرفهHow common the word is anywhere in COCAمدى شيوع الكلمة في أي مكان من COCAHow well the word fits between its actual neighborsمدى اتّساق الكلمة بين جارتيها الفعليتين
actress scoreدرجة actress2.70 × 10⁻⁹2.70 × 10⁻⁹2.46 × 10⁻¹²2.46 × 10⁻¹²
across scoreدرجة across2.78 × 10⁻⁹2.78 × 10⁻⁹1.17 × 10⁻¹⁵1.17 × 10⁻¹⁵
Decisionالقرارacross, by about 3%across، بفارق نحو 3%actress, by about 2,100 timesactress، بنحو 2,100 مرة
Unigram and bigram priors on the same two candidatesالاحتمال المسبق أحادي الكلمة وثنائي الكلمات على المرشّحين أنفسهما

Recall

Which bigram decides between actress and across, and what are its two values?أي bigram يحسم الاختيار بين actress و across، وما قيمتاه؟

The right-hand bigram into whose: P(whose | actress) = .0010 against P(whose | across) = .000006. The left bigram from versatile is .000021 for both, so it cancels.
الـ bigram الأيمن الداخل إلى whose: P(whose | actress) = .0010 مقابل P(whose | across) = .000006. أما الـ bigram الأيسر من versatile فقيمته .000021 للاثنين، فيلغي أحدهما الآخر.

Recall

Compute the full bigram noisy channel score for actress and across, and the ratio.احسب الدرجة الكاملة للقناة المشوشة ثنائية الكلمات لكل من actress و across، والنسبة بينهما.

actress: .000117 × .000021 × .0010 = 2.46 × 10⁻¹². across: .0000093 × .000021 × .000006 = 1.17 × 10⁻¹⁵. actress wins by about 2,100 times, the context ratio 167 times the channel ratio 12.6.
actress: .000117 × .000021 × .0010 = 2.46 × 10⁻¹². across: .0000093 × .000021 × .000006 = 1.17 × 10⁻¹⁵. تفوز actress بنحو 2,100 مرة، وهي نسبة السياق 167 مضروبة في نسبة القناة 12.6.

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

Using the unrounded bigram probabilities on slide 27, by roughly what factor does the context alone favor actress over across?باستخدام احتمالات الـ bigram غير المقرَّبة في الشريحة 27، بأي عامل تقريبًا يرجّح السياق وحده actress على across؟

One sentence about an actress proves nothing about a corrector. To know whether the bigram model is better in general, you run it on thousands of real misspellings whose intended word is known and count how often the top suggestion is right.

جملة واحدة عن ممثلة لا تثبت شيئًا عن المصحّح. ولكي تعرف هل نموذج الـ bigram أفضل بشكل عام، تشغّله على آلاف الأخطاء الإملائية الحقيقية التي تُعرف كلمتها المقصودة، وتعدّ كم مرة يكون الاقتراح الأول صحيحًا.

Where the misspellings come fromمن أين تأتي الأخطاء الإملائية

A spelling error test set is a list of pairs: what was typed, and what was meant. The slide names four public ones. They differ in size and in where the errors came from, and that matters: typing slips on a keyboard and handwritten spelling-test mistakes by schoolchildren are different error distributions, and a channel model trained on one may do poorly on the other.

مجموعة اختبار أخطاء الإملاء (spelling error test set) هي قائمة من الأزواج: ما كُتب، وما كان مقصودًا. تذكر الشريحة أربع مجموعات عامة منها. وهي تختلف في الحجم وفي مصدر الأخطاء، وهذا مهم: زلّات الكتابة على لوحة المفاتيح وأخطاء التلاميذ في اختبارات الإملاء المكتوبة بخط اليد هي توزيعات أخطاء مختلفة، ونموذج القناة المدرَّب على أحدها قد يؤدي أداءً ضعيفًا على الآخر.

Test setمجموعة الاختبارWhat it isما هيSizeالحجم
Wikipedia list of common misspellingsقائمة ويكيبيديا للأخطاء الإملائية الشائعةPairs collected by Wikipedia editors, one misspelling to one or more correctionsأزواج جمعها محررو ويكيبيديا، كل خطأ إملائي مقابل تصحيح واحد أو أكثر2,455 misspellings of 1,922 words (Mitton's processed copy)2,455 خطأ إملائيًا لـ 1,922 كلمة (النسخة المعالجة لدى Mitton)
Aspell filtered listالقائمة المفلترة عبر AspellA test set Atkinson built to test the GNU Aspell checkerمجموعة اختبار بناها Atkinson لاختبار المدقق GNU Aspell531 misspellings of 450 words531 خطأ إملائيًا لـ 450 كلمة
Birkbeck spelling error corpusمدوّنة Birkbeck لأخطاء الإملاءMitton's collection, mostly handwritten errors from school pupils, students and adult literacy learnersمجموعة Mitton، ومعظمها أخطاء مكتوبة بخط اليد من تلاميذ المدارس وطلاب الجامعات ومتعلمي محو الأمية من الكبار36,133 misspellings of 6,136 words36,133 خطأ إملائيًا لـ 6,136 كلمة
Norvig's listقائمة NorvigNorvig's bundle that includes the Wikipedia and Birkbeck data, offered for training or testingحزمة Norvig التي تتضمن بيانات ويكيبيديا وBirkbeck، وتُقدَّم للتدريب أو الاختبارCombines the sources aboveتجمع المصادر السابقة
The four test sets on slide 29مجموعات الاختبار الأربع في الشريحة 29

How to use them honestlyكيف تستخدمها بنزاهة

The lists serve two roles. Training data gives the counts for the confusion matrices. Test data measures the finished system. Keep them apart, and hold out a third slice, the development test set, for tuning choices such as the lambda weighting you will meet in part 07. Norvig did exactly this with Birkbeck: he developed on 270 misspellings and reported the final number on a separate 400, scoring 75% on the first and 68% on the second. The gap shows how much a score measured on the data you tuned on overstates real performance.

تؤدي هذه القوائم دورين. بيانات التدريب تعطي الأعداد لمصفوفات الالتباس، وبيانات الاختبار تقيس النظام النهائي. افصل بينهما، واحجز شريحة ثالثة هي مجموعة اختبار التطوير (development test set) لضبط الخيارات مثل ترجيح lambda الذي ستقابله في الجزء 07. وهذا بالضبط ما فعله Norvig مع Birkbeck: طوّر على 270 خطأ إملائيًا وأعلن الرقم النهائي على 400 منفصلة، فحصل على 75% في الأولى و68% في الثانية. ويُظهر هذا الفارق كم تبالغ الدرجة المقيسة على البيانات التي ضبطت عليها في تقدير الأداء الحقيقي.

Each known misspelling pair goes to exactly one bucket: train for counts, dev for tuning, test for the number you report.كل زوج خطأ إملائي معروف يذهب إلى سلة واحدة فقط: train للأعداد، و dev للضبط، و test للرقم الذي تعلنه.

Recall

Name the four test sets on slide 29 and one fact about each.سمِّ مجموعات الاختبار الأربع في الشريحة 29 واذكر معلومة واحدة عن كل منها.

Wikipedia's list of common misspellings (editor-collected pairs); its Aspell-filtered version (the GNU Aspell test set, 531 misspellings); the Birkbeck corpus (Mitton, about 36,000 misspellings, mostly handwritten); Norvig's list, which includes Wikipedia and Birkbeck and is offered for training or testing.
قائمة ويكيبيديا للأخطاء الإملائية الشائعة (أزواج جمعها المحررون)؛ ونسختها المفلترة عبر Aspell (مجموعة اختبار GNU Aspell، 531 خطأ إملائيًا)؛ ومدوّنة Birkbeck (Mitton، نحو 36,000 خطأ إملائي، معظمها مكتوب بخط اليد)؛ وقائمة Norvig التي تتضمن ويكيبيديا وBirkbeck وتُقدَّم للتدريب أو الاختبار.

Recapالخلاصة

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

  • The noisy channel score for a candidate w is P(x|w) × P(w). Multiply the two columns, then rank.درجة القناة المشوشة لمرشّح w هي P(x|w) × P(w). اضرب العمودين ثم رتّب.
  • With a unigram prior, across (2.78 × 10^-9) edges out actress (2.70 × 10^-9), a 3% margin. The model picks across, and it is wrong.مع احتمال مسبق أحادي الكلمة تتقدم across (2.78 × 10^-9) بفارق ضئيل على actress (2.70 × 10^-9)، بهامش 3%. يختار النموذج across، وهو مخطئ.
  • Two derivations of acres (es|e and ss|s) can be summed to about 2.1 × 10^-9. acres still loses.يمكن جمع اشتقاقَي acres (es|e و ss|s) لنحصل على نحو 2.1 × 10^-9. ومع ذلك تبقى acres خاسرة.
  • A bigram prior scores the candidate against both neighbors: P(w | versatile) × P(whose | w).الاحتمال المسبق ثنائي الكلمات يقيّم المرشّح مقابل جاريه كليهما: P(w | versatile) × P(whose | w).
  • P(whose | actress) = .0010 against P(whose | across) = .000006. That right-hand bigram does all the work.P(whose | actress) = .0010 مقابل P(whose | across) = .000006. هذا الـ bigram الأيمن يقوم بكل العمل.
  • Context alone favors actress by about 167 times (2.1 × 10^-8 against 1.26 × 10^-10; the slide rounds the second to 1 × 10^-10).السياق وحده يرجّح actress بنحو 167 مرة (2.1 × 10^-8 مقابل 1.26 × 10^-10، والشريحة تقرّب الثاني إلى 1 × 10^-10).
  • Full bigram noisy channel P(x|w) P(w|versatile) P(whose|w): actress 2.46 × 10^-12 against across 1.17 × 10^-15, so actress wins by about 2,100 times.القناة المشوشة الكاملة بالـ bigram هي P(x|w) P(w|versatile) P(whose|w): actress تساوي 2.46 × 10^-12 مقابل 1.17 × 10^-15 لـ across، فتفوز actress بنحو 2,100 مرة.
  • Evaluate on real misspelling lists: Wikipedia's list, its Aspell-filtered version, the Birkbeck corpus, and Norvig's collection, split into train, dev and test.قيّم على قوائم أخطاء إملائية حقيقية: قائمة ويكيبيديا، ونسختها المفلترة عبر Aspell، ومدوّنة Birkbeck، ومجموعة Norvig، مقسّمة إلى تدريب وتطوير واختبار.

Sourcesالمصادر