Tutorial Lengkap Label Studio: Data Labeling untuk Machine Learning
Label Studio adalah platform data labeling open-source untuk machine learning. Platform ini mendukung labeling berbagai tipe data termasuk teks, gambar, audio, video, dan time series, menjadikannya essential untuk membangun dataset training ML berkualitas tinggi.
Mengapa Label Studio?
Keunggulan Label Studio:- Multi-modal: Label teks, gambar, audio, video, HTML
- Fleksibel: Interface labeling yang customizable
- Kolaboratif: Workflow anotasi berbasis tim
- Integrasi: ML backends, cloud storage, webhooks
- Open source: Self-hosted dengan opsi enterprise
- Anotasi NLP (NER, sentiment, classification)
- Computer vision labeling (bounding boxes, segmentation)
- Transkripsi dan klasifikasi audio
- Anotasi data multi-modal
- Workflow active learning
Instalasi
# Install dengan pip
pip install label-studio
Start Label Studio
label-studio start
Atau dengan Docker
docker run -it -p 8080:8080 \
-v $(pwd)/mydata:/label-studio/data \
heartexlabs/label-studio:latest
Akses di http://localhost:8080
Quick Start
1. Buat Project
from labelstudiosdk import Client
Koneksi ke Label Studio
ls = Client(url='http://localhost:8080', apikey='your-api-key')
Buat project
project = ls.startproject(
title='Analisis Sentimen',
labelconfig='''
'''
)
print(f"Project dibuat: {project.id}")
2. Import Data
# Import dari list
tasks = [
{"text": "Saya suka produk ini!"},
{"text": "Ini sangat buruk."},
{"text": "Biasa saja, tidak istimewa."}
]
project.importtasks(tasks)
Import dari file
project.importtasks('data.json')
Import dari URL
project.importtasks([
{"image": "https://example.com/image1.jpg"},
{"image": "https://example.com/image2.jpg"}
])
3. Export Anotasi
# Export semua anotasi
annotations = project.exporttasks()
Export dalam format spesifik
annotations = project.exporttasks(exporttype='JSON')
annotations = project.exporttasks(exporttype='CSV')
annotations = project.exporttasks(exporttype='COCO')
annotations = project.exporttasks(exporttype='YOLO')
Simpan ke file
import json
with open('annotations.json', 'w') as f:
json.dump(annotations, f)
Konfigurasi Label
1. Klasifikasi Teks
2. Named Entity Recognition
3. Klasifikasi Gambar