رياضيات الكلمات: King ناقص Man زائد Woman
استكشف القياسات التناظرية وأقرب الجيران
رياضيات الكلمات: King ناقص Man زائد Woman درس مجاني في NLP Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في NLP Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة NLP Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Vectors Have Directions
Because words are now vectors, you can add and subtract them like arrows. This unlocks a playful idea called word math.
The Famous Example
Take king, subtract man, add woman, and the nearest vector is queen. This analogy stunned researchers when it first appeared. 👑
result = emb["king"] - emb["man"] + emb["woman"]
# nearest word -> "queen"Why It Works
The step from man to woman is a consistent direction in space. Adding that same direction to king lands you near queen.
Relationships as Offsets
Many relations become repeatable vector offsets. The gap encoding gender or tense behaves like a fixed arrow across word pairs.
More Analogies
The trick generalizes nicely. Paris minus France plus Italy lands near Rome, capturing a capital-city relationship.
r = emb["paris"] - emb["france"] + emb["italy"]
# nearest word -> "rome"Finding the Answer
You compute the target vector, then search for its nearest neighbor among all word vectors using cosine similarity.
One Line in Gensim
gensim wraps the whole analogy in a single call. You list positive and negative words and read the top result.
model.most_similar(positive=["king", "woman"],
negative=["man"], topn=1)Nearest Neighbors
Even without subtraction, you can ask which words sit closest to one term. These neighbors reveal what the model thinks is similar.
It Is Not Perfect
Analogies often work, but not always. Bias in the training text can produce unfair or wrong results, so stay critical.
Bias Lives in Vectors
Embeddings absorb the stereotypes present in their data. Always remember that bias in text becomes bias in your model.
Why This Amazes People
Simple arithmetic on learned vectors reflects real human relationships. That is the clearest sign embeddings truly capture meaning. ✨
Quick Check
What does king minus man plus woman tend to produce?
Recap
Word math adds and subtracts vectors to solve analogies like king to queen. It shows embeddings encode real relationships, bias and all. ✅
الأسئلة الشائعة
هل درس «رياضيات الكلمات: King ناقص Man زائد Woman» مجاني؟
نعم — نص درس «رياضيات الكلمات: King ناقص Man زائد Woman» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة NLP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة NLP Academy 4 دروس في المجموع.
ماذا ستتعلم في «رياضيات الكلمات: King ناقص Man زائد Woman»؟
استكشف القياسات التناظرية وأقرب الجيران تتمرن على NLP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ NLP Academy؟
لا تُشترط خبرة سابقة. NLP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «رياضيات الكلمات: King ناقص Man زائد Woman»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس NLP Academy هذا؟
نعم. كل درس في NLP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- من التعدادات المتناثرة إلى المتجهات الكثيفة
- كيف يتعلم word2vec المعنى
- تحميل متجهات GloVe في Python
- رياضيات الكلمات: King ناقص Man زائد Woman