0Pricing
NLP Academy · บทเรียน

คณิตศาสตร์ของคำ: King ลบ Man บวก Woman

สำรวจการเปรียบเทียบและคำข้างเคียงที่ใกล้ที่สุด

คณิตศาสตร์ของคำ: King ลบ Man บวก Woman เป็นบทเรียน NLP Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 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” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส NLP Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส NLP Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “คณิตศาสตร์ของคำ: King ลบ Man บวก Woman”

สำรวจการเปรียบเทียบและคำข้างเคียงที่ใกล้ที่สุด คุณปฏิบัติ NLP Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน NLP Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน NLP Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน

บทเรียน “คณิตศาสตร์ของคำ: King ลบ Man บวก Woman” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน NLP Academy นี้ได้ไหม

ได้ บทเรียน NLP Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. จากการนับแบบเบาบางสู่เวกเตอร์หนาแน่น
  2. word2vec เรียนรู้ความหมายอย่างไร
  3. โหลดเวกเตอร์ GloVe ใน Python
  4. คณิตศาสตร์ของคำ: King ลบ Man บวก Woman
← กลับไปที่ NLP Academy