POST
/
extractions
/
qa
import os
from isaacus import Isaacus

client = Isaacus(
    api_key=os.environ.get("ISAACUS_API_KEY"),  # This is the default and can be omitted
)
answer_extraction = client.extractions.qa.create(
    model="kanon-answer-extractor",
    query="What is the punishment for murder in Victoria?",
    texts=["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."],
)
print(answer_extraction.extractions)
{
  "extractions": [
    {
      "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
    }
  ],
  "usage": {
    "input_tokens": 43
  }
}

Authorizations

Authorization
string
header
required

An Isaacus-issued API key passed as a bearer token via the Authorization header in the format Authorization: Bearer YOUR_API_KEY.

Body

application/json

A request to extract answers from legal documents with an Isaacus legal AI extractive question answering model.

Response

200
application/json
The documents have been successfully processed.

The results of extracting answers from texts.