Universal classification
Classify the relevance of legal documents to a query with 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 legal documents to a query with 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 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.
1 - 5000
"This is a confidentiality clause."
The texts to classify.
The texts must contain at least one non-whitespace character.
[
"I agree not to tell anyone about the document."
]
Whether the query should be interpreted as an 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 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.
auto
, chunk_max
, chunk_avg
, chunk_min
"auto"
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.
{
"size": 512,
"overlap_ratio": null,
"overlap_tokens": null
}
Response
Classifications of the relevance of legal documents to a query produced by an Isaacus universal legal AI classifier.
The classifications of the texts, by relevance to the query, in order from highest to lowest relevance score.
[
{
"index": 0,
"score": 0.8825573934438159,
"chunks": [
{
"index": 0,
"start": 0,
"end": 45,
"score": 0.8825573934438159,
"text": "I agree not to tell anyone about the document."
}
]
}
]
Statistics about the usage of resources in the process of classifying the text.
{ "input_tokens": 19 }