ICS 582Lecture 01المحاضرة 01Full guideالشرح الكامل
Introduction to natural language processingمقدمة في معالجة اللغات الطبيعية (NLP)
The whole lecture on one page, taught concept by concept. Work through the parts in order, mark each concept once you understand it, and open the slide chips when you want the original slides.المحاضرة كاملة في صفحة واحدة، مشروحة مفهومًا مفهومًا. امشِ على الأجزاء بالترتيب، وعلّم كل مفهوم بعد أن تفهمه، وافتح أزرار الشرائح عندما تريد الرجوع إلى الشرائح الأصلية.
- Partsالأجزاء
- 4
- Conceptsالمفاهيم
- 16
- Slidesالشرائح
- 25
- Readingمدة القراءة
- 96 min96 دقيقة
Part 01: What natural language processing isما هي معالجة اللغات الطبيعية
The definition of NLP, its three goals, its other names, and where it sits at the intersection of linguistics, computer science and artificial intelligence alongside the other AI subfields.تعريف NLP وأهدافها الثلاثة وأسماؤها الأخرى، وموقعها عند تقاطع اللسانيات وعلوم الحاسب والذكاء الاصطناعي إلى جانب فروع الذكاء الاصطناعي الأخرى.
3 concepts3 مفاهيم, ، slides 1-6الشرائح 1-6
Why this part mattersلماذا يهمّ هذا الجزء
Every later lecture in this course is a tool: tokenizers, n-gram models, classifiers, transformers. This part fixes what the tools are for. It gives you the one definition an examiner can ask on day one and the sentence you will need in the introduction of any NLP paper or thesis chapter.
The deck opens with a slide that carries the footer ICS472, the undergraduate twin of this course.ICS 582 is the graduate version taught by Dr. Irfan Ahmad and uses the same slides, so nothing changes for you. Over six slides it moves from a wall of company logos to a one-sentence definition, then places the field on a map twice: once among its parent disciplines and once among its siblings inside artificial intelligence. We follow the same route, but each stop is an argument rather than a bullet list.
كل محاضرة لاحقة في هذا المقرر هي أداة: المُقطِّعات (tokenizers)، ونماذج n-gram، والمصنِّفات (classifiers)، والمحوّلات (transformers). أما هذا الجزء فيحدد الغاية التي وُجدت هذه الأدوات من أجلها. فهو يعطيك التعريف الوحيد الذي قد يسألك عنه الممتحن من اليوم الأول، والجملة التي ستحتاجها في مقدمة أي ورقة بحثية أو فصل من رسالة في NLP.
تبدأ الشرائح بشريحة تحمل في تذييلها ICS472، وهو المقرر التوأم لهذا المقرر في مرحلة البكالوريوس. أما ICS 582 فهو نسخة الدراسات العليا التي يدرّسها الدكتور عرفان أحمد (Dr. Irfan Ahmad) وتستخدم الشرائح نفسها، فلا يتغير عليك شيء. وعلى مدى ست شرائح ينتقل العرض من جدار مليء بشعارات الشركات إلى تعريف في جملة واحدة، ثم يضع المجال على الخريطة مرتين: مرة بين التخصصات الأم التي نشأ منها، ومرة بين إخوته داخل الذكاء الاصطناعي. ونحن نسلك الطريق نفسه، لكن كل محطة عندنا حجة متماسكة لا مجرد قائمة نقاط.
By the end you canفي نهاية هذا الجزء ستستطيع
- Recite the slide 4 definition of NLP and its three goals, with one product for each goal.اذكر تعريف NLP في الشريحة 4 وأهدافه الثلاثة، مع منتج واحد لكل هدف.
- Name the three alternative names of the field and say which facet each one stresses.سمِّ الأسماء البديلة الثلاثة للمجال، وبيّن الجانب الذي يبرزه كل منها.
- Draw and label the Venn of linguistics, computer science and AI, and say what each contributes.ارسم مخطط فِن (Venn) للسانيات وعلوم الحاسب والذكاء الاصطناعي مع تسمية أجزائه، وبيّن ما يقدمه كل منها.
- List the five AI subfields on slide 6 and place deep learning under machine learning.اسرد فروع الذكاء الاصطناعي الخمسة في الشريحة 6، وضع التعلم العميق تحت تعلم الآلة.
- Give one system for each pairing of NLP with vision, robotics and knowledge representation.أعطِ نظاماً واحداً لكل ربط بين NLP وكل من الرؤية الحاسوبية والروبوتات وتمثيل المعرفة.
Three things you probably did this week. You said "hey Siri, set an alarm for six" and a phone acted on it. A visitor pointed Google Translate's camera at an Arabic menu and read it in English. And Gmail moved a phishing message into spam before you ever saw it. All three are natural language processing, and they are three different jobs: a human talking to a machine, two humans with a machine in the middle, and no conversation at all, just text being handled usefully.
ثلاثة أشياء غالباً فعلتها هذا الأسبوع. قلت «hey Siri, set an alarm for six» فنفّذ الهاتف الأمر. ووجّه زائرٌ كاميرا Google Translate نحو قائمة طعام عربية فقرأها بالإنجليزية. ونقل Gmail رسالة تصيّد (phishing) إلى مجلد الرسائل المزعجة قبل أن تراها أصلاً. هذه الثلاثة كلها من معالجة اللغات الطبيعية (natural language processing)، وهي ثلاث مهام مختلفة: إنسان يتحدث إلى آلة، وإنسانان بينهما آلة وسيطة، ولا محادثة على الإطلاق، بل نص يُعالَج معالجة مفيدة فحسب.
That is exactly how the field defines itself. Slide 4 states it in one sentence: NLP is a branch of artificial intelligence that is concerned with interactions between computers and human language. The purpose clause that follows is the part to memorise, because it lists the three goals in a fixed order: enabling human-machine communication, improving human-human communication, or simply doing useful processing of text or speech. The wording is lifted almost verbatim from the opening of Jurafsky and Martin's textbook, which describes the goal of the field as getting computers to perform useful tasks involving human language, "tasks like enabling human-machine communication, improving human-human communication, or simply doing useful processing of text or speech" (Jurafsky and Martin, 2nd edition, chapter 1).
وهذا بالضبط هو تعريف المجال لنفسه. تقوله الشريحة 4 في جملة واحدة: NLP فرع من فروع الذكاء الاصطناعي (artificial intelligence) يُعنى بالتفاعل بين الحواسيب واللغة البشرية. أما جملة الغاية التي تليه فهي الجزء الذي يجب حفظه، لأنها تسرد الأهداف الثلاثة بترتيب ثابت: تمكين التواصل بين الإنسان والآلة (enabling human-machine communication)، وتحسين التواصل بين البشر (improving human-human communication)، أو مجرد إجراء معالجة مفيدة للنص أو الكلام (simply doing useful processing of text or speech). والصياغة منقولة حرفياً تقريباً من مطلع كتاب Jurafsky وMartin، الذي يصف هدف المجال بأنه جعل الحواسيب تؤدي مهام مفيدة تتضمن اللغة البشرية، «مهام مثل تمكين التواصل بين الإنسان والآلة، أو تحسين التواصل بين البشر، أو مجرد إجراء معالجة مفيدة للنص أو الكلام» (Jurafsky and Martin، الطبعة 2، الفصل 1).
Notice what the definition does not say. It does not name a technique. It does not say statistics, or neural networks, or grammars. NLP is defined by its problem, human language, and by what it wants to achieve with it. The techniques have moved from hand-written rules to statistical learning to deep neural networks (part 03 walks through that sequence), and the definition has not moved with them. That is why it is worth learning by heart: it will still be true when the current models are obsolete.
لاحظ ما لا يقوله التعريف. إنه لا يسمّي أي تقنية. لا يذكر الإحصاء، ولا الشبكات العصبية، ولا القواعد النحوية (grammars). فـNLP معرَّف بمشكلته، أي اللغة البشرية، وبما يريد تحقيقه بها. لقد انتقلت التقنيات من قواعد مكتوبة يدوياً إلى التعلم الإحصائي ثم إلى الشبكات العصبية العميقة (يستعرض الجزء 03 هذا التسلسل)، ولم يتغير التعريف معها. ولهذا يستحق الحفظ عن ظهر قلب: سيبقى صحيحاً حين تصبح النماذج الحالية قديمة.
The logos, sorted by goalالشعارات مصنّفة حسب الهدف
Slide 2 shows seven companies and says nothing else, so the exercise is to say it for them. Each logo stands for at least one product whose core step is a language step, and each of those products serves one of the three goals. Google Search is the clearest case: in 2019 Google wrote that "Search is about understanding language" and introduced BERT to help it understand one in 10 searches in the U.S. in English better (Google, 2019). Amazon's developer documentation describes the Alexa pipeline as streaming your speech to the cloud, where "the Alexa service handles the speech recognition and natural language processing" (Amazon). Meta's No Language Left Behind project calls machine translation "a key focus of artificial intelligence research today" and covers 200 languages (NLLB Team, 2022). Grammarly says its team of computational linguists and deep learning engineers builds algorithms that learn "the rules and hidden patterns of good writing by analyzing millions of sentences" (Grammarly), which is spelling and grammar correction at industrial scale.
تعرض الشريحة 2 سبع شركات ولا تقول شيئاً آخر، فالتمرين أن تقول أنت ما سكتت عنه. كل شعار يمثل منتجاً واحداً على الأقل خطوته الجوهرية خطوة لغوية، وكل منتج من هذه المنتجات يخدم أحد الأهداف الثلاثة. بحث Google أوضح مثال: في عام 2019 كتبت Google أن «البحث يدور حول فهم اللغة» (Search is about understanding language)، وقدّمت BERT لتساعد البحث على فهم عملية بحث واحدة من كل 10 عمليات باللغة الإنجليزية في الولايات المتحدة (U.S.) فهماً أفضل (Google, 2019). وتصف وثائق المطورين لدى Amazon مسار Alexa بأنه بثّ كلامك إلى السحابة، حيث «تتولى خدمة Alexa التعرف على الكلام ومعالجة اللغة الطبيعية» (Amazon). ويصف مشروع No Language Left Behind من Meta الترجمة الآلية (machine translation) بأنها «محور رئيسي لأبحاث الذكاء الاصطناعي اليوم»، ويغطي 200 لغة (NLLB Team, 2022). وتقول Grammarly إن فريقها من اللغويين الحاسوبيين ومهندسي التعلم العميق يبني خوارزميات تتعلم «قواعد الكتابة الجيدة وأنماطها الخفية من خلال تحليل ملايين الجمل» (Grammarly)، وهذا هو تصحيح الإملاء والقواعد (spelling and grammar correction) على نطاق صناعي.
| Companyالشركة | Productالمنتج | Goal servedالهدف الذي يخدمه | What the language step isما هي الخطوة اللغوية |
|---|---|---|---|
| GoogleGoogle | Search and Translateالبحث (Search) والترجمة (Translate) | Human-machine, human-humanإنسان وآلة، وبين البشر | Understanding a typed query (BERT), translating text between over 240 languagesفهم استعلام مكتوب (BERT)، وترجمة النصوص بين أكثر من 240 لغة |
| AppleApple | SiriSiri | Human-machineإنسان وآلة | Recognising speech and holding a back-and-forth conversationالتعرف على الكلام وإجراء محادثة متبادلة |
| MicrosoftMicrosoft | Translatorالمترجم (Translator) | Human-humanبين البشر | Translating conversations, documents and street signs, even offlineترجمة المحادثات والمستندات ولافتات الشوارع، حتى دون اتصال بالإنترنت |
| Twitter (now X)Twitter (الآن X) | Feed and moderationالخلاصة (Feed) والإشراف على المحتوى | Useful processingمعالجة مفيدة | Ranking and filtering a stream of short textsترتيب سيل من النصوص القصيرة وتصفيته |
| AmazonAmazon | AlexaAlexa | Human-machineإنسان وآلة | Streaming speech to the cloud, recognising it, deciding what the user wantsبث الكلام إلى السحابة، والتعرف عليه، وتحديد ما يريده المستخدم |
| Facebook (Meta)Facebook (Meta) | NLLB translationترجمة NLLB | Human-humanبين البشر | Machine translation across 200 languagesالترجمة الآلية عبر 200 لغة |
| GrammarlyGrammarly | Writing assistantمساعد الكتابة | Useful processingمعالجة مفيدة | Learning the patterns of good writing from millions of sentencesتعلم أنماط الكتابة الجيدة من ملايين الجمل |
One field, many namesمجال واحد وأسماء كثيرة
Slide 4 ends by admitting that the field "has many names" and lists three. They are not rival fields. Each stresses a different facet of the same work, and the facet tells you who is speaking. When someone says computational linguistics they are usually facing the linguistics side: language as the object of scientific study, with computation as the method. Its professional society is the ACL, which describes itself as serving people working on computational problems involving human language, "a field often referred to as either computational linguistics or natural language processing (NLP)" (ACL). When someone says speech and language processing they are quoting the title of the Jurafsky and Martin book and reminding you that speech is in scope. When someone says human language technology they are on the engineering side, thinking about systems that ship.
تنتهي الشريحة 4 بالاعتراف بأن للمجال «أسماء كثيرة» (has many names) وتذكر ثلاثة منها. وهي ليست مجالات متنافسة، بل يبرز كل اسم جانباً مختلفاً من العمل نفسه، والجانب يكشف لك من أي جهة يتحدث صاحبه. حين يقول أحدهم اللسانيات الحاسوبية (computational linguistics) فهو في الغالب يقف في جهة اللسانيات: اللغة موضوعاً للدراسة العلمية، والحوسبة منهجاً. وجمعيته المهنية هي ACL، التي تصف نفسها بأنها تخدم من يعملون على مسائل حاسوبية تتعلق باللغة البشرية، «وهو مجال يُشار إليه غالباً باسم اللسانيات الحاسوبية أو معالجة اللغات الطبيعية (NLP)» (ACL). وحين يقول أحدهم معالجة الكلام واللغة (speech and language processing) فهو يقتبس عنوان كتاب Jurafsky وMartin ويذكّرك بأن الكلام المنطوق ضمن نطاق المجال. وحين يقول أحدهم تقنيات اللغة البشرية (human language technology) فهو في جهة الهندسة، يفكر في أنظمة تُطلق وتُستخدم فعلاً.
The three alternative names on slide 4 and the facet each stressesالأسماء البديلة الثلاثة في الشريحة 4 والجانب الذي يبرزه كل منها
- Computational linguisticsاللسانيات الحاسوبية
- The linguistics-facing name. The ACL, founded in 1962 as the Association for Machine Translation and Computational Linguistics and renamed in 1968, defines it as the scientific study of language from a computational perspective.الاسم الذي يتجه إلى جهة اللسانيات. تعرّفه ACL، التي تأسست عام 1962 باسم جمعية الترجمة الآلية واللسانيات الحاسوبية (Association for Machine Translation and Computational Linguistics) وغيّرت اسمها عام 1968، بأنه الدراسة العلمية للغة من منظور حاسوبي.
- Speech and language processingمعالجة الكلام واللغة
- The title of the Jurafsky and Martin textbook. It makes explicit that spoken language, not only written text, belongs to the field.عنوان كتاب Jurafsky وMartin. وهو يصرّح بأن اللغة المنطوقة، لا النص المكتوب وحده، جزء من المجال.
- Human language technologyتقنيات اللغة البشرية
- The engineering-facing name. Technology means deployable systems: the search engine, the assistant, the filter, rather than the theory behind them.الاسم الذي يتجه إلى جهة الهندسة. والتقنية هنا تعني أنظمة قابلة للنشر والاستخدام: محرك البحث، والمساعد، والمرشِّح، لا النظرية التي تقف خلفها.
The list keeps growing. The current draft of the third edition says the field "has many names corresponding to its many facets, including natural language processing (NLP), computational linguistics, spoken language processing, speech recognition, or most recently simply language modeling" (Jurafsky and Martin, 3rd edition draft, chapter 1). Note the word "recently": language modeling is the newest label, not a replacement for the field.
والقائمة في ازدياد. تقول المسودة الحالية للطبعة الثالثة إن للمجال «أسماء كثيرة تقابل جوانبه الكثيرة، منها معالجة اللغات الطبيعية (NLP)، واللسانيات الحاسوبية، ومعالجة اللغة المنطوقة، والتعرف على الكلام، أو مؤخراً نمذجة اللغة (language modeling) فحسب» (Jurafsky and Martin، مسودة الطبعة 3، الفصل 1). لاحظ كلمة «مؤخراً» (recently): نمذجة اللغة أحدث تسمية، وليست بديلاً عن المجال.
Recall
State the definition of NLP on slide 4 and its three goals.اذكر تعريف NLP في الشريحة 4 وأهدافه الثلاثة.
Recall
Name the three alternative names on slide 4 and say which facet each stresses.اذكر الأسماء البديلة الثلاثة في الشريحة 4، وبيّن الجانب الذي يبرزه كل منها.
Quick checkاختبار سريع
Which of these is one of the three other names of the field listed on slide 4?أيٌّ مما يلي أحد الأسماء الثلاثة الأخرى للمجال المذكورة في الشريحة 4؟
Quick checkاختبار سريع
A phishing email is silently moved to the spam folder. Which slide 4 goal does this serve?نُقلت رسالة تصيّد بصمت إلى مجلد الرسائل المزعجة. أي هدف من أهداف الشريحة 4 يخدمه ذلك؟
Take the spam filter again and ask what you would need to build one. You need to know what counts as a word, that free and FREE!!! are the same word dressed differently, and that "not a scam" flips the meaning of "scam". That is linguistics. You need a classifier, a hash table for the vocabulary, and an algorithm that runs in reasonable time on millions of messages. That is computer science. And you need a way to learn the weights from mail people have reported, and to represent the result as "spam with probability 0.97". That is artificial intelligence.
خذ مرشّح الرسائل المزعجة مرة أخرى واسأل: ماذا تحتاج لبنائه؟ تحتاج أن تعرف ما الذي يُعدّ كلمة، وأن free وFREE!!! كلمة واحدة بلباسين مختلفين، وأن عبارة «not a scam» تقلب معنى «scam». هذه لسانيات. وتحتاج مصنِّفاً (classifier)، وجدول تجزئة (hash table) للمفردات، وخوارزمية تعمل في وقت معقول على ملايين الرسائل. هذه علوم حاسب. وتحتاج طريقة لتعلم الأوزان من الرسائل التي أبلغ عنها الناس، ولتمثيل النتيجة في صورة «رسالة مزعجة باحتمال 0.97». وهذا هو الذكاء الاصطناعي (artificial intelligence).
Slide 5 draws this as a Venn diagram: NLP sits at the intersection of linguistics, computer science (abbreviated Comp. Sci. on the slide) and AI, and the bullet list trails off with an ellipsis. The ellipsis is not decoration. Read against slide 24, which names the fields NLP draws its models, algorithms and theories from as computer science, mathematics and linguistics, the ellipsis stands most plausibly for mathematics (the part of it NLP leans on most is probability and statistics). Jurafsky and Martin go further, listing the foundations of the field as "computer science, linguistics, mathematics, electrical engineering, and psychology" (Jurafsky and Martin, 2nd edition, chapter 1). Electrical engineering enters through the signal processing that speech needs, and psychology through the study of how people actually produce and understand language.
ترسم الشريحة 5 ذلك في مخطط فِن (Venn): يقع NLP عند تقاطع اللسانيات وعلوم الحاسب (مختصرة على الشريحة Comp. Sci.) والذكاء الاصطناعي، وتنتهي قائمة النقاط بعلامة حذف (...). وعلامة الحذف ليست زينة. فإذا قرأناها في ضوء الشريحة 24، التي تسمي المجالات التي يستمد منها NLP نماذجه وخوارزمياته ونظرياته بأنها علوم الحاسب والرياضيات واللسانيات، فإن أرجح ما تعنيه علامة الحذف هو الرياضيات (وأكثر ما يعتمد عليه NLP منها هو الاحتمالات والإحصاء). ويذهب Jurafsky وMartin أبعد من ذلك، فيعدّدون أسس المجال بأنها «علوم الحاسب، واللسانيات، والرياضيات، والهندسة الكهربائية، وعلم النفس» (Jurafsky and Martin، الطبعة 2، الفصل 1). تدخل الهندسة الكهربائية عبر معالجة الإشارات التي يحتاجها الكلام، ويدخل علم النفس عبر دراسة كيف ينتج الناس اللغة ويفهمونها فعلاً.
What each parent contributesما يقدمه كل تخصص أم
The three circles are not interchangeable, and an exam question will often ask you to say what each one brings. Linguistics supplies the object of study and the vocabulary for describing it: the levels of language from sounds through words and sentences to meaning and discourse, the theories of grammar that say which sentences are well formed, and the very idea of ambiguity, which part 04 returns to. Computer science supplies the machinery. Jurafsky and Martin single out "state space search algorithms, such as dynamic programming, and machine learning algorithms, such as classifiers" as the most important (Jurafsky and Martin, 2nd edition, section 1.3). AI supplies learning and knowledge: how to fit a model to data, how to store facts a program can reason over, and the probabilistic stance that, given several possible readings, you should choose the most probable one.
الدوائر الثلاث ليست قابلة للتبادل، وكثيراً ما يطلب منك سؤال الامتحان أن تذكر ما يقدمه كل منها. تقدم اللسانيات موضوع الدراسة والمفردات اللازمة لوصفه: مستويات اللغة من الأصوات مروراً بالكلمات والجمل وصولاً إلى المعنى والخطاب (discourse)، ونظريات النحو التي تحدد أي الجمل سليمة البناء، وفكرة الغموض (ambiguity) نفسها، التي يعود إليها الجزء 04. وتقدم علوم الحاسب الآلية المنفّذة. يخص Jurafsky وMartin بالذكر «خوارزميات البحث في فضاء الحالات (state space search)، مثل البرمجة الديناميكية (dynamic programming)، وخوارزميات تعلم الآلة، مثل المصنِّفات» بوصفها الأهم (Jurafsky and Martin، الطبعة 2، القسم 1.3). ويقدم الذكاء الاصطناعي التعلم والمعرفة: كيف تُلائم نموذجاً مع البيانات، وكيف تخزن حقائق يستطيع البرنامج أن يستدل بها، والموقف الاحتمالي القائل إنه إذا كان أمامك عدة قراءات ممكنة فعليك أن تختار أرجحها.
| Disciplineالتخصص | What it gives NLPما يقدمه لـ NLP | Example in this courseمثال من هذا المقرر |
|---|---|---|
| Linguisticsاللسانيات | The object of study: levels of description from sounds to discourse, theories of grammar, the notion of ambiguityموضوع الدراسة: مستويات الوصف من الأصوات إلى الخطاب، ونظريات النحو، ومفهوم الغموض | What counts as a word, why 'I made her duck' has at least five readingsما الذي يُعدّ كلمة، ولماذا تحتمل جملة 'I made her duck' خمس قراءات على الأقل |
| Computer scienceعلوم الحاسب | Algorithms and data structures: state space search, dynamic programming, classifiersالخوارزميات وهياكل البيانات: البحث في فضاء الحالات (state space search)، والبرمجة الديناميكية، والمصنِّفات | A dynamic programming decoder, a hash table of the vocabulary, a spam classifierمفكِّك ترميز بالبرمجة الديناميكية، وجدول تجزئة للمفردات، ومصنِّف للرسائل المزعجة |
| Artificial intelligenceالذكاء الاصطناعي | Learning from data and representing knowledge; choosing the most probable of N interpretationsالتعلم من البيانات وتمثيل المعرفة، واختيار أرجح تفسير من بين N تفسيرات | Training weights from labelled mail, storing facts to answer a questionتدريب الأوزان من رسائل مصنّفة، وتخزين الحقائق للإجابة عن سؤال |
| The ellipsisعلامة الحذف | Mathematics (in practice probability and statistics), plus signal processing and psychologyالرياضيات (وعملياً الاحتمالات والإحصاء)، إضافة إلى معالجة الإشارات وعلم النفس | Probability, linear algebra, vector spaces, the acoustics of speechالاحتمالات، والجبر الخطي، وفضاءات المتجهات، وصوتيات الكلام |
Jurafsky and Martin make the point with the Unix program wc. When it counts bytes and lines it is ordinary data processing. When it counts words it is doing something linguistic, because it needs to know what a word is. The line between data processing and language processing is exactly the linguistics circle: the moment your program relies on knowledge of language, it has crossed into NLP.
يوضح Jurafsky وMartin الفكرة ببرنامج wc في Unix. حين يعدّ البايتات والأسطر فهو معالجة بيانات عادية. وحين يعدّ الكلمات فهو يفعل شيئاً لغوياً، لأنه يحتاج أن يعرف ما الكلمة. والحد الفاصل بين معالجة البيانات ومعالجة اللغة هو دائرة اللسانيات بالضبط: في اللحظة التي يعتمد فيها برنامجك على المعرفة باللغة (knowledge of language) يكون قد عبر إلى NLP.
Recall
Which three disciplines form the Venn on slide 5, and what does the ellipsis stand for?ما التخصصات الثلاثة التي تشكّل مخطط فِن في الشريحة 5، وعلامَ تدل علامة الحذف؟
Photograph a street sign in Riyadh with your phone. Vision finds the sign in the pixels and reads its letters. NLP translates the words on it. A delivery robot could be told "turn left at that sign" and act on it. And a knowledge base knows that the name on the sign is a real district with a location and a history. One photo has just touched four subfields of artificial intelligence, and most of those steps are now learned from data by a fifth.
صوّر لافتة شارع في الرياض بهاتفك. الرؤية الحاسوبية تجد اللافتة بين البكسلات وتقرأ حروفها. وNLP يترجم الكلمات المكتوبة عليها. ويمكن أن يُقال لروبوت توصيل «انعطف يساراً عند تلك اللافتة» فينفّذ. وقاعدة معرفة تعرف أن الاسم المكتوب على اللافتة حيٌّ حقيقي له موقع وتاريخ. صورة واحدة لمست للتو أربعة فروع من الذكاء الاصطناعي (artificial intelligence)، ومعظم هذه الخطوات صار اليوم يُتعلَّم من البيانات بواسطة فرع خامس.
Slide 6 lists those five subfields as stacked boxes: natural language processing, knowledge representation and deduction, machine learning, computer vision and robotics. Only one box has a sub-bullet: deep learning is indented under machine learning. The same map appears in the standard AI textbook. Russell and Norvig give knowledge representation its own chapter inside a part called "Knowledge, reasoning, and planning", give machine learning its own part with a deep learning chapter inside it, and group natural language processing, computer vision and robotics under "Communicating, perceiving, and acting" (Russell and Norvig, 4th edition, table of contents). The slide is the textbook's contents page compressed to five lines.
تسرد الشريحة 6 هذه الفروع الخمسة في صناديق متراصة: معالجة اللغات الطبيعية، وتمثيل المعرفة والاستنتاج (knowledge representation and deduction)، وتعلم الآلة (machine learning)، والرؤية الحاسوبية (computer vision)، والروبوتات (robotics). صندوق واحد فقط له نقطة فرعية: التعلم العميق (deep learning) مُزاح إلى الداخل تحت تعلم الآلة. والخريطة نفسها تظهر في كتاب الذكاء الاصطناعي المرجعي. يخصص Russell وNorvig لتمثيل المعرفة فصلاً مستقلاً داخل جزء عنوانه «Knowledge, reasoning, and planning» (المعرفة والاستدلال والتخطيط)، ويخصصان لتعلم الآلة جزءاً مستقلاً بداخله فصل عن التعلم العميق، ويجمعان معالجة اللغات الطبيعية والرؤية الحاسوبية والروبوتات تحت «Communicating, perceiving, and acting» (التواصل والإدراك والفعل) (Russell and Norvig، الطبعة 4، جدول المحتويات). فالشريحة هي صفحة محتويات الكتاب مضغوطة في خمسة أسطر.
- Natural language processingمعالجة اللغات الطبيعية (natural language processing)
- Knowledge representation and deduction (standard phrase: reasoning)تمثيل المعرفة والاستنتاج (knowledge representation and deduction)، والعبارة المعيارية: الاستدلال (reasoning)
- Machine learning, with deep learning as its sub-areaتعلم الآلة (machine learning)، والتعلم العميق (deep learning) فرع داخله
- Computer visionالرؤية الحاسوبية (computer vision)
- Roboticsالروبوتات (robotics)
Sibling and tool at onceأخٌ وأداة في آن واحد
The key point of the slide is why deep learning is indented rather than listed beside the others. Machine learning is a subfield in its own right, but it is also the main method NLP, computer vision and robotics now use, and an increasingly common one in knowledge representation as well. Goodfellow, Bengio and Courville draw this as nested sets: deep learning is a kind of representation learning, which is a kind of machine learning, "which is used for many but not all approaches to AI" (Goodfellow et al., 2016, figure 1.4). The nesting is why the slide indents deep learning, and the "used for" clause is why the AI textbook has both a chapter called Natural Language Processing and one called Deep Learning for Natural Language Processing. It is also why the rest of ICS 582 is mostly machine learning: the problem is language, the method is learning.
النقطة الأساسية في الشريحة هي سبب إزاحة التعلم العميق إلى الداخل بدلاً من وضعه بجانب الفروع الأخرى. تعلم الآلة فرع قائم بذاته، لكنه أيضاً المنهج الرئيسي الذي يستخدمه اليوم كل من NLP والرؤية الحاسوبية والروبوتات، ومنهج يتزايد استخدامه في تمثيل المعرفة كذلك. ويرسم Goodfellow وBengio وCourville ذلك في صورة مجموعات متداخلة: التعلم العميق نوع من تعلم التمثيلات (representation learning)، الذي هو نوع من تعلم الآلة، «الذي يُستخدم في كثير من مناهج الذكاء الاصطناعي لا في جميعها» (Goodfellow et al., 2016، الشكل 1.4). هذا التداخل هو سبب إزاحة الشريحة للتعلم العميق، وعبارة «يُستخدم في» (used for) هي سبب احتواء كتاب الذكاء الاصطناعي على فصل بعنوان Natural Language Processing وآخر بعنوان Deep Learning for Natural Language Processing. وهي أيضاً سبب كون معظم ما تبقى من ICS 582 تعلم آلة: المشكلة هي اللغة، والمنهج هو التعلم.
The pairings between NLP and its siblings are concrete systems you can name in an exam. With computer vision, image captioning: Vinyals and colleagues describe automatically describing an image as a problem that "connects computer vision and natural language processing" (Vinyals et al., 2014). Optical character recognition is the other direction, a vision task that extracts "printed or handwritten text from images such as posters, street signs, and product labels" and hands it to NLP (Microsoft Learn). With robotics, instruction following: the SayCan system completes "long-horizon, abstract, natural language instructions on a mobile manipulator", with the robot acting as the language model's "hands and eyes" (Ahn et al., 2022). With knowledge representation, question answering over a knowledge graph: Google's Knowledge Graph understands "real-world entities and their relationships to one another: things, not strings", and uses that to tell the Taj Mahal monument from the musician (Google, 2012).
الروابط بين NLP وإخوته أنظمة ملموسة تستطيع تسميتها في الامتحان. مع الرؤية الحاسوبية: توليد أوصاف الصور (image captioning)، إذ يصف Vinyals وزملاؤه الوصف التلقائي لصورة بأنه مشكلة «تربط الرؤية الحاسوبية بمعالجة اللغات الطبيعية» (Vinyals et al., 2014). والتعرف الضوئي على الحروف (OCR) هو الاتجاه المعاكس: مهمة رؤية تستخرج «النص المطبوع أو المكتوب بخط اليد من صور مثل الملصقات ولافتات الشوارع وملصقات المنتجات» وتسلّمه إلى NLP (Microsoft Learn). مع الروبوتات: اتباع التعليمات (instruction following)، إذ ينفّذ نظام SayCan «تعليمات مجردة طويلة الأفق بلغة طبيعية على روبوت متنقل ذي ذراع» (mobile manipulator)، ويعمل الروبوت بوصفه «يدَي النموذج اللغوي وعينيه» (Ahn et al., 2022). مع تمثيل المعرفة: الإجابة عن الأسئلة (question answering) فوق رسم بياني معرفي (knowledge graph)، إذ يفهم Knowledge Graph من Google «الكيانات في العالم الحقيقي وعلاقاتها ببعضها: أشياء لا سلاسل نصية» (things, not strings)، ويستخدم ذلك ليميّز نُصب تاج محل (Taj Mahal) من الموسيقي الذي يحمل الاسم نفسه (Google, 2012).
| Subfieldالفرع | What it studiesما يدرسه | Example systemنظام مثال | Where it touches NLPأين يلتقي بـ NLP |
|---|---|---|---|
| Knowledge representation and reasoningتمثيل المعرفة والاستدلال | Storing facts and drawing conclusions from themتخزين الحقائق واستخلاص النتائج منها | Google Knowledge Graph (things, not strings)Google Knowledge Graph (أشياء لا سلاسل نصية) | Question answering over a knowledge graph; disambiguating Taj Mahal the monument from Taj Mahal the musicianالإجابة عن الأسئلة فوق رسم بياني معرفي، والتمييز بين تاج محل (Taj Mahal) النُّصب وتاج محل الموسيقي |
| Machine learningتعلم الآلة | Learning behaviour from data instead of rulesتعلم السلوك من البيانات بدلاً من القواعد | A spam classifier trained on reported mailمصنِّف رسائل مزعجة مدرَّب على الرسائل المُبلَّغ عنها | Supplies almost every modern NLP model; deep learning is its sub-areaيوفر تقريباً كل نموذج حديث في NLP، والتعلم العميق فرع داخله |
| Computer visionالرؤية الحاسوبية | Interpreting images and videoتفسير الصور والفيديو | Azure OCR reading posters and product labelsخدمة OCR في Azure تقرأ الملصقات وبطاقات المنتجات | Image captioning and optical character recognition, whose output is textتوليد أوصاف الصور، والتعرف الضوئي على الحروف الذي يكون ناتجه نصاً |
| Roboticsالروبوتات | Perceiving and acting in the physical worldالإدراك والفعل في العالم المادي | SayCan mobile manipulatorالروبوت المتنقل ذو الذراع SayCan | Following natural language instructions; the robot is the language model's hands and eyesاتباع التعليمات المكتوبة بلغة طبيعية، فالروبوت هو يدا النموذج اللغوي وعيناه |
Recall
List the five AI subfields on slide 6 and say where deep learning belongs.اسرد فروع الذكاء الاصطناعي الخمسة في الشريحة 6، وبيّن أين يقع التعلم العميق.
Recall
Give one system where NLP meets computer vision and one where it meets robotics.اذكر نظاماً يلتقي فيه NLP بالرؤية الحاسوبية، وآخر يلتقي فيه بالروبوتات.
Quick checkاختبار سريع
On slide 6, which AI subfield contains deep learning as its sub-bullet?في الشريحة 6، أي فرع من فروع الذكاء الاصطناعي يضم التعلم العميق نقطةً فرعية تحته؟
Quick checkاختبار سريع
Which pairing matches a slide 6 subfield with a system where it meets NLP?أي ربط يطابق فرعاً من فروع الشريحة 6 مع نظام يلتقي فيه بـ NLP؟
Recapالخلاصة
If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا
- NLP is a branch of artificial intelligence concerned with interactions between computers and human language.NLP فرع من الذكاء الاصطناعي يُعنى بالتفاعل بين الحواسيب واللغة البشرية.
- Its goals are enabling human-machine communication, improving human-human communication, or simply doing useful processing of text or speech. Speech is inside the definition.أهدافه تمكين التواصل بين الإنسان والآلة، وتحسين التواصل بين البشر، أو مجرد إجراء معالجة مفيدة للنص أو الكلام. فالكلام داخل التعريف.
- Computational linguistics, speech and language processing and human language technology name the same field from the linguistics, speech and engineering sides.اللسانيات الحاسوبية (computational linguistics)، ومعالجة الكلام واللغة (speech and language processing)، وتقنيات اللغة البشرية (human language technology) أسماء للمجال نفسه من جهة اللسانيات وجهة الكلام وجهة الهندسة.
- NLP sits at the intersection of linguistics (levels and grammar), computer science (algorithms and data structures) and AI (learning and knowledge); slide 24 suggests mathematics is what the ellipsis hides.يقع NLP عند تقاطع اللسانيات (المستويات والنحو) وعلوم الحاسب (الخوارزميات وهياكل البيانات) والذكاء الاصطناعي (التعلم والمعرفة)، وتوحي الشريحة 24 بأن الرياضيات هي ما تخفيه علامة الحذف.
- The AI subfields on slide 6 are NLP, knowledge representation and deduction (the standard phrase is reasoning), machine learning, computer vision and robotics.فروع الذكاء الاصطناعي في الشريحة 6 هي NLP، وتمثيل المعرفة والاستنتاج (والعبارة المعيارية هي الاستدلال reasoning)، وتعلم الآلة، والرؤية الحاسوبية، والروبوتات.
- Deep learning is a sub-area of machine learning, and machine learning is both a sibling of NLP and the tool every other subfield now uses.التعلم العميق فرع داخل تعلم الآلة، وتعلم الآلة أخٌ لـ NLP وفي الوقت نفسه الأداة التي يستخدمها اليوم كل فرع آخر.
- NLP meets computer vision in captioning and OCR, robotics in instruction following, and knowledge representation in question answering over knowledge graphs.يلتقي NLP بالرؤية الحاسوبية في توليد أوصاف الصور (captioning) وفي OCR، وبالروبوتات في اتباع التعليمات، وبتمثيل المعرفة في الإجابة عن الأسئلة فوق الرسوم البيانية المعرفية (knowledge graphs).
Sourcesالمصادر
- Speech and Language Processing, 3rd edition draftBookJurafsky and MartinFree draft. Chapter 1 lists the names of the field and its links to other disciplines. Primary source for the whole lecture. The slide 25 reference says Prentice-Hall 2020; no such printed edition exists: 2020 matches a 3rd edition online draft, and the last printed edition is the 2nd (Pearson Prentice Hall, 2009).مسودة مجانية. يسرد الفصل 1 أسماء المجال وصلاته بالتخصصات الأخرى. المصدر الأساسي للمحاضرة كلها. يذكر مرجع الشريحة 25 أن الكتاب صادر عن Prentice-Hall عام 2020، ولا توجد طبعة مطبوعة كهذه: عام 2020 يوافق مسودة إلكترونية للطبعة الثالثة، وآخر طبعة مطبوعة هي الثانية (Pearson Prentice Hall، 2009).(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 2nd edition, chapter 1BookJurafsky and Martin (Pearson Prentice Hall, 2009)Origin of the slide 4 definition, the three goals, the names of the field, the wc example, and section 1.3 on search and classifiers.أصل تعريف الشريحة 4، والأهداف الثلاثة، وأسماء المجال، ومثال wc، والقسم 1.3 عن البحث والمصنِّفات.(opens in a new tab)(يفتح في تبويب جديد)
- What is Computational Linguistics?DocsAssociation for Computational LinguisticsDefinition of computational linguistics, founded 1962 as AMTCL, renamed ACL in 1968, knowledge-based versus data-driven models.تعريف اللسانيات الحاسوبية، وتأسيس الجمعية عام 1962 باسم AMTCL ثم تغيير اسمها إلى ACL عام 1968، والنماذج القائمة على المعرفة مقابل القائمة على البيانات.(opens in a new tab)(يفتح في تبويب جديد)
- Deep Learning, chapter 1BookGoodfellow, Bengio and Courville (MIT Press, 2016)Figure 1.4: deep learning inside representation learning inside machine learning inside AI.الشكل 1.4: التعلم العميق داخل تعلم التمثيلات داخل تعلم الآلة داخل الذكاء الاصطناعي.(opens in a new tab)(يفتح في تبويب جديد)
- Artificial Intelligence: A Modern Approach, 4th edition, table of contentsBookRussell and Norvig (Pearson, 2020)Parts for knowledge and reasoning, machine learning (with a deep learning chapter), and communicating, perceiving and acting (NLP, vision, robotics).أجزاء للمعرفة والاستدلال، ولتعلم الآلة (وفيه فصل عن التعلم العميق)، وللتواصل والإدراك والفعل (NLP والرؤية والروبوتات).(opens in a new tab)(يفتح في تبويب جديد)
- Principles of Knowledge Representation and ReasoningDocsKR Inc.The standard name of the subfield the slide calls knowledge representation and deduction; conference series since 1989.الاسم المعياري للفرع الذي تسميه الشريحة تمثيل المعرفة والاستنتاج، وسلسلة مؤتمرات منذ عام 1989.(opens in a new tab)(يفتح في تبويب جديد)
- Show and Tell: A Neural Image Caption GeneratorPaperVinyals, Toshev, Bengio and Erhan, 2014Captioning as a problem that connects computer vision and NLP.توليد أوصاف الصور بوصفه مشكلة تربط الرؤية الحاسوبية بـ NLP.(opens in a new tab)(يفتح في تبويب جديد)
- Do As I Can, Not As I Say: Grounding Language in Robotic AffordancesPaperAhn et al., 2022A robot following natural language instructions as the language model's hands and eyes.روبوت يتبع تعليمات بلغة طبيعية بوصفه يدَي النموذج اللغوي وعينيه.(opens in a new tab)(يفتح في تبويب جديد)
- OCR, Optical Character RecognitionDocsMicrosoft LearnOCR extracts printed and handwritten text from images such as posters and street signs.يستخرج OCR النص المطبوع والمكتوب بخط اليد من صور مثل الملصقات ولافتات الشوارع.(opens in a new tab)(يفتح في تبويب جديد)
- Introducing the Knowledge Graph: things, not stringsArticleGoogle, 2012Entities and relationships; the Taj Mahal disambiguation.الكيانات والعلاقات، والتمييز بين معاني Taj Mahal.(opens in a new tab)(يفتح في تبويب جديد)
- Understanding searches better than ever beforeArticleGoogle, 2019Search is about understanding language; BERT helps one in ten searches in the U.S. in English.البحث يدور حول فهم اللغة، و BERT يساعد في عملية بحث واحدة من كل عشر عمليات باللغة الإنجليزية في الولايات المتحدة.(opens in a new tab)(يفتح في تبويب جديد)
- Google Translate adds 110 new languagesArticleGoogle, 2024Type, say, handwrite or point the camera; over 240 languages after the 2024 expansion.اكتب، أو تحدث، أو اكتب بخط اليد، أو وجّه الكاميرا، وأكثر من 240 لغة بعد توسعة 2024.(opens in a new tab)(يفتح في تبويب جديد)
- SiriDocsAppleType or talk naturally, back-and-forth conversation.اكتب أو تحدث بشكل طبيعي، في محادثة متبادلة.(opens in a new tab)(يفتح في تبويب جديد)
- What is the Alexa Skills KitDocsAmazonAlexa handles speech recognition and natural language processing in the cloud.تتولى Alexa التعرف على الكلام ومعالجة اللغة الطبيعية في السحابة.(opens in a new tab)(يفتح في تبويب جديد)
- Microsoft TranslatorDocsMicrosoftConversations, documents and street signs, also offline.المحادثات والمستندات ولافتات الشوارع، ودون اتصال بالإنترنت أيضاً.(opens in a new tab)(يفتح في تبويب جديد)
- No Language Left Behind: Scaling Human-Centered Machine TranslationPaperNLLB Team, Meta AI, 2022Machine translation across 200 languages as a key focus of AI research.الترجمة الآلية عبر 200 لغة بوصفها محوراً رئيسياً في أبحاث الذكاء الاصطناعي.(opens in a new tab)(يفتح في تبويب جديد)
- How Grammarly worksDocsGrammarlyAlgorithms that learn the patterns of good writing from millions of sentences.خوارزميات تتعلم أنماط الكتابة الجيدة من ملايين الجمل.(opens in a new tab)(يفتح في تبويب جديد)
- Report spam in GmailDocsGoogleAs you report more spam, Gmail identifies similar emails as spam more efficiently.كلما أبلغت عن مزيد من الرسائل المزعجة، صار Gmail أكفأ في تمييز الرسائل المشابهة على أنها مزعجة.(opens in a new tab)(يفتح في تبويب جديد)
- Twitter has officially changed its logo to XArticleTechCrunch, 2023For the dated bird logo on slide 2.لشعار الطائر القديم في الشريحة 2.(opens in a new tab)(يفتح في تبويب جديد)
Part 02: Applications of NLPتطبيقات NLP
Five application families with the products that ship them: fully automatic and computer-aided machine translation, web question answering before and after LLMs, spelling and grammar correction, information extraction, and aspect-level sentiment analysis.خمس عائلات من التطبيقات مع المنتجات التي تقدمها: الترجمة الآلية الكاملة والترجمة بمساعدة الحاسب، والإجابة عن الأسئلة على الويب قبل النماذج اللغوية الكبيرة (LLMs) وبعدها، وتصحيح الإملاء والقواعد، واستخراج المعلومات، وتحليل المشاعر على مستوى الجوانب (aspect-level).
5 concepts5 مفاهيم, ، slides 7-13الشرائح 7-13
Why this part mattersلماذا يهمّ هذا الجزء
Your PhD work will build or evaluate systems like the ones on these seven slides, and a good answer about this lecture names each application together with the NLP task hiding behind it. A screenshot of Google Translate is not an answer. "Fully automatic translation for information access, versus computer-aided translation where a human owns the final text" is.
This part turns seven product screenshots into five reusable ideas: the human-in-the-loop spectrum (machine translation), extraction versus generation (question answering), dictionary versus context (spelling), text to fields (information extraction), and target plus polarity (sentiment). Along the way it plants one more idea that part 03 formalises: most NLP products are chains of components, and every link in the chain can be wrong.
سيبني بحثك في الدكتوراه أنظمة مثل تلك المعروضة في هذه الشرائح السبع أو سيقيّمها، والإجابة الجيدة عن هذه المحاضرة تسمّي كل تطبيق مع مهمة NLP المختبئة خلفه. لقطة شاشة من Google Translateليست إجابة. أما «ترجمة آلية بالكامل للوصول إلى المعلومات، مقابل ترجمة بمساعدة الحاسوب يكون فيها الإنسان هو المسؤول عن النص النهائي» فهي إجابة.
يحوّل هذا الجزء سبع لقطات شاشة لمنتجات إلى خمس أفكار قابلة لإعادة الاستخدام: طيف وجود الإنسان في الحلقة (الترجمة الآلية)، والاستخراج مقابل التوليد (الإجابة عن الأسئلة)، والقاموس مقابل السياق (الإملاء)، ومن النص إلى الحقول (استخراج المعلومات)، والهدف مع القطبية (تحليل المشاعر). وفي الطريق يزرع فكرة أخرى يصوغها الجزء 03 رسميًا: معظم منتجات NLP سلاسل من المكوّنات، وكل حلقة في السلسلة يمكن أن تخطئ.
By the end you canفي نهاية هذا الجزء ستستطيع
- Contrast fully automatic and computer-aided translation, and say when a human must stay in the loop.تقارن بين الترجمة الآلية الكاملة والترجمة بمساعدة الحاسوب، وتحدد متى يجب أن يبقى الإنسان داخل الحلقة.
- Explain the three steps behind a factual answer box, and how retrieval-augmented generation changes both the output and the failure mode.تشرح الخطوات الثلاث وراء صندوق الإجابة الحقائقية، وكيف يغيّر التوليد المعزّز بالاسترجاع (RAG) كلًا من المخرج ونمط الفشل.
- Distinguish non-word from real-word spelling errors, and say why the second needs a language model.تميّز بين أخطاء الإملاء التي تنتج كلمة غير موجودة (non-word) وتلك التي تنتج كلمة حقيقية (real-word)، وتوضح لماذا يحتاج النوع الثاني إلى نموذج لغوي.
- Read an email and fill an event template, including normalising 'tomorrow' against the message date.تقرأ بريدًا إلكترونيًا وتملأ قالب حدث، بما في ذلك تحويل كلمة «tomorrow» إلى تاريخ فعلي بالرجوع إلى تاريخ الرسالة.
- Explain why sentiment must be assigned per aspect, using the word 'light' as the worked case.تشرح لماذا يجب تحديد المشاعر لكل جانب (aspect) على حدة، مستخدمًا كلمة «light» مثالًا محلولًا.
Take the definition of NLP from part 01, paste it into Google Translate, and pick Arabic. In under a second the right pane fills with معالجة اللغة الطبيعية هي فرع من فروع الذكاء الاصطناعي and a Latin transliteration line underneath. Nobody touched that output. The system read 142 characters of English and produced finished Arabic. That is machine translation in its fully automatic mode, and it is the mode most people picture when they hear the words.
خذ تعريف NLP من الجزء 01، والصقه في Google Translate، واختر العربية. في أقل من ثانية تمتلئ الخانة اليمنى بعبارة «معالجة اللغة الطبيعية هي فرع من فروع الذكاء الاصطناعي» ومعها سطر نقحرة (transliteration) بالحروف اللاتينية تحتها. لم يلمس أحد هذا المخرج. قرأ النظام 142 حرفًا من الإنجليزية وأنتج عربية جاهزة. هذه هي الترجمة الآلية (machine translation) في نمطها الآلي بالكامل، وهو النمط الذي يتخيله معظم الناس عندما يسمعون هذه الكلمات.
Now look at the second screenshot on the same slide, which looks nothing like a consumer product. The source box holds an Arabic news sentence about the Lebanese president being subjected to a fierce campaign in parliament. The translator has typed one word into the translation box, lebanese, and the system has answered with a ranked list of what the next word could be: president, suffered, exposed, president emile, before, presented, offer. The human is still writing the sentence. The machine is predicting where the sentence goes next. This is computer-aided translation, and its existence is the most important fact on the slide: the professional tool keeps the human in charge.
انظر الآن إلى لقطة الشاشة الثانية في الشريحة نفسها، وهي لا تشبه منتجًا استهلاكيًا إطلاقًا. يحتوي مربع المصدر على جملة إخبارية عربية عن تعرّض الرئيس اللبناني لحملة عنيفة في البرلمان. كتب المترجم كلمة واحدة في مربع الترجمة، lebanese، فأجاب النظام بقائمة مرتّبة لما يمكن أن تكون عليه الكلمة التالية: president، suffered، exposed، president emile، before، presented، offer. الإنسان ما زال هو من يكتب الجملة، والآلة تتنبأ بالاتجاه الذي ستسير فيه الجملة بعد ذلك. هذه هي الترجمة بمساعدة الحاسوب (computer-aided translation)، ووجودها هو أهم حقيقة في الشريحة: الأداة المهنية تُبقي الإنسان هو صاحب القرار.
Two modes, and who owns the final textنمطان، ومن يملك النص النهائي
Jurafsky and Martin list three uses of MT: information access, aiding human translators, and in-the-moment communication. Fully automatic MT serves information access: you want to read a page written in a language you do not know, and a rough but instant translation is worth more than a perfect one next week. Google Translate alone, they note, translates hundreds of billions of words a day between over 100 languages. The second use is aiding human translators. Here the system is not the author. It drafts a translation that a person then fixes, a workflow called post-editing. Interactive systems (Barrachina et al., 2009) go further: they sit inside the editor and predict as the person types, which is what the slide shows.
يذكر Jurafsky وMartin ثلاثة استخدامات للترجمة الآلية MT: الوصول إلى المعلومات، ومساعدة المترجمين البشريين، والتواصل اللحظي. الترجمة الآلية بالكامل تخدم الوصول إلى المعلومات: تريد قراءة صفحة مكتوبة بلغة لا تعرفها، والترجمة التقريبية الفورية أثمن من ترجمة مثالية تصل الأسبوع القادم. ويذكران أن Google Translate وحده يترجم مئات المليارات من الكلمات يوميًا بين أكثر من 100 لغة. الاستخدام الثاني هو مساعدة المترجمين البشريين. هنا النظام ليس هو المؤلف، بل يكتب مسودة ترجمة يصلحها شخص بعد ذلك، وتسمى طريقة العمل هذه التحرير اللاحق (post-editing). والأنظمة التفاعلية (Barrachina et al., 2009) تذهب أبعد من ذلك: تعمل داخل المحرر وتتنبأ أثناء كتابة الشخص، وهذا ما تعرضه الشريحة.
The interactive kind has a precise description. Barrachina and colleagues put it this way: in each iteration, a prefix of the translation is validated (accepted or amended) by the human and the system computes its best, or n-best, translation suffix to complete that prefix. Read the slide's list with that in mind and it stops being a random menu. The list is an n-best set. "suffered" and "exposed" are two English readings of the same Arabic verb تعرض, and "president" versus "president emile" are two choices about how much of the source to consume in one step. The translator resolves in one click what a fully automatic system would have to gamble on.
للنوع التفاعلي وصف دقيق. يصوغه Barrachina وزملاؤه هكذا: في كل دورة، يعتمد الإنسان بادئة (prefix) من الترجمة (بقبولها أو تعديلها)، ويحسب النظام أفضل لاحقة (suffix) ترجمة، أو أفضل n لواحق (n-best)، لإكمال تلك البادئة. اقرأ قائمة الشريحة بهذا المنظور فتتوقف عن كونها قائمة عشوائية. القائمة مجموعة n-best. الكلمتان «suffered» و«exposed» قراءتان إنجليزيتان للفعل العربي نفسه «تعرّض»، و«president» مقابل «president emile» خياران حول مقدار ما يُستهلك من المصدر في خطوة واحدة. يحسم المترجم بنقرة واحدة ما كان على النظام الآلي بالكامل أن يراهن عليه.
| Modeالنمط | Who produces the final textمن ينتج النص النهائي | Typical useالاستخدام المعتاد | Slide 7 exampleمثال الشريحة 7 |
|---|---|---|---|
| Fully automaticآلي بالكامل | The systemالنظام | Information access, gisting, chatالوصول إلى المعلومات، وفهم الفكرة العامة (gisting)، والدردشة | Google Translate rendering the NLP definition in ArabicGoogle Translate وهو يترجم تعريف NLP إلى العربية |
| Assisted, post-editingبمساعدة الحاسوب، التحرير اللاحق (post-editing) | The human, correcting a machine draftالإنسان، وهو يصحح مسودة آلية | Localisation, documentationالتوطين (localisation)، والوثائق | Not pictured, but the common industrial workflowغير معروض، لكنه سير العمل الصناعي الشائع |
| Assisted, interactive predictionبمساعدة الحاسوب، التنبؤ التفاعلي | The human, accepting or amending predicted suffixesالإنسان، وهو يقبل اللواحق المتنبأ بها أو يعدّلها | Professional translation of news, legal and medical textالترجمة الاحترافية للأخبار والنصوص القانونية والطبية | The ranked list under the typed word lebaneseالقائمة المرتّبة تحت الكلمة المكتوبة lebanese |
Why keep the human at all, when the top screenshot is so good? Because the same paper opens with the plain admission that current MT systems are still not perfect and that in practice their output needs to be edited to correct errors. Which errors matter depends on the text. A gisted news article can survive a wrong verb. A contract, a drug label or a court transcript cannot, and someone must be accountable for the register, the terminology and the liability. The assisted mode is how the field turned an imperfect technology into a productivity tool rather than waiting for a perfect one.
لماذا نُبقي الإنسان أصلًا ما دامت لقطة الشاشة العلوية بهذه الجودة؟ لأن الورقة نفسها تبدأ باعتراف صريح بأن أنظمة الترجمة الآلية الحالية ما زالت غير مثالية، وأن مخرجاتها في الواقع تحتاج إلى تحرير لتصحيح الأخطاء. وأي الأخطاء مهم يعتمد على النص. مقال إخباري يُقرأ لأخذ الفكرة العامة يتحمل فعلًا خاطئًا، أما العقد أو نشرة الدواء أو محضر المحكمة فلا، ويجب أن يكون هناك شخص مسؤول عن مستوى اللغة (register) والمصطلحات والمسؤولية القانونية. النمط المساعد هو الطريقة التي حوّل بها هذا المجال تقنية غير مثالية إلى أداة إنتاجية، بدلًا من انتظار تقنية مثالية.
Recall
Name the two modes of machine translation on slide 7 and say who produces the final text in each.سمِّ نمطي الترجمة الآلية في الشريحة 7، وحدد من ينتج النص النهائي في كل منهما.
Quick checkاختبار سريع
On slide 7, what does the ranked list under the typed word 'lebanese' represent?في الشريحة 7، ماذا تمثّل القائمة المرتّبة تحت الكلمة المكتوبة «lebanese»؟
The product numbers, and why they are pipelinesأرقام المنتجات، ولماذا هي سلاسل معالجة
Slide 8 adds two products with feature lists. The Google Translate app page counts how many languages each mode supports, and the Skype Translator blurb promises voice calls in seven languages and adds a line worth remembering: it uses machine learning, so the more you use it, the better it gets. That sentence is the whole of part 03 in miniature. The system is not a fixed set of rules; it is a model that improves with data.
تضيف الشريحة 8 منتجين مع قوائم ميزاتهما. صفحة تطبيق Google Translate تعدّ اللغات التي يدعمها كل نمط، ووصف Skype Translator يعد بمكالمات صوتية بسبع لغات ويضيف سطرًا يستحق التذكر: إنه يستخدم تعلم الآلة (machine learning)، فكلما استخدمته أكثر تحسّن أكثر. هذه الجملة هي الجزء 03 كله مصغّرًا. النظام ليس مجموعة ثابتة من القواعد، بل نموذج يتحسن بالبيانات.
As printed on slide 8 (historical)كما طُبع في الشريحة 8 (تاريخي)
- Google Translate, typingGoogle Translate، الكتابة
- 103 languages103 لغات
- Google Translate, offlineGoogle Translate، دون اتصال
- 52 languages52 لغة
- Google Translate, instant camera translationGoogle Translate، الترجمة الفورية بالكاميرا
- 30 languages30 لغة
- Google Translate, camera mode (photos)Google Translate، وضع الكاميرا (الصور)
- 37 languages37 لغة
- Google Translate, conversation mode (two-way speech)Google Translate، وضع المحادثة (كلام في الاتجاهين)
- 32 languages32 لغة
- Skype Translator, voice callsSkype Translator، المكالمات الصوتية
- 7 languages7 لغات
- Skype Translator, instant messagingSkype Translator، المراسلة الفورية
- more than 50 languagesأكثر من 50 لغة
The more durable lesson on the slide is structural. Typing 103 languages is one system: text in, text out. Camera mode is not. To translate the Russian street sign in the photo, the phone must first read the pixels as characters (optical character recognition), then translate the characters, then paint the English back onto the image. Conversation mode is longer still: recognise speech, translate, synthesise speech in the other language. Jurafsky and Martin describe exactly this image-centric case, OCR of the text on a phone camera image used as input to an MT system to translate menus or street signs.
الدرس الأبقى في الشريحة درس بنيوي. الكتابة بـ 103 لغات نظام واحد: نص يدخل ونص يخرج. أما نمط الكاميرا فليس كذلك. لترجمة لافتة الشارع الروسية في الصورة، يجب على الهاتف أولًا أن يقرأ البكسلات كحروف (التعرف الضوئي على الحروف OCR)، ثم يترجم الحروف، ثم يرسم الإنجليزية فوق الصورة. ونمط المحادثة أطول: التعرف على الكلام، ثم الترجمة، ثم توليد الكلام باللغة الأخرى. ويصف JurafskyوMartin هذه الحالة المعتمدة على الصورة تحديدًا: OCR للنص في صورة كاميرا الهاتف يُستخدم مدخلًا لنظام MT لترجمة قوائم الطعام أو لافتات الشوارع.
A photo of a sign or a menu.
صورة للافتة أو لقائمة طعام.
Wrong letter here, wrong word later.
حرف خاطئ هنا يعني كلمة خاطئة لاحقًا.
The only NLP step the slide names.
خطوة NLP الوحيدة التي تسمّيها الشريحة.
Painted back over the sign.
تُرسم من جديد فوق اللافتة.
One speaker talks.
يتكلم أحد المتحدثَين.
Speech recognition guesses the words.
يخمّن التعرف على الكلام الكلماتِ المنطوقة.
Same MT engine as above.
محرك MT نفسه المذكور أعلاه.
The other speaker hears it.
يسمعه المتحدث الآخر.
Keep this picture. When part 03 introduces the linguistic pipeline from paragraphs down to morphemes, and when part 04 lists the ways language defeats a system, both are describing links in chains like these. A product that looks like one feature is usually three or four NLP tasks in a row, and the quality the user sees is the product of all of them.
احتفظ بهذه الصورة في ذهنك. عندما يقدّم الجزء 03 سلسلة المعالجة اللغوية من الفقرات نزولًا إلى الوحدات الصرفية (morphemes)، وعندما يسرد الجزء 04 الطرق التي تهزم بها اللغةُ الأنظمة، فكلاهما يصف حلقات في سلاسل كهذه. المنتج الذي يبدو ميزة واحدة هو عادةً ثلاث أو أربع مهام NLP متتالية، والجودة التي يراها المستخدم هي حاصل ضرب جودتها جميعًا.
Type how heavy is our planet into a search engine and two very different things can come back. On slide 9 the engine answers with a card: Earth, Mass, 5.972 × 1024 kg, a photograph, and a row of related planets. On slide 10 the same query produces an AI Overview: a paragraph explaining that Earth has a mass of approximately 5.972 × 1024 kilograms, about 13.1 septillion pounds, measured using gravity rather than scales, with a heading on how scientists measure it and two cited sources in a side rail. Both are question answering. They are built on opposite principles.
اكتب how heavy is our planet في محرك بحث، وقد يعود إليك شيئان مختلفان تمامًا. في الشريحة 9 يجيب المحرك ببطاقة: Earth، Mass، 5.972 × 1024 kg، وصورة، وصف من الكواكب ذات الصلة. وفي الشريحة 10 ينتج الاستعلام نفسه AI Overview: فقرة تشرح أن كتلة الأرض تقارب 5.972 × 1024 kilograms، أي نحو 13.1 septillion pounds، وأنها تُقاس باستخدام الجاذبية لا الموازين، مع عنوان فرعي عن كيفية قياس العلماء لها ومصدرين مستشهد بهما في شريط جانبي. كلاهما إجابة عن الأسئلة (question answering)، لكنهما مبنيان على مبدأين متعاكسين.
What the answer box has to get rightما الذي يجب أن يصيب فيه صندوق الإجابة
The card looks trivial and hides three separate decisions. The slide's own label names two of them: information extraction and word sense disambiguation. Start with the word "heavy". It has several senses: heavy rain, heavy traffic, a heavy heart, a heavy object. Only one of them is a physical quantity a database could store, so the system must choose the sense "has a large mass" before it can look anything up. That choice is word sense disambiguation, and the answer card's label "Mass" is the visible trace of it.
تبدو البطاقة بسيطة لكنها تخفي ثلاثة قرارات منفصلة. عنوان الشريحة نفسه يسمّي اثنين منها: استخراج المعلومات وإزالة غموض معنى الكلمة. ابدأ بكلمة «heavy». لها عدة معانٍ: heavy rain (مطر غزير)، وheavy traffic (ازدحام شديد)، وa heavy heart (قلب مثقل)، وa heavy object (جسم ثقيل). واحد منها فقط كمية فيزيائية يمكن لقاعدة بيانات أن تخزنها، لذلك يجب على النظام أن يختار معنى «له كتلة كبيرة» قبل أن يبحث عن أي شيء. هذا الاختيار هو إزالة غموض معنى الكلمة (word sense disambiguation)، وعنوان البطاقة «Mass» هو الأثر المرئي له.
The second decision is about "our planet". No table anywhere has a row called "our planet". The phrase is a string; the answer requires a thing. Google's Knowledge Graph was announced in 2012 under exactly that slogan, things not strings: a model that understands real-world entities and their relationships to one another, so that "Taj Mahal" can mean the monument or the musician. Mapping the mention "our planet" to the entity Earth is entity linking. (The literature calls this entity linking; entity resolution more often means merging duplicate records.) Only once both decisions are made does the third step become a lookup: fetch the mass attribute of the Earth node.
القرار الثاني يتعلق بعبارة «our planet». لا يوجد جدول في أي مكان فيه صف اسمه «our planet». العبارة سلسلة نصية (string)، والإجابة تتطلب شيئًا (thing). أُعلن عن Knowledge Graph من Google في 2012 تحت هذا الشعار بالضبط، «things not strings»: نموذج يفهم الكيانات الحقيقية وعلاقاتها ببعضها، بحيث يمكن أن تعني «Taj Mahal» المعلم الأثري أو الموسيقي. ربط الذكر «our planet» بالكيان Earth هو ربط الكيانات (entity linking). (تسميه الأدبيات entity linking، أما entity resolution فتعني في الغالب دمج السجلات المكررة.) وفقط بعد اتخاذ القرارين تصبح الخطوة الثالثة مجرد بحث: اجلب خاصية الكتلة من عقدة Earth.
Where did the graph get that number? From text, by information extraction: Jurafsky and Martin define IE as turning the unstructured information embedded in texts into structured data, for example for populating a relational database, and note that knowledge graphs of structured relational knowledge are a useful way for search engines to present information to users. The answer box is therefore the last inch of a long chain: extractors read encyclopedias and fact sheets once, store facts as graph edges, and the search engine reads the edge at query time. The same machinery returns in the email example two concepts from now.
من أين حصل الرسم على هذا الرقم؟ من النصوص، عن طريق استخراج المعلومات (information extraction): يعرّف Jurafsky وMartin الـ IE بأنه تحويل المعلومات غير المنظمة المضمّنة في النصوص إلى بيانات منظمة، مثلًا لملء قاعدة بيانات علائقية، ويذكران أن رسوم المعرفة التي تحمل معرفة علائقية منظمة طريقة مفيدة لمحركات البحث لعرض المعلومات على المستخدمين. لذا فصندوق الإجابة هو آخر بوصة في سلسلة طويلة: تقرأ برامج الاستخراج الموسوعات وصحائف الحقائق مرة واحدة، وتخزن الحقائق كحواف في الرسم، ثم يقرأ محرك البحث الحافة وقت الاستعلام. وتعود الآلية نفسها في مثال البريد الإلكتروني بعد مفهومين من الآن.
Worked exampleمثال محلول
How the answer box answers 'how heavy is our planet'كيف يجيب صندوق الإجابة عن «how heavy is our planet»
Disambiguate the senseأزل غموض المعنى
"heavy" is read as mass, not as the sense in heavy rain or heavy traffic. This selects the attribute to look up.تُقرأ «heavy» بمعنى الكتلة، لا بالمعنى الذي في heavy rain أو heavy traffic. وهذا يحدد الخاصية التي سيُبحث عنها.Resolve the entityحدد الكيان
"our planet" is mapped to the knowledge graph node Earth. This selects the row.تُربط «our planet» بعقدة Earth في رسم المعرفة. وهذا يحدد الصف.Retrieve the factاسترجع الحقيقة
The pair (Earth, mass) returns 5.972 × 1024 kg, a value that an information extraction system once pulled from a source document into the graph.الزوج (Earth, mass) يعيد 5.972 × 1024 kg، وهي قيمة سحبها نظام استخراج معلومات ذات مرة من وثيقة مصدر إلى الرسم.One field, renderedحقل واحد، معروض
Earth / Mass / 5.972 × 1024 kg, plus neighbouring nodes (Mars, Venus, Jupiter) as "People also search for".Earth / Mass / 5.972 × 1024 kg، إضافة إلى العقد المجاورة (Mars وVenus وJupiter) تحت عنوان «People also search for».
| Planetالكوكب | Slide 9 valueقيمة الشريحة 9 | Earth masses on slideبكتل الأرض كما في الشريحة | NASA valueقيمة NASA | NASA ratio to Earthنسبة NASA إلى الأرض |
|---|---|---|---|---|
| Earthالأرض | 5.972 × 1024 kg5.972 × 1024 kg | 11 | 5.9722 × 1024 kg5.9722 × 1024 kg | 11 |
| Marsالمريخ | 6.39 × 1023 kg6.39 × 1023 kg | 0.1070.107 | 6.4169 × 1023 kg6.4169 × 1023 kg | 0.1070.107 |
| Venusالزهرة | 4.867 × 1024 kg4.867 × 1024 kg | 0.8150.815 | 4.8673 × 1024 kg4.8673 × 1024 kg | 0.8150.815 |
| Jupiterالمشتري | 1.898 × 1027 kg1.898 × 1027 kg | 317.8317.8 | 1.89813 × 1027 kg1.89813 × 1027 kg | 317.8317.8 |
The ratios check out from the slide's own numbers: 6.39 / 59.72 = 0.107, 4.867 / 5.972 = 0.815 and 1898 / 5.972 = 317.8. The Mars row also carries a quiet lesson: the card shows 6.39 × 1023 kg while NASA's current fact sheet lists 6.4169 × 1023 kg, about 0.4 percent higher. Nothing in the card is broken. An extracted fact is only as accurate as the source it was extracted from, and that is the answer box's characteristic failure: it can only be as wrong as its stored fact, and it has no way to be more right.
النسب صحيحة عند حسابها من أرقام الشريحة نفسها: 6.39 / 59.72 = 0.107، 4.867 / 5.972 = 0.815، و1898 / 5.972 = 317.8. ويحمل صف Mars درسًا هادئًا أيضًا: البطاقة تعرض 6.39 × 1023 kg بينما تذكر صحيفة الحقائق الحالية لدى NASA 6.4169 × 1023 kg، أي أعلى بنحو 0.4 بالمئة. لا شيء في البطاقة معطّل. الحقيقة المستخرجة دقيقة بقدر دقة المصدر الذي استُخرجت منه فقط، وهذا هو الفشل المميز لصندوق الإجابة: لا يمكن أن يكون خاطئًا بأكثر من خطأ الحقيقة المخزنة، ولا سبيل له لأن يكون أصح منها.
What changes when a language model writes the answerما الذي يتغير عندما يكتب نموذج لغوي الإجابة
Slide 10 is the same query on a search page with an AI Mode tab and an AI Overview. Nothing was looked up in a graph and rendered as a card. Instead the engine retrieved documents, handed them to a large language model, and let the model write. Jurafsky and Martin call this retrieval-augmented generation: use information retrieval techniques to retrieve documents, then use a large language model to generate an answer conditioned on those documents. The recipe is three lines. Retrieve the top passages for the query, build a prompt that contains the query and those passages, and call the model.
الشريحة 10 هي الاستعلام نفسه في صفحة بحث فيها تبويب AI Mode وAI Overview. لم يُبحث عن شيء في رسم ولم يُعرض في بطاقة. بدلًا من ذلك استرجع المحرك وثائق، وسلّمها إلى نموذج لغوي كبير (large language model)، وترك النموذج يكتب. يسمي Jurafsky وMartin هذا التوليد المعزّز بالاسترجاع (retrieval-augmented generation): استخدم تقنيات استرجاع المعلومات لاسترجاع الوثائق، ثم استخدم نموذجًا لغويًا كبيرًا لتوليد إجابة مشروطة بتلك الوثائق. الوصفة ثلاثة أسطر: استرجع أفضل المقاطع للاستعلام، وابنِ prompt يحتوي الاستعلام وتلك المقاطع، ثم استدعِ النموذج.
The screenshot shows every ingredient. The retrieved passages are the two cards in the side rail, an AIP Inside Science article titled "How Much Does Earth Weigh?" and the Wikipedia article on Earth. The generation is the paragraph, which is not a quotation from either page but a new text stitched from both, complete with a unit conversion: 5.972 × 1024 kg times 2.20462 lb/kg is 1.317 × 1025 lb, which is the "13,170,000,000,000,000,000,000,000 lbs" in the overview and the "13 thousand, 170 billion trillion pounds" in the AIP article. The citation chips are the last ingredient, what the textbook calls a knowledge citation that helps the user decide whether to trust the generation.
تُظهر لقطة الشاشة كل المكوّنات. المقاطع المسترجعة هي البطاقتان في الشريط الجانبي: مقال من AIP Inside Science بعنوان «How Much Does Earth Weigh?»، ومقال ويكيبيديا عن Earth. والتوليد هو الفقرة، وهي ليست اقتباسًا من أي من الصفحتين بل نص جديد مخيط من كلتيهما، ومعه تحويل للوحدات: 5.972 × 1024 kg مضروبة في 2.20462 lb/kg تساوي 1.317 × 1025 lb، وهي «13,170,000,000,000,000,000,000,000 lbs» في الـ overview و«13 thousand, 170 billion trillion pounds» في مقال AIP. ورقاقات الاستشهاد (citation chips) هي المكوّن الأخير، وهي ما يسميه الكتاب استشهادًا معرفيًا (knowledge citation) يساعد المستخدم على تقرير ما إذا كان يثق بالنص المولَّد.
Look closely at the second chip and you can see the seams. Its snippet reads "Table_title: Earth Table_content: header: | Designations | row: ...", which is not prose at all; the retriever pulled a Wikipedia infobox as a flattened table and the model wrote around it. That is the point of the shift: the classic box extracts one structured fact and shows it, the overview retrieves raw text and composes. The output is more helpful, more explanatory and more flexible, and it introduces a failure that the card never had.
انظر عن قرب إلى الرقاقة الثانية وسترى مواضع الخياطة. مقتطفها يقول «Table_title: Earth Table_content: header: | Designations | row: ...»، وهذا ليس نثرًا على الإطلاق: سحب المسترجِع صندوق معلومات (infobox) من ويكيبيديا على شكل جدول مسطّح، وكتب النموذج حوله. وهذا هو جوهر التحول: الصندوق التقليدي يستخرج حقيقة منظمة واحدة ويعرضها، والـ overview يسترجع نصًا خامًا ويؤلّف منه. المخرج أكثر فائدة وأكثر شرحًا وأكثر مرونة، لكنه يُدخل نوعًا من الفشل لم يكن موجودًا في البطاقة قط.
| Propertyالخاصية | Answer box (slide 9)صندوق الإجابة (الشريحة 9) | AI Overview (slide 10)AI Overview (الشريحة 10) |
|---|---|---|
| What is producedما الذي يُنتَج | One field, rendered as a cardحقل واحد يُعرض على شكل بطاقة | A paragraph, with headings and a Show more buttonفقرة، مع عناوين وزر «Show more» |
| Where the answer comes fromمصدر الإجابة | A knowledge graph entryمُدخل في رسم المعرفة (knowledge graph) | Retrieved pages fed to a large language modelصفحات مسترجعة تُمرَّر إلى نموذج لغوي كبير (LLM) |
| Core NLP stepsخطوات NLP الأساسية | Sense disambiguation, entity linking, lookupإزالة غموض المعنى، وربط الكيان، والبحث | Retrieval, prompt construction, generationالاسترجاع، وبناء الـ prompt، والتوليد |
| Provenanceمصدر المعلومة (provenance) | Implicit: the graph itselfضمني: رسم المعرفة نفسه | Explicit: citation chips next to claimsصريح: شارات استشهاد بجانب الادعاءات |
| Main failureالفشل الرئيسي | A stale, imprecise, or missing factحقيقة قديمة أو غير دقيقة أو مفقودة | Fluent text that is not faithful to the facts or its cited sourcesنص سلس لكنه غير أمين للحقائق أو للمصادر التي يستشهد بها |
| Cost per queryالتكلفة لكل استعلام | A lookupعملية بحث واحدة | A large model inferenceاستدلال (inference) بنموذج كبير |
That new failure has a name. Large language models hallucinate, and a hallucination, in Jurafsky and Martin's words, is a response that is not faithful to the facts of the world. They report a study in which, asked questions about the legal domain, large language models hallucinated from 69 to 88 percent of the time, and add the more troubling half: it is not always possible to tell when a model is hallucinating, partly because LLMs are not well calibrated, so they can give a very wrong answer with complete certainty. The card can be stale. The paragraph can be wrong while sounding exactly like the truth, and the citations can point to a page that does not say what the paragraph claims.
لهذا الفشل الجديد اسم. النماذج اللغوية الكبيرة تهلوس، والهلوسة (hallucination) بتعبير Jurafsky وMartin استجابة غير أمينة لحقائق العالم. ويذكران دراسة وجدت أن النماذج اللغوية الكبيرة، عند سؤالها أسئلة في المجال القانوني، هلوست بنسبة تتراوح من 69 إلى 88 بالمئة من الوقت، ويضيفان النصف الأكثر إقلاقًا: ليس من الممكن دائمًا معرفة متى يهلوس النموذج، ويعود ذلك جزئيًا إلى أن الـ LLMs ليست معايرة جيدًا (not well calibrated)، فقد تعطي إجابة خاطئة تمامًا بيقين كامل. البطاقة قد تكون قديمة. أما الفقرة فقد تكون خاطئة وهي تبدو تمامًا كالحقيقة، وقد تشير الاستشهادات إلى صفحة لا تقول ما تدّعيه الفقرة.
Recall
What are the three things a classic answer box must do to answer 'how heavy is our planet'?ما الأمور الثلاثة التي يجب أن يفعلها صندوق الإجابة التقليدي ليجيب عن «how heavy is our planet»؟
Quick checkاختبار سريع
Compared with the classic answer box, what new failure mode does the AI Overview introduce?مقارنةً بصندوق الإجابة التقليدي، ما نمط الفشل الجديد الذي يُدخله AI Overview؟
Slide 11 shows spelling and grammar correction at work: a Word window with one sentence in it, This is bigger then that ofcourse. Two words are underlined, and the colours are not decoration. ofcourse carries a red squiggle. then carries a blue one, and the context menu under it offers a single replacement, than. Microsoft's documentation spells out the convention: potential spelling errors get a red squiggly line, potential grammatical errors get a blue one. The two colours mark two different problems, and the second is much harder than the first.
تعرض الشريحة 11 تصحيح الإملاء والقواعد (spelling and grammar correction) أثناء العمل: نافذة Word فيها جملة واحدة، This is bigger then that ofcourse. تحت كلمتين خط، والألوان ليست للزينة. تحت ofcourse خط متموج أحمر، وتحت then خط متموج أزرق، والقائمة المنبثقة تحتها تقترح بديلًا واحدًا، than. توثيق Microsoft يوضح القاعدة: أخطاء الإملاء المحتملة تحصل على خط متموج أحمر، والأخطاء النحوية المحتملة على خط أزرق. اللونان يشيران إلى مشكلتين مختلفتين، والثانية أصعب بكثير من الأولى.
Jurafsky and Martin draw the line precisely. Non-word spelling correction is the detection and correction of spelling errors that result in non-words, like graffe for giraffe. Real-word spelling correction is the task of detecting and correcting spelling errors even if they accidentally result in an actual word of English. ofcourse is the first kind: it is not in any dictionary, so the check is a lookup that needs no context whatsoever. then is the second kind. It is a perfectly good English word, in the dictionary, spelled correctly. Nothing about the word itself is wrong. What is wrong is the word in this position, between "bigger" and "that", where English demands the comparative partner "than".
يرسم Jurafsky وMartin الحد بدقة. تصحيح أخطاء الكلمات غير الموجودة (non-word spelling correction) هو اكتشاف وتصحيح أخطاء الإملاء التي تنتج كلمات غير موجودة، مثل graffe بدل giraffe. أما تصحيح أخطاء الكلمات الحقيقية (real-word spelling correction) فهو مهمة اكتشاف وتصحيح أخطاء الإملاء حتى لو نتجت عنها مصادفةً كلمة إنجليزية حقيقية. ofcourse من النوع الأول: ليست في أي قاموس، فالفحص مجرد بحث لا يحتاج إلى أي سياق على الإطلاق. وthen من النوع الثاني. إنها كلمة إنجليزية سليمة تمامًا، موجودة في القاموس ومكتوبة بشكل صحيح. لا شيء في الكلمة نفسها خاطئ. الخطأ هو الكلمة في هذا الموضع، بين «bigger» و«that»، حيث تتطلب الإنجليزية الكلمة المرافقة للمقارنة «than».
That difference is why the second problem is hard. The textbook says it directly: real-word spelling error detection is a much more difficult task, since any word in the input text could be an error. And it is not a rare case. Studies suggest that between 25 and 40 percent of spelling errors are valid English words. A checker that only consults a dictionary silently passes a quarter to nearly half of all mistakes. To catch them, the system must know what English sentences look like, which is to say it needs alanguage model, a model that assigns higher probability to "bigger than that" than to "bigger then that", or a grammar rule that encodes the same preference by hand.
هذا الفرق هو سبب صعوبة المشكلة الثانية. يقولها الكتاب صراحة: اكتشاف أخطاء الكلمات الحقيقية مهمة أصعب بكثير، لأن أي كلمة في النص المُدخل قد تكون خطأ. وهي ليست حالة نادرة. تشير الدراسات إلى أن ما بين 25 و40 بالمئة من أخطاء الإملاء كلمات إنجليزية صحيحة. المدقق الذي يرجع إلى القاموس فقط يمرّر بصمت من ربع إلى ما يقارب نصف كل الأخطاء. ولاكتشافها يجب أن يعرف النظام كيف تبدو الجمل الإنجليزية، أي أنه يحتاج إلى نموذج لغوي (language model)، وهو نموذج يعطي احتمالًا أعلى لـ «bigger than that» منه لـ «bigger then that»، أو إلى قاعدة نحوية تشفّر التفضيل نفسه يدويًا.
The noisy channel, in one lineالقناة المشوّشة، في سطر واحد
The classical machinery for both kinds is the noisy channel model. Imagine the writer meant some word w and a noisy channel, their fingers, produced x. The corrector wants the intended word that best explains what it sees.
الآلية الكلاسيكية للنوعين هي نموذج القناة المشوّشة (noisy channel model). تخيّل أن الكاتب قصد كلمة ما w، وأن قناة مشوّشة، وهي أصابعه، أنتجت x. يريد المصحّح الكلمة المقصودة التي تفسّر ما يراه على أفضل وجه.
The candidate set V is kept small because the majority of spelling errors consist of a single-letter change, so candidates within one insertion, deletion, substitution or transposition of the typed string (Damerau-Levenshtein distance 1) cover most cases. For a non-word, the language model term just prefers common words. For a real-word error, the channel model works against the correction: in the Mays et al. model the textbook uses, P(x | w) is alpha (about 0.95) when the typed word is the intended one, and only the small remainder 1 - alpha is spread over candidates such as than. The language model term P(w) must therefore outweigh that bias, and it can only do so from context.
تبقى مجموعة المرشحين V صغيرة لأن غالبية أخطاء الإملاء تتكون من تغيير حرف واحد، فالمرشحون الذين يبعدون إدراجًا واحدًا أو حذفًا أو استبدالًا أو تبديل موضع حرفين متجاورين عن السلسلة المكتوبة (مسافة Damerau-Levenshtein تساوي 1) يغطون معظم الحالات. في حالة الكلمة غير الموجودة، يفضّل حد النموذج اللغوي الكلمات الشائعة فقط. أما في خطأ الكلمة الحقيقية فنموذج القناة يعمل ضد التصحيح: في نموذج Mays et al. الذي يستخدمه الكتاب، تساوي P(x | w) القيمة alpha (نحو 0.95) عندما تكون الكلمة المكتوبة هي المقصودة، ولا يتوزع على المرشحين مثل than إلا الباقي الصغير 1 - alpha. لذلك يجب أن يتغلب حد النموذج اللغوي P(w) على هذا الانحياز، ولا يستطيع ذلك إلا من خلال السياق.
Worked exampleمثال محلول
Why 'then' needs contextلماذا تحتاج «then» إلى السياق
Dictionary lookupالبحث في القاموس
ofcourse is not in the vocabulary. Flag it, generate neighbours within one edit (insert a space, giving "of course"), pick the most probable. No context needed. Red underline.ofcourse ليست في المفردات. ضع عليها علامة، وولّد الجيران على بُعد تعديل واحد (أدخل مسافة لتحصل على «of course»)، واختر الأكثر احتمالًا. لا حاجة إلى سياق. خط أحمر.Dictionary lookup againالبحث في القاموس مرة أخرى
then is in the vocabulary. Lookup passes it. If the checker stopped here, the error would survive.then موجودة في المفردات، فيمرّرها البحث. لو توقف المدقق هنا لنجا الخطأ.Generate real-word candidatesولّد مرشحين من الكلمات الحقيقية
Words within one edit of "then" include than, the, them, ten, hen. Each is a plausible intended word under the channel model.الكلمات التي تبعد تعديلًا واحدًا عن «then» تشمل than وthe وthem وten وhen. كل منها كلمة مقصودة محتملة وفق نموذج القناة.Score the sentence with a language modelقيّم الجملة بنموذج لغوي
Under any model of English, "bigger than that" is far more probable than "bigger then that", "bigger the that" or "bigger them that". The product of channel and language model peaks at "than".وفق أي نموذج للإنجليزية، «bigger than that» أكثر احتمالًا بكثير من «bigger then that» أو «bigger the that» أو «bigger them that». وحاصل ضرب نموذج القناة في النموذج اللغوي يبلغ ذروته عند «than».Blue underline, one suggestionخط أزرق، واقتراح واحد
The checker offers than, exactly the menu on the slide. The exact probabilities depend on the model; the ordering does not.يقترح المدقق than، وهي بالضبط القائمة في الشريحة. الاحتمالات الدقيقة تعتمد على النموذج، أما الترتيب فلا.
This is also the oldest NLP application most people use every day. Jurafsky and Martin note that spelling correctors are ubiquitous in pretty much any software that relies on keyboard input, from word processors to search boxes to phone keyboards, and the same noisy channel idea reappears in speech recognition and machine translation. Real-word correction was also an early case of a language model doing linguistic work that no dictionary could, which is the pattern the whole modern field follows.
وهذا أيضًا أقدم تطبيق NLP يستخدمه معظم الناس كل يوم. يذكر Jurafsky وMartin أن مصححات الإملاء منتشرة في كل برنامج تقريبًا يعتمد على الإدخال بلوحة المفاتيح، من معالجات النصوص إلى مربعات البحث إلى لوحات مفاتيح الهواتف، وأن فكرة القناة المشوّشة نفسها تظهر مجددًا في التعرف على الكلام وفي الترجمة الآلية. وكان تصحيح الكلمات الحقيقية أيضًا حالة مبكرة لنموذج لغوي يؤدي عملًا لغويًا لا يستطيعه أي قاموس، وهذا هو النمط الذي يتبعه المجال الحديث كله.
Recall
Which of 'then' and 'ofcourse' is a non-word error, and why is the other one harder to catch?أيٌّ من «then» و«ofcourse» خطأ كلمة غير موجودة، ولماذا يصعب اكتشاف الآخر أكثر؟
Quick checkاختبار سريع
Why does Word need context to flag 'then' but not 'ofcourse'?لماذا يحتاج Word إلى السياق ليُعلِّم «then» ولا يحتاجه مع «ofcourse»؟
An email arrives for Dan Jurafsky, dated January 15, 2012, subject "curriculum meeting". The body is two lines: "Hi Dan, we've now scheduled the curriculum meeting. It will be in Gates 159 tomorrow from 10:00-11:30. -Chris". Beside it sits a grey card that the mail client has filled in by itself: Event, Date, Start, End, Where, and a blue button, Create new Calendar entry. The email is prose. The card is a record. Getting from one to the other is information extraction, and the card is the clearest picture of it in the whole lecture.
يصل بريد إلكتروني إلى Dan Jurafsky بتاريخ January 15, 2012، وموضوعه «curriculum meeting». نص الرسالة سطران: «Hi Dan, we've now scheduled the curriculum meeting. It will be in Gates 159 tomorrow from 10:00-11:30. -Chris». وبجانبه بطاقة رمادية ملأها برنامج البريد بنفسه: Event وDate وStart وEnd وWhere، وزر أزرق: Create new Calendar entry. البريد نثر، والبطاقة سجل. والانتقال من الأول إلى الثاني هو استخراج المعلومات (information extraction)، والبطاقة أوضح صورة له في المحاضرة كلها.
Hover or tap a span in the email, or a field in the record, to see what filled it.مرّر المؤشر أو انقر على مقطع في البريد، أو على حقل في السجل، لترى ما الذي ملأه.
- Subject:
- Date:
- To:
- Dan Jurafsky
Hi Dan, we've now scheduled the .
It will be in from -.
-Chris
Two fields are copied straight from the text (the room and the event name). Three are inferred: the date is the header date plus one day, and the time range is split in two with morning assumed. Inferred slots are where an extractor can be wrong.حقلان يُنسخان مباشرة من النص (القاعة واسم الحدث). وثلاثة تُستنتج: التاريخ هو تاريخ الترويسة مضافًا إليه يوم واحد، ومدى الوقت يُقسم إلى قسمين مع افتراض أنه صباحًا. والخانات المستنتجة هي المواضع التي قد يخطئ فيها المستخرِج.
The extracted record on slide 12السجل المستخرج في الشريحة 12
- Eventالحدث (Event)
- Curriculum mtgاجتماع المنهج (Curriculum mtg)
- Dateالتاريخ (Date)
- Jan-16-2012Jan-16-2012
- Startالبداية (Start)
- 10:00am10:00am
- Endالنهاية (End)
- 11:30am11:30am
- Whereالمكان (Where)
- Gates 159Gates 159
- Actionالإجراء (Action)
- Create new Calendar entryإنشاء موعد جديد في التقويم (Create new Calendar entry)
The card is an instance of what Jurafsky and Martin call template filling: find documents that invoke a particular script, then fill the slots of the associated template with fillers extracted from the text. The script here is "a meeting is being scheduled", the template has five slots, and the textbook adds the distinction that makes the slide interesting. Slot fillers may consist of text segments extracted directly from the text, or they may consist of concepts that have been inferred from text elements through some additional processing. Sort the five fields by that rule and they split cleanly in two.
البطاقة مثال على ما يسميه Jurafsky وMartin ملء القوالب (template filling): اعثر على الوثائق التي تستدعي سيناريو (script) معينًا، ثم املأ خانات القالب المرتبط به بقيم مستخرجة من النص. السيناريو هنا «اجتماع يجري تحديد موعده»، والقالب له خمس خانات، ويضيف الكتاب التمييز الذي يجعل الشريحة مثيرة للاهتمام: قيم الخانات قد تكون مقاطع نصية مستخرجة مباشرة من النص، أو مفاهيم استُنتجت من عناصر النص عبر معالجة إضافية. رتّب الحقول الخمسة وفق هذه القاعدة فتنقسم بوضوح إلى مجموعتين.
| Fieldالحقل | Text it came fromالنص الذي جاءت منه | Copied or inferredمنسوخة أم مستنتَجة | What had to happenما الذي كان يجب أن يحدث |
|---|---|---|---|
| Whereالمكان (Where) | Gates 159Gates 159 | Copiedمنسوخة | Recognise a building-plus-room string as a locationالتعرّف على سلسلة نصية من مبنى ورقم غرفة بوصفها موقعًا |
| Eventالحدث (Event) | curriculum meetingcurriculum meeting | Copied, then abbreviatedمنسوخة، ثم مختصَرة | Take the subject line as the event nameأخذ سطر الموضوع اسمًا للحدث |
| Dateالتاريخ (Date) | tomorrow, with the header date January 15, 2012tomorrow، مع تاريخ الترويسة January 15, 2012 | Inferredمستنتَجة | Resolve a relative expression against the document dateتحويل تعبير نسبي بالرجوع إلى تاريخ الوثيقة |
| Startالبداية (Start) | 10:0010:00 | Inferredمستنتَجة | Split the range, assume morningتقسيم النطاق، وافتراض أنه صباحًا |
| Endالنهاية (End) | 11:3011:30 | Inferredمستنتَجة | Split the range, assume morningتقسيم النطاق، وافتراض أنه صباحًا |
Resolving "tomorrow"تحويل «tomorrow» إلى تاريخ
The Date field is the one worth slowing down on, because the word "tomorrow" contains no date at all. Jurafsky and Martin call this temporal normalization, the task of mapping a temporal expression to a point in time or to a duration, and they explain why it is possible: most temporal expressions are incomplete and only implicitly anchored, often with respect to the dateline of the article, which they call the document's temporal anchor. The values of expressions such as today, yesterday or tomorrow can all be computed relative to that anchor, and the rule for these two is the simplest one there is. Tomorrow adds a day to the anchor, yesterday subtracts one.
حقل Date هو الذي يستحق التمهل عنده، لأن كلمة «tomorrow» لا تحتوي أي تاريخ على الإطلاق. يسمي Jurafsky وMartin هذا التطبيع الزمني (temporal normalization)، وهو مهمة ربط التعبير الزمني بنقطة في الزمن أو بمدة، ويشرحان لماذا هو ممكن: معظم التعابير الزمنية ناقصة ومرتبطة ضمنيًا فقط، وغالبًا ما يكون ذلك بالنسبة إلى تاريخ نشر المقال، الذي يسميانه المرساة الزمنية للوثيقة (temporal anchor). ويمكن حساب قيم تعابير مثل today وyesterday وtomorrow كلها بالنسبة إلى تلك المرساة، والقاعدة لهذين الاثنين أبسط قاعدة ممكنة: tomorrow تضيف يومًا إلى المرساة، وyesterday تطرح يومًا.
Worked exampleمثال محلول
From 'tomorrow' to Jan-16-2012من «tomorrow» إلى Jan-16-2012
Find the anchorاعثر على المرساة
The email header gives the document date: January 15, 2012. This is the temporal anchor.ترويسة البريد تعطي تاريخ الوثيقة: January 15, 2012. هذه هي المرساة الزمنية.Classify the expressionصنّف التعبير
"tomorrow" is a relative expression, not an absolute date like "January 16" and not a duration like "two hours".«tomorrow» تعبير نسبي، وليس تاريخًا مطلقًا مثل «January 16»، وليس مدة مثل «ساعتين» (two hours).Apply the ruleطبّق القاعدة
Anchor plus one day: 2012-01-15 becomes 2012-01-16, the ISO 8601 value that the card displays as Jan-16-2012.المرساة زائد يوم واحد: 2012-01-15 تصبح 2012-01-16، وهي قيمة ISO 8601 التي تعرضها البطاقة على شكل Jan-16-2012.Split the time rangeقسّم النطاق الزمني
"10:00-11:30" is one string holding two times. Start takes 10:00, End takes 11:30. The text never says am or pm; the extractor assumes a meeting at ten is in the morning, which is a world knowledge inference and a possible error.«10:00-11:30» سلسلة واحدة تحمل وقتين. يأخذ Start القيمة 10:00، ويأخذ End القيمة 11:30. النص لا يذكر am أو pm أبدًا، ويفترض المستخرِج أن اجتماعًا في العاشرة يكون صباحًا، وهذا استنتاج من المعرفة بالعالم (world knowledge) وخطأ محتمل.Fill the locationاملأ المكان
Gates 159 is recognised as a named entity of type location, a building name followed by a room number, and copied into Where.يُتعرَّف على Gates 159 بوصفه كيانًا مسمّى (named entity) من نوع موقع، أي اسم مبنى يليه رقم غرفة، ويُنسخ إلى Where.Five slots, one actionخمس خانات، وإجراء واحد
Every slot is filled, so the client can enable Create new Calendar entry. The two copied fields are safe. The three inferred ones are where a bug would live.كل الخانات ممتلئة، فيستطيع البرنامج تفعيل Create new Calendar entry. الحقلان المنسوخان آمنان، والحقول الثلاثة المستنتجة هي حيث يمكن أن يختبئ الخطأ.
Two threads tie this concept to its neighbours. First, the textbook's own exercise on this chapter asks for exactly the application on the slide: associating temporal expressions connected with events in email with specific calendar entries, which is a sign of how central the example is. Second, the graph that the answer box read from in the previous concept was populated by the same kind of extractor working over encyclopedias instead of inboxes. Search returns documents. Extraction returns fields with normalised values that a program can act on, and the blue button is the program acting.
خيطان يربطان هذا المفهوم بجيرانه. أولًا، تمرين الكتاب نفسه في هذا الفصل يطلب التطبيق الموجود في الشريحة بالضبط: ربط التعابير الزمنية المتصلة بالأحداث في البريد الإلكتروني بمدخلات تقويم محددة، وهذا دليل على مدى مركزية المثال. ثانيًا، الرسم الذي قرأ منه صندوق الإجابة في المفهوم السابق مُلئ بالنوع نفسه من المستخرِجات وهي تعمل على الموسوعات بدلًا من صناديق البريد. البحث يعيد وثائق، والاستخراج يعيد حقولًا بقيم مُطبَّعة يمكن لبرنامج أن يتصرف بناءً عليها، والزر الأزرق هو البرنامج وهو يتصرف.
Recall
List the fields the calendar extractor fills from Chris's email, and explain how 'tomorrow' becomes Jan-16-2012.اذكر الحقول التي يملؤها مستخرِج التقويم من بريد Chris، واشرح كيف تصبح «tomorrow» هي Jan-16-2012.
Quick checkاختبار سريع
How does the extractor turn 'tomorrow' into Jan-16-2012 on slide 12?كيف يحوّل المستخرِج «tomorrow» إلى Jan-16-2012 في الشريحة 12؟
Slide 13 puts a camera next to a list of the things people talk about when they review it: zoom, affordability, size and weight, flash, ease of use. Under "Size and weight" it collects three remarks: "nice and compact to carry!", "since the camera is small and light, I won't need to carry around those heavy, bulky professional cameras either!", and "the camera feels flimsy, is plastic and very light in weight you have to be very delicate in the handling of this camera". Read the second and third again. Both say the camera is light. Decide below whether each one is praise or complaint, then read on.
تضع الشريحة 13 كاميرا بجانب قائمة بالأشياء التي يتحدث عنها الناس عند تقييمها: التقريب (zoom)، والسعر المناسب (affordability)، والحجم والوزن (size and weight)، والفلاش (flash)، وسهولة الاستخدام (ease of use). وتحت «Size and weight» تجمع ثلاث ملاحظات: «nice and compact to carry!»، و«since the camera is small and light, I won't need to carry around those heavy, bulky professional cameras either!»، و«the camera feels flimsy, is plastic and very light in weight you have to be very delicate in the handling of this camera». اقرأ الثانية والثالثة مرة أخرى. كلتاهما تقول إن الكاميرا خفيفة. قرر في الأسفل هل كل منهما مدح أم شكوى، ثم تابع القراءة.
Decide the polarity of each review before revealing the marks the slide gives them.حدّد قطبية كل مراجعة قبل كشف العلامات التي تمنحها لها الشريحة.
nice and compact to carry!
since the camera is small and light, I won't need to carry around those heavy, bulky professional cameras either!
the camera feels flimsy, is plastic and very light in weight you have to be very delicate in the handling of this camera
The slide title pairs information extraction with sentiment analysis, and that pairing is the lesson. Bing Liu, whose book defined the field, states the principle: an opinion consists of a sentiment (positive or negative) and a target, and an opinion without its target being identified is of limited use. He calls the finer-grained task aspect level analysis, earlier called feature-based opinion mining after Hu and Liu's 2004 work on exactly this kind of camera review, and he formalises an opinion as a tuple of entity, aspect, sentiment, holder and time. Then he adds the line that explains the slide title: that tuple is basically a database schema. Sentiment analysis at this level is an extraction task first. Find the aspect, then judge the polarity of what was said about it.
عنوان الشريحة يقرن استخراج المعلومات (information extraction) بـ تحليل المشاعر (sentiment analysis)، وهذا الاقتران هو الدرس. يصوغ Bing Liu، الذي عرّف كتابه هذا المجال، المبدأ هكذا: الرأي يتكون من مشاعر (إيجابية أو سلبية) وهدف (target)، والرأي الذي لم يُحدَّد هدفه محدود الفائدة. ويسمي المهمة الأدق التحليل على مستوى الجانب (aspect)، وكانت تسمى سابقًا تنقيب الآراء المعتمد على الخصائص (feature-based opinion mining) نسبةً إلى عمل Hu وLiu عام 2004 على هذا النوع بالضبط من مراجعات الكاميرات، ويصوغ الرأي رسميًا على أنه صف (tuple) من الكيان والجانب والمشاعر وصاحب الرأي والزمن. ثم يضيف السطر الذي يفسر عنوان الشريحة: هذا الصف هو في الأساس مخطط قاعدة بيانات (database schema). تحليل المشاعر على هذا المستوى مهمة استخراج أولًا: اعثر على الجانب، ثم احكم على قطبية ما قيل عنه.
| Aspectالجانب | Sentenceالجملة | Cue wordsكلمات الدلالة | Polarityالقطبية |
|---|---|---|---|
| Size and weightالحجم والوزن | nice and compact to carry!«لطيفة وصغيرة الحجم، سهلة الحمل!» (nice and compact to carry!) | nice, compactnice، compact | positiveإيجابية |
| Size and weightالحجم والوزن | since the camera is small and light, I won't need to carry around those heavy, bulky professional cameras either!«بما أن الكاميرا صغيرة وخفيفة (small and light)، فلن أحتاج أيضًا إلى حمل تلك الكاميرات الاحترافية الثقيلة الضخمة!» | small, light, contrasted with heavy, bulkysmall، light، في مقابل heavy، bulky | positiveإيجابية |
| Size and weightالحجم والوزن | the camera feels flimsy, is plastic and very light in weight you have to be very delicate in the handling of this camera«تبدو الكاميرا هشّة (flimsy)، ومصنوعة من البلاستيك، وخفيفة جدًا في الوزن (very light in weight)، فعليك أن تتعامل معها بحذر شديد» | flimsy, plastic, very light in weight, delicateflimsy، plastic، very light in weight، delicate | negativeسلبية |
Now the word "light" can be explained rather than just noticed. In the second review it sits next to "small" and is set against "heavy, bulky professional cameras", so it means easy to carry. In the third it sits next to "flimsy", "plastic" and "delicate", so it means insubstantial. The physical fact is identical. The polarity is a property of the aspect and the context together, not of the word and not of the document. Liu's own camera example makes the mirror image point: "my wife thinks it is too heavy for her" is a negative opinion about weight, and nothing about the word "heavy" on its own tells you that.
الآن يمكن تفسير كلمة «light» بدلًا من مجرد ملاحظتها. في المراجعة الثانية تقع بجانب «small» وتُقابَل بـ «heavy, bulky professional cameras»، فهي تعني سهلة الحمل. وفي الثالثة تقع بجانب «flimsy» و«plastic» و«delicate»، فهي تعني واهية بلا متانة. الحقيقة الفيزيائية واحدة. القطبية خاصية للجانب والسياق معًا، لا للكلمة ولا للوثيقة. ومثال Liu نفسه عن الكاميرا يقدّم الصورة المعكوسة: «my wife thinks it is too heavy for her» رأي سلبي عن الوزن، ولا شيء في كلمة «heavy» وحدها يخبرك بذلك.
Aspects are not always spelled out either. Hu and Liu give the sentence "While light, it will not easily fit in pockets" and point out that the word size does not appear in it, so the system has to infer the aspect before it can score the opinion. Their illustrative summary for a digital camera counts opinions per feature, which is what the grey bars beside the slide's review list are sketching.
والجوانب لا تُذكر صراحةً دائمًا. يعطي Hu وLiu الجملة «While light, it will not easily fit in pockets» ويشيران إلى أن كلمة size لا تظهر فيها، فعلى النظام أن يستنتج الجانب قبل أن يقيّم الرأي. وملخصهما التوضيحي لكاميرا رقمية يعدّ الآراء لكل خاصية، وهذا ما ترسمه الأشرطة الرمادية بجانب قائمة المراجعات في الشريحة.
| Featureالخاصية | Positiveإيجابي | Negativeسلبي |
|---|---|---|
| picture qualityجودة الصورة (picture quality) | 253253 | 66 |
| sizeالحجم (size) | 134134 | 1010 |
- Find the sentences that express an opinion.اعثر على الجمل التي تعبّر عن رأي.
- Extract the aspect each opinion targets, explicit (flash) or implicit (light, therefore size and weight).استخرج الجانب الذي يستهدفه كل رأي، صريحًا (flash) أو ضمنيًا (light، أي الحجم والوزن).
- Classify the polarity of the opinion about that aspect, using the surrounding words.صنّف قطبية الرأي عن ذلك الجانب، مستعينًا بالكلمات المحيطة.
- Aggregate into per-aspect counts, so a reader sees two positive and one negative on size and weight.اجمعها في أعداد لكل جانب، فيرى القارئ رأيين إيجابيين ورأيًا سلبيًا واحدًا عن الحجم والوزن.
The order matters. A whole-document score would average the third review's complaint about build against whatever it praised elsewhere, perhaps affordability, and report a lukewarm three stars that helps nobody. Liu makes the same point with a restaurant: "although the service is not that great, I still love this restaurant" is positive about the restaurant and negative about the service, and a document-level system does not discover what exactly people liked and did not like.
الترتيب مهم. التقييم على مستوى الوثيقة كاملة سيأخذ متوسط شكوى المراجعة الثالثة من جودة التصنيع مع ما مدحته في مكان آخر، ربما السعر المناسب، ويعطي ثلاث نجوم فاترة لا تفيد أحدًا. ويطرح Liu النقطة نفسها بمثال مطعم: «although the service is not that great, I still love this restaurant» إيجابية تجاه المطعم وسلبية تجاه الخدمة، والنظام الذي يعمل على مستوى الوثيقة لا يكتشف ما الذي أعجب الناس بالضبط وما الذي لم يعجبهم.
Recall
Why is 'light' positive in one camera review and negative in another?لماذا تكون «light» إيجابية في مراجعة كاميرا وسلبية في أخرى؟
Recall
Which systems in this part are pipelines of several NLP components?أي الأنظمة في هذا الجزء سلاسل معالجة من عدة مكوّنات NLP؟
Quick checkاختبار سريع
In the camera reviews, 'light' is positive once and negative once. What does that show?في مراجعات الكاميرا، جاءت «light» إيجابية مرة وسلبية مرة. ماذا يُظهر ذلك؟
Recapالخلاصة
If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا
- Machine translation has two modes: fully automatic for information access, and computer-aided (post-editing or interactive prediction) when a human owns the final text.للترجمة الآلية نمطان: آلي بالكامل للوصول إلى المعلومات، وبمساعدة الحاسوب (التحرير اللاحق post-editing أو التنبؤ التفاعلي) عندما يكون الإنسان هو المسؤول عن النص النهائي.
- Slide 8's categories are still the right ones to learn; the counts are a historical snapshot, not a fact sheet. Learn the modes (typing, offline, camera, conversation, voice calls), not the numbers: Google Translate passed 240 languages in 2024 and Skype was retired on 5 May 2025.فئات الشريحة 8 ما زالت هي الصحيحة للحفظ، أما الأعداد فهي لقطة تاريخية وليست مرجعًا للحقائق. احفظ الأنماط (الكتابة، دون اتصال، الكاميرا، المحادثة، المكالمات الصوتية) لا الأرقام: تجاوز Google Translate حاجز 240 لغة في 2024، وأُوقف Skype في 5 مايو 2025.
- Camera and conversation translation are pipelines: OCR or speech recognition, then MT, then rendering or speech synthesis. Each stage can inject error.ترجمة الكاميرا وترجمة المحادثة سلاسل معالجة (pipelines): التعرف الضوئي على الحروف OCR أو التعرف على الكلام، ثم الترجمة الآلية MT، ثم العرض أو توليد الكلام. وكل مرحلة قد تُدخل خطأً.
- A factual answer box needs word sense disambiguation (heavy means mass), entity linking (our planet means Earth) and a knowledge graph lookup (5.972 × 10^24 kg).صندوق الإجابة الحقائقية يحتاج إلى إزالة غموض معنى الكلمة (heavy تعني الكتلة)، وربط الكيان (our planet تعني الأرض)، والبحث في رسم المعرفة (5.972 × 10^24 kg).
- An AI Overview is retrieval-augmented generation: retrieve pages, prompt an LLM, cite. Its new failure mode is fluent text that is not faithful to the facts or its cited sources.الـ AI Overview هو توليد معزّز بالاسترجاع: استرجع الصفحات، ثم مرّرها في prompt إلى نموذج لغوي كبير LLM، ثم استشهد بالمصادر. ونمط الفشل الجديد فيه نص سلس لكنه غير أمين للحقائق أو للمصادر التي يستشهد بها.
- Non-word errors (ofcourse) fail dictionary lookup. Real-word errors (then for than) pass it and need context. Between 25 and 40 percent of spelling errors are real words.أخطاء الكلمات غير الموجودة (ofcourse) تفشل في البحث في القاموس. أما أخطاء الكلمات الحقيقية (then بدل than) فتنجح فيه وتحتاج إلى السياق. وما بين 25 و40 بالمئة من أخطاء الإملاء كلمات حقيقية.
- Information extraction fills a template: Event, Date, Start, End, Where. 'tomorrow' is normalised as the email date plus one day, Jan-16-2012.استخراج المعلومات يملأ قالبًا: Event وDate وStart وEnd وWhere. وتُحوَّل «tomorrow» إلى تاريخ البريد زائد يوم واحد، أي Jan-16-2012.
- Sentiment is a pair of target and polarity. The same word 'light' is positive next to 'compact' and negative next to 'flimsy', so extract the aspect first, then classify.المشاعر زوج من هدف (target) وقطبية (polarity). الكلمة نفسها «light» إيجابية بجانب «compact» وسلبية بجانب «flimsy»، لذلك استخرج الجانب أولًا ثم صنّف.
Sourcesالمصادر
- Speech and Language Processing, 3rd edition draftBookStanford University (Jurafsky and Martin)Draft of August 2026; the chapters below are its PDF sectionsمسودة أغسطس 2026، والفصول أدناه هي أقسامها بصيغة PDF(opens in a new tab)(يفتح في تبويب جديد)
- Chapter 13: Machine TranslationBookJurafsky and Martin, StanfordInformation access, post-editing and CAT, OCR-then-MT, hundreds of billions of words a dayالوصول إلى المعلومات، والتحرير اللاحق (post-editing) والترجمة بمساعدة الحاسوب CAT، وOCR ثم MT، ومئات المليارات من الكلمات يوميًا(opens in a new tab)(يفتح في تبويب جديد)
- Chapter 11: Information Retrieval and Retrieval-Augmented GenerationBookJurafsky and Martin, StanfordRAG algorithm, knowledge citation, hallucination, 69 to 88 percent in the legal domain, calibrationخوارزمية RAG، والاستشهاد بالمعرفة، والهلوسة (hallucination)، ونسبة 69 إلى 88 بالمئة في المجال القانوني، والمعايرة (calibration)(opens in a new tab)(يفتح في تبويب جديد)
- Chapter 21: Information Extraction: Relations, Events, and TimeBookJurafsky and Martin, StanfordIE definition, template filling, temporal anchor, tomorrow adds a day, exercise on calendar entries from emailتعريف استخراج المعلومات IE، وملء القوالب (template filling)، والمرساة الزمنية (temporal anchor)، و«tomorrow» تضيف يومًا، وتمرين على إنشاء مواعيد تقويم من البريد الإلكتروني(opens in a new tab)(يفتح في تبويب جديد)
- Appendix D: Spelling Correction and the Noisy ChannelBookJurafsky and Martin, StanfordNon-word versus real-word errors, 25 to 40 percent, single-letter changes, noisy channelأخطاء الكلمات غير الموجودة (non-word) مقابل أخطاء الكلمات الحقيقية (real-word)، ونسبة 25 إلى 40 بالمئة، والتغييرات بحرف واحد، والقناة المشوّشة (noisy channel)(opens in a new tab)(يفتح في تبويب جديد)
- Statistical Approaches to Computer-Assisted TranslationPaperComputational Linguistics, 2009 (Barrachina et al.)Prefix validated by the human, system proposes the best or n-best suffix; MT output still needs editingبادئة يعتمدها الإنسان، ويقترح النظام أفضل لاحقة أو أفضل n لواحق (n-best)، ومخرجات الترجمة الآلية MT ما زالت تحتاج إلى تحرير(opens in a new tab)(يفتح في تبويب جديد)
- 110 new languages are coming to Google TranslateArticleGoogle, 27 June 2024PaLM 2, largest expansion ever, 614 million speakersPaLM 2، أكبر توسعة على الإطلاق، 614 مليون متحدث(opens in a new tab)(يفتح في تبويب جديد)
- Google Translate adds support for 110 languagesArticleTechCrunch, 27 June 2024Total of 243 languages after the expansionإجمالي 243 لغة بعد التوسعة(opens in a new tab)(يفتح في تبويب جديد)
- Download and use Google TranslateDocsGoogle Translate HelpOver 200 languages for text, handwriting, photos and speechأكثر من 200 لغة للنص وخط اليد والصور والكلام(opens in a new tab)(يفتح في تبويب جديد)
- The next chapter: Moving from Skype to Microsoft TeamsArticleMicrosoft 365 Blog, 28 February 2025Skype retired in May 2025 in favour of Teamsأُوقف Skype في مايو 2025 لصالح Teams(opens in a new tab)(يفتح في تبويب جديد)
- Skype is retiring in May 2025: what you need to knowDocsMicrosoft SupportAs of 5 May 2025, Skype is retiredاعتبارًا من 5 مايو 2025، أُوقف Skype(opens in a new tab)(يفتح في تبويب جديد)
- Introducing the Knowledge Graph: things, not stringsArticleGoogle, 16 May 2012 (Amit Singhal)Entities and their relationships; Taj Mahal the monument or the musicianالكيانات والعلاقات بينها، و«Taj Mahal» المعلم الأثري أم الموسيقي(opens in a new tab)(يفتح في تبويب جديد)
- Generative AI in Search: Let Google do the searching for youArticleGoogle, 14 May 2024AI Overviews rolling out to everyone in the USإتاحة AI Overviews للجميع في الولايات المتحدة(opens in a new tab)(يفتح في تبويب جديد)
- AI in Search: Going beyond information to intelligenceArticleGoogle, 20 May 2025AI Mode rolling out in the USإتاحة AI Mode في الولايات المتحدة(opens in a new tab)(يفتح في تبويب جديد)
- Planetary Fact SheetDocsNASA NSSDCAMasses in units of 10^24 kg; ratio table gives Venus 0.815, Mars 0.107, Jupiter 317.8الكتل بوحدة 10^24 kg، وجدول النسب يعطي الزهرة 0.815، والمريخ 0.107، والمشتري 317.8(opens in a new tab)(يفتح في تبويب جديد)
- Earth Fact SheetDocsNASA NSSDCAMass 5.9722 × 10^24 kg; Mars, Venus and Jupiter fact sheets on the same siteالكتلة 5.9722 × 10^24 kg، وصحائف بيانات المريخ والزهرة والمشتري على الموقع نفسه(opens in a new tab)(يفتح في تبويب جديد)
- How Much Does Earth Weigh?ArticleAIP Inside Science, 19 August 2021The source cited by the AI Overview on slide 10; 13 thousand, 170 billion trillion poundsالمصدر الذي استشهد به AI Overview في الشريحة 10، و13 ألفًا و170 مليار تريليون رطل(opens in a new tab)(يفتح في تبويب جديد)
- Check spelling and grammar in OfficeDocsMicrosoft SupportRed squiggle for spelling, blue squiggle for grammarخط متعرج أحمر للإملاء، وخط متعرج أزرق للنحو(opens in a new tab)(يفتح في تبويب جديد)
- Sentiment Analysis and Opinion MiningBookMorgan and Claypool, 2012 (Bing Liu, author draft)Aspect level, opinion as a tuple that is basically a database schema, camera weight and restaurant examplesمستوى الجانب (aspect level)، والرأي بوصفه صفًا (tuple) هو في الأساس مخطط قاعدة بيانات، وأمثلة وزن الكاميرا والمطعم(opens in a new tab)(يفتح في تبويب جديد)
- Mining and Summarizing Customer ReviewsPaperKDD 2004 (Hu and Liu)Feature-based summary of digital camera reviews; 'While light, it will not easily fit in pockets'ملخص قائم على الخصائص لمراجعات الكاميرات الرقمية، و«While light, it will not easily fit in pockets»(opens in a new tab)(يفتح في تبويب جديد)
Part 03: How NLP is done: approaches and linguistic knowledgeكيف تُنجز NLP: المناهج والمعرفة اللغوية
The four families of NLP approaches, the pipeline from paragraphs to morphemes, the levels of linguistic knowledge from phonetics to discourse, and the contrast between a machine and a child who is predisposed to acquire language.العائلات الأربع من مناهج NLP، والمسار من الفقرات وصولا إلى المورفيمات، ومستويات المعرفة اللغوية من علم الأصوات (phonetics) إلى الخطاب (discourse)، والمقارنة بين الآلة والطفل المهيأ فطريا لاكتساب اللغة.
4 concepts4 مفاهيم, ، slides 14-19الشرائح 14-19
Why this part mattersلماذا يهمّ هذا الجزء
Everything after this lecture, from regular expressions and n-grams to classifiers, sequence labelling and transformers, is one of four approaches applied at one of a handful of linguistic levels. This part gives you both axes.
The exam questions on this material are definitional and comparative, so precise vocabulary is the whole game: which step turns sentences into words, how stemming differs from lemmatization, which levels exist only for speech. The research project will demand the same vocabulary in a different form, because every task you propose has to say which level it lives at and whether the knowledge at that level is coded by hand or learned from data. We build the four approaches first, run one paragraph through the text pipeline, climb the levels of linguistic knowledge, and finish with the observation that motivates the next part: a machine starts with none of this.
كل ما يأتي بعد هذه المحاضرة، من التعابير النمطية (regular expressions) وn-grams إلى المصنِّفات ووسم التسلسلات (sequence labelling) والمحوّلات (transformers)، هو أحد أربعة مناهج مطبّق عند واحد من عدد قليل من المستويات اللغوية. هذا الجزء يعطيك المحورين معًا.
أسئلة الامتحان في هذه المادة تعريفية ومقارِنة، لذا فالمصطلحات الدقيقة هي كل شيء: أي خطوة تحوّل الجمل إلى كلمات، وكيف يختلف stemming عن lemmatization، وأي المستويات موجودة للكلام المنطوق فقط. والمشروع البحثي سيطلب منك المصطلحات نفسها بصيغة أخرى، لأن كل مهمة تقترحها يجب أن تقول عند أي مستوى تقع، وهل المعرفة عند ذلك المستوى مكتوبة يدويًا أم متعلَّمة من البيانات. سنبني المناهج الأربعة أولًا، ثم نمرّر فقرة واحدة عبر خط معالجة النص، ثم نصعد مستويات المعرفة اللغوية، وننتهي بالملاحظة التي تمهّد للجزء التالي: الآلة تبدأ من دون أي شيء من هذا.
By the end you canفي نهاية هذا الجزء ستستطيع
- Name the four approaches and say for each what a human writes and what the data supplies, with one strength and one weakness.أن تسمّي المناهج الأربعة، وتقول لكل منها ما الذي يكتبه الإنسان وما الذي توفّره البيانات، مع نقطة قوة واحدة ونقطة ضعف واحدة.
- Run a paragraph through sentence boundary disambiguation, tokenization, stemming and lemmatization, and predict where each step can go wrong.أن تمرّر فقرة عبر تحديد حدود الجمل (sentence boundary disambiguation) والتقطيع إلى وحدات (tokenization) والتجذيع (stemming) والتأصيل المعجمي (lemmatization)، وتتوقع أين يمكن أن تخطئ كل خطوة.
- Define stemming versus lemmatization and give an example where they differ.أن تعرّف التجذيع (stemming) مقابل التأصيل المعجمي (lemmatization)، وتعطي مثالًا يختلفان فيه.
- Order the levels of linguistic knowledge from phonetics to discourse, place orthography and the lexical level, and say which levels apply to speech only.أن ترتّب مستويات المعرفة اللغوية من علم الأصوات النطقي (phonetics) إلى الخطاب (discourse)، وتحدد موضع الإملاء (orthography) والمستوى المعجمي (lexical)، وتقول أي المستويات تخص الكلام المنطوق فقط.
- Explain why a machine, unlike a child, must have every level hand-coded or learned, and connect that to why NLP is difficult.أن تشرح لماذا يجب أن يُبرمج كل مستوى يدويًا أو يُتعلّم في حالة الآلة، بخلاف الطفل، وتربط ذلك بسبب صعوبة معالجة اللغات الطبيعية (NLP).
In 1966 Joseph Weizenbaum's ELIZA could take "I need some help" and answer "WHAT WOULD IT MEAN TO YOU IF YOU GOT SOME HELP". Jurafsky and Martin describe it as "a surprisingly simple program that uses pattern matching on words to recognize phrases like 'I need X' and change the words into suitable outputs", working "by having a series or cascade of regex substitutions". Every one of those rules was typed by a person. A modern translation system, by contrast, was shown millions of sentence pairs and nobody wrote a rule for any of them.
في عام 1966 كان برنامج ELIZA الذي كتبه Joseph Weizenbaum يستطيع أن يأخذ عبارة «I need some help» ويجيب «WHAT WOULD IT MEAN TO YOU IF YOU GOT SOME HELP». ويصفه Jurafsky وMartin بأنه «برنامج بسيط على نحو مفاجئ يستخدم مطابقة الأنماط على الكلمات ليتعرّف على عبارات مثل 'I need X' ويحوّل الكلمات إلى مخرجات مناسبة»، ويعمل «عبر سلسلة أو تتابع من عمليات الاستبدال بالتعابير النمطية (regex)». كل واحدة من تلك القواعد كتبها إنسان. أما نظام الترجمة الحديث، في المقابل، فقد عُرضت عليه ملايين أزواج الجمل ولم يكتب أحد قاعدة لأي منها.
Those two systems mark the ends of one axis, and the four approaches on slide 15 are points along it. What separates them is not the task and not the programming language. It is the answer to a single question: what does a human write, and what does the data supply?
هذان النظامان يحددان طرفي محور واحد، والمناهج الأربعة في الشريحة 15 نقاط على امتداده. ما يفرّق بينها ليس المهمة وليس لغة البرمجة، بل الإجابة عن سؤال واحد: ما الذي يكتبه الإنسان، وما الذي توفّره البيانات؟
Rule-based: the human writes everythingالمنهج القائم على القواعد: الإنسان يكتب كل شيء
In rule-based NLP the knowledge of language lives in artefacts a person authored: a grammar, a lexicon, a set of regular expressions, a finite-state machine. The Georgetown-IBM demonstration of 7 January 1954, the first public machine translation, was in Hutchins's account "a small-scale experiment of just 250 words and six 'grammar' rules". ELIZA came twelve years later, and Jurafsky and Martin date the whole symbolic era "roughly from 1965 til the early 1990s".
في rule-based NLP (المعالجة القائمة على القواعد) تعيش المعرفة باللغة في أدوات ألّفها إنسان: قواعد نحوية (grammar)، ومعجم (lexicon)، ومجموعة من التعابير النمطية، وآلة حالات منتهية (finite-state machine). وعرض Georgetown-IBM في 7 January 1954، وهو أول ترجمة آلية علنية، كان بحسب رواية Hutchins «تجربة صغيرة الحجم من 250 كلمة فقط وست قواعد ‹نحوية›». وجاء ELIZA بعده باثنتي عشرة سنة، ويؤرّخ Jurafsky وMartin الحقبة الرمزية كلها بأنها «تقريبًا من 1965 حتى أوائل التسعينيات (1990s)».
The strengths follow from authorship. A rule is precise, you can read it, you can explain any output by pointing at the rule that produced it, and nothing has to be trained. Rule-based tokenizers are, in Jurafsky and Martin's words, "deterministic algorithms based on regular expressions compiled into efficient finite state automata", which is why they are fast. The weakness follows from the same fact: language keeps producing phenomena nobody wrote a rule for, and every one of them costs another rule, which may conflict with the rules already there.
نقاط القوة نابعة من كون الإنسان هو المؤلف. القاعدة دقيقة، ويمكنك قراءتها، ويمكنك تفسير أي مخرج بالإشارة إلى القاعدة التي أنتجته، ولا شيء يحتاج إلى تدريب. والمقطِّعات (tokenizers) القائمة على القواعد هي، بتعبير Jurafsky وMartin، «خوارزميات حتمية مبنية على تعابير نمطية مترجمة إلى آلات حالات منتهية فعّالة»، ولهذا هي سريعة. ونقطة الضعف نابعة من الحقيقة نفسها: اللغة لا تتوقف عن إنتاج ظواهر لم يكتب لها أحد قاعدة، وكل ظاهرة منها تكلّف قاعدة جديدة، قد تتعارض مع القواعد الموجودة أصلًا.
Classical machine learning: the human writes the features, the data sets the weightsتعلم الآلة الكلاسيكي: الإنسان يكتب السمات، والبيانات تحدد الأوزان
Machine learning based NLP moves the boundary. A person still decides what the model looks at, but the data decides how much each observation matters. For a part-of-speech tagger the designer might say "look at the word, its suffix, its capitalisation, and the previous tag". Jurafsky and Martin describe the arrangement exactly: "Although the idea of what features to use is done by the system designer by hand, the specific features are automatically populated by using feature templates", so a word-shape feature maps DC10-30 to XXdd-dd without anyone listing every flight number. A Classifier such as naive Bayes or logistic regression, or a sequence model such as a hidden Markov model or a conditional random field (Lafferty, McCallum and Pereira, 2001), then learns the weights from labelled examples.
Machine learning based NLP (المعالجة القائمة على تعلم الآلة) تحرّك الحد الفاصل. لا يزال الإنسان يقرر ما الذي ينظر إليه النموذج، لكن البيانات تقرر مدى أهمية كل ملاحظة. ففي واسم أقسام الكلام (part-of-speech tagger) قد يقول المصمم «انظر إلى الكلمة، ولاحقتها، وحالة أحرفها الكبيرة، والوسم السابق». ويصف Jurafsky وMartin هذا الترتيب بدقة: «رغم أن فكرة السمات التي تُستخدم يضعها مصمم النظام يدويًا، فإن السمات المحددة تُملأ تلقائيًا باستخدام قوالب السمات (feature templates)»، فسمة شكل الكلمة (word-shape) تحوّل DC10-30 إلى XXdd-dd دون أن يسرد أحد كل أرقام الرحلات. ثم يتعلم classifier (مصنِّف) مثل naive Bayes أو logistic regression، أو نموذج تسلسلي مثل hidden Markov model أو conditional random field (Lafferty وMcCallum وPereira، 2001)، الأوزانَ من أمثلة موسومة.
The era began, by Jurafsky and Martin's account, with Jelinek's IBM speech group between 1975 and 1985, and "by the late 1980s statistical methods had begun to spread from speech researchers to NLP researchers working on text"; they date this "long revival of empiricism" as lasting until 2017. The strength is robustness: a probabilistic model degrades gracefully on input no rule anticipated. The price is twofold. Someone must label the training data, and someone must engineer the features, which is where the linguistic knowledge of the designer now goes.
بدأت هذه الحقبة، بحسب رواية Jurafsky وMartin، مع مجموعة الكلام في IBM بقيادة Jelinek بين 1975 و1985، و«بحلول أواخر الثمانينيات (1980s) بدأت الطرق الإحصائية تنتشر من باحثي الكلام إلى باحثي NLP العاملين على النص»؛ ويؤرّخان هذا «الإحياء الطويل للتجريبية» بأنه استمر حتى 2017. نقطة القوة هي المتانة: النموذج الاحتمالي يتراجع أداؤه بلطف على مدخلات لم تتوقعها أي قاعدة. والثمن مزدوج: يجب أن يَسِم أحدٌ بيانات التدريب، ويجب أن يهندس أحدٌ السمات، وهناك تذهب الآن المعرفة اللغوية لدى المصمم.
End-to-end deep learning: the data supplies the representations tooالتعلم العميق من الطرف إلى الطرف: البيانات توفّر التمثيلات أيضًا
End-to-end NLP using deep learning removes feature engineering. The model reads raw text (or audio) and learns its own intermediate representations on the way to the output. Sutskever, Vinyals and Le (2014) translated by using "a multilayered Long Short-Term Memory (LSTM) to map the input sequence to a vector of a fixed dimensionality, and then another deep LSTM to decode the target sequence". Vaswani and colleagues (2017) then proposed "a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely". Jurafsky and Martin note that the transformer, "invented for machine translation, quickly became a general-purpose neural architecture", and mark prompting in 2019 as the next inflection point. Speech went the same way: modern recognisers are encoder-decoder models with no hand-built pronunciation pipeline in front.
End-to-end NLP using deep learning (المعالجة من الطرف إلى الطرف بالتعلم العميق) تلغي هندسة السمات. يقرأ النموذج النص الخام (أو الصوت) ويتعلم تمثيلاته الوسيطة بنفسه في طريقه إلى المخرج. ترجم Sutskever وVinyals وLe (2014) باستخدام «شبكة Long Short-Term Memory (LSTM) متعددة الطبقات لتحويل تسلسل المدخل إلى متجه ذي أبعاد ثابتة، ثم شبكة LSTM عميقة أخرى لفك ترميز التسلسل الهدف». ثم اقترح Vaswani وزملاؤه (2017) «معمارية شبكة بسيطة جديدة، هي Transformer، تقوم على آليات الانتباه (attention) وحدها، وتستغني عن التكرار (recurrence) والالتفاف (convolutions) تمامًا». ويلاحظ Jurafsky وMartin أن المحوّل «الذي اختُرع للترجمة الآلية سرعان ما صار معمارية عصبية للأغراض العامة»، ويعدّان التلقين (prompting) عام 2019 نقطة التحوّل التالية. وسار الكلام في الطريق نفسه: أنظمة التعرف على الكلام الحديثة نماذج encoder-decoder لا يسبقها خط معالجة للنطق مبني يدويًا.
What the designer still writes is the architecture and the training objective. Everything else, including whatever the model knows about morphology or syntax, arrives from data. That gives the best accuracy and one model for many tasks, at the cost of very large data sets and compute, and of a system nobody can read. Jurafsky and Martin treat interpretability as an open research field for exactly this reason.
ما يكتبه المصمم الآن هو المعمارية وهدف التدريب فقط. كل ما عدا ذلك، بما فيه أي شيء يعرفه النموذج عن الصرف (morphology) أو النحو (syntax)، يأتي من البيانات. وهذا يعطي أعلى دقة ونموذجًا واحدًا لمهام كثيرة، على حساب مجموعات بيانات وقدرة حوسبة ضخمة جدًا، وعلى حساب نظام لا يستطيع أحد قراءته. ولهذا السبب تحديدًا يعامل Jurafsky وMartin قابلية التفسير (interpretability) بوصفها مجالًا بحثيًا مفتوحًا.
Hybrid: rules around a learned coreالمنهج الهجين: قواعد حول نواة متعلَّمة
The Hybrid approach is what most production systems actually are. The pattern is a learned model in the middle with rules on either side: rules for normalisation before the model, and rules for constraints, safety checks or formatting after it. The clearest example is hiding inside the largest models. The GPT-2 tokenizer first runs a hand-written regular expression, which Jurafsky and Martin show as "the GPT-2 pre-tokenizer regular expression, used to split (roughly) on whitespace before running the BPE algorithm", and only then applies byte-pair encoding merges learned from data (Sennrich, Haddow and Birch, 2016). Rule first, learning second, in the front door of a language model.
hybrid approach (المنهج الهجين) هو ما تكونه معظم أنظمة الإنتاج فعليًا. النمط هو نموذج متعلَّم في الوسط وقواعد على جانبيه: قواعد للتطبيع (normalisation) قبل النموذج، وقواعد للقيود أو فحوص الأمان أو التنسيق بعده. وأوضح مثال مختبئ داخل أكبر النماذج نفسها: مقطِّع GPT-2 يشغّل أولًا تعبيرًا نمطيًا مكتوبًا يدويًا، يعرضه Jurafsky وMartin بوصفه «التعبير النمطي للتقطيع المسبق في GPT-2، المستخدم للتقسيم (تقريبًا) عند المسافات قبل تشغيل خوارزمية BPE»، وبعد ذلك فقط يطبّق عمليات دمج byte-pair encoding المتعلَّمة من البيانات (Sennrich وHaddow وBirch، 2016). القاعدة أولًا، والتعلم ثانيًا، عند الباب الأمامي لنموذج لغوي.
| Approachالمنهج | What a human writesما يكتبه الإنسان | What the data suppliesما توفّره البيانات | Strengthsنقاط القوة | Weaknessesنقاط الضعف | Era and exampleالحقبة والمثال |
|---|---|---|---|---|---|
| Rule-basedالقائم على القواعد (Rule-based) | Grammars, lexicons, regular expressions, finite-state machinesقواعد نحوية (grammars)، ومعاجم (lexicons)، وتعابير نمطية (regular expressions)، وآلات حالات منتهية (finite-state machines) | Nothingلا شيء | Precise, inspectable, needs no training data, fastدقيق، وقابل للفحص، ولا يحتاج إلى بيانات تدريب، وسريع | Brittle; every new phenomenon is another rule to writeهشّ؛ كل ظاهرة جديدة تعني قاعدة أخرى يجب كتابتها | Georgetown-IBM 1954, ELIZA 1966; symbolic era to the early 1990sGeorgetown-IBM 1954، وELIZA 1966؛ الحقبة الرمزية حتى أوائل التسعينيات (1990s) |
| Classical machine learningتعلم الآلة الكلاسيكي (Classical machine learning) | Feature templates, the choice of modelقوالب السمات (feature templates)، واختيار النموذج | The weights, from labelled examplesالأوزان، من أمثلة موسومة | Robust to noise, gives probabilities, learns from dataمتين أمام الضوضاء، ويعطي احتمالات، ويتعلم من البيانات | Needs labelled data and hand-designed featuresيحتاج إلى بيانات موسومة وسمات مصممة يدويًا | Naive Bayes, HMM, CRF (2001); empiricist era starting between 1975 and 1988, lasting to 2017Naive Bayes وHMM وCRF (2001)؛ حقبة تجريبية بدأت بين 1975 و1988 واستمرت حتى 2017 |
| End-to-end deep learningالتعلم العميق من الطرف إلى الطرف (End-to-end deep learning) | The architecture and the lossالمعمارية ودالة الخسارة (loss) | Representations and weightsالتمثيلات والأوزان | Highest accuracy, no feature engineering, one model for many tasksأعلى دقة، ولا هندسة سمات، ونموذج واحد لمهام كثيرة | Needs large data and compute; hard to inspectيحتاج إلى بيانات وحوسبة ضخمة؛ ويصعب فحصه | seq2seq 2014, Transformer 2017, prompting 2019seq2seq 2014، وTransformer 2017، والتلقين (prompting) 2019 |
| Hybridالهجين (Hybrid) | Normalisation rules, constraints and checksقواعد التطبيع (normalisation)، والقيود، والفحوص | The learned coreالنواة المتعلَّمة | Practical, safe, works for low-resource languagesعملي، وآمن، ويصلح للغات قليلة الموارد | Two systems to maintainنظامان يجب صيانتهما | GPT-2 regex pre-tokenizer plus learned BPE merges (2019)التعبير النمطي للتقطيع المسبق في GPT-2 مع عمليات دمج BPE متعلَّمة (2019) |
Quick checkاختبار سريع
Which approach typically needs the most training data and compute to reach its accuracy?أي منهج يحتاج عادةً إلى أكبر قدر من بيانات التدريب والحوسبة ليبلغ دقته؟
Recall
Name the four approaches on slide 15 and give one strength and one weakness of each.سمِّ المناهج الأربعة في الشريحة 15 وأعطِ نقطة قوة واحدة ونقطة ضعف واحدة لكل منها.
Take one paragraph: "Dr. Ahmad's students are running experiments. The pipeline costs 3.14 dollars per run. It works!" To a machine this is a string of characters. Before any approach from the last concept can be applied, that string has to be cut into units the approach can work on, and slide 16 names the cuts: paragraphs to sentences, sentences to words, words to their morphology.
خذ فقرة واحدة: «Dr. Ahmad's students are running experiments. The pipeline costs 3.14 dollars per run. It works!». بالنسبة للآلة هذه مجرد سلسلة من الحروف. وقبل أن يُطبَّق عليها أي منهج من المفهوم السابق، يجب أن تُقطَّع هذه السلسلة إلى وحدات يستطيع المنهج العمل عليها، والشريحة 16 تسمّي هذه القطوع: من الفقرات إلى الجمل، ومن الجمل إلى الكلمات، ومن الكلمات إلى بنيتها الصرفية.
Step through the paragraph below before reading on. Watch which periods survive as sentence boundaries, where the apostrophe goes, and what happens to are under each normaliser.
تنقّل خطوة بخطوة عبر الفقرة أدناه قبل أن تكمل القراءة. راقب أي النقاط تبقى حدودًا للجمل، وأين تذهب الفاصلة العليا (apostrophe)، وماذا يحدث لكلمة are مع كل أداة تطبيع.
Dr. Ahmad's students are running experiments. The pipeline costs 3.14 dollars per run. It works!
- Stepالخطوة
- Raw inputالمدخل الخام
- Changedما تغيّر
- Nothing yet. The text is one string of characters with no structure the machine can use.لا شيء بعد. النص سلسلة واحدة من الحروف بلا أي بنية يستطيع الحاسوب استخدامها.
- Watchلاحظ
- Two periods are not boundaries: the abbreviation in Dr. and the decimal point in 3.14.نقطتان ليستا حدَّي جملة: النقطة في الاختصار Dr. والفاصلة العشرية في 3.14.
- Paragraphsالفقرات
- 1
- Sentencesالجمل
- 3
- Periods kept inside tokensنقاط باقية داخل الوحدات اللفظية
- 2
- Tokensالوحدات اللفظية
- 19
- Clitics split offلواحق متصلة مفصولة
- 1
- Non-word stemsجذوع ليست كلمات
- 3
Outputs precomputed with NLTK: the Punkt sentence tokenizer, the Treebank word tokenizer, the Porter stemmer in ORIGINAL_ALGORITHM mode, and the WordNet lemmatizer given each token's part of speech. Porter's own reference implementation leaves one- and two-letter words untouched, so it returns is unchanged where NLTK's original mode gives i.المخرجات محسوبة مسبقًا بمكتبة NLTK: مُقطِّع الجمل Punkt، ومُقطِّع الكلمات Treebank، وأداة التجذيع Porter في نمط ORIGINAL_ALGORITHM، وأداة الإرجاع إلى الأصل WordNet مع تمرير قسم الكلام لكل وحدة لفظية. التنفيذ المرجعي الأصلي لخوارزمية Porter يترك الكلمات ذات الحرف الواحد والحرفين دون تغيير، فيُعيد is كما هي، بينما يُعطي النمط الأصلي في NLTK الناتج i.
Paragraphs to sentences: the period is ambiguousمن الفقرات إلى الجمل: النقطة ملتبسة
Sentence boundary disambiguation looks easy because sentences end in punctuation. Jurafsky and Martin explain why it is not: "Question marks and exclamation points are relatively unambiguous markers", but "the period character '.', on the other hand, is ambiguous between a sentence boundary marker and a marker of abbreviations like Dr. or Inc.". Our paragraph has two periods that are not boundaries: the one in Dr. and the decimal point in 3.14. The stepper's second example adds the harder case, Inc., where one period closes the abbreviation and ends the sentence at the same time. Jurafsky and Martin use that case to argue that "sentence tokenization and word tokenization can be addressed jointly": the decision about the period is one decision, not two.
يبدو sentence boundary disambiguation (تحديد حدود الجمل) سهلًا لأن الجمل تنتهي بعلامات ترقيم. ويشرح Jurafsky وMartin لماذا ليس كذلك: «علامات الاستفهام والتعجب مؤشرات غير ملتبسة نسبيًا»، لكن «حرف النقطة '.'، في المقابل، ملتبس بين كونه علامة على حد الجملة وكونه علامة على اختصارات مثل Dr. أو Inc.». في فقرتنا نقطتان ليستا حدّين: التي في Dr.، والفاصلة العشرية في 3.14. والمثال الثاني في الأداة التفاعلية يضيف الحالة الأصعب، Inc.، حيث تُغلق نقطة واحدة الاختصار وتُنهي الجملة في الوقت نفسه. ويستخدم Jurafsky وMartin هذه الحالة ليحتجّا بأن «تقطيع الجمل وتقطيع الكلمات يمكن معالجتهما معًا»: القرار بشأن النقطة قرار واحد، لا قراران.
Practical splitters decide with an abbreviation dictionary, which "can be hand-built or machine-learned" (Kiss and Strunk, 2006, is the standard unsupervised method, and the NLTK Punkt tokenizer in the stepper implements it). Notice which approach that is: a rule, backed by a list that a person or a corpus supplies. The last concept's axis is already in play at the first step.
المقسِّمات العملية تقرر باستخدام معجم اختصارات، «يمكن أن يُبنى يدويًا أو يُتعلَّم آليًا» (وKiss وStrunk، 2006، هي الطريقة غير الموجَّهة (unsupervised) المعيارية، ومقطِّع NLTK Punkt في الأداة التفاعلية يطبّقها). لاحظ أي منهج هذا: قاعدة، مدعومة بقائمة يوفّرها إنسان أو مدوّنة نصية. فمحور المفهوم السابق حاضر منذ الخطوة الأولى.
Sentences to words: tokenization is not splitting on spacesمن الجمل إلى الكلمات: التقطيع ليس تقسيمًا عند المسافات
Tokenization turns a sentence into tokens, and the trouble starts with the apostrophe. Jurafsky and Martin point out that "I'm is one word, grammatically it functions as two words". The 's in Ahmad's is a clitic, in their definition "a morpheme that acts syntactically like a word but is reduced in form and attached ... to another word" (a morpheme being the smallest meaningful piece of a word, defined properly below), and the Penn Treebank convention therefore splits it off, giving Ahmad and 's as two tokens. The same convention separates doesn't into does and n't, keeps hyphenated words such as San Francisco-based together, and makes every punctuation mark its own token, which is why the first sentence yields eight tokens, not six words.
Tokenization (التقطيع إلى وحدات) يحوّل الجملة إلى وحدات (tokens)، والمشكلة تبدأ مع الفاصلة العليا. يشير Jurafsky وMartin إلى أن «I'm كلمة واحدة، لكنها نحويًا تعمل ككلمتين». و's في Ahmad's هي clitic (لاحقة متصلة)، وهي في تعريفهما «مورفيم يتصرف نحويًا مثل كلمة لكنه مختزل الشكل وملتصق ... بكلمة أخرى» (والمورفيم هو أصغر جزء ذي معنى في الكلمة، وسنعرّفه تعريفًا دقيقًا أدناه)، ولذلك يفصلها عرف Penn Treebank، فيعطي Ahmad و's بوصفهما وحدتين. والعرف نفسه يفصل doesn't إلى does وn't، ويُبقي الكلمات الموصولة بشرطة مثل San Francisco-based معًا، ويجعل كل علامة ترقيم وحدة مستقلة، ولهذا تعطي الجملة الأولى ثماني وحدات، لا ست كلمات.
The choices are language-specific. Arabic attaches the preposition b (by, with) and the conjunction w (and) to the following word, so a tokenizer for Arabic must decide whether to detach them. Chinese, Japanese and Thai, in Jurafsky and Martin's words, "simply don't have orthographic words at all": Chinese words average "roughly between 1.5 and 1.9 characters long" and a sentence such as 姚明进入总决赛 can be segmented as three words, five words or seven characters. Numbers differ too, 555,500.50 in one convention and 555 500,50 in another. This is Segmentation in its most basic form, and part 4 returns to it as a source of difficulty.
هذه الخيارات خاصة بكل لغة. فالعربية تُلصق حرف الجر الباء (b، بمعنى «بـ» أو «مع») وحرف العطف الواو (w، بمعنى «و») بالكلمة التالية، فيجب على مقطِّع العربية أن يقرر هل يفصلهما أم لا. أما الصينية واليابانية والتايلاندية فهي، بتعبير Jurafsky وMartin، «ببساطة لا تملك كلمات إملائية على الإطلاق»: متوسط طول الكلمة الصينية «تقريبًا بين 1.5 و1.9 حرف»، وجملة مثل 姚明进入总决赛 يمكن تقسيمها إلى ثلاث كلمات أو خمس كلمات أو سبعة حروف. والأرقام تختلف أيضًا: 555,500.50 في عرف و555 500,50 في عرف آخر. هذا هو segmentation (التجزئة) في أبسط صوره، والجزء 4 يعود إليه بوصفه مصدرًا للصعوبة.
Words to morphology: chop, or look upمن الكلمات إلى الصرف: اقطع، أو ابحث في المعجم
A word is built from morphemes, which Jurafsky and Martin define as minimal meaning-bearing units: cats is the morpheme cat plus the morpheme -s. Morphology is the level that knows this, and slide 16 lists two ways to use it. Stemming, in Manning, Raghavan and Schütze's definition, is "a crude heuristic process that chops off the ends of words in the hope of achieving this goal correctly most of the time". Lemmatization means "doing things properly with the use of a vocabulary and morphological analysis of words, normally aiming to remove inflectional endings only" and returning the lemma, the dictionary form.
الكلمة مبنية من مورفيمات (morphemes)، يعرّفها Jurafsky وMartin بأنها أصغر الوحدات الحاملة للمعنى: cats هي المورفيم cat زائد المورفيم -s. وmorphology (الصرف) هو المستوى الذي يعرف هذا، والشريحة 16 تذكر طريقتين لاستخدامه. Stemming (التجذيع)، في تعريف Manning وRaghavan وSchütze، هو «عملية استدلالية خشنة تقطع أواخر الكلمات على أمل تحقيق هذا الهدف بشكل صحيح في أغلب الأحيان». أما lemmatization (التأصيل المعجمي) فيعني «فعل الأمور كما ينبغي باستخدام مفردات (vocabulary) وتحليل صرفي للكلمات، بهدف إزالة اللواحق التصريفية فقط في العادة» وإرجاع الـ lemma، أي الصيغة المعجمية للكلمة.
The difference is visible in the stepper. Porter's 1980 algorithm, "the most common algorithm for stemming English", turns experiments into experi and are into ar: neither is a word, and the stemmer does not care, because it never consults a dictionary. The WordNet lemmatizer turns are into be. No suffix rule can do that; Manning and colleagues give exactly this case, "am, are, is" to be, as the reason lemmatization needs a vocabulary. It also needs the part of speech: running as a verb lemmatizes to run, but as a noun ("the running of the race") it stays running. The Porter stemmer gives run either way, and on that verb the two methods happen to agree.
الفرق ظاهر في الأداة التفاعلية. خوارزمية Porter لعام 1980، وهي «أشهر خوارزمية لتجذيع الإنجليزية»، تحوّل experiments إلى experi وare إلى ar: ولا واحدة منهما كلمة، والمجذِّع لا يبالي، لأنه لا يرجع إلى أي معجم أبدًا. أما مؤصِّل WordNet فيحوّل are إلى be. لا توجد قاعدة لواحق تستطيع ذلك؛ ويعطي Manning وزملاؤه هذه الحالة بعينها، «am, are, is» إلى be، بوصفها سبب احتياج التأصيل المعجمي إلى مفردات. ويحتاج أيضًا إلى part of speech (نوع الكلمة): فـ running بوصفها فعلًا تؤصَّل إلى run، أما بوصفها اسمًا («the running of the race») فتبقى running. ومجذِّع Porter يعطي run في الحالتين، وفي حالة الفعل هذه يتفق الأسلوبان مصادفةً.
Worked exampleمثال محلول
The first sentence through all four stagesالجملة الأولى عبر المراحل الأربع كلها
Sentence boundary disambiguationتحديد حدود الجمل
"Dr. Ahmad's students are running experiments." is kept as one sentence. The period in Dr. is judged an abbreviation marker, the final period a boundary.تُبقى «Dr. Ahmad's students are running experiments.» جملة واحدة. يُحكم على النقطة في Dr. بأنها علامة اختصار، وعلى النقطة الأخيرة بأنها حد الجملة.Tokenization (Penn Treebank convention)التقطيع إلى وحدات (عرف Penn Treebank)
Dr. / Ahmad / 's / students / are / running / experiments / . The clitic is split off; the abbreviation keeps its period.Dr. / Ahmad / 's / students / are / running / experiments / . تُفصل اللاحقة المتصلة (clitic)؛ ويحتفظ الاختصار بنقطته.Porter stemsجذوع Porter
dr. / ahmad / ' / student / ar / run / experi / .dr. / ahmad / ' / student / ar / run / experi / .WordNet lemmas, given the part of speechالصيغ المعجمية من WordNet، مع معرفة نوع الكلمة
students to student; are to be; running (verb) to run; experiments to experiment.students إلى student؛ are إلى be؛ running (فعل) إلى run؛ experiments إلى experiment.Resultالنتيجة
8 tokens, 2 stems that are not words (ar, experi), and 1 lemma that no suffix rule could reach (be).8 وحدات، وجذعان اثنان (2) ليسا كلمتين (ar، experi)، وصيغة معجمية واحدة (1) لا تستطيع أي قاعدة لواحق الوصول إليها (be).
| Stemmingالتجذيع (Stemming) | Lemmatizationالتأصيل المعجمي (Lemmatization) | |
|---|---|---|
| Methodالطريقة | Chops suffixes by ruleيقطع اللواحق بالقاعدة | Looks up the dictionary form using a vocabulary and morphological analysisيبحث عن الصيغة المعجمية باستخدام مفردات (vocabulary) وتحليل صرفي |
| Outputالمخرج | May be a non-wordقد لا يكون كلمة | Always a real word (the lemma)دائمًا كلمة حقيقية (الـ lemma) |
| Speedالسرعة | Fastسريع | Slowerأبطأ |
| Needsما يحتاجه | Nothing beyond the rulesلا شيء غير القواعد | A lexicon, and often the part of speechمعجم (lexicon)، وغالبًا نوع الكلمة (part of speech) |
| Exampleمثال | experiments to experi, are to arexperiments إلى experi، وare إلى ar | experiments to experiment, are to beexperiments إلى experiment، وare إلى be |
| Typical useالاستخدام المعتاد | Search indexing, where recall matters more than readable outputفهرسة البحث، حيث يهم الاستدعاء (recall) أكثر من قابلية قراءة المخرج | Anything that shows text to people or feeds a parserأي شيء يعرض نصًا على الناس أو يغذّي محللًا نحويًا (parser) |
Quick checkاختبار سريع
In the pipeline of slide 16, which step turns sentences into words?في خط المعالجة في الشريحة 16، أي خطوة تحوّل الجمل إلى كلمات؟
Recall
Define stemming and lemmatization with one example each, and name what lemmatization needs that stemming does not.عرّف التجذيع (stemming) والتأصيل المعجمي (lemmatization) مع مثال لكل منهما، واذكر ما يحتاجه التأصيل المعجمي ولا يحتاجه التجذيع.
Recall
Why is the period a problem for sentence boundary disambiguation? Give a counterexample.لماذا تمثّل النقطة مشكلة في تحديد حدود الجمل؟ أعطِ مثالًا مضادًا.
Extend the running example by one sentence: "Dr. Ahmad's students are running experiments. They will publish them tomorrow." Say it aloud, and something has to know that the sound wave you produced for running counts as that word and not runny. Write it down, and something has to know that they means the students and them means the experiments. Between those two ends lie the levels of linguistic knowledge, and slide 17 draws them twice: as concentric rings and as a stack with two roots.
وسّع المثال الجاري بجملة واحدة: «Dr. Ahmad's students are running experiments. They will publish them tomorrow.». قلها بصوت عالٍ، وعندها يجب أن يعرف شيءٌ ما أن الموجة الصوتية التي أصدرتها لـ running تُحسب تلك الكلمة لا runny. واكتبها، وعندها يجب أن يعرف شيءٌ ما أن they تعني الطلاب وthem تعني التجارب. وبين هذين الطرفين تقع مستويات المعرفة اللغوية، والشريحة 17 ترسمها مرتين: حلقاتٍ متحدة المركز، ومكدّسًا (stack) له جذران.
Walking one sentence up the ringsصعود جملة واحدة عبر الحلقات
Phonetics is, in Jurafsky and Martin's definition, "the study of the speech sounds used in the languages of the world, how they are produced in the human vocal tract, how they are realized acoustically, and how they can be digitized and processed". Its unit is the phone, the actual speech sound; the rings figure labels it "speech sounds", which is correct. A casual runnin' ends in a different phone from a careful running, and a recogniser must still hear one word: that variation is phonetics. Phonology abstracts over that variation to phonemes, the sound units that make one word different from another: running and runny differ by phonemes, however each is pronounced. Jurafsky and Martin put both under one heading in their list, "Phonetics and Phonology: knowledge about linguistic sounds", and note that speech recognition and synthesis need them to know "how words are pronounced in terms of sequences of sounds and how each of these sounds is realized acoustically".
Phonetics (علم الأصوات النطقي) هو، في تعريف Jurafsky وMartin، «دراسة أصوات الكلام المستخدمة في لغات العالم، وكيف تُنتج في المجرى الصوتي للإنسان، وكيف تتحقق صوتيًا (acoustically)، وكيف يمكن رقمنتها ومعالجتها». ووحدته الـ phone، أي الصوت الكلامي الفعلي؛ والشكل الحلقي يسمّيه «أصوات الكلام» (speech sounds)، وهذا صحيح. فكلمة runnin' المنطوقة بعفوية تنتهي بـ phone مختلف عن running المنطوقة بعناية، ومع ذلك يجب أن يسمع نظام التعرف على الكلام كلمة واحدة: هذا التنوع هو مجال phonetics. أما Phonology (علم الأصوات الوظيفي) فيجرّد هذا التنوع إلى فونيمات (phonemes)، وهي الوحدات الصوتية التي تجعل كلمة تختلف عن أخرى: running وrunny تختلفان بفونيمات، مهما كان نطق كل منهما. ويضع Jurafsky وMartin الاثنين تحت عنوان واحد في قائمتهما، «Phonetics and Phonology: المعرفة بالأصوات اللغوية»، ويلاحظان أن التعرف على الكلام وتوليده يحتاجان إليهما لمعرفة «كيف تُنطق الكلمات بوصفها تسلسلات من الأصوات وكيف يتحقق كل صوت منها صوتيًا».
On the text side the same role is played by Orthography, the writing system: the letters r-u-n-n-i-n-g, the fact that Arabic is written right to left with letters that change shape by position, the choice of Unicode code points. Both branches feed Morphology, which was the last concept: run plus -ing, student plus -s, Ahmad plus 's. Jurafsky and Martin's example is that "recognizing that doors is plural" requires morphology.
وعلى جانب النص يؤدي الدور نفسه orthography (الإملاء)، أي نظام الكتابة: الحروف r-u-n-n-i-n-g، وحقيقة أن العربية تُكتب من اليمين إلى اليسار بحروف يتغير شكلها بحسب موضعها، واختيار نقاط الترميز في Unicode. وكلا الفرعين يغذّي morphology (الصرف)، وهو موضوع المفهوم السابق: run زائد -ing، وstudent زائد -s، وAhmad زائد 's. ومثال Jurafsky وMartin هو أن «التعرف على أن doors جمع» يتطلب الصرف.
Above morphology sits the lexical level, which slide 16 calls "lexemes". A Lexeme is a vocabulary item with its senses: run as move fast, as operate, as manage. This is the level where Word sense disambiguation lives, the same task that slide 9 needed to read "heavy" as mass. Syntax is "knowledge of the structural relationships between words": the noun phrase "Dr. Ahmad's students" is the subject of "are running", and Parsing is the task that recovers such structure. Semantics is "knowledge of meaning", here the literal proposition that some students conduct experiments.
فوق الصرف يقع المستوى المعجمي (lexical)، الذي تسمّيه الشريحة 16 «lexemes». والـ lexeme (الوحدة المعجمية) مفردة من المفردات مع معانيها: run بمعنى يركض، وبمعنى يشغّل، وبمعنى يدير. وهذا هو المستوى الذي تعيش فيه word sense disambiguation (تحديد معنى الكلمة)، وهي المهمة نفسها التي احتاجتها الشريحة 9 لقراءة «heavy» بمعنى الكتلة. وsyntax (النحو) هو «المعرفة بالعلاقات البنيوية بين الكلمات»: العبارة الاسمية «Dr. Ahmad's students» هي فاعل «are running»، وparsing (التحليل النحوي) هو المهمة التي تستعيد هذه البنية. وsemantics (علم الدلالة) هو «المعرفة بالمعنى»، وهو هنا القضية الحرفية بأن بعض الطلاب يُجرون تجارب.
The last two levels leave the sentence (the rings stop at pragmatics; only the stack adds discourse above it). Pragmatics is "knowledge of the relationship of meaning to the goals and intentions of the speaker": "tomorrow" names a different day depending on when the sentence was written, which is exactly what the calendar extraction of slide 12 had to resolve. Discourse is "knowledge about linguistic units larger than a single utterance": deciding that they and them refer back to the students and the experiments is coreference resolution, the standard discourse task. Jurafsky and Martin close the list with the sentence that opens the next part: "most tasks in speech and language processing can be viewed as resolving ambiguity at one of these levels".
المستويان الأخيران يتجاوزان الجملة (الحلقات تتوقف عند pragmatics؛ والمكدّس وحده يضيف discourse فوقه). pragmatics (التداولية) هي «المعرفة بعلاقة المعنى بأهداف المتكلم ومقاصده»: «tomorrow» (غدًا) تشير إلى يوم مختلف بحسب وقت كتابة الجملة، وهذا بالضبط ما كان على استخراج التقويم في الشريحة 12 أن يحلّه. وdiscourse (الخطاب) هو «المعرفة بالوحدات اللغوية الأكبر من قول واحد»: تقرير أن they وthem تعودان على الطلاب والتجارب هو coreference resolution (حل الإحالة المشتركة)، وهي المهمة المعيارية على مستوى الخطاب. ويختم Jurafsky وMartin القائمة بالجملة التي تفتتح الجزء التالي: «معظم المهام في معالجة الكلام واللغة يمكن النظر إليها على أنها حل لالتباس عند أحد هذه المستويات».
| Levelالمستوى | Unitالوحدة | Question it answersالسؤال الذي يجيب عنه | Example taskمهمة مثالية |
|---|---|---|---|
| Phoneticsعلم الأصوات النطقي (Phonetics) | Phones (speech sounds)الأصوات الكلامية (phones) | How is it pronounced, and what does the waveform look like?كيف يُنطق، وكيف يبدو شكل الموجة الصوتية؟ | Speech recognition front end, feature extractionالواجهة الأمامية للتعرف على الكلام، واستخراج السمات |
| Phonologyعلم الأصوات الوظيفي (Phonology) | Phonemesالفونيمات (phonemes) | Which sound differences change the word?أي فروق صوتية تغيّر الكلمة؟ | Pronunciation modelling in speech recognition and synthesisنمذجة النطق في التعرف على الكلام وتوليده |
| Orthographyالإملاء (Orthography) | Characters, Unicode code pointsالحروف، ونقاط الترميز في Unicode | How is the language written?كيف تُكتب اللغة؟ | Unicode and UTF-8 handling, script-specific normalisationالتعامل مع Unicode و UTF-8، والتطبيع الخاص بكل نظام كتابة |
| Morphologyالصرف (Morphology) | Morphemesالمورفيمات (morphemes) | What parts is the word built from?من أي أجزاء بُنيت الكلمة؟ | Stemming, lemmatization, subword tokenizationالتجذيع (stemming)، والتأصيل المعجمي (lemmatization)، والتقطيع إلى وحدات جزئية (subword tokenization) |
| Lexicalالمعجمي (Lexical) | Lexemes and sensesالوحدات المعجمية (lexemes) ومعانيها | Which word, and which sense of it?أي كلمة، وبأي معنى من معانيها؟ | Word sense disambiguation (the 'heavy' of slide 9)تحديد معنى الكلمة (word sense disambiguation)، مثل 'heavy' في الشريحة 9 |
| Syntaxالنحو (Syntax) | Phrases and sentencesالعبارات والجمل | How do the words group?كيف تتجمع الكلمات؟ | Parsing, prepositional phrase attachment (slide 21)التحليل النحوي (parsing)، وإلحاق شبه الجملة الحرفية (الشريحة 21) |
| Semanticsعلم الدلالة (Semantics) | Propositionsالقضايا (propositions) | What does it literally mean?ما معناه الحرفي؟ | Semantic role labelling, question answeringوسم الأدوار الدلالية (semantic role labelling)، والإجابة عن الأسئلة |
| Pragmaticsالتداولية (Pragmatics) | An utterance in contextقول في سياقه (utterance in context) | What did the speaker intend?ماذا قصد المتكلم؟ | Resolving 'tomorrow' in slide 12, dialogue systemsحل 'tomorrow' في الشريحة 12، وأنظمة الحوار |
| Discourseالخطاب (Discourse) | Multi-sentence textنص من عدة جمل | How do the sentences connect?كيف تترابط الجمل؟ | Coreference resolution, coherence modellingحل الإحالة المشتركة (coreference resolution)، ونمذجة الترابط |
Two figures, three omissionsشكلان، وثلاثة إغفالات
The rings and the stack on slide 17 disagree in three small ways, and each is worth knowing because they are the kind of thing an exam question probes. The rings have no lexical ring: they go straight from morphology (words) to syntax (phrases and sentences), while the stack has "lexemes" between them. The rings have no orthography: they start from phonetics as if all input were speech, while the stack shows the text branch explicitly. The rings also stop at pragmatics, labelled "meaning in context of discourse", while the stack puts a separate discourse level on top. Read the stack as the complete list and the rings as the speech-first view.
الحلقات والمكدّس في الشريحة 17 يختلفان في ثلاثة أمور صغيرة، وكل منها يستحق المعرفة لأنها من النوع الذي يختبره سؤال الامتحان. الحلقات ليس فيها حلقة معجمية (lexical): تنتقل مباشرة من morphology (الكلمات) إلى syntax (العبارات والجمل)، بينما في المكدّس «lexemes» بينهما. والحلقات ليس فيها orthography: تبدأ من phonetics كأن كل المدخلات كلام منطوق، بينما يُظهر المكدّس فرع النص صراحة. والحلقات أيضًا تتوقف عند pragmatics، المعنونة «meaning in context of discourse» (المعنى في سياق الخطاب)، بينما يضع المكدّس مستوى discourse منفصلًا في الأعلى. اقرأ المكدّس بوصفه القائمة الكاملة، والحلقات بوصفها المنظور الذي يبدأ من الكلام.
Quick checkاختبار سريع
Which level of linguistic knowledge deals with meaning in the context of the discourse and the speaker's intent?أي مستوى من مستويات المعرفة اللغوية يتناول المعنى في سياق الخطاب ومقصد المتكلم؟
Quick checkاختبار سريع
Which two levels does speech input pass through that text input skips?ما المستويان اللذان يمر بهما مدخل الكلام ويتخطاهما مدخل النص؟
Recall
Order the levels from sound to discourse, and say which two apply to speech only.رتّب المستويات من الصوت إلى الخطاب، وقل أي اثنين منها يخصان الكلام المنطوق فقط.
The lecture opens its next question, why NLP is difficult, with a picture rather than a list: a baby in a pinstriped suit sitting beside a laptop, labelled "Predisposed for acquiring language" and "Not so!". The joke carries the most important idea in the part. Jurafsky and Martin cite estimates that young adult speakers of American English know between 30,000 and 100,000 words, and conclude that children must learn "about 7 to 10 words a day, every single day" to reach that level by age 20 (the full range alone implies roughly 4 to 14 a day), most of them picked up "as a by-product of reading" with nobody teaching each one. The laptop knows nothing until someone types rules or feeds it data.
تفتتح المحاضرة سؤالها التالي، لماذا NLP صعبة، بصورة لا بقائمة: رضيع في بدلة مقلّمة يجلس بجانب حاسوب محمول، مع العبارتين «Predisposed for acquiring language» (مهيّأ لاكتساب اللغة) و«Not so!» (ليس كذلك!). والنكتة تحمل أهم فكرة في هذا الجزء. يستشهد Jurafsky وMartin بتقديرات تفيد بأن المتحدثين البالغين الشباب بالإنجليزية الأمريكية يعرفون بين 30,000 و100,000 كلمة، ويستنتجان أن الأطفال يجب أن يتعلموا «نحو 7 إلى 10 كلمات يوميًا، كل يوم دون انقطاع» ليصلوا إلى هذا المستوى بحلول سن 20 (والمدى الكامل وحده يعني تقريبًا 4 إلى 14 كلمة يوميًا)، ومعظمها يُلتقط «بوصفه نتيجة جانبية للقراءة» دون أن يعلّم أحدٌ كل كلمة منها. أما الحاسوب المحمول فلا يعرف شيئًا حتى يكتب له أحدٌ قواعد أو يغذّيه ببيانات.
The claim on the slide is the nativist position in psycholinguistics. Its classic argument is the poverty of the stimulus: in the Stanford Encyclopedia's summary, "there are aspects of developed linguistic competence which cannot be explained with respect to the evidence available to the language learning child", so something must be built in. The debate about how much is built in remains open; the same entry notes that modern empiricists no longer defend a blank slate but "complex, innately structured minds and learning systems" while denying that any of them are specific to language. For this course you do not need to settle that. You need the part of the slide that nobody disputes: whatever a child brings to the task, a machine brings none of it.
الادعاء في الشريحة هو الموقف الفطري (nativist) في علم النفس اللغوي. وحجته الكلاسيكية هي فقر المثير (poverty of the stimulus): في تلخيص موسوعة Stanford، «هناك جوانب من الكفاءة اللغوية المكتملة لا يمكن تفسيرها بالأدلة المتاحة للطفل الذي يتعلم اللغة»، فلا بد أن يكون شيء ما مبنيًا فيه مسبقًا. والجدل حول مقدار ما هو مبني مسبقًا لا يزال مفتوحًا؛ إذ يلاحظ المدخل نفسه أن التجريبيين المعاصرين لم يعودوا يدافعون عن صفحة بيضاء، بل عن «عقول وأنظمة تعلّم معقدة ذات بنية فطرية»، مع إنكارهم أن يكون أيٌّ منها خاصًا باللغة. في هذا المقرر لا تحتاج إلى حسم ذلك. تحتاج إلى الجزء من الشريحة الذي لا يجادل فيه أحد: مهما كان ما يجلبه الطفل إلى المهمة، فالآلة لا تجلب منه شيئًا.
Now put the two previous concepts side by side. The rings list the Knowledge of language that any language processor must have, from phonetics to discourse. The four approaches list the only two ways that knowledge can get into a machine: a person writes it down (rule-based), or a model extracts it from data (machine learning and Deep learning). There is no third route. Every ring, for every language the system must handle, has to be filled through one of those two arrows. That is why NLP is difficult, which part 4 takes up, and why slide 24 lists the disciplines and tools needed to do the filling.
الآن ضع المفهومين السابقين جنبًا إلى جنب. الحلقات تسرد knowledge of language (المعرفة باللغة) التي يجب أن يملكها أي معالج للغة، من phonetics إلى discourse. والمناهج الأربعة تسرد الطريقتين الوحيدتين اللتين يمكن أن تدخل بهما هذه المعرفة إلى الآلة: إما أن يكتبها إنسان (rule-based)، وإما أن يستخرجها نموذج من البيانات (machine learning وdeep learning). لا يوجد طريق ثالث. كل حلقة، ولكل لغة يجب أن يتعامل معها النظام، يجب أن تُملأ عبر أحد هذين السهمين. ولهذا NLP صعبة، وهو ما يتناوله الجزء 4، ولهذا تسرد الشريحة 24 التخصصات والأدوات اللازمة لعملية الملء هذه.
The learned route is now the dominant one, and Jurafsky and Martin describe how far it reaches: large language models "learn this knowledge of language, knowledge of concepts, and knowledge of the world simply by being taught to predict the next word", an idea that goes back to the distributional hypothesis of the 1950s. Note what the learner is given: text, and only text. A child gets speech embedded in a situation, with gestures, objects and corrections. Jurafsky and Martin add that "grounding from real-world interaction or other modalities like vision can help build even more powerful models, but even text alone is remarkably useful".
طريق التعلم هو المهيمن الآن، ويصف Jurafsky وMartin إلى أي مدى يصل: large language models (النماذج اللغوية الكبيرة) «تتعلم هذه المعرفة باللغة، والمعرفة بالمفاهيم، والمعرفة بالعالم، ببساطة عبر تدريبها على توقّع الكلمة التالية»، وهي فكرة ترجع إلى الفرضية التوزيعية (distributional hypothesis) في الخمسينيات (1950s). لاحظ ما يُعطى للمتعلم: نص، ونص فقط. أما الطفل فيحصل على كلام مغروس في موقف، مع إيماءات وأشياء وتصحيحات. ويضيف Jurafsky وMartin أن «التأريض (grounding) من التفاعل مع العالم الحقيقي أو من وسائط أخرى مثل الرؤية يمكن أن يساعد في بناء نماذج أقوى، لكن حتى النص وحده مفيد على نحو لافت».
What each learner starts withما يبدأ به كل متعلّم
- Childالطفل
- A predisposition to acquire language (the slide's claim), plus speech in context with feedbackتهيّؤ فطري لاكتساب اللغة (وهو ادعاء الشريحة)، إضافةً إلى كلام في سياقه مع تغذية راجعة
- Rule-based systemالنظام القائم على القواعد
- Whatever grammars, lexicons and regular expressions a person has writtenما كتبه إنسان من قواعد نحوية (grammars) ومعاجم (lexicons) وتعابير نمطية (regular expressions)، لا أكثر
- Learned systemالنظام المتعلِّم
- An architecture and a training objective; every level must be extracted from dataمعمارية وهدف تدريب؛ وكل مستوى يجب أن يُستخرج من البيانات
Quick checkاختبار سريع
According to slide 19, how must each level of linguistic knowledge get into a machine?بحسب الشريحة 19، كيف يجب أن يدخل كل مستوى من مستويات المعرفة اللغوية إلى الآلة؟
Recall
What must happen to every level of linguistic knowledge before a machine can use it, and why does the slide contrast the machine with a child?ما الذي يجب أن يحدث لكل مستوى من مستويات المعرفة اللغوية قبل أن تستطيع الآلة استخدامه، ولماذا تقارن الشريحة الآلة بالطفل؟
Recapالخلاصة
If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا
- The four approaches differ in who supplies the knowledge: rules (a human), classical ML (human features, data-set weights), end-to-end deep learning (data supplies the representations too), hybrid (rules around a learned core).تختلف المناهج الأربعة في من يوفّر المعرفة: القواعد (الإنسان)، وتعلم الآلة الكلاسيكي (الإنسان يحدد السمات والبيانات تحدد الأوزان)، والتعلم العميق من الطرف إلى الطرف (البيانات توفّر التمثيلات أيضًا)، والهجين (قواعد تحيط بنواة متعلَّمة).
- Rule-based NLP runs from the Georgetown-IBM demo of 1954 (250 words, six rules) and ELIZA in 1966 through the symbolic era to the early 1990s; statistical methods dominated until 2017; transformers (2017) and prompting (2019) define the current era.تمتد معالجة اللغة القائمة على القواعد من عرض Georgetown-IBM عام 1954 (250 كلمة وست قواعد) و ELIZA عام 1966 مرورًا بالحقبة الرمزية حتى أوائل التسعينيات؛ ثم هيمنت الطرق الإحصائية حتى 2017؛ وتحدد المحوّلات (transformers) عام 2017 والتلقين (prompting) عام 2019 الحقبة الحالية.
- The pipeline is paragraphs to sentences (sentence boundary disambiguation), sentences to words (tokenization), words to morphology (stemming or lemmatization). Parsing builds structure over tokens; it is not a splitting step.خط المعالجة هو: من الفقرات إلى الجمل (تحديد حدود الجمل)، ومن الجمل إلى الكلمات (tokenization)، ومن الكلمات إلى الصرف (stemming أو lemmatization). أما التحليل النحوي (parsing) فيبني بنية فوق الوحدات؛ وليس خطوة تقسيم.
- The period is ambiguous: abbreviation, decimal or sentence end, and sometimes two at once, as in 'Acme Inc.' at the end of a sentence.النقطة ملتبسة: قد تكون علامة اختصار، أو فاصلة عشرية، أو نهاية جملة، وأحيانًا اثنين معًا، كما في 'Acme Inc.' في آخر الجملة.
- Tokenization is not trivial: clitics ('s, n't, Arabic b and w), hyphens, numbers, and Chinese, Japanese and Thai with no spaces between words.التقطيع إلى وحدات ليس أمرًا تافهًا: هناك اللواحق المتصلة (clitics) مثل 's و n't وحرفا الباء والواو في العربية، والشرطات، والأرقام، واللغات الصينية واليابانية والتايلاندية التي لا تضع مسافات بين الكلمات.
- Stemming chops (experiments to experi, are to ar); lemmatization looks up (experiments to experiment, are to be) and may need the part of speech.التجذيع يقطع (experiments إلى experi، و are إلى ar)؛ والتأصيل المعجمي يبحث في المعجم (experiments إلى experiment، و are إلى be) وقد يحتاج إلى نوع الكلمة (part of speech).
- Levels from sound to discourse: phonetics, phonology (speech only), orthography (text only), morphology, lexical, syntax, semantics, pragmatics, discourse. Most NLP tasks resolve ambiguity at one of these levels.المستويات من الصوت إلى الخطاب: phonetics، ثم phonology (للكلام فقط)، ثم orthography (للنص فقط)، ثم morphology، ثم lexical، ثم syntax، ثم semantics، ثم pragmatics، ثم discourse. ومعظم مهام NLP تحل التباسًا عند أحد هذه المستويات.
- A child is predisposed to acquire language; a machine is not, so every level must be hand-coded or learned from data. That is the bridge to why NLP is hard.الطفل مهيّأ فطريًا لاكتساب اللغة؛ أما الآلة فليست كذلك، ولذلك يجب أن يُبرمج كل مستوى يدويًا أو يُتعلّم من البيانات. وهذا هو الجسر إلى سؤال لماذا NLP صعبة.
Sourcesالمصادر
- Speech and Language Processing, 3rd edition draft, chapter 1: IntroductionBookJurafsky and Martin, StanfordHistory of NLP and Figure 1.6 (section 1.4), vocabulary growth (1.2), interpretability and probing (1.5), LLMs learning from next-word predictionتاريخ NLP والشكل 1.6 (القسم 1.4)، ونمو المفردات (1.2)، وقابلية التفسير والسَّبر (1.5)، وتعلّم النماذج اللغوية الكبيرة من توقّع الكلمة التالية(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 3rd edition draft, chapter 2: Words and TokensBookJurafsky and Martin, StanfordELIZA, morphemes and clitics, Chinese segmentation, Penn Treebank tokenization, rule-based tokenization, sentence segmentation (2.8.1), GPT-2 pre-tokenizer regex (Figure 2.15)ELIZA، والمورفيمات واللواحق المتصلة (clitics)، وتجزئة الصينية، والتقطيع بعرف Penn Treebank، والتقطيع القائم على القواعد، وتقسيم الجمل (2.8.1)، والتعبير النمطي للتقطيع المسبق في GPT-2 (الشكل 2.15)(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 3rd edition draft, chapter 15: PhoneticsBookJurafsky and Martin, StanfordDefinition of phonetics, phones, the phonemeتعريف علم الأصوات النطقي (phonetics)، والأصوات الكلامية (phones)، والفونيم (phoneme)(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 3rd edition draft, chapter 16: Automatic Speech RecognitionBookJurafsky and Martin, StanfordEncoder-decoder speech recognition with no hand-built pronunciation pipelineالتعرف على الكلام بنماذج encoder-decoder دون خط معالجة للنطق مبني يدويًا(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 3rd edition draft, chapter 18: Sequence LabelingBookJurafsky and Martin, StanfordHMMs, CRFs, feature templates and word-shape features designed by hand (18.5)نماذج HMM و CRF، وقوالب السمات (feature templates) وسمات شكل الكلمة (word-shape) المصممة يدويًا (18.5)(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 3rd edition draft, chapter 24: Coreference ResolutionBookJurafsky and Martin, StanfordCoreference as the standard discourse-level taskالإحالة المشتركة (coreference) بوصفها المهمة المعيارية على مستوى الخطاب(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 2nd edition, chapter 1 (sample chapter)BookPearson, Jurafsky and MartinSection 1.1: the six kinds of knowledge from phonetics and phonology to discourse; section 1.2: most tasks resolve ambiguity at one of these levelsالقسم 1.1: أنواع المعرفة الستة من phonetics و phonology إلى discourse؛ والقسم 1.2: معظم المهام تحل التباسًا عند أحد هذه المستويات(opens in a new tab)(يفتح في تبويب جديد)
- Introduction to Information Retrieval: Stemming and lemmatizationBookCambridge University Press, Manning, Raghavan and SchützeDefinitions of stemming and lemmatization, am/are/is to be, Porter as the most common English stemmerتعريفا التجذيع (stemming) والتأصيل المعجمي (lemmatization)، وتحويل am/are/is إلى be، و Porter بوصفه أشهر مجذِّع للإنجليزية(opens in a new tab)(يفتح في تبويب جديد)
- Natural Language Processing with Python, chapter 3BookBird, Klein and Loper, NLTKStemming is not a well-defined process; Porter versus the WordNet lemmatizer; Punkt sentence tokenizerالتجذيع ليس عملية محددة تحديدًا جيدًا؛ ومقارنة Porter بمؤصِّل WordNet؛ ومقسِّم الجمل Punkt(opens in a new tab)(يفتح في تبويب جديد)
- An algorithm for suffix stripping (Program 14(3), 1980), official pagePaperM. F. PorterThe original Porter algorithm with test vocabulary and outputsخوارزمية Porter الأصلية مع مفردات الاختبار ومخرجاتها(opens in a new tab)(يفتح في تبويب جديد)
- The Georgetown-IBM experiment demonstrated in January 1954PaperAMTA 2004, W. J. Hutchins250 words and six grammar rules250 كلمة وست قواعد نحوية(opens in a new tab)(يفتح في تبويب جديد)
- Conditional Random Fields: Probabilistic Models for Segmenting and Labeling Sequence DataPaperICML 2001, Lafferty, McCallum and PereiraThe CRF, a classical ML sequence modelنموذج CRF، وهو نموذج تسلسلي من تعلم الآلة الكلاسيكي(opens in a new tab)(يفتح في تبويب جديد)
- Sequence to Sequence Learning with Neural NetworksPaperNeurIPS 2014, Sutskever, Vinyals and LeDeep LSTM encoder and decoder for translationمرمِّز (encoder) ومفكِّك ترميز (decoder) من نوع LSTM عميق للترجمة(opens in a new tab)(يفتح في تبويب جديد)
- Attention Is All You NeedPaperNeurIPS 2017, Vaswani et al.The Transformer, based solely on attentionالمحوّل (Transformer)، القائم على الانتباه (attention) وحده(opens in a new tab)(يفتح في تبويب جديد)
- Neural Machine Translation of Rare Words with Subword UnitsPaperACL 2016, Sennrich, Haddow and BirchByte-pair encoding as learned subword tokenizationترميز أزواج البايتات (byte-pair encoding) بوصفه تقطيعًا متعلَّمًا إلى وحدات جزئية(opens in a new tab)(يفتح في تبويب جديد)
- Unsupervised Multilingual Sentence Boundary DetectionPaperComputational Linguistics 2006, Kiss and StrunkThe Punkt method for learning abbreviation listsطريقة Punkt لتعلّم قوائم الاختصارات(opens in a new tab)(يفتح في تبويب جديد)
- A Structural Probe for Finding Syntax in Word RepresentationsPaperNAACL 2019, Hewitt and ManningSyntax trees recovered from inside language model representationsأشجار نحوية مستعادة من داخل تمثيلات النماذج اللغوية(opens in a new tab)(يفتح في تبويب جديد)
- BERT Rediscovers the Classical NLP PipelinePaperACL 2019, Tenney, Das and PavlickCoreference and other levels encoded inside BERTالإحالة المشتركة ومستويات أخرى مُرمَّزة داخل BERT(opens in a new tab)(يفتح في تبويب جديد)
- Innateness and LanguageArticleStanford Encyclopedia of Philosophy, G. DupreThe poverty of the stimulus argument and the state of the nativist debateحجة فقر المثير (poverty of the stimulus) وحال الجدل حول الموقف الفطري (nativist)(opens in a new tab)(يفتح في تبويب جديد)
Part 04: Why NLP is hard and how progress is madeلماذا NLP صعبة وكيف يتحقق التقدم
Ambiguity at every level shown through 'I made her duck', the telescope sentence and real newspaper crash blossoms, six further sources of difficulty, and the knowledge sources and disciplines that make progress possible.الغموض في كل مستوى من خلال جملة I made her duck، وجملة التلسكوب، وعناوين الصحف الحقيقية الملتبسة (crash blossoms)، وستة مصادر أخرى للصعوبة، ومصادر المعرفة والتخصصات التي تجعل التقدم ممكنا.
4 concepts4 مفاهيم, ، slides 20-25الشرائح 20-25
Why this part mattersلماذا يهمّ هذا الجزء
Most tasks in this course, from spelling correction to machine translation, can be viewed as resolving one of the ambiguities in this part, and the models you will meet are the machinery for doing it. If you can name the ambiguity, you can name the model that attacks it.
Part 3 laid out the levels of linguistic knowledge. This part shows why each level is needed by breaking one four-word sentence into five meanings, then drawing two grammatical parses of one prepositional phrase, then reading six real headlines that went wrong. It closes with six further sources of difficulty and the three kinds of knowledge that make progress possible. Exam questions ask for the five readings, the two attachments and the six difficulties by name, and the Arabic counterparts (dialects, clitics, no capital letters) are the difficulties your own research data will carry.
يمكن النظر إلى معظم المهام في هذا المقرر، من تصحيح الأخطاء الإملائية إلى الترجمة الآلية، على أنها حلٌّ لأحد أنواع الغموض الواردة في هذا الجزء، والنماذج التي ستقابلها هي الأدوات التي تنفّذ هذا الحل. إذا استطعت أن تسمّي نوع الغموض، استطعت أن تسمّي النموذج الذي يعالجه.
عرض الجزء 3 مستويات المعرفة اللغوية. أما هذا الجزء فيبيّن لماذا نحتاج إلى كل مستوى منها: يفكّك جملة واحدة من أربع كلمات إلى خمسة معانٍ، ثم يرسم تحليلين نحويين صحيحين لشبه جملة جارّة واحدة (prepositional phrase)، ثم يقرأ ستة عناوين صحفية حقيقية ساء فهمها. ويختم بستة مصادر إضافية للصعوبة وبثلاثة أنواع من المعرفة تجعل التقدّم ممكنًا. أسئلة الامتحان تطلب القراءات الخمس، ونوعي الربط (attachment)، والصعوبات الست بأسمائها، أما نظائرها العربية (اللهجات، واللواحق المتصلة clitics، وغياب الأحرف الكبيرة) فهي الصعوبات التي ستحملها بيانات بحثك أنت.
By the end you canفي نهاية هذا الجزء ستستطيع
- Produce five readings of 'I made her duck' and name the linguistic level of the ambiguity behind each.استخرج خمس قراءات لجملة 'I made her duck' وسمِّ المستوى اللغوي للغموض الذي يقف وراء كل قراءة.
- Draw the NP and VP attachments of a prepositional phrase and explain why both parses are grammatical.ارسم ربط شبه الجملة الجارّة (prepositional phrase) بالمركب الاسمي (NP) وبالمركب الفعلي (VP)، واشرح لماذا يكون التحليلان كلاهما صحيحين نحويًا.
- Define a crash blossom, tell where the name comes from, and disambiguate any of the six headlines.عرّف مصطلح crash blossom، واذكر من أين جاء الاسم، وأزل الغموض عن أي عنوان من العناوين الستة.
- List six sources of difficulty beyond ambiguity with the slide example and the NLP subproblem each defeats.عدّد ستة مصادر للصعوبة غير الغموض، مع مثال الشريحة لكل منها والمسألة الفرعية في معالجة اللغات الطبيعية (NLP) التي يُفشلها.
- State the three tools on slide 24 (two kinds of knowledge and a way to combine them) and the three source disciplines, and map them onto the four approaches of slide 15.اذكر الأدوات الثلاث في الشريحة 24 (نوعان من المعرفة وطريقة للجمع بينهما) والتخصصات الثلاثة التي تُستمد منها، واربطها بالمناهج الأربعة في الشريحة 15.
Take four ordinary words, I made her duck, and look for every meaning they can carry. The lecture asks for at least five and leaves the answers to you. Before reading on, try it honestly: how many can you find? Most people stop at two and are surprised that the sentence keeps going.
خذ أربع كلمات عادية، I made her duck، وابحث عن كل معنى يمكن أن تحمله. تطلب المحاضرة خمسة معانٍ على الأقل وتترك الإجابة لك. قبل أن تكمل القراءة، جرّب بصدق: كم معنى تستطيع أن تجد؟ يتوقف معظم الناس عند معنيين ويُفاجَؤون بأن الجملة تستمر في إعطاء المزيد.
Recall
Find five meanings of 'I made her duck' before you reveal the list.جد خمسة معانٍ للجملة 'I made her duck' قبل أن تكشف القائمة.
The five meanings are not the lesson. The lesson is where each one comes from. Jurafsky and Martin use this sentence because every reading is produced by one decision at one linguistic level, and those levels are exactly the ones you met in part 3. That is what makes ambiguity the central problem of the field rather than a party trick.
المعاني الخمسة ليست هي الدرس. الدرس هو من أين يأتي كل معنى. يستخدم Jurafsky و Martin هذه الجملة لأن كل قراءة تنتج عن قرار واحد في مستوى لغوي واحد، وهذه المستويات هي بالضبط التي عرفتها في الجزء 3. وهذا ما يجعل الغموض (ambiguity) المشكلة المركزية في هذا المجال لا مجرد حيلة للتسلية.
I cooked waterfowl for herI cooked waterfowl for herطبختُ لها بطةً (طائرًا مائيًا)
- Bracketingالتقويس
- [made [her]IO [duck]NP]
- Levelالمستوى
- Part of speech and word senseقسم الكلام ومعنى الكلمة
- Resolved byتُحلّ بواسطة
- POS tagging, word sense disambiguationوسم أقسام الكلام (POS tagging)، وتحديد معنى الكلمة (word sense disambiguation)
Work through what flips. The word duck can be a noun (the bird) or a verb (to lower your head), and her can be a dative pronoun (for her) or a possessive (her duck). Both are lexical ambiguities of part of speech. The word make keeps its part of speech but not its meaning: it can mean create or cook, which is a lexical ambiguity of sense, and choosing the right one is Word sense disambiguation. The cause and transform readings are not two further senses of make. They come from the frame the verb takes: the sentence as a whole can be built in three shapes, make with a single object (her duck as one noun phrase), make with two objects (her and duck, one turned into the other), or make with an object and a bare verb (her then duck as an action). That is syntactic ambiguity, a question of syntax rather than of any single word.
تتبّع ما الذي يتبدّل. كلمة duck قد تكون اسمًا (الطائر) أو فعلًا (أن تخفض رأسك)، وكلمة her قد تكون ضميرًا في حالة المفعول غير المباشر (dative، أي «لها») أو ضمير ملكية (بطتها). كلاهما من الغموض المعجمي (lexical ambiguity) في نوع الكلمة (part of speech). أما كلمة make فتحتفظ بنوعها لكنها لا تحتفظ بمعناها: قد تعني «صنع» أو «طبخ»، وهذا غموض معجمي في المعنى، واختيار المعنى الصحيح هو word sense disambiguation (إزالة غموض معنى الكلمة). وقراءتا «جعلها تفعل» و«حوّلها» ليستا معنيين إضافيين للفعل make، بل تأتيان من الإطار الذي يأخذه الفعل: يمكن أن تُبنى الجملة كلها بثلاثة أشكال، make مع مفعول واحد (her duck مركبًا اسميًا واحدًا)، أو make مع مفعولين (her وduck، أحدهما يتحوّل إلى الآخر)، أو make مع مفعول وفعل مجرد (her ثم duck بوصفه فعلًا تقوم به). هذا هو الغموض التركيبي (syntactic ambiguity)، وهو مسألة نحو وتركيب (syntax) لا مسألة كلمة بعينها.
| Readingالقراءة | Glossالمعنى | What flipsما الذي يتبدّل | Level of ambiguityمستوى الغموض |
|---|---|---|---|
| 11 | I cooked waterfowl for herطبختُ لها بطة (طائرًا مائيًا) | made = cook, her = dative, duck = nounmade = طبخ، her = مفعول غير مباشر (dative)، duck = اسم | Part of speech and word senseنوع الكلمة ومعنى الكلمة |
| 22 | I cooked waterfowl belonging to herطبختُ البطة التي تملكها هي | her = possessive, so her duck is one NPher = ضمير ملكية، فتكون her duck مركبًا اسميًا واحدًا (NP) | Syntactic (and POS of her)تركيبي (ونوع الكلمة في her) |
| 33 | I created the plaster duck she ownsصنعتُ البطة الجبسية التي تملكها | made = createmade = صنع | Word senseمعنى الكلمة |
| 44 | I caused her to quickly lower her headجعلتُها تخفض رأسها بسرعة | duck = verb, made takes an object plus a bare verbduck = فعل، وmade يأخذ مفعولًا وفعلًا مجردًا | Part of speech and syntacticنوع الكلمة وتركيبي |
| 55 | I turned her into a duckحوّلتُها إلى بطة | made takes two objectsmade يأخذ مفعولين | Syntactic (ditransitive)تركيبي (فعل متعدٍّ إلى مفعولين، ditransitive) |
One level is still missing, and it only appears when the sentence is spoken. In speech the first word could have been eye and the second could have been maid. Jurafsky and Martin call this an even deeper kind of ambiguity, because it sits below the words themselves, at the level of phonetics. A speech recogniser must settle it before any of the other decisions can even begin. Toggle the cycler to "heard, not read" to see it.
ما زال هناك مستوى ناقص، ولا يظهر إلا عندما تُنطق الجملة. في الكلام المنطوق قد تكون الكلمة الأولى eye والثانية maid. يسمّي Jurafsky و Martin هذا نوعًا أعمق من الغموض، لأنه يقع تحت مستوى الكلمات نفسها، في مستوى الصوتيات (phonetics). يجب على نظام التعرّف على الكلام أن يحسمه قبل أن تبدأ أيٌّ من القرارات الأخرى. بدّل أداة التنقل إلى "heard, not read" (مسموع لا مقروء) لترى ذلك.
| Levelالمستوى | The decisionالقرار | Task that resolves itالمهمة التي تحسمه |
|---|---|---|
| Phonetic (speech only)صوتي (في الكلام المنطوق فقط) | Is the first word I or eye, the second made or maidهل الكلمة الأولى I أم eye، والثانية made أم maid | Speech recognitionالتعرّف على الكلام (speech recognition) |
| Part of speechنوع الكلمة | Is duck a noun or a verb; is her a dative pronoun or a possessiveهل duck اسم أم فعل؛ وهل her ضمير مفعول غير مباشر أم ضمير ملكية | POS taggingوسم أنواع الكلمات (POS tagging) |
| Word senseمعنى الكلمة | Does make mean cook or createهل تعني make طبخ أم صنع | Word sense disambiguationإزالة غموض معنى الكلمة (word sense disambiguation) |
| Syntactic structureالبنية التركيبية | Does make take one object, two objects, or an object plus a verbهل يأخذ make مفعولًا واحدًا، أم مفعولين، أم مفعولًا مع فعل | Parsingالتحليل النحوي (parsing) |
This table is the sentence Jurafsky and Martin build their whole book on: most or all tasks in speech and language processing can be viewed as resolving ambiguity at one of these levels. Part-of-speech tagging decides whether duck is a noun or a verb, word sense disambiguation decides what make means, and probabilistic parsing decides whether her and duck group together. Every one of those tasks has its own chapter later in the course, and each one is answering a question this four-word sentence raises.
هذا الجدول هو الفكرة التي بنى عليها Jurafsky و Martin كتابهما كله: يمكن النظر إلى معظم مهام معالجة الكلام واللغة أو كلها على أنها حلٌّ للغموض في أحد هذه المستويات. وسم أنواع الكلمات (part-of-speech tagging) يقرر هل duck اسم أم فعل، وإزالة غموض المعنى تقرر ماذا تعني make، والتحليل النحوي (parsing) الاحتمالي يقرر هل تتجمّع her وduck معًا. لكل مهمة من هذه المهام فصلها الخاص لاحقًا في المقرر، وكل واحدة منها تجيب عن سؤال تطرحه هذه الجملة ذات الكلمات الأربع.
Recall
Which words in 'I made her duck' are ambiguous in part of speech, which word is ambiguous in sense, and what is ambiguous about the sentence as a whole?أي الكلمات في 'I made her duck' غامضة في نوع الكلمة، وأي كلمة غامضة في المعنى، وما الغامض في الجملة ككل؟
If the duck sentence felt contrived, here is one nobody would blink at: I saw the man with a telescope. Who has the telescope? Read it once and you will have decided without noticing. Read it again and the other answer is just as available.
إن بدت لك جملة البطة متكلَّفة، فهذه جملة لن يتوقف عندها أحد: I saw the man with a telescope. من الذي يحمل التلسكوب؟ اقرأها مرة وستكون قد قررت دون أن تنتبه. اقرأها مرة أخرى وستجد الإجابة الأخرى متاحة بالقدر نفسه.
The phrase with a telescope is a prepositional phrase, and a prepositional phrase has to attach to something. Attach it inside the noun phrase, [the man [with a telescope]], and the man has the telescope. Attach it to the verb phrase, [saw [the man] [with a telescope]], and the telescope is the instrument of seeing: I used it. This is prepositional phrase attachment, one of the two common kinds of syntactic ambiguity in English text (the other is coordination ambiguity, as in old men and women), and the point is that both parses are fully grammatical. The grammar licenses both; only context, plausibility or statistics can choose. A third reading hides in the first word: saw can also be the present tense of the verb to saw, so I am cutting the man with a telescope, a lexical ambiguity stacked on top of the syntactic one.
العبارة with a telescope شبه جملة جارّة (prepositional phrase)، ولا بد لشبه الجملة الجارّة أن ترتبط بشيء ما. اربطها داخل المركب الاسمي، [the man [with a telescope]]، فيكون الرجل هو حامل التلسكوب. اربطها بالمركب الفعلي، [saw [the man] [with a telescope]]، فيصبح التلسكوب أداة الرؤية: أنا الذي استخدمته. هذا هو ربط شبه الجملة الجارّة (prepositional phrase attachment)، أحد النوعين الشائعين من الغموض التركيبي (syntactic ambiguity) في النصوص الإنجليزية (والآخر هو غموض العطف (coordination ambiguity)، كما في old men and women)، والنقطة الأساسية أن التحليلين كليهما صحيحان نحويًا تمامًا. النحو يجيز الاثنين، ولا يختار بينهما إلا السياق أو المعقولية أو الإحصاء. وتختبئ قراءة ثالثة في الكلمة الأولى: قد تكون saw أيضًا المضارع من الفعل «ينشر» (بالمنشار)، فيصبح المعنى أنني أنشر الرجل الذي معه تلسكوب، وهو غموض معجمي (lexical ambiguity) يتراكب فوق الغموض التركيبي.
Jurafsky and Martin treat this under structural ambiguity in their parsing chapter: it occurs when the grammar can assign more than one parse to a sentence, and attachment ambiguity is one of the two common forms, the other being coordination ambiguity. Their own example is Groucho Marx's I shot an elephant in my pajamas, where in my pajamas can attach to the shooting or to the elephant. They call ambiguity the most serious problem faced by syntactic parsers, because a grammar big enough to cover real English assigns a naturally occurring sentence not two parses but many, most of them grammatical yet semantically unreasonable. Parsing is therefore never just recognising structure; it is choosing among structures.
يتناول Jurafsky و Martin هذا تحت عنوان الغموض البنيوي (structural ambiguity) في فصل التحليل النحوي: يحدث حين يستطيع النحو أن يعطي الجملة أكثر من تحليل واحد، وغموض الربط (attachment ambiguity) أحد شكليه الشائعين، والآخر غموض العطف. ومثالهما هو جملة Groucho Marx I shot an elephant in my pajamas، حيث يمكن أن ترتبط in my pajamas بفعل الإطلاق أو بالفيل. ويصفان الغموض بأنه أخطر مشكلة تواجه المحللات النحوية، لأن النحو الكبير بما يكفي لتغطية الإنجليزية الحقيقية يعطي الجملة الطبيعية لا تحليلين بل تحليلات كثيرة، معظمها صحيح نحويًا لكنه غير معقول دلاليًا. لذلك فإن التحليل النحوي (parsing) ليس مجرد التعرّف على البنية أبدًا، بل هو الاختيار بين البنى.
Quick checkاختبار سريع
In 'I saw the man with a telescope', which attachment gives the reading where the man owns the telescope?في جملة 'I saw the man with a telescope'، أي ربط يعطي القراءة التي يكون فيها الرجل مالك التلسكوب؟
Crash blossoms: ambiguity in the wildCrash blossoms: الغموض في الواقع
Ambiguity is not a classroom invention, and the six headlines stamped "100% REAL" in the lecture prove it: every one really ran in a news outlet. Headlines drop articles, auxiliaries and the copula to save space, which strips away exactly the cues a reader uses to settle part of speech and attachment. The result is a headline that admits an unintended reading, and copy editors have a name for it: a Crash blossom.
الغموض ليس اختراعًا صفّيًا، والعناوين الستة المختومة بعبارة "100% REAL" في المحاضرة تثبت ذلك: كل واحد منها نُشر فعلًا في وسيلة إخبارية. تحذف العناوين أدوات التعريف والأفعال المساعدة وفعل الكينونة لتوفير المساحة، وهذا ينزع بالضبط القرائن التي يستخدمها القارئ لحسم نوع الكلمة (part of speech) والربط. والنتيجة عنوان يسمح بقراءة غير مقصودة، ولمحرري النصوص اسم لذلك: crash blossom.
The name comes from the first line on the slide. In August 2009 the site Japan Today ran the headline Violinist Linked to JAL Crash Blossoms about Diana Yukawa, whose father died in the 1985 Japan Airlines crash and whose career was flourishing. Editors on the Testy Copy Editors forum read it as a species called crash blossoms and, in the thread that followed, proposed "crash blossom" as the general term for a headline that leads the reader down the garden path. Ben Zimmer picked the story up on Language Log that month and then in his New York Times On Language column in January 2010, which is what made the word stick.
يأتي الاسم من السطر الأول في الشريحة. في August 2009 نشر موقع Japan Today العنوان Violinist Linked to JAL Crash Blossoms عن عازفة الكمان Diana Yukawa، التي توفي والدها في حادث تحطم طائرة الخطوط اليابانية سنة 1985 وكانت مسيرتها المهنية مزدهرة (المعنى المقصود: عازفة مرتبطة بحادث JAL تزدهر). قرأه المحررون في منتدى Testy Copy Editors على أنه نوع من الزهور اسمه «أزهار التحطم»، واقترحوا في النقاش الذي تلا ذلك "crash blossom" مصطلحًا عامًا لكل عنوان يقود القارئ في طريق مضلِّل (garden path). التقط Ben Zimmer القصة في مدونة Language Log في الشهر نفسه، ثم في عموده On Language في صحيفة New York Times في January 2010، وهذا ما جعل الكلمة ترسخ.
| Headlineالعنوان | Intended readingالقراءة المقصودة | Garden-path readingالقراءة المضلِّلة (garden path) | Ambiguous word and typeالكلمة الغامضة ونوع الغموض |
|---|---|---|---|
| Violinist Linked to JAL Crash BlossomsViolinist Linked to JAL Crash Blossoms | A violinist connected to the crash is flourishingعازفة كمان مرتبطة بحادث التحطم تزدهر مسيرتها | A species called crash blossoms is linked to a violinistنوع من الزهور اسمه crash blossoms مرتبط بعازفة كمان | blossoms: verb or noun (POS), and crash blossoms as a compound (segmentation)blossoms: فعل أم اسم (نوع الكلمة)، وcrash blossoms بوصفها اسمًا مركبًا (التقطيع) |
| Teacher Strikes Idle KidsTeacher Strikes Idle Kids | Teachers' strikes leave children idleإضرابات المعلمين تترك الأطفال بلا عمل | A teacher hits lazy childrenمعلم يضرب أطفالًا كسالى | strikes: noun or verb (POS), which flips idle between verb and adjectivestrikes: اسم أم فعل (نوع الكلمة)، وهذا يقلب idle بين فعل وصفة |
| Red Tape Holds Up New BridgesRed Tape Holds Up New Bridges | Bureaucracy delays the bridgesالبيروقراطية تؤخّر الجسور | Tape robs, or physically supports, the bridgesشريط لاصق يسرق الجسور، أو يحملها فعليًا | holds up: delays, robs or supports (word sense of a phrasal verb)holds up: يؤخّر أو يسرق أو يحمل (معنى فعل مركب، phrasal verb) |
| Hospitals Are Sued by 7 Foot DoctorsHospitals Are Sued by 7 Foot Doctors | Seven podiatrists sueسبعة أطباء أقدام يرفعون دعوى | Doctors seven feet tall sueأطباء طول كل منهم سبعة أقدام يرفعون دعوى | [7 [foot doctors]] versus [[7 foot] doctors] (syntactic, compound attachment)[7 [foot doctors]] مقابل [[7 foot] doctors] (تركيبي، ربط الاسم المركب) |
| Juvenile Court to Try Shooting DefendantJuvenile Court to Try Shooting Defendant | The court will prosecute a defendant in a shooting caseالمحكمة ستحاكم متهمًا في قضية إطلاق نار | The court will attempt to shoot the defendantالمحكمة ستحاول إطلاق النار على المتهم | try: prosecute or attempt (word sense); shooting: noun modifier or verb (POS)try: يحاكم أو يحاول (معنى الكلمة)؛ shooting: اسم واصف أم فعل (نوع الكلمة) |
| Local High School Dropouts Cut in HalfLocal High School Dropouts Cut in Half | The dropout rate was halvedانخفض معدل التسرب من المدارس إلى النصف | Students were bisectedشُطر الطلاب نصفين | cut in half: figurative or literal (word sense), plus dropouts as a rate (world knowledge)cut in half: مجازي أم حرفي (معنى الكلمة)، إضافة إلى فهم dropouts على أنها معدل (معرفة العالم) |
Look at the last column and you will see the same three kinds of ambiguity as the duck sentence, just without the helpful function words. Strikes, blossoms and shooting are part-of-speech flips; holds up, try and cut in half are sense flips; 7 foot doctors is a bracketing flip. Notice also that one choice forces others: once strikes is a verb, idle must be an adjective, and once it is a noun, idle must be a verb. Ambiguities are not independent, which is why parsers resolve them jointly rather than word by word.
انظر إلى العمود الأخير وسترى الأنواع الثلاثة نفسها من الغموض التي رأيتها في جملة البطة، لكن بلا كلمات الوظيفة المساعِدة. Strikes وblossoms وshooting تقلّبات في نوع الكلمة؛ holds up وtry وcut in half تقلّبات في المعنى؛ و7 foot doctors تقلّب في التجميع بين الأقواس. ولاحظ أيضًا أن اختيارًا واحدًا يفرض غيره: إذا كانت strikes فعلًا، وجب أن تكون idle صفة، وإذا كانت اسمًا، وجب أن تكون idle فعلًا. أنواع الغموض ليست مستقلة بعضها عن بعض، ولهذا تحسمها المحللات النحوية معًا لا كلمةً كلمة.
Quick checkاختبار سريع
Which ambiguity is at the root of the headline 'Teacher Strikes Idle Kids'?أي نوع من الغموض يقف في أصل العنوان 'Teacher Strikes Idle Kids'؟
Recall
What is a crash blossom, and where does the name come from?ما الـ crash blossom، ومن أين جاء الاسم؟
Recall
Draw the two attachments of 'I saw the man with a telescope' as bracketings and say what each means.ارسم الربطين في 'I saw the man with a telescope' بالأقواس، وقل ماذا يعني كل منهما.
Suppose ambiguity were solved. Would language understanding be easy? No, and there are six more reasons, each a different way real text refuses to behave like the tidy sentences of a grammar book. Take them one at a time, and for each one ask which NLP subproblem it defeats, because that subproblem is a research area with its own benchmarks.
لنفترض أن مشكلة الغموض قد حُلّت. هل يصبح فهم اللغة سهلًا؟ لا، فهناك ستة أسباب أخرى، كل منها طريقة مختلفة يرفض بها النص الحقيقي أن يتصرف مثل الجمل المرتّبة في كتب النحو. تناولها واحدًا تلو الآخر، واسأل عن كل منها أي مسألة فرعية في معالجة اللغات الطبيعية يُفشلها، لأن تلك المسألة الفرعية مجال بحثي له معاييره (benchmarks) الخاصة.
Non-standard textالنص غير القياسي
Guys plz d/l the lettr Ive written 2 Jeff Gaspin is perfectly readable to a human and almost useless to a model trained on edited prose. Five of its tokens are misspelt, abbreviated or numerals standing in for words. This is non-standard language, and it defeats normalisation: the step that is supposed to map surface forms to the vocabulary the model knows. For a KFUPM student the sharper version is diglossia. Farghaly and Shaalan describe Arabic as a language where Modern Standard Arabic is the formal written variety while everyday speech is Gulf, Egyptian or Levantine dialect. Text messages and social media carry that dialect into writing, and Darwish describes how it often arrives as Arabizi (Latin letters and digits standing in for Arabic sounds, as in 3ala for على), so a system trained on newswire MSA meets a different language on the phone.
الجملة Guys plz d/l the lettr Ive written 2 Jeff Gaspin مقروءة تمامًا للإنسان، لكنها شبه عديمة الفائدة لنموذج دُرّب على نصوص محرَّرة. خمس من وحداتها (tokens) مكتوبة بأخطاء إملائية أو مختصرة أو أرقام تقوم مقام كلمات. هذه هي اللغة غير القياسية (non-standard language)، وهي تُفشل التطبيع (normalisation): الخطوة التي يُفترض أن تحوّل الأشكال السطحية إلى المفردات التي يعرفها النموذج. وبالنسبة لطالب في KFUPM فالنسخة الأشد هي الازدواجية اللغوية (diglossia). يصف Farghaly و Shaalan العربية بأنها لغة تكون فيها الفصحى الحديثة (Modern Standard Arabic) هي الصيغة المكتوبة الرسمية، بينما الكلام اليومي باللهجة الخليجية أو المصرية أو الشامية. تحمل الرسائل النصية ووسائل التواصل الاجتماعي هذه اللهجة إلى الكتابة، ويصف Darwish كيف تصل غالبًا في صورة العربيزي (Arabizi) (حروف لاتينية وأرقام تقوم مقام الأصوات العربية، كما في 3ala بدل على)، فيلتقي النظام المدرَّب على فصحى الأخبار (newswire MSA) بلغة مختلفة على الهاتف.
Segmentationالتقطيع
The slide shows the New York-New Haven Railroad tokenized two ways. The naive split, on spaces alone, gives the | New | York-New | Haven | Railroad, gluing York to the wrong New. The right split, the | New York | - | New Haven | Railroad, needs to know that New York and New Haven are each one name. This is a Segmentation problem and it defeats Tokenization and named entity recognition together. Jurafsky and Martin note in their tokenization chapter that keeping a multiword expression such as New York as one token requires a multiword expression dictionary, so tokenization is tied to recognising names and to morphology. Arabic makes segmentation unavoidable rather than occasional: the preposition b (by, with) and the conjunction w (and) are clitics written attached to the following word, so وبالقلم is one orthographic word that a tokenizer must cut into w + b + al + qalam, four units, before anything else can run.
تعرض الشريحة the New York-New Haven Railroad مقطّعة بطريقتين. التقطيع الساذج، على المسافات وحدها، يعطي the | New | York-New | Haven | Railroad، فيلصق York بكلمة New الخاطئة. أما التقطيع الصحيح، the | New York | - | New Haven | Railroad، فيحتاج إلى معرفة أن New York وNew Haven كلٌّ منهما اسم واحد. هذه مشكلة تقطيع (segmentation)، وهي تُفشل التجزئة إلى وحدات (tokenization) والتعرّف على الكيانات المسمّاة (named entity recognition) معًا. ويشير Jurafsky و Martin في فصل التجزئة إلى أن إبقاء تعبير متعدد الكلمات مثل New York وحدةً واحدة يتطلب قاموسًا للتعابير متعددة الكلمات، فترتبط التجزئة بالتعرّف على الأسماء وبـعلم الصرف (morphology). والعربية تجعل التقطيع أمرًا لا مفر منه بدل أن يكون عارضًا: حرف الجر b (الباء: بـ، مع) وحرف العطف w (الواو) لواحق متصلة (clitics) تُكتب ملتصقة بالكلمة التالية، فتكون وبالقلم كلمة إملائية واحدة يجب على المُجزِّئ أن يقطعها إلى w + b + al + qalam، أربع وحدات، قبل أن يعمل أي شيء آخر.
Idiomsالتعابير الاصطلاحية
Dark horse, get cold feet, lose face, throw in the towel. An Idiom is a multiword expression whose meaning is not built from its parts: no towel is thrown, no feet get cold. This defeats compositional semantics, the assumption that the meaning of a phrase is assembled from the meanings of its words, and it wrecks machine translation that translates word by word. Arabic has its own stock: على عيني is literally "on my eye" and means "gladly, of course".
Dark horse، get cold feet، lose face، throw in the towel. التعبير الاصطلاحي (idiom) تعبير متعدد الكلمات لا يُبنى معناه من أجزائه: لا منشفة تُرمى، ولا أقدام تبرد. وهذا يُفشل علم الدلالة (semantics) التركيبي، أي افتراض أن معنى العبارة يُجمَّع من معاني كلماتها، ويحطّم الترجمة الآلية (machine translation) التي تترجم كلمةً كلمة. وللعربية مخزونها الخاص: على عيني حرفيًا "on my eye" ومعناها "بكل سرور، بالتأكيد".
Neologismsالكلمات المستحدثة
Unfriend, Retweet, Malware, Webinar. Each of these entered everyday use, or in the case of unfriend returned to it with a new sense, only when a product or a threat made it necessary. A Neologism defeats any system with a closed vocabulary, which treats it as an out-of-vocabulary token and learns nothing. Vocabulary is open: new words arrive faster than lexicons can be updated. This is the motivation for the subword tokenization of lecture 2, where byte-pair encoding lets a model build unfriend from smaller, frequent pieces (ideally un plus friend) without ever having seen the whole word. Arabic coins verbs from loanwords the same way: speakers say سيّف, "to save" a file, forcing an English root into an Arabic verb pattern.
Unfriend، Retweet، Malware، Webinar. دخلت كل واحدة من هذه الكلمات الاستعمال اليومي، أو عادت إليه بمعنى جديد كما في حالة unfriend، فقط حين جعلها منتج ما أو تهديد ما ضرورية. الكلمة المستحدثة (neologism) تُفشل أي نظام ذي مفردات مغلقة، إذ يعاملها وحدةً خارج المفردات (out-of-vocabulary) ولا يتعلم منها شيئًا. المفردات مفتوحة: تصل الكلمات الجديدة أسرع مما يمكن تحديث المعاجم. وهذا هو الدافع وراء التجزئة إلى وحدات جزئية (subword tokenization) في المحاضرة 2، حيث يتيح ترميز أزواج البايتات (byte-pair encoding) للنموذج أن يبني unfriend من قطع أصغر شائعة (في الحالة المثالية un زائد friend) دون أن يرى الكلمة كاملة قط. والعربية تشتق أفعالًا من الكلمات المقترضة بالطريقة نفسها: يقول المتحدثون سيّف، أي حفظ الملف ("to save")، فيُدخلون جذرًا إنجليزيًا قسرًا في وزن فعل عربي.
World knowledgeمعرفة العالم
Mary and Sue are sisters. Mary and Sue are mothers. Same shape, same syntax, same plural predicate. Yet the first means sisters of each other and the second cannot mean mothers of each other. Nothing in the sentence tells you that; you know it because you know how sisterhood and motherhood work. This is world knowledge, and the subproblem it defeats is commonsense reasoning. It is the same in every language, which is why there is no Arabic column to add.
Mary and Sue are sisters. Mary and Sue are mothers. الشكل نفسه، والتركيب نفسه، والمسند الجمعي نفسه. ومع ذلك تعني الأولى أنهما أختان إحداهما للأخرى، ولا يمكن أن تعني الثانية أنهما أمّان إحداهما للأخرى. لا شيء في الجملة يخبرك بذلك؛ أنت تعرفه لأنك تعرف كيف تعمل الأخوّة والأمومة. هذه هي معرفة العالم (world knowledge)، والمسألة الفرعية التي تُفشلها هي الاستدلال بالحس السليم (commonsense reasoning). وهي واحدة في كل لغة، ولهذا لا يوجد عمود عربي يُضاف هنا.
Tricky entity namesأسماء الكيانات المخادعة
Where is A Bug's Life playing, Let It Be was recorded, a mutation on the for gene. A Named entity is supposed to be a proper name, but these names are made of ordinary words: an article, a pronoun, a preposition. Named entity recognition has to decide that for is a gene and Let It Be is a record without any lexical clue. In English the capital letters help a little. Arabic has no capital letters at all, so every person, place and organisation name looks like a common word. Farghaly and Shaalan list the missing capital letters among the central challenges for Arabic named entity recognition.
Where is A Bug's Life playing، Let It Be was recorded، a mutation on the for gene. يُفترض أن يكون الكيان المسمّى (named entity) اسم علم، لكن هذه الأسماء مكوّنة من كلمات عادية: أداة تعريف، وضمير، وحرف جر. على نظام التعرّف على الكيانات المسمّاة أن يقرر أن for جين وأن Let It Be تسجيل موسيقي دون أي قرينة معجمية. في الإنجليزية تساعد الأحرف الكبيرة قليلًا. أما العربية فليس فيها أحرف كبيرة أصلًا، فيبدو كل اسم لشخص أو مكان أو منظمة ككلمة عادية. ويُدرج Farghaly و Shaalan غياب الأحرف الكبيرة ضمن التحديات المركزية للتعرّف على الكيانات المسمّاة في العربية.
| Difficultyالصعوبة | Slide exampleمثال الشريحة | What it defeatsما الذي تُفشله | Arabic counterpartالنظير العربي |
|---|---|---|---|
| Non-standard textالنص غير القياسي | Guys plz d/l the lettr Ive written 2 Jeff GaspinGuys plz d/l the lettr Ive written 2 Jeff Gaspin | Normalisation; models trained on edited textالتطبيع (normalisation)؛ والنماذج المدرَّبة على نصوص محرَّرة | Gulf dialect and Arabizi versus MSAاللهجة الخليجية والعربيزي (Arabizi) مقابل الفصحى الحديثة (MSA) |
| Segmentationالتقطيع | the New York-New Haven Railroadthe New York-New Haven Railroad | Tokenization and named entity recognitionالتجزئة إلى وحدات (tokenization) والتعرّف على الكيانات المسمّاة (NER) | Clitics: w + b + al + qalam written as one wordاللواحق المتصلة (clitics): w + b + al + qalam تُكتب كلمة واحدة |
| Idiomsالتعابير الاصطلاحية | dark horse, get cold feet, lose face, throw in the toweldark horse, get cold feet, lose face, throw in the towel | Compositional semantics, translationعلم الدلالة التركيبي (compositional semantics)، والترجمة | 'on my eye' meaning gladly«على عيني» (on my eye) بمعنى «بكل سرور» |
| Neologismsالكلمات المستحدثة | unfriend, Retweet, Malware, Webinarunfriend, Retweet, Malware, Webinar | Closed vocabularies (out-of-vocabulary words)المفردات المغلقة (كلمات خارج المفردات، out-of-vocabulary) | Loanword verbs such as 'to save' a fileأفعال مشتقة من كلمات مقترضة مثل «سيّف» الملف (to save) |
| World knowledgeمعرفة العالم | Mary and Sue are sisters / are mothersMary and Sue are sisters / are mothers | Commonsense reasoningالاستدلال بالحس السليم (commonsense reasoning) | Same problem in every languageالمشكلة نفسها في كل لغة |
| Tricky entity namesأسماء الكيانات المخادعة | A Bug's Life, Let It Be, the for geneA Bug's Life, Let It Be, the for gene | Named entity recognitionالتعرّف على الكيانات المسمّاة (named entity recognition) | No capital letters at all, so every name looks commonلا توجد أحرف كبيرة إطلاقًا، فيبدو كل اسم كلمة عادية |
The lecture closes the list with "But that's what makes it fun!" and for a PhD student that line is literal. Each card is a research community: text normalisation, tokenization and segmentation, multiword expressions, open-vocabulary modelling, commonsense reasoning and named entity recognition all have their own shared tasks and leaderboards, and Arabic versions of most of them are still open.
تختم المحاضرة القائمة بعبارة "But that's what makes it fun!" (لكن هذا ما يجعلها ممتعة)، وبالنسبة لطالب دكتوراه فهذه العبارة حرفية. كل بطاقة مجتمع بحثي قائم: تطبيع النصوص، والتجزئة والتقطيع، والتعابير متعددة الكلمات، ونمذجة المفردات المفتوحة، والاستدلال بالحس السليم، والتعرّف على الكيانات المسمّاة، لكل منها مهامه المشتركة (shared tasks) ولوحات تصنيفه (leaderboards)، ونسخها العربية في معظمها ما زالت مفتوحة.
Quick checkاختبار سريع
Why does a bigger dictionary not solve idioms such as 'throw in the towel'?لماذا لا يحل قاموس أكبر مشكلة التعابير الاصطلاحية مثل 'throw in the towel'؟
Recall
List the six sources of difficulty on slide 23 with one example each.عدّد مصادر الصعوبة الستة في الشريحة 23 مع مثال واحد لكل منها.
Go back to Mary and Sue are mothers and ask what a system would need to read it correctly. It needs the syntax of a plural predicate, which is knowledge of language. It needs to know that motherhood is not reciprocal between two women, which is knowledge about the world. And it needs some procedure that brings the two together on this sentence, a way to combine knowledge sources. Those are exactly the three tools the lecture says progress requires.
عُد إلى Mary and Sue are mothers واسأل ماذا يحتاج النظام ليقرأها قراءة صحيحة. يحتاج إلى تركيب المسند الجمعي، وهذه معرفة باللغة (knowledge of language). ويحتاج إلى أن يعرف أن الأمومة ليست علاقة متبادلة بين امرأتين، وهذه معرفة بالعالم (knowledge about the world). ويحتاج إلى إجراء ما يجمع الاثنين على هذه الجملة، أي طريقة للجمع بين مصادر المعرفة. وهذه بالضبط الأدوات الثلاث التي تقول المحاضرة إن التقدّم يتطلبها.
The third tool is the interesting one, because it is where the four approaches of slide 15 come from. Each approach is one answer to how knowledge sources get combined. Rule-based NLP encodes linguistic knowledge by hand and combines it by the order in which rules fire. Machine learning based NLP learns the linguistic knowledge from annotated data and lets a classifier weigh it. End-to-end deep learning learns everything, including whatever world knowledge the text happens to contain, from raw input inside one network. A hybrid approach mixes them, typically rules where knowledge is crisp and models where it is statistical.
الأداة الثالثة هي المثيرة للاهتمام، لأنها مصدر المناهج الأربعة في الشريحة 15. كل منهج هو إجابة واحدة عن سؤال: كيف تُجمع مصادر المعرفة؟ المعالجة القائمة على القواعد (Rule-based NLP) ترمّز المعرفة اللغوية يدويًا وتجمعها بترتيب تنفيذ القواعد. المعالجة القائمة على تعلّم الآلة (Machine learning based NLP) تتعلم المعرفة اللغوية من بيانات موسومة وتترك لمصنِّف (classifier) أن يوازن بينها. التعلم العميق من الطرف إلى الطرف (End-to-end deep learning) يتعلم كل شيء، بما في ذلك أي معرفة بالعالم يتضمنها النص، من المُدخَل الخام داخل شبكة واحدة. أما المنهج الهجين (hybrid approach) فيمزج بينها، وعادةً بقواعد حيث تكون المعرفة واضحة الحدود ونماذج حيث تكون إحصائية.
| Approachالمنهج | Knowledge of language fromمصدر المعرفة باللغة | World knowledge fromمصدر المعرفة بالعالم | How sources are combinedطريقة الجمع بين المصادر |
|---|---|---|---|
| Rule-basedقائم على القواعد (rule-based) | Hand-written grammars and lexiconsقواعد نحوية ومعاجم مكتوبة يدويًا | Hand-written facts and ontologiesحقائق وأنطولوجيات مكتوبة يدويًا | The programmer decides the order of rulesالمبرمج يحدد ترتيب القواعد |
| Machine learningتعلّم الآلة (machine learning) | Learned from annotated corporaتُتعلَّم من مدوّنات موسومة | Whatever is encoded in featuresما تُرمّزه السمات (features) أيًّا كان | A classifier weighs the featuresمصنِّف (classifier) يوازن بين السمات |
| End-to-end deep learningالتعلم العميق من الطرف إلى الطرف (end-to-end) | Learned from raw textتُتعلَّم من النص الخام | Absorbed implicitly from huge corporaتُمتص ضمنيًا من مدوّنات ضخمة | One network mixes everythingشبكة واحدة تمزج كل شيء |
| Hybridهجين (hybrid) | Rules plus learned componentsقواعد مع مكوّنات متعلَّمة | Rules, knowledge bases, learned componentsقواعد، وقواعد معرفة، ومكوّنات متعلَّمة | A pipeline or a voting schemeسلسلة معالجة (pipeline) أو نظام تصويت |
The second half of slide 24 says where the models, algorithms and theories come from: computer science, mathematics and linguistics. Slide 5 drew NLP where artificial intelligence, computer science and linguistics meet; slide 24 keeps computer science and linguistics but puts mathematics where artificial intelligence was. Jurafsky and Martin open their overview of the field with the same sentence, that the models are all drawn from the standard toolkits of computer science, mathematics and linguistics. Computer science supplies state space search, classifiers and dynamic programming. Mathematics supplies probability and linear algebra. Linguistics supplies the levels of part 3 and the categories, such as noun phrase and prepositional phrase, that the algorithms operate on.
يذكر النصف الثاني من الشريحة 24 من أين تأتي النماذج والخوارزميات والنظريات: علوم الحاسب، والرياضيات، واللسانيات. رسمت الشريحة 5 معالجة اللغات الطبيعية في نقطة التقاء الذكاء الاصطناعي وعلوم الحاسب واللسانيات؛ أما الشريحة 24 فتُبقي علوم الحاسب واللسانيات لكنها تضع الرياضيات مكان الذكاء الاصطناعي. ويفتتح Jurafsky و Martin نظرتهما العامة إلى المجال بالجملة نفسها: إن النماذج كلها مستمدة من الأدوات المعتادة لعلوم الحاسب والرياضيات واللسانيات. تقدّم علوم الحاسب البحث في فضاء الحالات (state space search)، والمصنِّفات (classifiers)، والبرمجة الديناميكية (dynamic programming). وتقدّم الرياضيات الاحتمالات والجبر الخطي. وتقدّم اللسانيات مستويات الجزء 3 والفئات، مثل المركب الاسمي وشبه الجملة الجارّة، التي تعمل عليها الخوارزميات.
Where the computer science tools appear later in the courseأين تظهر أدوات علوم الحاسب لاحقًا في المقرر
- Dynamic programmingالبرمجة الديناميكية
- Minimum edit distance (lecture 2), Viterbi decoding for hidden Markov modelsأقل مسافة تحرير (minimum edit distance، المحاضرة 2)، وفك الترميز بخوارزمية Viterbi لنماذج ماركوف المخفية (hidden Markov models)
- Classifiersالمصنِّفات
- Naive Bayes and logistic regression for text classificationNaive Bayes والانحدار اللوجستي (logistic regression) لتصنيف النصوص
- State space searchالبحث في فضاء الحالات
- Constituency and dependency parsing, decoding in translationالتحليل النحوي للمكوّنات والتبعية (constituency and dependency parsing)، وفك الترميز في الترجمة
Quick checkاختبار سريع
Which of the slide-24 tools tells you that 'Mary and Sue are mothers' does not mean mothers of each other?أي أداة من أدوات الشريحة 24 تخبرك أن 'Mary and Sue are mothers' لا تعني أن كل واحدة منهما أمٌّ للأخرى؟
The textbook behind the slidesالكتاب المرجعي وراء الشرائح
The lecture credits its material mainly to Jurafsky and Martin, Speech and Language Processing. That is right; the duck sentence, the toolkit sentence and the whole shape of this lecture come from its first chapter. The edition details on the slide are not right.
تنسب المحاضرة مادتها أساسًا إلى Jurafsky و Martin، Speech and Language Processing. وهذا صحيح؛ فجملة البطة، وجملة الأدوات، والشكل العام لهذه المحاضرة كلها مأخوذة من الفصل الأول للكتاب. أما تفاصيل الطبعة المذكورة في الشريحة فليست صحيحة.
Recall
Name the three tools on slide 24 and the three disciplines the models are drawn from, then say which of the four approaches of slide 15 learns its knowledge of language from raw text.سمِّ الأدوات الثلاث في الشريحة 24 والتخصصات الثلاثة التي تُستمد منها النماذج، ثم قل أي المناهج الأربعة في الشريحة 15 يتعلم معرفته باللغة من النص الخام.
Recapالخلاصة
If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا
- Ambiguity lives at every level: part of speech (duck, her), word sense (make), syntax (argument structure, PP attachment) and, in speech, phonetics (eye, maid).الغموض موجود في كل مستوى: نوع الكلمة (duck و her)، ومعنى الكلمة (make)، والتركيب النحوي (بنية مكمّلات الفعل وربط شبه الجملة الجارّة)، وفي الكلام المنطوق الصوتيات (eye و maid).
- Jurafsky and Martin: ordinary sentences carry many grammatical parses that humans rarely notice, and most or all NLP tasks are ambiguity resolution at some level.يقول Jurafsky و Martin إن الجمل العادية تحمل تحليلات نحوية كثيرة نادرًا ما ينتبه لها البشر، وإن معظم مهام معالجة اللغات الطبيعية أو كلها هي حلٌّ للغموض في مستوى ما.
- The same prepositional phrase can attach to the noun phrase or to the verb phrase. Both parses are grammatical, so grammar alone cannot choose.يمكن أن ترتبط شبه الجملة الجارّة نفسها بالمركب الاسمي أو بالمركب الفعلي. التحليلان كلاهما صحيحان نحويًا، لذلك لا يستطيع النحو وحده أن يختار بينهما.
- A crash blossom is a real headline whose compressed syntax admits a garden-path reading. The name comes from 'Violinist Linked to JAL Crash Blossoms' (2009).الـ crash blossom عنوان صحفي حقيقي يسمح تركيبه المضغوط بقراءة مضلِّلة من نوع garden path. جاء الاسم من العنوان 'Violinist Linked to JAL Crash Blossoms' سنة 2009.
- Beyond ambiguity: non-standard text, segmentation, idioms, neologisms, world knowledge and tricky entity names, each defeating a named NLP subproblem.غير الغموض: النص غير القياسي، والتقطيع، والتعابير الاصطلاحية، والكلمات المستحدثة، ومعرفة العالم، وأسماء الكيانات المخادعة، وكل منها يُفشل مسألة فرعية محددة في معالجة اللغات الطبيعية.
- Arabic adds diglossia between MSA and dialect, clitics glued onto words, and no capitalisation cue for names.تضيف العربية الازدواجية اللغوية (diglossia) بين الفصحى الحديثة (MSA) واللهجة، واللواحق المتصلة (clitics) الملتصقة بالكلمات، وغياب الأحرف الكبيرة التي تدل على الأسماء.
- Progress needs knowledge of language, knowledge about the world and a way to combine them, with tools drawn from computer science, mathematics and linguistics.يحتاج التقدّم إلى معرفة باللغة، ومعرفة بالعالم، وطريقة للجمع بينهما، مع أدوات مستمدة من علوم الحاسب والرياضيات واللسانيات.
- Slide 25's 'Prentice-Hall, 2020' is wrong. The Prentice Hall editions are 2000 and 2009; the 3rd edition is a free online draft, most recently August 2026.عبارة 'Prentice-Hall, 2020' في الشريحة 25 خاطئة. طبعتا Prentice Hall هما 2000 و 2009، أما الطبعة الثالثة فهي مسودة مجانية على الإنترنت، أحدث إصداراتها في أغسطس 2026.
Sourcesالمصادر
- Speech and Language Processing, 1st and 2nd editionsBookPrentice Hall, 2000 and 2009 (Jurafsky and Martin)Authors' book page. Chapter 1, sections 1.2 (the five readings of 'I made her duck' and the levels of ambiguity) and 1.3 (toolkits of computer science, mathematics and linguistics)صفحة الكتاب لدى المؤلفَين. الفصل 1، القسمان 1.2 (القراءات الخمس لجملة 'I made her duck' ومستويات الغموض) و 1.3 (أدوات علوم الحاسب والرياضيات واللسانيات)(opens in a new tab)(يفتح في تبويب جديد)
- Review of Speech and Language Processing, second editionPaperComputational Linguistics 35(3), 2009Confirms Pearson Prentice Hall, 2009, ISBN 978-0-13-187321-6يؤكد أن الناشر Pearson Prentice Hall سنة 2009، ورقم ISBN 978-0-13-187321-6(opens in a new tab)(يفتح في تبويب جديد)
- Speech and Language Processing, 3rd edition draftBookStanford University (Jurafsky and Martin)Free online draft, release of 19 August 2026; recommended primary sourceمسودة مجانية على الإنترنت، إصدار 19 August 2026؛ المصدر الأساسي الموصى به(opens in a new tab)(يفتح في تبويب جديد)
- Chapter 19: Context-Free Grammars and Constituency ParsingBookSpeech and Language Processing, 3rd edition draftStructural ambiguity, attachment and coordination ambiguity, the elephant in my pajamasالغموض البنيوي، وغموض الربط وغموض العطف، ومثال the elephant in my pajamas(opens in a new tab)(يفتح في تبويب جديد)
- Chapter 2: Words and TokensBookSpeech and Language Processing, 3rd edition draftMultiword expressions such as New York, Arabic clitics b and w, minimum edit distanceالتعابير متعددة الكلمات مثل New York، واللواحق المتصلة العربية b و w، وأقل مسافة تحرير(opens in a new tab)(يفتح في تبويب جديد)
- Crash blossomsArticleLanguage Log (Ben Zimmer), 26 August 2009First public account of the term and its Testy Copy Editors origin, with the Juvenile Court headlineأول عرض علني للمصطلح ولأصله في منتدى Testy Copy Editors، مع عنوان Juvenile Court(opens in a new tab)(يفتح في تبويب جديد)
- Defining crash blossomArticleLanguage Log (Geoffrey Pullum)Garden-path definition (Waigl's characterisation) and the debate over what counts as a crash blossomتعريف القراءة المضلِّلة garden path (بحسب وصف Waigl) والنقاش حول ما يُعدّ crash blossom(opens in a new tab)(يفتح في تبويب جديد)
- Crash blossomArticleWordorigins.orgJapan Today, August 2009, Diana Yukawa; dates of the Language Log and New York Times piecesJapan Today في August 2009، و Diana Yukawa؛ وتواريخ مقالتي Language Log و New York Times(opens in a new tab)(يفتح في تبويب جديد)
- On Language: Crash BlossomsArticleThe New York Times Magazine (Ben Zimmer), 31 January 2010The column that popularised the term; date taken from the Wordorigins entryالعمود الذي نشر المصطلح على نطاق واسع؛ التاريخ مأخوذ من مدخل Wordorigins(opens in a new tab)(يفتح في تبويب جديد)
- Stanford NLP course slides (Jurafsky and Manning, 2012)DocsStanford UniversityIntroductory deck with the six headlines, the six difficulty cards and the knowledge listالعرض التمهيدي الذي يحوي العناوين الستة وبطاقات الصعوبة الست وقائمة المعرفة(opens in a new tab)(يفتح في تبويب جديد)
- Arabic Natural Language Processing: Challenges and SolutionsPaperACM Transactions on Asian Language Information Processing 8(4), 2009 (Farghaly and Shaalan)Diglossia, clitic attachment, absence of capitalisationالازدواجية اللغوية، واتصال اللواحق بالكلمات، وغياب الأحرف الكبيرة(opens in a new tab)(يفتح في تبويب جديد)
- Arabizi Detection and Conversion to ArabicPaperEMNLP 2014 Workshop on Arabic Natural Language Processing (Kareem Darwish)Arabizi in social media text: Latin letters and digits standing in for Arabic soundsالعربيزي في نصوص وسائل التواصل الاجتماعي: حروف لاتينية وأرقام تقوم مقام الأصوات العربية(opens in a new tab)(يفتح في تبويب جديد)