لماذا تفقد الكلمات المفردة معناها
كيف يختلف not bad عن bad
لماذا تفقد الكلمات المفردة معناها درس مجاني في NLP Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في NLP Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة NLP Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Words Standing Alone
So far you have treated text as a bag of single words. But meaning often lives in how words sit next to each other, not in any word alone.
The Bag-of-Words Blind Spot
A bag-of-words model throws away order. To it, the two sentences below are identical, even though they mean opposite things. 😮
a = sorted("this is not good".split())
b = sorted("good is not this".split())
print(a == b) # TrueNot Bad vs Bad
Think about a review that says not bad. The word bad alone looks negative, but the pair flips it to mildly positive.
Negation Gets Lost
When you count words one by one, the word not floats free. The model never learns which word it was actually negating.
tokens = "not bad".split()
print(tokens) # ['not', 'bad'] counted apartPhrases Carry Meaning
Real language is full of phrases like new york or machine learning. Split them up and you lose the concept they name together.
Order Changes Everything
Compare dog bites man with man bites dog. Same three words, very different news. Order is signal, and single words discard it.
Enter the N-Gram
An n-gram is a short, contiguous run of n words. It is the simplest way to glue neighbors together and keep a little local context.
Unigrams You Already Know
A single word is just a unigram, an n-gram of size one. So bag-of-words was secretly an n-gram model all along.
text = "not bad at all"
unigrams = text.split()
print(unigrams)Pairs Rescue Context
Step up to size two and not bad becomes a single feature. Now the model can learn that this pair leans positive.
A Sliding Window
Picture a small window sliding along the text, one step at a time, grabbing every adjacent group of words it passes over.
Context, Not Grammar
N-grams do not understand grammar. They simply preserve which words appear together, and that small clue boosts many NLP tasks.
Quick Check
Why do plain single-word features struggle with a phrase like not bad?
Recap: Why Pairs Matter
Single words ignore order, so negation and phrases slip away. N-grams keep neighbors together and bring local context back. Next you will name them. ✨
الأسئلة الشائعة
هل درس «لماذا تفقد الكلمات المفردة معناها» مجاني؟
نعم — نص درس «لماذا تفقد الكلمات المفردة معناها» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة NLP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة NLP Academy 4 دروس في المجموع.
ماذا ستتعلم في «لماذا تفقد الكلمات المفردة معناها»؟
كيف يختلف not bad عن bad تتمرن على NLP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ NLP Academy؟
لا تُشترط خبرة سابقة. NLP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «لماذا تفقد الكلمات المفردة معناها»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس NLP Academy هذا؟
نعم. كل درس في NLP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- لماذا تفقد الكلمات المفردة معناها
- شرح الثنائيات والثلاثيات
- سمات N-Gram في scikit-learn
- اختيار نطاق N-Gram المناسب