スキル一覧に戻る

label-training-data

pjt222
更新日 Yesterday
4 閲覧
17
2
17
GitHubで表示
デザインaiautomationdesigndata

について

このスキルは、Label Studioなどのツールを用いて体系的なデータラベリングワークフローを構築し、品質管理を実施し、ラベリングチームを管理します。教師あり機械学習プロジェクトを開始する際、ラベル付きデータ不足によりモデル性能が制限されている場合、または能動的学習を導入する際に役立ちます。主な機能には、アノテーター間一致率の測定や、ラベル付きデータの機械学習トレーニングパイプラインへの統合が含まれます。

クイックインストール

Claude Code

推奨
メイン
npx skills add pjt222/agent-almanac -a claude-code
プラグインコマンド代替
/plugin add https://github.com/pjt222/agent-almanac
Git クローン代替
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/label-training-data

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Label Training Data

See Extended Examples for complete configuration files and templates.

Systematically label data for supervised ML with quality controls and efficient workflows.

适用场景

  • Starting supervised ML project that requires labeled training data
  • Current model performance limited by insufficient labeled examples
  • Need to label text, images, audio, or video data
  • Want to measure and improve annotation quality
  • Managing team of annotators with different expertise levels
  • Implementing active learning to prioritize valuable examples
  • Need to track labeling progress and costs
  • Ensuring consistent labels across multiple annotators

输入

  • 必需: Unlabeled dataset (images, text, audio, video)
  • 必需: Label schema (classes, attributes, or annotation types)
  • 必需: Labeling guidelines document
  • 可选: Pre-existing labels (for quality comparison)
  • 可选: Model predictions for pre-annotation
  • 可选: Budget and timeline constraints
  • 可选: Domain expert availability for difficult examples

步骤

第 1 步:Install and Configure Label Studio

Set up Label Studio as the labeling platform.

# Install Label Studio
pip install label-studio

# Or use Docker for production
docker pull heartexlabs/label-studio:latest

# Create project directory
mkdir -p labeling-project/{data,exports,config}
cd labeling-project

# Initialize Label Studio
label-studio init my_project

# Start Label Studio server
label-studio start my_project --port 8080

Access at http://localhost:8080 (default credentials: create on first visit).

For production deployment with Docker:

# docker-compose.yml
version: '3.8'

services:
  label-studio:
    image: heartexlabs/label-studio:latest
    ports:
      - "8080:8080"
# ... (see EXAMPLES.md for complete implementation)
docker-compose up -d

预期结果: Label Studio running and accessible, PostgreSQL database initialized for production use.

失败处理: If port 8080 already in use, change port in config, if Docker fails check Docker daemon is running, ensure sufficient disk space for data volumes, check firewall allows port 8080.

第 2 步:Design Labeling Interface and Schema

Create labeling configuration for your task type.

# labeling-project/config/labeling_config.py
"""
Label Studio configuration templates for common tasks.
"""

