ICS 582Lecture 01المحاضرة 01Referenceالمرجع
Reference sheetالورقة المرجعية
Introduction to natural language processing compressed onto one page: the definitions, formulas and numbers to have in your head before a quiz or exam.محاضرة «مقدمة في معالجة اللغات الطبيعية (NLP)» مضغوطة في صفحة واحدة: التعريفات والمعادلات والأرقام التي يجب أن تكون حاضرة في ذهنك قبل الاختبار القصير أو الامتحان.
Definition, goals and namesالتعريف والأهداف والأسماء
Define NLP by its goal, not its tool. The definition has survived two complete changes of technique. Part 01: What is NLP
عرّف NLP بغايتها لا بأداتها. لقد صمد هذا التعريف أمام تغيّرين كاملين في التقنية. الجزء 01: ما هي NLP
Slide 4, verbatim structureالشريحة 4، بنيتها كما وردت
- NLP (slide 4)NLP (الشريحة 4)
- A branch of artificial intelligence concerned with interactions between computers and human language.فرع من الذكاء الاصطناعي يُعنى بالتفاعل بين الحواسيب واللغة البشرية.
- Three goals, in slide orderثلاثة أهداف، بترتيب الشريحة
- Enabling human-machine communication; improving human-human communication; or simply doing useful processing of text or speech.تمكين التواصل بين الإنسان والآلة؛ وتحسين التواصل بين الإنسان والإنسان؛ أو ببساطة إجراء معالجة مفيدة للنص أو الكلام.
- Three other names, in slide orderثلاثة أسماء أخرى، بترتيب الشريحة
- Computational linguistics (linguistics side, the ACL); speech and language processing (speech is in scope, the textbook title); human language technology (engineering side, systems that ship).اللسانيات الحاسوبية (computational linguistics، الجانب اللساني، جمعية ACL)؛ ومعالجة الكلام واللغة (speech and language processing، الكلام المنطوق داخل نطاق المجال، وهو عنوان الكتاب المقرر)؛ وتقنية اللغة البشرية (human language technology، الجانب الهندسي، أنظمة تُطرح للاستخدام).
- Newest labelأحدث تسمية
- Language modeling, which the 3rd edition calls the most recent name of the field, not a replacement for it.نمذجة اللغة (language modeling)، وتسميها الطبعة الثالثة أحدث اسم للمجال، لا بديلًا عنه.
| Nameالاسم | Facetالوجه | What it stressesما يركز عليه | Anchorالمرجع |
|---|---|---|---|
| Computational linguisticsاللسانيات الحاسوبية (Computational linguistics) | Linguisticsاللسانيات | Language as object of study, computation as methodاللغة موضوعًا للدراسة، والحوسبة منهجًا | ACL, founded 1962 as AMTCL, renamed 1968جمعية ACL، تأسست عام 1962 باسم AMTCL، وتغيّر اسمها عام 1968 |
| Speech and language processingمعالجة الكلام واللغة (Speech and language processing) | Speechالكلام | Spoken language belongs to the fieldاللغة المنطوقة جزء من المجال | Title of Jurafsky and Martinعنوان كتاب Jurafsky and Martin |
| Human language technologyتقنية اللغة البشرية (Human language technology) | Engineeringالهندسة | Deployable systems, not theoryأنظمة قابلة للنشر، لا نظرية | Search engines, assistants, filtersمحركات البحث، والمساعدات، والمرشِّحات |
The Venn and the AI subfieldsمخطط Venn وفروع الذكاء الاصطناعي
Slide 5: NLP at the intersection of linguistics, computer science and AI, with an ellipsis for mathematics. Slide 6: five AI subfields, deep learning indented under machine learning. Part 01: What is NLP
الشريحة 5: تقع NLP عند تقاطع اللسانيات وعلوم الحاسب والذكاء الاصطناعي، مع علامة حذف (...) تشير إلى الرياضيات. الشريحة 6: خمسة فروع للذكاء الاصطناعي، والتعلم العميق (deep learning) مُزاح تحت تعلم الآلة (machine learning). الجزء 01: ما هي NLP
| Disciplineالتخصص | Contributionالإسهام | Exampleمثال |
|---|---|---|
| Linguisticsاللسانيات | The object: levels of description, grammar, the idea of ambiguityالموضوع: مستويات الوصف، والقواعد النحوية، وفكرة الغموض | What counts as a word; five readings of a sentenceما الذي يُعد كلمة؛ والقراءات الخمس لجملة واحدة |
| Computer scienceعلوم الحاسب | Algorithms and data structures: search, dynamic programming, classifiersالخوارزميات وبنى البيانات: البحث، والبرمجة الديناميكية، والمصنِّفات | Viterbi, a vocabulary hash table, a spam classifierخوارزمية Viterbi، وجدول تجزئة (hash table) للمفردات، ومصنِّف للرسائل المزعجة (spam) |
| Artificial intelligenceالذكاء الاصطناعي | Learning from data, representing knowledge, choosing the most probable readingالتعلم من البيانات، وتمثيل المعرفة، واختيار القراءة الأكثر احتمالًا | Weights trained from reported mailأوزان مدرَّبة من الرسائل المُبلَّغ عنها |
| The ellipsisعلامة الحذف (...) | Mathematics (probability and statistics), plus signal processing and psychologyالرياضيات (الاحتمالات والإحصاء)، إضافة إلى معالجة الإشارات وعلم النفس | Linear algebra, vector spaces, acousticsالجبر الخطي، والفضاءات المتجهية، والصوتيات |
| Subfieldالفرع | Studiesيدرس | Touches NLP throughيلامس NLP عبر |
|---|---|---|
| Natural language processingمعالجة اللغات الطبيعية (NLP) | Human languageاللغة البشرية | The subject of this courseموضوع هذا المقرر |
| Knowledge representation and deductionتمثيل المعرفة والاستنتاج | Storing facts and drawing conclusionsتخزين الحقائق واستخلاص النتائج | Question answering over a knowledge graph (Taj Mahal: monument or musician)الإجابة عن الأسئلة فوق رسم معرفي (Taj Mahal: معلم أثري أم موسيقي) |
| Machine learning (deep learning inside it)تعلم الآلة (ومنه التعلم العميق) | Learning behaviour from dataتعلم السلوك من البيانات | Supplies almost every modern NLP modelيوفّر تقريبًا كل نموذج حديث في NLP |
| Computer visionالرؤية الحاسوبية | Images and videoالصور والفيديو | Image captioning, OCRتوليد أوصاف الصور (image captioning)، والتعرف الضوئي على الحروف (OCR) |
| Roboticsالروبوتات | Perceiving and acting physicallyالإدراك والفعل في العالم المادي | Following natural language instructions (SayCan)اتباع تعليمات مكتوبة باللغة الطبيعية (SayCan) |
| Companyالشركة | Productالمنتج | Goal servedالهدف الذي يخدمه |
|---|---|---|
| GoogleGoogle | Search (BERT), Translateالبحث (BERT)، وTranslate | Human-machine, human-humanالتواصل بين الإنسان والآلة، وبين الإنسان والإنسان |
| AppleApple | SiriSiri | Human-machineالتواصل بين الإنسان والآلة |
| MicrosoftMicrosoft | TranslatorTranslator | Human-humanالتواصل بين الإنسان والإنسان |
| Twitter (now X)Twitter (الآن X) | Feed ranking and moderationترتيب الخلاصة والإشراف على المحتوى | Useful processingمعالجة مفيدة |
| AmazonAmazon | AlexaAlexa | Human-machineالتواصل بين الإنسان والآلة |
| Facebook (Meta)Facebook (Meta) | NLLB translationترجمة NLLB | Human-humanالتواصل بين الإنسان والإنسان |
| GrammarlyGrammarly | Writing assistantمساعد كتابة | Useful processingمعالجة مفيدة |
Machine translationالترجمة الآلية (MT)
Two modes, sorted by who owns the final text. Camera and conversation translation wrap MT inside OCR, speech recognition and speech synthesis. Part 02: Applications
نمطان، مصنفان بحسب من يملك النص النهائي. ترجمة الكاميرا وترجمة المحادثة تغلّفان MT داخل التعرف الضوئي على الحروف (OCR) والتعرف على الكلام وتوليد الكلام. الجزء 02: التطبيقات
| Modeالنمط | Who produces the final textمن ينتج النص النهائي | Typical useالاستخدام المعتاد | Slide exampleمثال الشريحة |
|---|---|---|---|
| Fully automaticآلي بالكامل | The systemالنظام | Information access, gistingالوصول إلى المعلومات، وفهم الفكرة العامة (gisting) | Google Translate rendering the NLP definition in ArabicGoogle Translate يترجم تعريف NLP إلى العربية |
| Assisted, post-editingبمساعدة، تحرير لاحق (post-editing) | The human, fixing a machine draftالإنسان، بتصحيح مسودة الآلة | Localisation, documentationالتوطين (localisation)، والتوثيق | Not pictured; the common industrial workflowغير معروض في الشريحة؛ وهو سير العمل الصناعي الشائع |
| Assisted, interactive predictionبمساعدة، تنبؤ تفاعلي (interactive prediction) | The human, accepting or amending predicted suffixesالإنسان، بقبول اللواحق المتنبأ بها أو تعديلها | Professional news, legal, medical textالنصوص الإخبارية والقانونية والطبية الاحترافية | The ranked list under the typed word lebaneseالقائمة المرتبة تحت الكلمة المكتوبة lebanese |
Interactive CAT (Barrachina et al., 2009): the human validates a prefix, the system proposes the best or n-best suffix. The list under lebanese is an n-best set; suffered and exposed are two readings of the Arabic verb تعرض.
الترجمة التفاعلية بمساعدة الحاسب (Interactive CAT، Barrachina et al., 2009): يعتمد الإنسان بادئة (prefix)، ويقترح النظام أفضل لاحقة (suffix) أو أفضل n لواحق (n-best). القائمة تحت lebanese هي مجموعة n-best؛ وsuffered وexposed قراءتان للفعل العربي تعرض.
| Productالمنتج | Chainالسلسلة | Failure it inheritsالإخفاق الذي يرثه |
|---|---|---|
| Camera translationترجمة الكاميرا | OCR, then MT, then render the overlayOCR، ثم MT، ثم رسم الترجمة فوق الصورة | A wrong letter becomes a wrong wordحرف خاطئ يصبح كلمة خاطئة |
| Conversation modeوضع المحادثة | Speech recognition, then MT, then speech synthesisالتعرف على الكلام، ثم MT، ثم توليد الكلام | A misheard word is translated faithfullyكلمة أسيء سماعها تُترجم بأمانة |
| AI OverviewAI Overview | Retrieve, then prompt, then generate, then citeالاسترجاع، ثم بناء الموجّه (prompt)، ثم التوليد، ثم الإحالة إلى المصادر | Fluent text that is not faithful to the sourcesنص سلس لكنه غير وفي للمصادر |
| Aspect sentimentالمشاعر على مستوى الجوانب | Aspect extraction, then polarity classificationاستخراج الجانب، ثم تصنيف القطبية | Right polarity on the wrong targetقطبية صحيحة على هدف خاطئ |
Slide 8 counts (historical)أعداد الشريحة 8 (تاريخية)
- Google Translate, typingالكتابة في Google Translate
- 103 languages103 لغة
- Google Translate, offlineGoogle Translate دون اتصال
- 52 languages52 لغة
- Google Translate, instant cameraالكاميرا الفورية في Google Translate
- 30 languages30 لغة
- Google Translate, camera photosصور الكاميرا في Google Translate
- 37 languages37 لغة
- Google Translate, conversationالمحادثة في Google Translate
- 32 languages32 لغة
- Skype Translator, voiceالصوت في Skype Translator
- 7 languages7 لغات
- Skype Translator, chatالدردشة في Skype Translator
- more than 50 languagesأكثر من 50 لغة
- Todayاليوم
- Google added 110 languages on 27 June 2024 (about 243 total, help pages say over 200). Skype retired 5 May 2025.أضافت Google عدد 110 لغات في 27 يونيو 2024 (نحو 243 لغة إجمالًا، وصفحات المساعدة تقول أكثر من 200). وأُوقف Skype في 5 مايو 2025.
Question answering: extract or generateالإجابة عن الأسئلة: استخراج أم توليد
Slide 9 is a knowledge graph card. Slide 10 is retrieval-augmented generation on the same query, several years apart. Part 02: Applications
الشريحة 9 بطاقة من رسم معرفي (knowledge graph). والشريحة 10 توليد معزز بالاسترجاع (retrieval-augmented generation) على الاستعلام نفسه، بفارق عدة سنوات بينهما. الجزء 02: التطبيقات
How the answer box answers 'how heavy is our planet'كيف يجيب مربع الإجابة عن 'how heavy is our planet'
- 1. Word sense disambiguation1. توضيح معنى الكلمة
- "heavy" is read as mass, not the sense in heavy rain or heavy traffic.تُقرأ "heavy" بمعنى الكتلة، لا بالمعنى الذي في heavy rain أو heavy traffic.
- 2. Entity resolution2. تحديد الكيان
- "our planet" is mapped to the knowledge graph node Earth (things, not strings).تُربط عبارة "our planet" بالعقدة Earth في الرسم المعرفي (أشياء لا سلاسل نصية، things, not strings).
- 3. Fact retrieval3. استرجاع الحقيقة
- (Earth, mass) returns 5.972 × 10^24 kg, a value information extraction once pulled from text.الزوج (Earth, mass) يعيد 5.972 × 10^24 kg، وهي قيمة استخرجها استخراج المعلومات (information extraction) من النص في وقت ما.
| Propertyالخاصية | Answer box (slide 9)مربع الإجابة (الشريحة 9) | AI Overview (slide 10)AI Overview (الشريحة 10) |
|---|---|---|
| Outputالمخرج | One field, rendered as a cardحقل واحد يُعرض على شكل بطاقة | A paragraph with headings and citationsفقرة بعناوين وإحالات إلى المصادر |
| Sourceالمصدر | A knowledge graph entryمُدخل في رسم معرفي | Retrieved pages fed to an LLMصفحات مسترجعة تُغذّى إلى نموذج لغوي كبير (LLM) |
| Core stepsالخطوات الأساسية | Sense disambiguation, entity resolution, lookupتوضيح المعنى، وتحديد الكيان، ثم البحث | Retrieval, prompt construction, generationالاسترجاع، وبناء الموجّه، والتوليد |
| Provenanceمصدر المعلومة (provenance) | Implicit, the graph itselfضمني، هو الرسم نفسه | Explicit citation chipsشارات إحالة صريحة |
| Main failureالإخفاق الرئيسي | A stale or missing factحقيقة قديمة أو مفقودة | Fluent but unfaithful text (hallucination)نص سلس لكنه غير وفي (هلوسة، hallucination) |
| Cost per queryالتكلفة لكل استعلام | A lookupعملية بحث واحدة | A large model inferenceاستدلال بنموذج كبير |
| Planetالكوكب | Slide valueقيمة الشريحة | Earth massesبكتل الأرض | NASA valueقيمة NASA |
|---|---|---|---|
| Earthالأرض | 5.972 × 10^24 kg5.972 × 10^24 kg | 11 | 5.9722 × 10^24 kg5.9722 × 10^24 kg |
| Marsالمريخ | 6.39 × 10^23 kg6.39 × 10^23 kg | 0.1070.107 | 6.4169 × 10^23 kg6.4169 × 10^23 kg |
| Venusالزهرة | 4.867 × 10^24 kg4.867 × 10^24 kg | 0.8150.815 | 4.8673 × 10^24 kg4.8673 × 10^24 kg |
| Jupiterالمشتري | 1.898 × 10^27 kg1.898 × 10^27 kg | 317.8317.8 | 1.89813 × 10^27 kg1.89813 × 10^27 kg |
Ratios from the slide's own numbers: 6.39 / 59.72 = 0.107, 4.867 / 5.972 = 0.815, 1898 / 5.972 = 317.8. A hallucination is a response not faithful to the facts of the world; fluency is a property of the generator, faithfulness of the grounding.
النسب محسوبة من أرقام الشريحة نفسها: 6.39 / 59.72 = 0.107، 4.867 / 5.972 = 0.815، 1898 / 5.972 = 317.8. الهلوسة (hallucination) استجابة غير وفية لحقائق العالم؛ الطلاقة خاصية في المولّد، أما الوفاء للحقائق فخاصية في الإسناد إلى المصادر (grounding).
Spelling: non-word versus real-word errorsالإملاء: أخطاء الكلمات غير الموجودة (non-word) مقابل أخطاء الكلمات الحقيقية (real-word)
A dictionary catches the first kind. Only context catches the second. Part 02: Applications
القاموس يلتقط النوع الأول. ولا يلتقط النوع الثاني إلا السياق. الجزء 02: التطبيقات
| Non-word errorخطأ كلمة غير موجودة | Real-word errorخطأ كلمة حقيقية | |
|---|---|---|
| Example on slide 11المثال في الشريحة 11 | ofcourseofcourse | then for thanthen بدل than |
| Underline in Wordالتسطير في Word | Red (spelling)أحمر (إملاء) | Blue (grammar)أزرق (قواعد) |
| Detected byيُكتشف عبر | Dictionary lookup, no contextالبحث في القاموس، دون سياق | Context: a language model or a grammar ruleالسياق: نموذج لغة أو قاعدة نحوية |
| Share of all spelling errorsالنسبة من كل الأخطاء الإملائية | The remainderالباقي | 25 to 40 percentمن 25 إلى 40 بالمئة |
| Noisy channel term that decidesالحد الحاسم في القناة المشوشة (noisy channel) | Channel model prefers a nearby common wordنموذج القناة يفضّل كلمة شائعة قريبة | Language model P(w) in context does the workنموذج اللغة P(w) في السياق هو الذي يحسم |
- Candidates V are kept within Damerau-Levenshtein distance 1; most errors are a single-letter change.تُحصر الكلمات المرشحة V ضمن مسافة Damerau-Levenshtein قدرها 1؛ فمعظم الأخطاء تغيير في حرف واحد.
- For then versus than, P(x | w) is high either way, so P(w) in "bigger ___ that" decides.في حالة then مقابل than، تكون P(x | w) مرتفعة في الحالتين، لذلك فإن P(w) في السياق "bigger ___ that" هي التي تحسم.
Information extraction and sentimentاستخراج المعلومات وتحليل المشاعر
Template filling: slots are copied from the text or inferred from it. Temporal normalization anchors relative expressions to the document date. Part 02: Applications
ملء القوالب (template filling): تُنسخ الخانات (slots) من النص أو تُستنتج منه. والتطبيع الزمني (temporal normalization) يربط التعبيرات النسبية بتاريخ الوثيقة. الجزء 02: التطبيقات
| Slotالخانة | Valueالقيمة | Copied or inferredمنسوخ أم مستنتج |
|---|---|---|
| Eventالحدث | Curriculum mtgCurriculum mtg | Copied from the subject line, abbreviatedمنسوخ من سطر الموضوع، مختصرًا |
| Dateالتاريخ | Jan-16-2012Jan-16-2012 | Inferred: header date January 15, 2012 plus one dayمستنتج: تاريخ الترويسة January 15, 2012 زائد يوم واحد |
| Startالبداية | 10:00am10:00am | Inferred: range split, morning assumedمستنتج: تقسيم النطاق، مع افتراض أنه صباحًا |
| Endالنهاية | 11:30am11:30am | Inferred: range split, morning assumedمستنتج: تقسيم النطاق، مع افتراض أنه صباحًا |
| Whereالمكان | Gates 159Gates 159 | Copied: a location named entityمنسوخ: كيان مسمى يدل على مكان |
| Sentenceالجملة | Cue wordsكلمات الدلالة | Polarityالقطبية |
|---|---|---|
| nice and compact to carry!nice and compact to carry! | nice, compactnice, compact | Positiveإيجابية |
| small and light, unlike heavy, bulky professional camerassmall and light, unlike heavy, bulky professional cameras | small, light versus heavy, bulkysmall, light مقابل heavy, bulky | Positiveإيجابية |
| feels flimsy, is plastic and very light in weightfeels flimsy, is plastic and very light in weight | flimsy, plastic, delicateflimsy, plastic, delicate | Negativeسلبية |
Four ways to build NLPأربع طرق لبناء NLP
One axis: how much of the knowledge of language a human writes versus how much the data supplies. Part 03: How NLP is done
محور واحد: كم من المعرفة باللغة يكتبه الإنسان مقابل كم منها توفره البيانات. الجزء 03: كيف تُنجز NLP
| Approachالمنهج | Human writesما يكتبه الإنسان | Data suppliesما توفره البيانات | Strengthنقطة القوة | Weaknessنقطة الضعف |
|---|---|---|---|---|
| Rule-basedالقائم على القواعد (Rule-based) | Grammars, lexicons, regexes, finite-state machinesقواعد نحوية، ومعاجم، وتعابير نمطية (regexes)، وآلات حالات منتهية | Nothingلا شيء | Precise, inspectable, no training dataدقيق، وقابل للفحص، ولا يحتاج بيانات تدريب | Brittle, every phenomenon needs a ruleهش، فكل ظاهرة تحتاج قاعدة |
| Classical MLتعلم الآلة الكلاسيكي (Classical ML) | Feature templates, choice of modelقوالب السمات (feature templates)، واختيار النموذج | The weightsالأوزان | Robust, probabilisticمتين، واحتمالي | Needs labels and hand-designed featuresيحتاج بيانات معنونة وسمات مصممة يدويًا |
| End-to-end deep learningالتعلم العميق من الطرف إلى الطرف (end-to-end) | Architecture and lossالبنية ودالة الخسارة | Representations and weightsالتمثيلات والأوزان | Highest accuracy, no feature engineeringأعلى دقة، ولا حاجة لهندسة السمات | Large data and compute, hard to inspectيحتاج بيانات وحوسبة ضخمة، ويصعب فحصه |
| Hybridالهجين (Hybrid) | Normalisation rules, constraints, checksقواعد التطبيع، والقيود، والفحوص | The learned coreالنواة المتعلَّمة | Practical, safe, works when data is scarceعملي، وآمن، ويعمل حين تشح البيانات | Two systems to maintainنظامان يجب صيانتهما |
Dates to knowتواريخ يجب معرفتها
- 7 January 19547 يناير 1954
- Georgetown-IBM demonstration: 250 words, six grammar rules.عرض Georgetown-IBM: 250 كلمة وست قواعد نحوية.
- 1966
- ELIZA: a cascade of regex substitutions (rule-based).ELIZA: سلسلة من الاستبدالات بالتعابير النمطية (regex)، أي نظام قائم على القواعد.
- 1965 to early 1990s1965 إلى أوائل التسعينيات
- Symbolic era (Jurafsky and Martin, Figure 1.6).العصر الرمزي (Jurafsky and Martin, Figure 1.6).
- 1975 to 19851975 إلى 1985
- Jelinek's IBM speech group starts the statistical turn.مجموعة Jelinek للكلام في IBM تبدأ التحول الإحصائي.
- Late 1980s to 2017أواخر الثمانينيات إلى 2017
- Empiricist era: naive Bayes, HMM, CRF (2001).العصر التجريبي: naive Bayes وHMM وCRF (2001).
- 2014, 2017, 20192014 و2017 و2019
- seq2seq, the Transformer, prompting. GPT-2 tokenizer: regex pre-tokenizer plus learned BPE merges.seq2seq، ثم Transformer، ثم التوجيه بالموجّهات (prompting). مقطِّع GPT-2: مقطِّع أولي بالتعابير النمطية (regex pre-tokenizer) مع عمليات دمج BPE متعلَّمة.
The text pipelineخط معالجة النص (pipeline)
Three cuts, each a decision that a rule or a model makes and can get wrong. Part 03: How NLP is done
ثلاثة تقطيعات، كل منها قرار تتخذه قاعدة أو نموذج، وقد يخطئ فيه. الجزء 03: كيف تُنجز NLP
| Cutالتقطيع | Stepالخطوة | Where it goes wrongموضع الخطأ |
|---|---|---|
| Paragraphs to sentencesمن الفقرات إلى الجمل | Sentence boundary disambiguationتوضيح حدود الجمل (sentence boundary disambiguation) | The period is ambiguous: Dr., 3.14, or Inc. ending a sentence (both at once)النقطة غامضة: Dr.، أو 3.14، أو Inc. في نهاية جملة (الأمران معًا) |
| Sentences to wordsمن الجمل إلى الكلمات | Tokenizationالتقطيع إلى وحدات (tokenization) | Clitics ('s, n't, Arabic b and w), hyphens, numbers, no spaces in Chinese, Japanese, Thaiالسوابق واللواحق المتصلة ('s وn't، وb وw في العربية)، والشرطات، والأرقام، وغياب المسافات في الصينية واليابانية والتايلندية |
| Words to morphologyمن الكلمات إلى الصرف | Stemming or lemmatizationالتجذيع (stemming) أو التأصيل المعجمي (lemmatization) | Porter: experiments to experi. Lemmatizer: are to bePorter: experiments إلى experi. المؤصِّل المعجمي: are إلى be |
Worked sentence, Penn Treebank convention: "Dr. Ahmad's students are running experiments." gives 8 tokens (Dr. / Ahmad / 's / students / are / running / experiments / .), 2 Porter stems that are not words (ar, experi) and 1 lemma no suffix rule reaches (be).
جملة محلولة وفق اصطلاح Penn Treebank: الجملة "Dr. Ahmad's students are running experiments." تعطي 8 وحدات (tokens) هي (Dr. / Ahmad / 's / students / are / running / experiments / .)، و2 من جذوع Porter ليستا كلمتين حقيقيتين (ar، experi)، و1 أصل معجمي (lemma) لا تصل إليه أي قاعدة لحذف اللواحق (be).
| Stemmingالتجذيع | Lemmatizationالتأصيل المعجمي | |
|---|---|---|
| Methodالطريقة | Chops suffixes by ruleيقص اللواحق بالقواعد | Looks up the dictionary form with a vocabulary and morphological analysisيبحث عن صيغة القاموس باستخدام المفردات والتحليل الصرفي |
| Outputالمخرج | May be a non-wordقد لا يكون كلمة حقيقية | Always a real word, the lemmaكلمة حقيقية دائمًا، هي الأصل المعجمي (lemma) |
| Needsيحتاج | Only the rulesالقواعد فقط | A lexicon, often the part of speechمعجمًا، وغالبًا قسم الكلام |
| Exampleمثال | experiments to experi, are to arexperiments إلى experi، وare إلى ar | experiments to experiment, are to beexperiments إلى experiment، وare إلى be |
| Over-stemmingالإفراط في التجذيع (over-stemming) | university and universal both to universuniversity وuniversal كلاهما إلى univers | Not applicableلا ينطبق |
| Useالاستخدام | Search indexingفهرسة البحث | Anything shown to people or fed to a parserأي شيء يُعرض على الناس أو يُمرَّر إلى محلل نحوي |
Levels of linguistic knowledgeمستويات المعرفة اللغوية
Order from sound to discourse. Speech enters through phonetics and phonology, text through orthography, and both meet at morphology. Part 03: How NLP is done
رتّبها من الصوت إلى الخطاب. الكلام المنطوق يدخل عبر علم الأصوات (phonetics) وعلم النظام الصوتي (phonology)، والنص المكتوب يدخل عبر الإملاء ونظام الكتابة (orthography)، ويلتقي الاثنان عند الصرف (morphology). الجزء 03: كيف تُنجز NLP
| Levelالمستوى | Unitالوحدة | Inputالمُدخل | Example taskمهمة مثال |
|---|---|---|---|
| Phoneticsعلم الأصوات (Phonetics) | Phone (speech sound)الصوت الكلامي (phone) | Speech onlyالكلام فقط | Speech recognition front endالواجهة الأمامية للتعرف على الكلام |
| Phonologyعلم النظام الصوتي (Phonology) | Phonemeالفونيم (phoneme) | Speech onlyالكلام فقط | Pronunciation modellingنمذجة النطق |
| Orthographyالإملاء ونظام الكتابة (Orthography) | Character, code pointالحرف، ونقطة الترميز (code point) | Text onlyالنص فقط | Unicode handling, script normalisationالتعامل مع Unicode، وتطبيع نظام الكتابة |
| Morphologyالصرف (Morphology) | Morphemeالمورفيم (morpheme) | Bothكلاهما | Stemming, lemmatization, subword tokenizationالتجذيع، والتأصيل المعجمي، والتقطيع إلى وحدات جزئية (subword tokenization) |
| Lexicalالمعجمي (Lexical) | Lexeme and its sensesالوحدة المعجمية (lexeme) ومعانيها | Bothكلاهما | Word sense disambiguation (heavy on slide 9)توضيح معنى الكلمة (heavy في الشريحة 9) |
| Syntaxالنحو (Syntax) | Phrase, sentenceالعبارة، والجملة | Bothكلاهما | Parsing, PP attachment (slide 21)التحليل النحوي (parsing)، وارتباط شبه الجملة الحرفية (PP attachment، الشريحة 21) |
| Semanticsالدلالة (Semantics) | Propositionالقضية (proposition) | Bothكلاهما | Semantic role labelling, question answeringوسم الأدوار الدلالية، والإجابة عن الأسئلة |
| Pragmaticsالتداولية (Pragmatics) | Utterance in contextالقول في سياقه (utterance) | Bothكلاهما | Resolving tomorrow (slide 12), dialogueحسم tomorrow (الشريحة 12)، والحوار |
| Discourseالخطاب (Discourse) | Multi-sentence textنص متعدد الجمل | Bothكلاهما | Coreference resolutionحل الإحالة المشتركة (coreference resolution) |
Ambiguityالغموض (ambiguity)
Most or all NLP tasks resolve ambiguity at one of the levels above. The marks are in the level column, not the glosses. Part 04: Why NLP is hard
معظم مهام NLP، إن لم تكن كلها، تحسم الغموض في أحد المستويات السابقة. الدرجات في عمود المستوى، لا في الشروح. الجزء 04: لماذا NLP صعبة
| Readingالقراءة | Glossالمعنى | Level of ambiguityمستوى الغموض |
|---|---|---|
| 11 | I cooked waterfowl for herطهوتُ لها طيرًا مائيًا (بطة) | Part of speech and word senseقسم الكلام ومعنى الكلمة |
| 22 | I cooked waterfowl belonging to herطهوتُ طيرًا مائيًا يخصها | Syntactic, and part of speech of herنحوي، وقسم الكلام لكلمة her |
| 33 | I created the plaster duck she ownsصنعتُ البطة الجصية التي تملكها | Word sense of makeمعنى الكلمة make |
| 44 | I caused her to quickly lower her headجعلتُها تخفض رأسها بسرعة | Part of speech of duck and syntacticقسم الكلام لكلمة duck، ونحوي |
| 55 | I turned her into a duckحوّلتُها إلى بطة | Syntactic (ditransitive make)نحوي (make متعدٍّ إلى مفعولين، ditransitive) |
| Bonus, speech onlyإضافية، في الكلام المنطوق فقط | eye / maid instead of I / madeeye / maid بدل I / made | Phoneticصوتي |
| Bracketingالتقويس | Attachmentالارتباط | Meaningالمعنى |
|---|---|---|
| [saw [the man [with a telescope]]][saw [the man [with a telescope]]] | Inside the noun phraseداخل العبارة الاسمية | The man has the telescopeالرجل هو من يحمل التلسكوب |
| [saw [the man] [with a telescope]][saw [the man] [with a telescope]] | To the verb phraseبالعبارة الفعلية | I used the telescope to see himاستخدمتُ التلسكوب لأراه |
| saw as the cutting verbsaw بمعنى فعل النشر بالمنشار | Lexical, stacked on topمعجمي، يُضاف فوق الغموضين السابقين | I am sawing the manأنا أنشر الرجل بالمنشار |
Both parses are grammatical, so grammar alone cannot choose. The two common structural ambiguities in English are attachment and coordination (old men and women). A crash blossom is a real headline whose compressed syntax admits a garden-path reading; named after Violinist Linked to JAL Crash Blossoms (Japan Today, August 2009), popularised by Ben Zimmer in January 2010.
كلا التحليلين صحيح نحويًا، لذلك لا يستطيع النحو وحده أن يختار. الغموضان البنيويان الشائعان في الإنجليزية هما الارتباط (attachment) والعطف (coordination) كما في old men and women. و"زهرة التحطم" (crash blossom) عنوان صحفي حقيقي يسمح تركيبه المضغوط بقراءة مضلِّلة (garden-path)؛ سُمّيت على اسم العنوان Violinist Linked to JAL Crash Blossoms (Japan Today، August 2009)، ونشر المصطلحَ Ben Zimmer في January 2010.
| Headlineالعنوان | Garden-path readingالقراءة المضلِّلة | Ambiguous word and typeالكلمة الغامضة ونوع الغموض |
|---|---|---|
| Violinist Linked to JAL Crash BlossomsViolinist Linked to JAL Crash Blossoms | A species called crash blossomsنوع من الأزهار يُدعى crash blossoms | blossoms: verb or noun; compound segmentationblossoms: فعل أم اسم؛ وتقسيم الاسم المركب |
| Teacher Strikes Idle KidsTeacher Strikes Idle Kids | A teacher hits lazy childrenمعلم يضرب أطفالًا كسالى | strikes: noun or verb, which flips idlestrikes: اسم أم فعل، وهذا يقلب دور idle |
| Red Tape Holds Up New BridgesRed Tape Holds Up New Bridges | Tape robs or supports the bridgesشريط أحمر يسطو على الجسور أو يسندها | holds up: phrasal verb senseholds up: معنى الفعل المركب (phrasal verb) |
| Hospitals Are Sued by 7 Foot DoctorsHospitals Are Sued by 7 Foot Doctors | Doctors seven feet tallأطباء طولهم سبعة أقدام | [7 [foot doctors]] versus [[7 foot] doctors][7 [foot doctors]] مقابل [[7 foot] doctors] |
| Juvenile Court to Try Shooting DefendantJuvenile Court to Try Shooting Defendant | The court will attempt to shoot himالمحكمة ستحاول إطلاق النار عليه | try: sense; shooting: part of speechtry: المعنى؛ وshooting: قسم الكلام |
| Local High School Dropouts Cut in HalfLocal High School Dropouts Cut in Half | Students were bisectedالطلاب شُطروا نصفين | cut in half: literal or figurative; world knowledgecut in half: حرفي أم مجازي؛ ومعرفة بالعالم |
Six more reasons, and the tools for progressستة أسباب أخرى، وأدوات التقدم
Beyond ambiguity, six cards on slide 23, each defeating a named subproblem. Slide 24 lists three tools and three disciplines. Part 04: Why NLP is hard
إلى جانب الغموض، هناك ست بطاقات على الشريحة 23، كل منها تُفشل مشكلة فرعية محددة. وتسرد الشريحة 24 ثلاث أدوات وثلاثة تخصصات. الجزء 04: لماذا NLP صعبة
| 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التطبيع (normalisation) | Diglossia: MSA versus dialect, Arabizi (3ala)الازدواجية اللغوية (diglossia): الفصحى (MSA) مقابل اللهجة، والعربيزي (3ala) |
| Segmentationالتقسيم (Segmentation) | the New York-New Haven Railroadthe New York-New Haven Railroad | Tokenization, named entity recognitionالتقطيع إلى وحدات، والتعرف على الكيانات المسماة | Clitics: w + b + al + qalam as one wordالسوابق واللواحق المتصلة: w + b + al + qalam (وبالقلم) كلمة واحدة |
| Idiomsالتعابير الاصطلاحية (Idioms) | dark horse, get cold feet, throw in the toweldark horse, get cold feet, throw in the towel | Compositional semantics, translationالدلالة التركيبية، والترجمة | on my eye, meaning gladlyعلى عيني، بمعنى بكل سرور |
| Neologismsالكلمات المستحدثة (Neologisms) | unfriend, Retweet, Malware, Webinarunfriend, Retweet, Malware, Webinar | Closed vocabularies (OOV words)المفردات المغلقة (كلمات خارج المفردات، OOV) | Loanword verbs such as to save a fileأفعال مستعارة مثل "سيّف الملف" بمعنى to save a file |
| World knowledgeالمعرفة بالعالم | Mary and Sue are sisters / are mothersMary and Sue are sisters / are mothers | Commonsense reasoningالاستدلال بالحس السليم | Same 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التعرف على الكيانات المسماة | No capital letters, every name looks commonلا توجد حروف كبيرة، فكل اسم يبدو كلمة عادية |
- Three tools: knowledge of language, knowledge about the world, a way to combine knowledge sources.ثلاث أدوات: المعرفة باللغة، والمعرفة بالعالم، وطريقة للجمع بين مصادر المعرفة.
- Three disciplines: computer science (search, classifiers, dynamic programming), mathematics (probability, linear algebra), linguistics (levels and categories).ثلاثة تخصصات: علوم الحاسب (البحث، والمصنِّفات classifiers، والبرمجة الديناميكية)، والرياضيات (الاحتمالات، والجبر الخطي)، واللسانيات (المستويات والفئات).
- A bigger dictionary fixes neither idioms (non-compositional meaning) nor neologisms (open vocabulary). The fixes are structural: multiword units, and subword models.القاموس الأكبر لا يعالج التعابير الاصطلاحية (idioms، معناها غير تركيبي) ولا الكلمات المستحدثة (neologisms، المفردات مفتوحة). الحلول بنيوية: وحدات متعددة الكلمات (multiword units)، ونماذج الوحدات الجزئية (subword models).
| Approachالمنهج | Knowledge of language fromمصدر المعرفة باللغة | World knowledge fromمصدر المعرفة بالعالم | Combined byطريقة الجمع |
|---|---|---|---|
| Rule-basedالقائم على القواعد | Hand-written grammars and lexiconsقواعد نحوية ومعاجم مكتوبة يدويًا | Hand-written facts and ontologiesحقائق وأنطولوجيات مكتوبة يدويًا | Order of rule firingترتيب تفعيل القواعد |
| Machine learningتعلم الآلة | Annotated corporaمدونات نصية معنونة (annotated corpora) | Whatever the features encodeما تُرمّزه السمات أيًا كان | A classifier weighs featuresمصنِّف يوازن بين السمات |
| End-to-end deep learningالتعلم العميق من الطرف إلى الطرف | Raw textنص خام | Absorbed implicitly from huge corporaتُمتص ضمنيًا من مدونات نصية ضخمة | One network mixes everythingشبكة واحدة تمزج كل شيء |
| Hybridالهجين | Rules plus learned componentsقواعد مع مكونات متعلَّمة | Rules, knowledge bases, learned partsقواعد، وقواعد معرفة، وأجزاء متعلَّمة | A pipeline or a voteخط معالجة أو تصويت |
Numbers worth memorisingأرقام تستحق الحفظ
Figures quoted across the four partsأرقام مذكورة عبر الأجزاء الأربعة
- Vocabulary by age 20حجم المفردات عند سن 20
- 30,000 to 100,000 words, about 7 to 10 a day, mostly from reading.من 30,000 إلى 100,000 كلمة، أي نحو 7 إلى 10 كلمات يوميًا، معظمها من القراءة.
- Real-word spelling errorsأخطاء الكلمات الحقيقية
- 25 to 40 percent of all spelling errors are valid words in the wrong place.من 25 إلى 40 بالمئة من كل الأخطاء الإملائية كلمات صحيحة في غير موضعها.
- LLM hallucination, legal questionsهلوسة LLM في الأسئلة القانونية
- 69 to 88 percent of the time, and models are poorly calibrated.من 69 إلى 88 بالمئة من الحالات، والنماذج ضعيفة المعايرة (poorly calibrated).
- BERT in Search (2019)BERT في البحث (2019)
- Helps one in 10 English searches.يساعد في عملية بحث واحدة من كل 10 عمليات بحث بالإنجليزية.
- NLLB
- 200 languages.200 لغة.
- Chinese word lengthطول الكلمة الصينية
- Roughly 1.5 to 1.9 characters; no orthographic word boundaries.نحو 1.5 إلى 1.9 حرف؛ ولا توجد حدود للكلمات في نظام الكتابة.
- Earth mass in poundsكتلة الأرض بالأرطال
- 5.972 × 10^24 kg × 2.20462 lb/kg ≈ 1.317 × 10^25 lb, the 13.1 septillion pounds of slide 10.5.972 × 10^24 kg × 2.20462 lb/kg ≈ 1.317 × 10^25 lb، أي 13.1 سبتيليون رطل (septillion pounds) المذكورة في الشريحة 10.
Slide errataأخطاء الشرائح
Answer with the corrected fact, and name the slide if a question depends on it. Part 04: Why NLP is hard
أجب بالمعلومة المصححة، واذكر رقم الشريحة إذا كان السؤال يعتمد عليها. الجزء 04: لماذا NLP صعبة
What the slides get wrong, or leave datedما تخطئ فيه الشرائح أو ما صار قديمًا فيها
- Slide 1الشريحة 1
- Footer reads ICS472, the undergraduate twin. Same slides, same content for ICS 582.التذييل يقول ICS472، وهو المقرر التوأم في المرحلة الجامعية. الشرائح نفسها والمحتوى نفسه لمقرر ICS 582.
- Slide 2الشريحة 2
- Dated logos: the Twitter bird (X since 24 July 2023) and Facebook (now Meta). A snapshot, not an error.شعارات قديمة: طائر Twitter (أصبح X منذ 24 يوليو 2023) وFacebook (الآن Meta). لقطة من زمنها، لا خطأ.
- Slide 6الشريحة 6
- Says knowledge representation and deduction. The standard phrase is knowledge representation and reasoning; deduction is one kind of reasoning.تقول knowledge representation and deduction. العبارة المعيارية هي knowledge representation and reasoning؛ والاستنتاج (deduction) نوع واحد من أنواع الاستدلال (reasoning).
- Slide 8الشريحة 8
- Language counts are from an old app page, and Skype Translator was retired on 5 May 2025. Learn the categories, not the numbers.أعداد اللغات مأخوذة من صفحة قديمة للتطبيق، وقد أُوقف Skype Translator في 5 مايو 2025. احفظ الفئات لا الأرقام.
- Slide 9الشريحة 9
- Mars shows 6.39 × 10^23 kg; NASA lists 6.4169 × 10^23 kg. Google's stale fact, not the lecturer's; a live example of staleness.يظهر المريخ بقيمة 6.39 × 10^23 kg؛ بينما تذكر NASA القيمة 6.4169 × 10^23 kg. الحقيقة القديمة من Google لا من المحاضر؛ وهي مثال حي على تقادم المعلومات.
- Slide 12الشريحة 12
- Jan-16-2012 does not contradict the January 15 header. Tomorrow is anchor plus one day. No error.التاريخ Jan-16-2012 لا يناقض ترويسة January 15. كلمة tomorrow تعني نقطة الإسناد زائد يوم واحد. لا خطأ هنا.
- Slide 13الشريحة 13
- The screenshot covers the middle of the second and third review bullets. Full sentences are in the PDF text layer.لقطة الشاشة تغطي منتصف النقطتين الثانية والثالثة من المراجعات. الجمل الكاملة موجودة في طبقة النص داخل ملف PDF.
- Slide 16الشريحة 16
- {parsing, tokenization} sits on the sentences-to-words arrow. Tokenization does that alone; parsing builds structure over existing tokens. Also reads pragmatcs.تقع {parsing, tokenization} على سهم "من الجمل إلى الكلمات". التقطيع إلى وحدات (tokenization) يقوم بذلك وحده؛ أما التحليل النحوي (parsing) فيبني بنية فوق وحدات موجودة. وفيها أيضًا الخطأ الإملائي pragmatcs.
- Slide 17الشريحة 17
- Pragmatcs again. The rings omit the lexical level and orthography; read the stack as the complete list and the rings as the speech-first view.الخطأ Pragmatcs مرة أخرى. الحلقات تُسقط المستوى المعجمي ونظام الكتابة (orthography)؛ اقرأ المكدس على أنه القائمة الكاملة، والحلقات على أنها منظور يبدأ من الكلام المنطوق.
- Slide 25الشريحة 25
- Prentice-Hall 2020 does not exist. Editions: 2000 and 2009 (ISBN 978-0-13-187321-6); the 3rd edition is a free online draft (19 August 2026) whose chapter 1 no longer contains the duck sentence.لا توجد طبعة Prentice-Hall 2020. الطبعات: 2000 و2009 (ISBN 978-0-13-187321-6)؛ والطبعة الثالثة مسودة مجانية على الإنترنت (19 أغسطس 2026) لم يعد فصلها الأول يحتوي جملة duck.