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 extract answers from legal documents with an Isaacus legal AI extractive question answering model.
The query to extract the answer to.
The query must contain at least one non-whitespace character.
Unlike the texts from which the answer will be extracted, the query cannot be so long that it exceeds the maximum input length of the model.
1 - 5000
"What is the punishment for murder in Victoria?"
The texts to search for the answer in and extract the answer from.
There must be at least one text.
Each text must contain at least one non-whitespace character.
[
"The standard sentence for murder in the State of Victoria is 30 years if the person murdered was a police officer and 25 years in any other case."
]
Whether to, if the model's score of the likelihood that an answer can not be extracted from a text is greater than the highest score of all possible answers, still return the highest scoring answers for that text.
If you have already determined that the texts answer the query, for example, by using one of our classification or reranker models, then you should set this to true
.
false
The number of highest scoring answers to return.
If null
, which is the default, all answers will be returned.
x >= 1
1
Settings for how texts should be chunked into smaller segments by semchunk before extraction.
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.
Options for how to split text into smaller chunks.
{ "size": 512, "overlap_ratio": 0.1 }
{ "size": 512, "overlap_tokens": 10 }
{ "size": 512 }
Response
The documents have been successfully processed.
The results of extracting answers from texts.
The results of extracting answers from the texts, ordered from highest to lowest answer confidence score (or else lowest to highest inextractability score if there are no answers for a text).
[
{
"index": 0,
"answers": [
{
"text": "30 years if the person murdered was a police officer and 25 years in any other case",
"start": 61,
"end": 144,
"score": 0.11460486645671249
}
],
"inextractability_score": 0.0027424068182309302
}
]
Statistics about the usage of resources in the process of extracting answers from the texts.
{ "input_tokens": 43 }