Annotation इतिहास
Auditing और विश्लेषण के लिए timestamps के साथ प्रत्येक annotation क्रिया को ट्रैक करें।
Annotation इतिहास
Potato सूक्ष्म timestamp metadata के साथ सभी annotation क्रियाओं की व्यापक ट्रैकिंग प्रदान करता है। यह प्रदर्शन विश्लेषण, गुणवत्ता आश्वासन, और विस्तृत audit trails सक्षम करता है।
अवलोकन
Annotation history system ट्रैक करता है:
- प्रत्येक annotation क्रिया: Label selections, span annotations, text inputs
- सटीक timestamps: Server और client-side timestamps
- क्रिया metadata: User, instance, schema, पुराने/नए values
- प्रदर्शन मेट्रिक्स: Processing times, action rates
- संदिग्ध गतिविधि: असामान्य रूप से तेज़ या burst activity patterns
क्रिया ट्रैकिंग
प्रत्येक annotation परिवर्तन एक AnnotationAction के रूप में दर्ज किया जाता है:
| Field | विवरण |
|---|---|
action_id | प्रत्येक क्रिया के लिए Unique UUID |
timestamp | Server-side timestamp |
client_timestamp | Browser-side timestamp (यदि उपलब्ध हो) |
user_id | क्रिया करने वाला User |
instance_id | Annotate की जा रही Instance |
action_type | की गई क्रिया का प्रकार |
schema_name | Annotation schema नाम |
label_name | Schema के भीतर विशिष्ट label |
old_value | पिछला value (updates/deletes के लिए) |
new_value | नया value (adds/updates के लिए) |
span_data | Span annotations के लिए Span विवरण |
server_processing_time_ms | Server processing समय |
क्रिया प्रकार
सिस्टम इन क्रिया प्रकारों को ट्रैक करता है:
add_label- नई label selectionupdate_label- Label value बदलाdelete_label- Label हटायाadd_span- नई span annotation बनाईupdate_span- Span annotation संशोधितdelete_span- Span annotation हटाई
कॉन्फ़िगरेशन
Annotation history tracking default रूप से सक्षम है। कोई अतिरिक्त कॉन्फ़िगरेशन आवश्यक नहीं।
प्रदर्शन मेट्रिक्स
सिस्टम क्रिया इतिहास से प्रदर्शन मेट्रिक्स की गणना करता है:
from potato.annotation_history import AnnotationHistoryManager
metrics = AnnotationHistoryManager.calculate_performance_metrics(actions)
# Returns:
{
'total_actions': 150,
'average_action_time_ms': 45.2,
'fastest_action_time_ms': 12,
'slowest_action_time_ms': 234,
'actions_per_minute': 8.5,
'total_processing_time_ms': 6780
}संदिग्ध गतिविधि का पता लगाना
सिस्टम संभावित समस्याग्रस्त annotation patterns का पता लगा सकता है:
from potato.annotation_history import AnnotationHistoryManager
analysis = AnnotationHistoryManager.detect_suspicious_activity(
actions,
fast_threshold_ms=500, # Actions faster than this are flagged
burst_threshold_seconds=2 # Actions closer than this are flagged
)
# Returns:
{
'suspicious_actions': [...],
'fast_actions_count': 5,
'burst_actions_count': 12,
'fast_actions_percentage': 3.3,
'burst_actions_percentage': 8.0,
'suspicious_score': 15.2,
'suspicious_level': 'Low'
}संदिग्ध Levels
| Score | Level | व्याख्या |
|---|---|---|
| 0-10 | Normal | सामान्य annotation व्यवहार |
| 10-30 | Low | कुछ तेज़ actions, संभवतः स्वीकार्य |
| 30-60 | Medium | उल्लेखनीय pattern, समीक्षा की आवश्यकता हो सकती है |
| 60-80 | High | चिंताजनक pattern, समीक्षा अनुशंसित |
| 80-100 | Very High | गुणवत्ता समस्या की संभावना, तत्काल समीक्षा |
API Reference
AnnotationAction
from potato.annotation_history import AnnotationAction
action = AnnotationAction(
action_id="uuid-here",
timestamp=datetime.now(),
user_id="annotator1",
instance_id="doc_001",
action_type="add_label",
schema_name="sentiment",
label_name="positive",
old_value=None,
new_value=True
)
# Serialize to dictionary
data = action.to_dict()
# Deserialize from dictionary
action = AnnotationAction.from_dict(data)AnnotationHistoryManager
from potato.annotation_history import AnnotationHistoryManager
# Create a new action with current timestamp
action = AnnotationHistoryManager.create_action(
user_id="annotator1",
instance_id="doc_001",
action_type="add_label",
schema_name="sentiment",
label_name="positive",
old_value=None,
new_value=True
)
# Filter actions by time range
filtered = AnnotationHistoryManager.get_actions_by_time_range(
actions,
start_time=datetime(2024, 1, 1),
end_time=datetime(2024, 1, 31)
)
# Filter actions by instance
instance_actions = AnnotationHistoryManager.get_actions_by_instance(
actions, instance_id="doc_001"
)
# Calculate performance metrics
metrics = AnnotationHistoryManager.calculate_performance_metrics(actions)
# Detect suspicious activity
analysis = AnnotationHistoryManager.detect_suspicious_activity(actions)उपयोग के मामले
गुणवत्ता आश्वासन
गुणवत्ता समस्याओं के लिए annotator व्यवहार की निगरानी करें:
for user_id in get_all_users():
user_actions = get_user_actions(user_id)
analysis = AnnotationHistoryManager.detect_suspicious_activity(user_actions)
if analysis['suspicious_level'] in ['High', 'Very High']:
flag_for_review(user_id, analysis)Audit Trail
नियामक अनुपालन के लिए परिवर्तन ट्रैक करें:
instance_actions = AnnotationHistoryManager.get_actions_by_instance(
all_actions, "doc_001"
)
audit_log = [action.to_dict() for action in instance_actions]
with open("audit_doc_001.json", "w") as f:
json.dump(audit_log, f, indent=2)समय विश्लेषण
Annotation timing patterns समझें:
from collections import Counter
hours = Counter(action.timestamp.hour for action in all_actions)
print("Peak annotation hours:", hours.most_common(5))Data Storage
Annotation history user state files में संग्रहीत है:
output/
annotations/
user_state_annotator1.json # Includes action history
user_state_annotator2.json
Export Format
Actions ISO 8601 timestamps के साथ serialize किए जाते हैं:
{
"action_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2024-01-15T10:30:45.123456",
"user_id": "annotator1",
"instance_id": "doc_001",
"action_type": "add_label",
"schema_name": "sentiment",
"label_name": "positive",
"old_value": null,
"new_value": true,
"server_processing_time_ms": 23
}सर्वोत्तम प्रथाएँ
- नियमित निगरानी: समय-समय पर संदिग्ध गतिविधि रिपोर्ट जांचें
- Threshold tuning: Task की जटिलता के आधार पर detection thresholds समायोजित करें
- Export backups: दीर्घकालिक भंडारण के लिए नियमित रूप से history export करें
- Privacy compliance: Timestamps के लिए data retention policies पर विचार करें
आगे पढ़ें
- Admin Dashboard - Annotation statistics देखें
- Behavioral Tracking - Interaction-level tracking
- Quality Control - स्वचालित गुणवत्ता जांच
कार्यान्वयन विवरण के लिए, source documentation देखें।