行動トラッキング
品質分析と研究のための詳細なインタラクションデータの取得。
行動トラッキング
Potatoの行動トラッキングシステムは、アノテーションセッション中の詳細なインタラクションデータをキャプチャし、研究者がアノテーターの行動、タイミングパターン、AIアシスタンスの使用状況、意思決定プロセスを分析できるようにします。
概要
行動トラッキングシステムは以下をキャプチャします:
- すべてのアノテーションアクション:ラベル選択、スパンアノテーション、テキスト入力
- 正確なタイムスタンプ:サーバー側とクライアント側のタイムスタンプ
- AIアシスタンスの使用状況:提案が表示されたタイミングと承認の有無
- フォーカスとタイミングデータ:各要素に費やされた時間、スクロール深度
- ナビゲーション履歴:インスタンスを通じた完全なパス
追跡される内容
インタラクションイベント
アノテーションインターフェースとのすべてのユーザーインタラクションがキャプチャされます:
| イベントタイプ | 説明 | ターゲット例 |
|---|---|---|
click | 要素のマウスクリック | label:positive、nav:next |
focus_in | 要素がフォーカスを受ける | textbox:explanation |
focus_out | 要素からフォーカスが離れる | label:negative |
keypress | キーボードショートカット | key:1、nav:ArrowRight |
navigation | インスタンスナビゲーション | next、prev、instance_load |
save | アノテーション保存イベント | instance:123 |
annotation_change | ラベル変更 | schema:sentiment |
AIアシスタンスの使用状況
AI支援アノテーションの完全なライフサイクル追跡:
json
{
"request_timestamp": 1706500010.0,
"response_timestamp": 1706500012.5,
"schema_name": "sentiment",
"suggestions_shown": ["positive", "neutral"],
"suggestion_accepted": "positive",
"time_to_decision_ms": 3500
}アノテーション変更
すべてのアノテーションの詳細な変更履歴:
json
{
"timestamp": 1706500002.5,
"schema_name": "sentiment",
"label_name": "positive",
"action": "select",
"old_value": null,
"new_value": true,
"source": "user"
}ソースタイプ:
user- 直接的なユーザーインタラクションai_accept- ユーザーがAI提案を承認keyboard- キーボードショートカットを使用prefill- 設定から事前入力
データ形式
各アノテーションインスタンスにはbehavioral_dataオブジェクトが含まれます:
json
{
"id": "instance_123",
"annotations": {
"sentiment": {"positive": true}
},
"behavioral_data": {
"instance_id": "instance_123",
"session_start": 1706500000.0,
"session_end": 1706500045.0,
"total_time_ms": 45000,
"interactions": [...],
"ai_usage": [...],
"annotation_changes": [...],
"navigation_history": [...],
"focus_time_by_element": {
"label:positive": 2500,
"textbox:explanation": 8000
},
"scroll_depth_max": 75.5
}
}設定
行動トラッキングはデフォルトで有効です。追加の設定は不要です。
フロントエンドデバッグモード
インタラクショントラッカーのデバッグログを有効にするには:
javascript
// In browser console
window.interactionTracker.setDebugMode(true);分析例
行動データの読み込み
python
import json
from pathlib import Path
def load_behavioral_data(annotation_dir: str) -> dict:
data = {}
for user_dir in Path(annotation_dir).iterdir():
if not user_dir.is_dir():
continue
state_file = user_dir / 'user_state.json'
if state_file.exists():
with open(state_file) as f:
user_state = json.load(f)
user_id = user_state.get('user_id')
behavioral = user_state.get('instance_id_to_behavioral_data', {})
data[user_id] = behavioral
return dataアノテーション時間の分析
python
def analyze_annotation_time(behavioral_data: dict) -> dict:
stats = {}
for user_id, instances in behavioral_data.items():
times = []
for instance_id, bd in instances.items():
if 'total_time_ms' in bd:
times.append(bd['total_time_ms'] / 1000)
if times:
stats[user_id] = {
'mean_time': sum(times) / len(times),
'min_time': min(times),
'max_time': max(times),
'total_instances': len(times)
}
return stats不審な行動の検出
python
def detect_suspicious_annotators(behavioral_data: dict,
min_time_threshold: float = 2.0) -> list:
suspicious = []
for user_id, instances in behavioral_data.items():
fast_count = 0
for instance_id, bd in instances.items():
time_sec = bd.get('total_time_ms', 0) / 1000
if time_sec < min_time_threshold:
fast_count += 1
total = len(instances)
if total > 0:
fast_rate = fast_count / total
if fast_rate > 0.5:
suspicious.append({
'user_id': user_id,
'fast_rate': fast_rate,
'total_instances': total
})
return suspicious管理者ダッシュボード統合
管理者ダッシュボードには行動分析タブが含まれています:
- ユーザーインタラクションヒートマップ:インタラクションパターンの視覚的表現
- AIアシスタンスメトリクス:承認/拒否率、判断時間
- タイミング分布:アノテーション時間のヒストグラム
- 不審なアクティビティアラート:レビューが必要なフラグ付きアノテーター
APIエンドポイント
インタラクションの追跡
http
POST /api/track_interactions
Content-Type: application/json
{
"instance_id": "instance_123",
"events": [...],
"focus_time": {"element": ms},
"scroll_depth": 75.5
}行動データの取得
http
GET /api/behavioral_data/<instance_id>インスタンスの完全な行動データを返します。
ベストプラクティス
研究者向け
- ベースラインの確立:既知の優良アノテーターから行動データを収集してベースラインを確立する
- 品質メトリクス:品質評価のためにアノテーション一致度と並行して行動データを使用する
- トレーニング評価:トレーニング前後の行動パターンを比較する
- AI影響分析:AIアシスタンスがアノテーションの品質と速度にどのように影響するか測定する
アノテーションプロジェクト向け
- リアルタイム監視:管理者ダッシュボードを使用して問題を早期に発見する
- 閾値の設定:タイミングとインタラクションメトリクスの許容範囲を定義する
- フィードバックの提供:行動の洞察を使用してアノテーターにターゲットを絞ったフィードバックを提供する
トラブルシューティング
行動データが収集されない
interaction_tracker.jsが読み込まれていることを確認する(ブラウザのNetworkタブを確認)- ブラウザコンソールでJavaScriptエラーを確認する
- APIエンドポイントにアクセス可能であることを確認する(
/api/track_interactions)
データが永続化されない
- ユーザー状態が保存されていることを確認する(
user_state.jsonを確認) - アノテーション出力ディレクトリが書き込み可能であることを確認する
関連情報
- 管理者ダッシュボード - リアルタイム監視
- アノテーション履歴 - 詳細な変更追跡
- 品質管理 - 自動品質チェック
実装の詳細については、ソースドキュメントを参照してください。