Universal classification
Classify the relevance of a legal document to a query using an Isaacus universal legal AI classifier.
Authorizations
An Isaacus-issued API key passed as a bearer token via the Authorization
header in the format Authorization: Bearer YOUR_API_KEY
.
Body
A request to classify the relevance of a legal document to a query using an Isaacus universal legal AI classifier.
The ID of the model to use for universal classification.
kanon-universal-classifier
, kanon-universal-classifier-mini
"kanon-universal-classifier"
The Isaacus Query Language (IQL) query or, if IQL is disabled, the statement, to evaluate the text against.
The query must contain at least one non-whitespace character.
Unlike the text being classified, the query cannot be so long that it exceeds the maximum input length of the universal classifier.
1 - 5000
"This is a confidentiality clause."
The text to classify.
The text must contain at least one non-whitespace character.
1 - 10000000
"I agree not to tell anyone about the document."
Settings for how the text should be chunked into smaller segments before classification using semchunk.
If null
, the text 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.
{
"overlap_ratio": null,
"size": 512,
"overlap_tokens": null
}
Whether the query should be interpreted as an Isaacus Query Language (IQL) query or else as a statement.
true
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 input.
chunk_max
uses the highest confidence score of all of the text's chunks.
chunk_avg
averages the confidence scores of all of the text's chunks.
chunk_min
uses the lowest confidence score of all of the text's chunks.
auto
, chunk_max
, chunk_avg
, chunk_min
"auto"
Response
A classification of the relevance of a legal document to a query produced by an Isaacus universal legal AI classifier.
The text as broken into chunks by semchunk, each chunk with its own confidence score.
If no chunking occurred, this will be null
.
A chunk of a text that has been classified by an Isaacus universal legal AI classifier.
[
{
"end": 46,
"score": 0.7481262778280844,
"start": 0,
"text": "I agree not to tell anyone about the document."
}
]
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.
0 <= x <= 1
0.7481262778280844
Statistics about the usage of resources in the process of classifying the text.
{ "input_tokens": 19 }