A classifier classifies an input (such as an entire image or sentence of text) into different categories. It assigns a confidence score for each class. Hive’s classifier models include the visual classification models and text classification models.
Classification models can be multi-headed, where each group of mutually exclusive model classes belong to a single model head. For example, when an image is run through Hive's visual moderation model, one head might classify sexually not-safe-for-work (NSFW) content while another head might classify the presence of guns.
This concept is illustrated below. This imaginary model has two heads:
- NSFW classification:
general_nsfw
,general_suggestive
,general_not_nsfw_not_suggestive
- Gun classification:
gun_in_hand
,animated_gun
,gun_not_in_hand
,no_gun
The confidence scores for each model head sum to 1.
Sample of task.status.output
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": 200,
"project_id": 12345,
"user_id": 1234,
"created_on": "2020-05-25T19:55:02.312Z",
"status": {
"status": {
"code": 0,
"message": "SUCCESS"
},
"response": {
"input": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"charge": 0,
"model": "string",
"model_version": 0,
"model_type": "string",
"created_on": "string",
"media": {
"type": "string",
"mimetype": "string",
"duration": 0,
"width": 0,
"height": 0
},
"user_id": 0,
"project_id": 0
},
"output": [
{
"time": 0,
"classes": [
{
"class": "general_nsfw",
"score": 0.9
},
{
"class": "general_suggestive",
"score": 0.05
},
{
"class": "general_not_nsfw_not_suggestive",
"score": 0.05
},
{
"class": "gun_in_hand",
"score": 0.88
},
{
"class": "animated_gun",
"score": 0.04
},
{
"class": "gun_not_in_hand",
"score": 0.04
},
{
"class": "no_gun",
"score": 0.04
}
]
}
]
}
},
"from_cache": false,
"metadata": "string"
}
Name | Description |
---|---|
time | Timestamp in seconds of video or audio frame extracted from the original media. Always 0 for images |
classes | List of objects for each output class that the API predicts. |
class | Name of predicted class. |
score | Confidence score of predicted class. |
id | Unique identifier for the job or request. |
code | HTTP or request-level status code. In the sample, 200 indicates a successful request. |
project_id | The top-level project ID associated with this request. |
user_id | The top-level user ID associated with this request. |
created_on | ISO 8601 timestamp indicating when this request was created. |
status.status.message | Descriptive message corresponding to the status code. (e.g. 0 for success) |
status.response.output | Array of output objects, each containing classification data (time and classes). |
from_cache | Boolean indicating whether the result was retrieved from a cache. |
metadata | Additional metadata or notes about the request. |