label-studio

用于机器学习项目的数据标注与注释开源平台。支持文本、图像、音频、视频和时间序列数据,提供可配置的标注界面、机器学习辅助标注、团队协作功能,并通过 API 集成以自动化工作流。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "label-studio":https://skillpi.com/zh/skills/deepskill-295f7bbb2e3d9fcd8227f75444e94909ae180fd14bf3a54ffffd30e34cc21110。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于机器学习项目的数据标注与注释开源平台。支持文本、图像、音频、视频和时间序列数据,提供可配置的标注界面、机器学习辅助标注、团队协作功能,并通过 API 集成以自动化工作流。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: label-studio
description: |
  Open-source data labeling and annotation platform for ML projects. Supports text, image,
  audio, video, and time-series data. Features configurable labeling interfaces, ML-assisted
  labeling, team collaboration, and API integration for automated workflows.
license: Apache-2.0
compatibility: 'python 3.8+, label-studio 1.10+, Linux/macOS/Windows'
metadata:
  author: terminal-skills
  version: 1.0.0
  category: data-ai
  tags:
    - data-labeling
    - annotation
    - ml-workflows
    - active-learning
    - data-quality

Label Studio

Installation

# Install Label Studio
pip install label-studio

# Start the server
label-studio start --port 8080
# Visit http://localhost:8080 to create account and first project

Docker Deployment

# docker-compose.yml — Production Label Studio with PostgreSQL
version: "3.9"
services:
  label-studio:
    image: heartexlabs/label-studio:latest
    ports:
      - "8080:8080"
    environment:
      DJANGO_DB: default
      POSTGRE_NAME: labelstudio
      POSTGRE_USER: labelstudio
      POSTGRE_PASSWORD: labelstudio
      POSTGRE_HOST: db
      POSTGRE_PORT: 5432
      LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED: "true"
      LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT: /label-studio/files
    volumes:
      - ls-data:/label-studio/data
      - ./files:/label-studio/files
    depends_on:
      - db
  db:
    image: postgres:15
    environment:
      POSTGRES_DB: labelstudio
      POSTGRES_USER: labelstudio
      POSTGRES_PASSWORD: labelstudio
    volumes:
      - pg-data:/var/lib/postgresql/data
volumes:
  ls-data:
  pg-data:

Labeling Configuration (XML Templates)

<!-- text_classification.xml — Sentiment classification labeling interface -->
<View>
  <Header value="Classify the sentiment of this text:"/>
  <Text name="text" value="$text"/>
  <Choices name="sentiment" toName="text" choice="single" showInline="true">
    <Choice value="Positive"/>
    <Choice value="Negative"/>
    <Choice value="Neutral"/>
  </Choices>
</View>
<!-- ner_labeling.xml — Named entity recognition labeling interface -->
<View>
  <Labels name="label" toName="text">
    <Label value="Person" background="#FF0000"/>
    <Label value="Organization" background="#00FF00"/>
    <Label value="Location" background="#0000FF"/>
    <Label value="Date" background="#FFA500"/>
  </Labels>
  <Text name="text" value="$text"/>
</View>
<!-- image_bbox.xml — Image object detection with bounding boxes -->
<View>
  <Image name="image" value="$image"/>
  <RectangleLabels name="label" toName="image">
    <Label value="Car" background="#FF0000"/>
    <Label value="Person" background="#00FF00"/>
    <Label value="Bicycle" background="#0000FF"/>
  </RectangleLabels>
</View>

API: Import Tasks

# import_tasks.py — Import labeling tasks via the API
import requests

LS_URL = "http://localhost:8080"
API_KEY = "your-api-key-from-account-settings"
PROJECT_ID = 1

headers = {"Authorization": f"Token {API_KEY}"}

# Import text classification tasks
tasks = [
    {"data": {"text": "This product is amazing! I love it."}},
    {"data": {"text": "Terrible experience, would not recommend."}},
    {"data": {"text": "It's okay, nothing special."}},
]

