Endpoints
Universal classification
POST /classifications/universal
Classify documents with an Isaacus universal classification model.
Base URL: https://api.isaacus.com/v1
Request body
| Field | Type | Description |
|---|---|---|
model | string | The ID of the model to use for universal classification. |
query | string | The Isaacus Query Language (IQL) query or, if IQL is disabled, the statement, to evaluate the texts against. |
texts | array[string] | The texts to classify. |
is_iql | boolean | Whether the query should be interpreted as an IQL query or else as a statement. |
scoring_method | enum (auto | chunk_max | chunk_avg | chunk_min) | The method to use for producing an overall confidence score. |
chunking_options | object | null | Settings for how the texts should be chunked into smaller segments before classification using semchunk. |
model string
The ID of the model to use for universal classification.
query string
The Isaacus Query Language (IQL) query or, if IQL is disabled, the statement, to evaluate the texts against.
The query must contain at least one non-whitespace character.
Unlike the texts being classified, the query cannot be so long that it exceeds the maximum input length of the universal classifier.
texts array[string]
The texts to classify.
Each text must contain at least one non-whitespace character.
is_iql boolean
Whether the query should be interpreted as an IQL query or else as a statement.
scoring_method enum (auto | chunk_max | chunk_avg | chunk_min)
The method to use for producing an overall confidence score.
auto is the default scoring method and is recommended for most use cases. Currently, it is equivalent to chunk_max. In the future, it will automatically select the best method based on the model and inputs.
chunk_max uses the highest confidence score of all of the texts’ chunks.
chunk_avg averages the confidence scores of all of the texts’ chunks.
chunk_min uses the lowest confidence score of all of the texts’ chunks.
chunking_options object
Settings for how the texts should be chunked into smaller segments before classification using semchunk.
If null, the texts will not be chunked and will instead be truncated to the maximum input length of the model less overhead if found to exceed that limit.
Chunking is enabled by default.
size integer
The maximum number of tokens allowed in a chunk.
If null, the maximum input length of the model will be used less overhead.
overlap_ratio number
The proportion of the chunk size by which chunks should overlap.
The ratio must be less than 1.
If null, no overlapping will occur unless overlap_tokens is set.
overlap_ratio and overlap_tokens cannot both be set.
overlap_tokens integer
The number of tokens by which chunks should overlap.
If null, no overlapping will occur unless overlap_ratio is set.
overlap_tokens and overlap_ratio cannot both be set.
Response
| Field | Type | Description |
|---|---|---|
classifications | array[object] | The classifications of the texts, by relevance to the query, in order from highest to lowest confidence score. |
usage | object | Statistics about the usage of resources in the process of classifying the text. |
classifications array[object]
The classifications of the texts, by relevance to the query, in order from highest to lowest confidence score.
index integer
The index of the text in the input array of texts, starting from 0 (and, therefore, ending at the number of texts minus 1).
score number
A score of the likelihood that the query expressed about the text is supported by the text.
A score greater than 0.5 indicates that the text supports the query, while a score less than 0.5 indicates that the text does not support the query.
chunks array[object]
The text as broken into chunks by semchunk, each chunk with its own confidence score, ordered from highest to lowest score.
If no chunking occurred, this will be null.
index integer
The original position of the chunk in the outputted list of chunks before sorting, starting from 0 (and, therefore, ending at the number of chunks minus 1).
start integer
The index of the character in the original text where the chunk starts, beginning from 0.
end integer
The index of the character immediately after the last character of the chunk in the original text, beginning from 0 (such that, in Python, the chunk is equivalent to text[start:end]).
score number
The model’s score of the likelihood that the query expressed about the chunk is supported by the chunk.
A score greater than 0.5 indicates that the chunk supports the query, while a score less than 0.5 indicates that the chunk does not support the query.
text string
The text of the chunk.
usage object
Statistics about the usage of resources in the process of classifying the text.
input_tokens integer
The number of tokens inputted to the model.
See making requests for authentication, SDK usage, and errors.