v1

latestOpenAPI 3.0.32026-07-26451985.7 KB

question-answering

Answer questions based on a given context for applications like customer support, information retrieval, and educational tools

post/models/v2/deepset/roberta-base-squad2

Request body

questionstring required
contextstring required

Example request

{
  "question": "Who's the lead character?",
  "context": "Ron, the hero, looked at Greybeard and smote him asunder"
}

Response

Successful question-answering response.

errorstring nullable required

Null on success; otherwise an error message.

outputobject required

Successful response with the answer, score, and start and end indices

Example response

{
  "output": {
    "score": 0.2002170979976654,
    "start": 0,
    "end": 3,
    "answer": "Ron"
  }
}