response = requests.post(
    f"{LS_URL}/api/projects/{PROJECT_ID}/import",
    headers=headers,
    json=tasks,
)
print(f"Imported {response.json()['task_count']} tasks")

API: Export Annotations

# export_annotations.py — Export completed annotations for model training
import requests
import json

LS_URL = "http://localhost:8080"
API_KEY = "your-api-key"
PROJECT_ID = 1

headers = {"Authorization": f"Token {API_KEY}"}

response = requests.get(
    f"{LS_URL}/api/projects/{PROJECT_ID}/export?exportType=JSON",
    headers=headers,
)

annotations = response.json()
for task in annotations:
    text = task["data"]["text"]
    label = task["annotations"][0]["result"][0]["value"]["choices"][0]
    print(f"Text: {text[:50]}... → Label: {label}")

# Save for training
with open("labeled_data.json", "w") as f:
    json.dump(annotations, f, indent=2)

Label Studio SDK

# sdk_usage.py — Use the Python SDK for programmatic access
from label_studio_sdk import Client

ls = Client(url="http://localhost:8080", api_key="your-api-key")

# Create a new project
project = ls.start_project(
    title="Customer Reviews",
    label_config="""
    <View>
      <Text name="text" value="$text"/>
      <Choices name="sentiment" toName="text" choice="single">
        <Choice value="Positive"/>
        <Choice value="Negative"/>
      </Choices>
    </View>
    """,
)

# Import tasks
project.import_tasks([
    {"text": "Great product!"},
    {"text": "Not worth the money."},
])

# Get annotated tasks
labeled = project.get_labeled_tasks()
print(f"Completed annotations: {len(labeled)}")

ML Backend (Pre-labeling)

# ml_backend.py — ML backend for pre-labeling / active learning
from label_studio_ml import LabelStudioMLBase

class SentimentPredictor(LabelStudioMLBase):
    def setup(self):
        from transformers import pipeline
        self.classifier = pipeline("sentiment-analysis")

    def predict(self, tasks, **kwargs):
        predictions = []
        for task in tasks:
            text = task["data"]["text"]
            result = self.classifier(text)[0]
            predictions.append({
                "result": [{
                    "from_name": "sentiment",
                    "to_name": "text",
                    "type": "choices",
                    "value": {"choices": [result["label"].capitalize()]},
                }],
                "score": result["score"],
            })
        return predictions
# Start the ML backend
label-studio-ml start ./ml_backend --port 9090

# Connect it to Label Studio project via Settings > Machine Learning

Key Concepts

  • Labeling configs: XML templates defining the annotation interface — highly customizable
  • Tasks: Data items to be labeled, imported via API or UI
  • Annotations: Human labels on tasks, exportable in multiple formats (JSON, CSV, COCO, etc.)
  • ML backends: Connect models for pre-labeling and active learning workflows
  • Webhooks: Get notified when annotations are created or updated
  • Multi-type: Supports text, images, audio, video, HTML, and time-series in one platform

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 提供机器学习数据标注平台的完整解决方案,覆盖文本、图像、音频等多模态数据
  • 包含生产级 Docker 部署方案与 PostgreSQL 集成,适合实际项目使用
触发精准95/100

亮点

  • description 准确描述平台核心功能与适用场景,触发词完整且无歧义
结构规范90/100

亮点

  • 文档结构清晰,分模块展示安装、配置、API、SDK 等关键内容
  • 提供多种标注界面 XML 模板与完整代码示例,便于用户快速上手
执行可靠88/100

亮点

  • 支持 pip 与 Docker 两种部署方式,适应不同环境需求
  • API 与 SDK 示例完整,ML 后端集成方案清晰,覆盖主要异常场景
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 保存或修改文件

    先确认输出目录和同名文件是否会被覆盖;重要文件保留备份,优先写入新的输出目录。

    主文档提及 · 第 163 行
  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 27 行
  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 118, 121, 146, 149, 173 行
文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • localhost

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。