Import Tasks
You can import tasks in Label Studio JSON format or connect to cloud storage providers and import image, audio, or video files directly.
Note the following:
- You must know your project ID. You can find this in the URL when viewing a Label Studio project (e.g.
https://app.humansignal.com/projects/<PROJECT_ID>) or you can use the API. - This example imports data using JSON format. The key for the data field should match the variable you used in your labeling config.
- For information on finding your API key and base URL, see Authenticate and Connect to the API.
For example, when we created the project, we specified the following labeling config:
So our imported data must use text so that the value=$text variable can find it.
Create a single task
You can import a single labeling task into your project using the tasks.create method:
Create multiple tasks
To create multiple tasks at once in a project, use the import_tasks method:
Create multiple tasks with preannotations
You can also import predictions together with tasks as pre-annotated tasks. The SDK offers several ways that you can import pre-annotations into Label Studio.
One way is to import tasks in a simple JSON format, where one key in the JSON identifies the data object being labeled, and the other is the key containing the prediction. In this case, that is sentiment because that is the name we used in our labeling configuration.
For example:
See also Add model predictions.
Read more about importing pre-annotations in the Label Studio documentation.