Clarifai Guide
Clarifai Home
v6.11
v6.11
  • Welcome
  • Getting Started
    • Quick Start
    • Applications
      • Create an Application
      • Application Settings
      • Collaboration
    • Authentication
      • App-Specific API Keys
      • Personal Access Tokens
      • Scopes
      • Authorize
      • 2FA
    • Glossary
  • How-To
    • Portal
      • Auto Annotation
      • Custom Models
      • Text Classification
      • Visual Text Recognition
    • API
      • Auto Annotation
      • Batch Predict CSV on Custom Text Model
      • Custom KNN Face Classifier Workflow
      • Custom Models
      • Custom Text Model
      • Visual Text Recognition
  • API Guide
    • API overview
      • API Clients
      • Using Postman with Clarifai APIs
      • Status Codes
      • Pagination
      • Patching
    • Data Mode
      • Supported Formats
      • Create, Get, Update, Delete
      • Collectors
    • Concepts
      • Create, Get, Update
      • Languages
      • Search by Concept
      • Knowledge Graph
    • Scribe Label
      • Annotations
      • Training Data
      • Positive and Negative Annotations
      • Tasks
      • Task Annotations
    • Enlight Train
      • Clarifai Models
      • Model Types
      • Create, Get, Update, Delete
      • Deep Training
      • Evaluate
        • Interpreting Evaluations
        • Improving Your Model
    • Mesh Workflows
      • Base Workflows
      • Create, Get, Update, Delete
      • Input Nodes
      • Workflow Predict
    • Armada Predict
      • Images
      • Video
      • Prediction Parameters
      • Multilingual Classification
    • Spacetime Search
      • Search Overview
      • Combine or Negate
      • Filter
      • Rank
      • Index Images for Search
      • Legacy Search
        • Combine or Negate
        • Filter
        • Rank
        • Saved Searches
  • Portal Guide
    • Portal Overview
    • Data Mode
      • Supported Formats
      • CSV and TSV
      • Collectors
    • Concepts
      • Create, Get, Update, Delete
      • Knowledge Graph
      • Languages
    • Scribe Label
      • Create a Task
      • Label Types
      • Labeling Tools
      • Workforce Management
      • Training Data
      • Positive and Negative Annotations
    • Enlight Train
      • Training Basics
      • Clarifai Models
      • Model Types
      • Deep Training
      • Evaluate
        • Interpreting Evaluations
        • Improving Your Model
    • Mesh Workflows
      • Base Workflows
      • Setting Up a Mesh Workflow
      • Input Nodes
    • Armada Predict
    • Spacetime Search
      • Rank
      • Filter
      • Combine or Negate
      • Saved Searches
      • Visual Search
  • Data Labeling Services
    • Scribe LabelForce
  • Product Updates
    • Upcoming API Changes
    • Changelog
      • Release 6.11
      • Release 6.10
      • Release 6.9
      • Release 6.8
      • Release 6.7
      • Release 6.6
      • Release 6.5
      • Release 6.4
      • Release 6.3
      • Release 6.2
      • Release 6.1
      • Release 6.0
      • Release 5.11
      • Release 5.10
Powered by GitBook
On this page
  • Create
  • Non-Assigned Task
  • Assigned Task
  • Task with Partitioned Worker Strategy
  • Task with Consensus Review
  • Get
  • Get Task by ID
  • List All Tasks
  • List Tasks Assigned to User
  • List Tasks Assigned to User for Review
  • Update
  • Update Task
  • Delete
  • Delete Multiple Tasks

Was this helpful?

  1. API Guide
  2. Scribe Label

Tasks

Group your labeling work into tasks that can be delegated.

The tasks are a powerful tool which can help your team to annotate inputs from your application.

Create

To create a new task in your app you POST the task information to v2/task endpoint.

Non-Assigned Task

A task should be assigned to a list of users, but it's not required. The following code will create a non-assigned task.

curl -X POST \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
  {
      "tasks": [
          {
              "type": "CONCEPTS_CLASSIFICATION",
              "name": "Annotate {{concept_id}}",
              "worker": {
                  "strategy": "FULL"
              },
              "concept_ids": [
                  "{{concept_id}}"
              ],
              "input_source": {
                  "type": "ALL_INPUTS"
              },
              "sample_ms": 1000,
              "review": {
                  "strategy": "NONE"
              }
          }
      ]
  }'\
  https://api.clarifai.com/v2/tasks

Assigned Task

A task should be assigned to a list of users. These users will do the work, so they're also called workers. A task may also be assigned to a list of users for review.

curl -X POST \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
    {
        "tasks": [
            {
                "type": "CONCEPTS_CLASSIFICATION",
                "name": "Annotate {{concept_id}}",
                "worker": {
                    "strategy": "FULL",
                    "user_ids": [
                        "{{worker_user_id}}"
                    ]
                },
                "concept_ids": [
                    "{{concept_id}}"
                ],
                "input_source": {
                    "type": "ALL_INPUTS"
                },
                "sample_ms": 1000,
                "review": {
                    "strategy": "MANUAL",
                    "manual_strategy_info": {
                        "sample_percentage": 0.5
                    },
                    "user_ids": [
                        "{{reviewer_user_id}}"
                    ]
                }
            }
        ]
    }'\
  https://api.clarifai.com/v2/tasks

Task with Partitioned Worker Strategy

