إنشاء قائمة كلمات إيجابية وسلبية
معجم المشاعر الخاص بك
إنشاء قائمة كلمات إيجابية وسلبية درس مجاني في NLP Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في NLP Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة NLP Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Meet the Lexicon
A lexicon is simply a list of words tagged with sentiment. It is the dictionary your rule-based detector will look words up in. 📖
Two Buckets to Start
Begin with two lists: positive words and negative words. Each list holds terms that reliably signal one feeling on their own.
Positive Words
Fill the positive set with words readers say when happy: good, great, love, excellent, amazing. Keep them lowercase for easy matching.
positive = {"good", "great", "love", "excellent", "amazing"}Negative Words
The negative set collects complaint words: bad, awful, hate, terrible, broken. These are the red flags your detector hunts for.
negative = {"bad", "awful", "hate", "terrible", "broken"}Why Use a Set
A Python set checks membership instantly, so testing if a word is positive stays fast even when your lists grow large.
Lowercase Everything
Great and GREAT should match the same entry, so store words lowercased and lowercase incoming text too. This keeps matching consistent.
Checking a Word
Looking a word up is one line. The in operator tells you instantly whether a term lives in your positive list.
word = "love"
is_pos = word in positiveBorrow a Ready Lexicon
You do not have to start blank. Tools like NLTK ship curated opinion lexicons with thousands of scored words you can reuse.
Watch for Overlap
A word should not sit in both lists, so keep your sets disjoint. Conflicts make scoring ambiguous and confuse your final label.
Domain Matters
Sentiment is domain-specific. For a hotel, quiet is positive; for a party, it is not. Tune the lexicon to your specific use case.
Keep It Growing
Treat your lists as living data. When the detector misses a clear cue, just add that word, so the lexicon steadily improves over time.
Quick Check
Think about why we chose this data structure.
Recap
You built a lexicon: positive and negative word sets, lowercased and disjoint, for fast lookups. You can borrow NLTK lists and tune them per domain. Next we score full reviews. ✅
الأسئلة الشائعة
هل درس «إنشاء قائمة كلمات إيجابية وسلبية» مجاني؟
نعم — نص درس «إنشاء قائمة كلمات إيجابية وسلبية» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة NLP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة NLP Academy 4 دروس في المجموع.
ماذا ستتعلم في «إنشاء قائمة كلمات إيجابية وسلبية»؟
معجم المشاعر الخاص بك تتمرن على NLP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ NLP Academy؟
لا تُشترط خبرة سابقة. NLP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «إنشاء قائمة كلمات إيجابية وسلبية»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس NLP Academy هذا؟
نعم. كل درس في NLP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- ما تحليل المشاعر؟
- إنشاء قائمة كلمات إيجابية وسلبية
- تقييم مراجعة بعدّ المؤشرات
- معالجة النفي والحالات الخاصة