المقارنة الزوجية
مقارنة أزواج من العناصر لتقييم التفضيل والجودة.
المقارنة الزوجية
تتيح المقارنة الزوجية للموسِّمين مقارنة عنصرين جنبًا إلى جنب وتحديد تفضيلهم. يدعم وضعين:
- الوضع الثنائي (الافتراضي): انقر على البلاطة المفضلة (A أو B)، مع زر تعادل اختياري
- وضع المقياس: استخدم شريط تمرير لتقييم مدى تفضيل خيار على الآخر
تشمل حالات الاستخدام الشائعة مقارنة مخرجات النماذج، وتعلم التفضيل لـ RLHF، ومقارنة جودة الترجمات أو الملخصات، واختبار A/B.
الوضع الثنائي
يعرض الوضع الثنائي بلاطتين قابلتين للنقر. ينقر الموسِّمون على خيارهم المفضل.
annotation_schemes:
- annotation_type: pairwise
name: preference
description: "Which response is better?"
mode: binary
# Data source - key in instance data containing items to compare
items_key: "responses"
# Display options
show_labels: true
labels:
- "Response A"
- "Response B"
# Tie option
allow_tie: true
tie_label: "No preference"
# Keyboard shortcuts
sequential_key_binding: true
# Validation
label_requirement:
required: trueوضع المقياس
يعرض وضع المقياس شريط تمرير بين عنصرين، مما يسمح للموسِّمين بتحديد درجة التفضيل.
annotation_schemes:
- annotation_type: pairwise
name: preference_scale
description: "Rate how much better A is than B"
mode: scale
items_key: "responses"
labels:
- "Response A"
- "Response B"
# Scale configuration
scale:
min: -3 # Negative = prefer left item (A)
max: 3 # Positive = prefer right item (B)
step: 1
default: 0
# Endpoint labels
labels:
min: "A is much better"
max: "B is much better"
center: "Equal"
label_requirement:
required: trueصيغة البيانات
يتوقع المخطط بيانات عنصر تحتوي على قائمة عناصر للمقارنة:
{"id": "1", "responses": ["Response A text", "Response B text"]}
{"id": "2", "responses": ["First option here", "Second option here"]}يحدد إعداد items_key الحقل الذي يحتوي على العناصر للمقارنة. يجب أن يحتوي الحقل على قائمة بعنصرين على الأقل.
اختصارات لوحة المفاتيح
في الوضع الثنائي مع sequential_key_binding: true:
| المفتاح | الإجراء |
|---|---|
1 | اختيار الخيار A |
2 | اختيار الخيار B |
0 | اختيار التعادل/بدون تفضيل (إذا كان allow_tie: true) |
وضع المقياس يستخدم تفاعل شريط التمرير.
صيغة المخرجات
الوضع الثنائي
{
"preference": {
"selection": "A"
}
}مع التعادل:
{
"preference": {
"selection": "tie"
}
}وضع المقياس
القيم السالبة تشير إلى تفضيل A، والموجبة لـ B، والصفر للتساوي:
{
"preference_scale": {
"scale_value": "-2"
}
}أمثلة
مقارنة ثنائية أساسية
annotation_schemes:
- annotation_type: pairwise
name: quality
description: "Which text is higher quality?"
labels: ["Text A", "Text B"]
allow_tie: trueمقارنة متعددة الجوانب
المقارنة على أبعاد متعددة:
annotation_schemes:
- annotation_type: pairwise
name: fluency
description: "Which response is more fluent?"
labels: ["Response A", "Response B"]
- annotation_type: pairwise
name: relevance
description: "Which response is more relevant?"
labels: ["Response A", "Response B"]
- annotation_type: pairwise
name: overall
description: "Which response is better overall?"
labels: ["Response A", "Response B"]
allow_tie: trueمقياس التفضيل بنطاق مخصص
annotation_schemes:
- annotation_type: pairwise
name: sentiment_comparison
description: "Compare the sentiment of these two statements"
mode: scale
labels: ["Statement A", "Statement B"]
scale:
min: -5
max: 5
step: 1
labels:
min: "A is much more positive"
max: "B is much more positive"
center: "Equal sentiment"جمع تفضيلات RLHF
annotation_schemes:
- annotation_type: pairwise
name: overall
description: "Overall, which response is better?"
labels: ["Response A", "Response B"]
allow_tie: true
sequential_key_binding: true
- annotation_type: multiselect
name: criteria
description: "What factors influenced your decision?"
labels:
- Accuracy
- Helpfulness
- Clarity
- Safety
- Completeness
- annotation_type: text
name: notes
description: "Additional notes (optional)"
textarea: true
required: falseالتنسيق
يستخدم توسيم المقارنة الزوجية متغيرات CSS من نظام السمات. أضف CSS مخصصًا لتخصيص البلاطات:
/* Make tiles taller */
.pairwise-tile {
min-height: 200px;
}
/* Change selected tile highlight */
.pairwise-tile.selected {
border-color: #10b981;
background-color: rgba(16, 185, 129, 0.1);
}أفضل الممارسات
- استخدم تسميات واضحة ومتميزة - يجب أن يفهم الموسِّمون الخيارات فورًا
- فكّر في خيارات التعادل بعناية - أحيانًا يكون فرض الاختيار مناسبًا
- استخدم اختصارات لوحة المفاتيح - تسرّع التوسيم بشكل ملحوظ
- أضف حقول التبرير - تساعد في فهم الأسباب وتحسين جودة البيانات
- اختبر مع بياناتك - تأكد من أن العرض يعمل بشكل جيد مع طول محتواك
قراءة إضافية
- أشجار المحادثات - لمقارنات التفرع المعقدة
- ميزات الإنتاجية - اختصارات لوحة المفاتيح
لمزيد من التفاصيل التقنية، راجع الوثائق المصدرية.