The previous tasks were created with full worker strategy.

{
    "strategy": "FULL"
}

In case of FULL worker strategy, each worker will work on all inputs selected in the input source.

If you wish the work to be distributed between workers, then you can select the PARTITIONED worker strategy.

In the following example:

  • there are two workers

  • workers_per_input: each input will be assigned to 1 worker

  • weights.{{user_id1}}: the first worker will get 90% of inputs

  • weights.{{user_id2}}: the second worker will get 10% of inputs

curl -X POST \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
    {
        "tasks": [
            {
                "type": "CONCEPTS_CLASSIFICATION",
                "name": "Annotate {{concept_id}}",
                "worker": {
                    "strategy": "PARTITIONED",
                    "user_ids": ["{{user_id1}}", "{{user_id2}}"],
                    "partitioned_strategy_info": {
                        "type": "WEIGHTED",
                        "workers_per_input": 1,
                        "weights": {
                            "{{user_id1}}": 90,
                            "{{user_id2}}": 10
                        }
                    }
                },
                "concept_ids": [
                    "{{concept_id}}"
                ],
                "input_source": {
                    "type": "ALL_INPUTS"
                },
                "sample_ms": 1000,
                "review": {
                    "strategy": "NONE"
                }
            }
        ]
    }'\
  https://api.clarifai.com/v2/tasks

Notes:

  • It is not required for the weights to add up to 100. For example, the weights [9, 1] are equivalent with weights [90, 10].

  • The partitioning is approximate. This means that the number of assigned inputs to each worker may have a small error margin, but it will be close to the assigned weight percentage.

Task with Consensus Review

The previous tasks were created with no review or manual review strategy.

{
  "strategy": "MANUAL"
}

We recommend to create tasks with CONSENSUS review strategy. When enough workers label an input in the same way, it will automatically be approved, with no need for the reviewer to spend time to check. In this way, the reviewer will be able to focus on the inputs where the workers don't agree.

Note that an approval threshold must be set. For example, in case of 3 workers and approval_threshold set to 2, if an input is labeled in the same way by 2 workers, they form a majority and the group reaches a consensus.

curl -X POST \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
    {
        "tasks": [
            {
                "type": "CONCEPTS_CLASSIFICATION",
                "name": "Annotate {{concept_id}}",
                "worker": {
                    "strategy": "PARTITIONED",
                    "user_ids": ["{{user_id1}}", "{{user_id2}}", "{{user_id3}}"],
                    "partitioned_strategy_info": {
                        "type": "WEIGHTED",
                        "workers_per_input": 1,
                        "weights": {
                            "{{user_id1}}": 1,
                            "{{user_id2}}": 1,
                            "{{user_id3}}": 1
                        }
                    }
                },
                "concept_ids": [
                    "{{concept_id}}"
                ],
                "input_source": {
                    "type": "ALL_INPUTS"
                },
                "sample_ms": 1000,
                "review": {
                    "strategy": "CONSENSUS",
                    "consensus_strategy_info": {
                        "approval_threshold": 2
                    },
                    "user_ids": [
                        "{{user_id4}}"
                    ]
                }
            }
        ]
    }'\
  https://api.clarifai.com/v2/tasks

Get

Get Task by ID

You can get a singular task by its ID. The ID was automatically generated when it was created.

curl -X GET \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://api.clarifai.com/v2/tasks/{task_id}

List All Tasks

curl -X GET \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://api.clarifai.com/v2/tasks

List Tasks Assigned to User

Get only the tasks assigned to a specific user for work.

curl -X GET \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://api.clarifai.com/v2/tasks?worker_user_ids={{user_id}}

List Tasks Assigned to User for Review

Get only the tasks assigned to a specific user for review.

curl -X GET \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://api.clarifai.com/v2/tasks?review_user_ids={{user_id}}

Update

Currently, we only support updating a task by providing all information at once.

Update Task

curl -X PATCH \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
    {
        "action": "overwrite",
        "tasks": [
            {
                "id": "{{task_id}}",
                "type": "CONCEPTS_CLASSIFICATION",
                "name": "Annotate {{concept_id}}",
                "worker": {
                    "strategy": "PARTITIONED",
                    "user_ids": ["{{user_id1}}", "{{user_id2}}"],
                    "partitioned_strategy_info": {
                        "type": "WEIGHTED",
                        "workers_per_input": 1,
                        "weights": {
                            "{{user_id1}}": 1,
                            "{{user_id2}}": 1
                        }
                    }
                },
                "concept_ids": [
                    "{{concept_id}}"
                ],
                "input_source": {
                    "type": "ALL_INPUTS"
                },
                "sample_ms": 1000,
                "review": {
                    "strategy": "CONSENSUS",
                    "consensus_strategy_info": {
                        "approval_threshold": 2
                    },
                    "user_ids": [
                        "{{user_id3}}"
                    ]
                },
                "status": {
                    "code": "TASK_DONE"
                }
            }
        ]
    }'\
  https://api.clarifai.com/v2/tasks

Delete

Delete Multiple Tasks

You can delete tasks using their IDs.

curl -X DELETE \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
    {
        "ids":["{{task_id}}"]
    }'\
  https://api.clarifai.com/v2/tasks
PreviousPositive and Negative AnnotationsNextTask Annotations

Last updated 4 years ago

Was this helpful?

You can get a list of tasks within your app with a GET call. This call supports .

pagination