I’m getting into manual annotation for NLP , found a cool tool named DOCCANO for annotation which has auto labelling feature. If anyone know how to setup auto annotation using custom REST api request.
2 Answers
Answer from @druskacik is very useful. just one minor edit: the values need to be wrapped in double-quotation marks.
In the example case:
[
{% for entity in input %}
{
"start_offset": "{{ entity.start_offset }}",
"end_offset": "{{ entity.end_offset}}",
"label": "P-B"
}{% if not loop.last %},{% endif %}
{% endfor %}
]

- 11
- 1
Example for Sequence Labeling project:
Let's say we have custom API that requires text to be classified send in a request body, like this:
{
"text": "example text"
}
When setting up Auto Labeling in Doccano, in the second screen Set parameters, set up your API url and other optional parameters (e.g. authentication headers), then use text
variable as shown in the screenshot, using {{ text }}
format. Every time the auto labeling API is called, it will send text in place of this variable.
In the next step, Set a template, we need to specify a mapping template for mapping the API response to doccano specific format. In this case, we could use this:
It uses jinja
format, here is mapping template from the screenshot:
[
{% for entity in input %}
{
"start_offset": {{ entity.start_offset }},
"end_offset": {{ entity.end_offset}},
"label": "P-B"
}{% if not loop.last %},{% endif %}
{% endfor %}
]
Finally, in the last step, we just map labels from the previous step to labels that were created before in the doccano project. This should be straightforward.
Then just click Finish and we are good to go.
To enable auto-labeling, open any datapoint in the Dataset tab and toggle the switch in the window that shows up after clicking Auto Labeling button. From now on, every time you open an un-approved data row, it will automatically use auto-labeling to label the text for you.

- 2,176
- 2
- 13
- 26