These end-to-end examples demonstrate how to use the SDK for specific use cases.
These scripts will help you import tasks with preannotations (predictions).
- import_preannotations.ipynb - The notebook with explanations: import tasks with preannotations for the classification labeling config
- import_preannotations.py - Import tasks with preannotations for the classification labeling config
- import_brush_predictions.py - This example shows how to import masks for BrushLabels
If your data is hosted in Google Cloud Storage (GCS), you can write a Python script to continuously sync data from the bucket with Label Studio. Follow this example to see how to do that with the Label Studio SDK. It's convenient and secure to host data in the cloud for data labeling, then sync task references to Label Studio to allow annotators to view and label the tasks without your data leaving the secure cloud bucket, LS won't touch your bucket data directly, only user browsers will do it.
See the notebook: Annotate data from Google Cloud Storage
- Export with filters - This example shows how to use the simplest version of exporting data with filters.
- Export snapshots - This example shows how to export, check export status and download JSON shapshots from Label Studio. This is detailed code on how to use snapshots. It includes the following steps:
- Create a snapshot
- Check the snapshot status
- Download the snapshot
If you want to write a Python script to set up an active learning workflow for labeling and training, review this
- working active learning example as a Jupyter notebook or
- start with the active learning python script example.
If you want to write a Python script to perform programmatic labeling and use weak supervision to correct the noisy labels, refer to this working weak supervision example as a Jupyter notebook or start with the weak supervision python script example.
Scripts for the enterprise version of Label Studio.
- label_studio_enterprise/assigner.py - This script runs every 10 seconds and assigns users to a new batch of tasks filtered by the specified column.
- label_studio_enterprise/assignment.ipynb - This tutorial describes the basics of assigning users to projects, workspaces, and specific tasks in Label Studio Enterprise using the Python SDK.
- label_studio_enterprise/user_management.ipynb - This tutorial describes the basics of managing users in Label Studio Enterprise using the Python SDK.
This script does the migration from one Label Studio instance to another (enterprise versions are supported too) using API.
- Adding new labels to the project - This tutorial demonstrates how to add new labels to an ongoing project in real-time. The included example showcases the use of the tag, which can be applied to the entire document. However, this same principle can also be used for other cases, such as modifying labels for computer vision applications (bounding boxes, polygons, etc.), or segments in text and audio using nested tags.
- Data Manager tab management - This tutorial describes the basics of managing views (tabs) in Label Studio Data Manager using the Python SDK.