انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-067-L02

مقاييس التشابه

  • الدرس 2 من 6
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

pick the distance measure that matches the embedding model.

الموضوعات المخطط لها

  • Cosine distance: compares direction, ignores length. The common default for text embeddings.
  • Inner product: fast; ranks like cosine when vectors are normalized to length 1.
  • Euclidean (L2): straight-line distance; use it when the model was trained for it.
  • Rule: use the measure the model documents. A wrong measure still returns results, just worse ones.
  • The index must use the same measure as the query.
تفاصيل المخطط المبدئي

عرض عملي

Measurepgvector operatorUse when
Cosine distance<=>model recommends cosine
Inner product (negated)<#>vectors normalized
Euclidean<->model trained for L2

اختبر فهمك

What happens if you use a measure the model was not trained for?

أظهر الإجابة

Queries run, but ranking quality drops silently.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.