# Text Classification (single label)
TEXT_CLASSIFICATION = """
<View>
# ... (see EXAMPLES.md for complete implementation)

预期结果: Labeling interface configured with appropriate controls for task type, data imported successfully, interface accessible to annotators.

失败处理: Validate XML config with Label Studio's config validator, check data file format (JSON or CSV), ensure image/audio URLs are accessible if using external storage, verify API key has correct permissions.

第 3 步:Prepare Data and Implement Sampling Strategy

Format data for import and prioritize examples for labeling.

# labeling-project/prepare_data.py
import pandas as pd
import json
import random
from typing import List, Dict
from sklearn.cluster import KMeans
import numpy as np

# ... (see EXAMPLES.md for complete implementation)

预期结果: Data formatted correctly for Label Studio import, sampling strategy prioritizes informative examples, tasks include metadata for tracking.

失败处理: Verify JSON format with jq or Python json.load(), check that URLs are accessible if using remote images, ensure no special characters break JSON encoding, validate column names match config.

第 4 步:Implement Quality Control and IAA Measurement

Set up processes to measure and improve annotation quality.

# labeling-project/quality_control.py
import pandas as pd
import numpy as np
from sklearn.metrics import cohen_kappa_score, confusion_matrix
from typing import Dict, List, Tuple
import logging

logging.basicConfig(level=logging.INFO)
# ... (see EXAMPLES.md for complete implementation)

预期结果: Inter-annotator agreement measured (Cohen's Kappa > 0.6 is moderate, >0.8 is good), difficult tasks identified for review, annotator performance tracked.

失败处理: If Kappa very low (<0.4), review labeling guidelines for clarity, retrain annotators, simplify label schema, check for ambiguous examples, consider using expert annotators for gold standard.

第 5 步:Export and Integrate Labeled Data

Export labels and prepare for ML training.

# labeling-project/export_labels.py
import requests
import pandas as pd
import json
from typing import List, Dict
import logging

logger = logging.getLogger(__name__)
# ... (see EXAMPLES.md for complete implementation)

预期结果: Annotations exported in training-ready format, label distribution balanced or documented, data quality validated before training.

失败处理: Verify API key permissions, check export format compatibility with your ML framework, handle missing annotations gracefully, validate JSON structure matches expected format.

第 6 步:Set Up Continuous Labeling Pipeline

Automate labeling workflow with active learning integration.

# labeling-project/active_learning_pipeline.py
import schedule
import time
import logging
from datetime import datetime
from prepare_data import DataSampler, prepare_label_studio_format
from export_labels import LabelStudioExporter, convert_to_training_format
import pandas as pd
# ... (see EXAMPLES.md for complete implementation)

预期结果: Active learning selects informative examples automatically, labeling batches prepared weekly, model retrained when sufficient new labels available.

失败处理: If uncertainty sampling doesn't improve model, try diversity sampling, if annotators can't keep up reduce batch size, monitor labeling queue length, implement backpressure if queue grows too large.

验证清单

  • Label Studio accessible and responsive
  • Labeling interface intuitive (test with sample annotator)
  • Data import successful with correct format
  • Inter-annotator agreement (Cohen's Kappa) > 0.6
  • Quality control identifies problematic tasks
  • Labels export in training-ready format
  • Label distribution matches expected (or intentionally imbalanced)
  • Active learning pipeline runs without manual intervention
  • Annotation throughput meets project timeline

常见问题

  • Unclear guidelines: Ambiguous instructions cause inconsistent labels; invest in detailed guidelines with examples
  • Insufficient overlap: Can't measure IAA without multiple annotators per task; use 10-20% overlap
  • Ignoring difficult cases: Edge cases often skipped but critical for model robustness; flag for expert review
  • Batch effects: Annotator fatigue or learning causes temporal inconsistency; randomize task order
  • No quality feedback: Annotators don't improve without feedback; provide regular accuracy reports
  • Wrong sampling strategy: Random sampling wastes budget on easy examples; use uncertainty or diversity sampling
  • Labeling in isolation: Domain experts needed for complex tasks; pair novices with experts initially
  • Not tracking costs: Labeling expensive; monitor time per task and total budget consumption

相关技能

  • version-ml-data - Version control for labeled datasets
  • track-ml-experiments - Track model performance as labels added

GitHub リポジトリ

pjt222/agent-almanac
パス: i18n/zh-CN/skills/label-training-data
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

関連スキル

executing-plans

デザイン

executing-plansスキルは、完全な実装計画があり、それを管理されたバッチでレビューチェックポイントを設けながら実行する場合に使用します。このスキルは計画を読み込んで批判的にレビューした後、小さなバッチ(デフォルトは3タスク)でタスクを実行し、各バッチの間に進捗状況を報告してアーキテクトのレビューを受けます。これにより、品質管理チェックポイントが組み込まれた体系的な実装が保証されます。

スキルを見る

requesting-code-review

デザイン

このスキルは、コードレビュアーサブエージェントを起動し、処理を進める前に要件に対してコード変更を分析します。タスク完了後、主要な機能の実装後、またはmainブランチへのマージ前などに使用すべきです。このレビューは、現在の実装と元の計画を比較することで、問題を早期に発見するのに役立ちます。

スキルを見る

connect-mcp-server

デザイン

このスキルは、開発者がHTTP、stdio、またはSSEトランスポートを使用してMCPサーバーをClaude Codeに接続するための包括的なガイドを提供します。GitHub、Notion、カスタムAPIなどの外部サービスを統合するためのインストール、設定、認証、セキュリティについて解説しています。MCP統合のセットアップ、外部ツールの設定、またはClaudeのModel Context Protocolを扱う際にご利用ください。

スキルを見る

web-cli-teleport

デザイン

このスキルは、タスク分析に基づいて開発者がClaude Code WebとCLIインターフェースの選択を支援し、これらの環境間でのシームレスなセッションテレポーテーションを可能にします。Web、CLI、モバイル環境を切り替える際のセッション状態とコンテキストを管理することで、ワークフローを最適化します。様々な段階で異なるツールを必要とする複雑なプロジェクトにご活用ください。

スキルを見る