Annotations
Annotations are the fundamental building block of your ML training data. They reference a portion of a source file and are contained within Annotation Layers.
post
https://api.annolab.ai
/v1/annotation/create
Create Annotation
Examples of how to make an annotation create request
Python
import requests
ANNO_LAB_API_KEY = 'XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
annotation = {
'annoTypeIdentifier': 'Place Name',
'projectIdentifier': 'New NER Project',
'schemaIdentifier': 'NER',
'layerIdentifier': 'NER Gold',
'sourceIdentifier': 145,
'offsets': [0, 5],
'directoryIdentifier': 'Wikipedia Subset',
'value': '{latitude:"37.983810", longitude:"23.727539"}'
}
headers = {
'Authorization': 'Api-Key '+ANNO_LAB_API_KEY,
}
url = 'https://api.annolab.ai/v1/annotation/create'
response = requests.post(url, headers=headers, json=annotation)
print(response.json())
post
https://api.annolab.ai
/v1/annotation/bulk-create
Bulk Create Annotations
Examples of how to bulk create annotations
Python
import requests
ANNO_LAB_API_KEY = 'XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
headers = {
'Authorization': 'Api-Key '+ANNO_LAB_API_KEY,
}
bulk_request = {
'preventDuplication': True
'annotations': [
{
'annoTypeIdentifier': 'Place Name',
'projectIdentifier': 'New NER Project',
'schemaIdentifier': 'NER',
'layerIdentifier': 'NER Gold',
'sourceIdentifier': 145,
'offsets': [0, 5],
'directoryIdentifier': 'Wikipedia Subset',
'value': '{latitude:"37.983810", longitude:"23.727539"}',
'clientId': "24a"
},
{
'annoTypeIdentifier': 'Place Name',
'projectIdentifier': 'New NER Project',
'schemaIdentifier': 'NER',
'layerIdentifier': 'NER Gold',
'sourceIdentifier': 145,
'offsets': [120, 128],
'directoryIdentifier': 'Wikipedia Subset',
'value': '{latitude:"37.983810", longitude:"23.727539"}',
'clientId': "24b"
}
]
}
url = 'https://api.annolab.ai/v1/annotation/bulk-create'
response = requests.post(url, headers=headers, json=bulk_request)