Document classification output
The API resources performing document classification return a JSON object with this format:
{
"success": Boolean success flag,
"data": {
"content": analyzed text,
"language": language code,
"version": technology version info,
"categories": []
}
}
Tip
Use the live demo to see how API responses look like. Choose a taxonomy, run an analysis then select the {...} json tab in the results page.
For the description of the contents, language and version properties, see the API resources output overview.
Each item of the categories array represents a category, for example:
{
"frequency": 70.62,
"hierarchy": [
"Sport",
"Competition discipline",
"Basketball"
],
"id": "20000851",
"label": "Basketball",
"namespace": "iptc_en_1.0",
"positions": [
{
"end": 14,
"start": 0
},
{
"end": 53,
"start": 35
},
{
"end": 139,
"start": 136
}
],
"score": 4005.0,
"winner": true
}
namespaceis the name of the software module containing the reference taxonomy.id,labelandhierarchyidentify the category.scoreis the cumulative score that was attributed to the category.frequencyis the percentage ratio of the category score to the sum of all categories' scores.winneris a Boolean flag set totrueif the category was considered particularly relevant.positionsis an array containing the positions of the text blocks that contributed to category score.
Some resources that classify documents, if requested with appropriate query strings, can return additional output, such as GeoJSON or the main groups of emotional traits.