v28

latestOpenAPI 3.1.0Apache 2.0raw.githubusercontent.com2026-03-11543173.3 KB
Extractions

Extractive question answering

Extract information from documents with an Isaacus extractive question answering model.

post/extractions/qa

Request body

model'kanon-answer-extractor' required

The ID of the model to use for extractive question answering.

querystring required

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.

textsstring[] required

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.

ignore_inextractabilityboolean

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.

top_kinteger

The number of highest scoring answers to return.

If null, which is the default, all answers will be returned.

Example request

{
  "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."
  ]
}

Response

The results of extracting answers from texts.

Example response

{
  "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
  }
}