Annotation Types

Annotation types are the valid annotation labels that can be applied to source material.

Create Annotation Type

POST https://api.annolab.ai/v1/annotation-type/create

Create a new annotation type within your schema

Headers

NameTypeDescription

Authorization*

string

Where you put your api key. Creating a schema requires a key with "Write" permissions. {"Authorization": "Api-Key XXXXXXX-XXXXXXX-XXXXXXX"}

Request Body

NameTypeDescription

isRelation

boolean

Whether the type being created is intended for use as an annotation relation type. Defaults to False

color

string

Hex code for the color of the annotation type color: "#D00021B" if not provided it will be auto generated

typeName*

string

Name of the annotation type that will be created

projectIdentifier*

string

Identifier for the project that will contain the annotation type. Either the id or the unique name.

category

string

Category grouping for the annotation type

isDocumentClassification

boolean

Boolean for whether the annotation type is a document type classification

{
    "schemaName": "NER",
    "schemaId": 7,
    "key": "place-name",
    "color": "#F882FD",
    "typeId": "51",
    "name": "Place Name"
}

This code shows how to create a new annotation type

import requests

ANNO_LAB_API_KEY = 'XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'

annotationType = {
  'projectIdentifier': 'New NER Project',
  'category': 'NER',
  'typeName': 'Place Name' 
}

headers = {
  'Authorization': 'Api-Key '+ANNO_LAB_API_KEY,
}

url = 'https://api.annolab.ai/v1/annotation-type/create'

response = requests.post(url, headers=headers, json=annotationType)

print(response.json())

Last updated