Skip to main content
POST
Question answering on context

Body

application/json

Request to ask questions about provided text context.

question
required

Question string or list of questions. Required.

context
required

Context text(s) corresponding to the question(s). Required.

top_k
integer
default:1

Number of top answers to return.

doc_stride
integer
default:128

Overlap size when splitting long context for the model.

max_answer_len
integer
default:15

Maximum number of tokens allowed in the returned answer.

max_seq_len
integer
default:384

Maximum sequence length of context+question in tokens.

max_question_len
integer
default:64

Maximum question length after tokenization.

handle_impossible_answer
boolean
default:false

Whether to allow returning a no-answer result when no answer is found.

align_to_words
boolean
default:true

Attempt to align predicted answer boundaries to actual word boundaries.

Response

200 - application/json

Answering results

score
number
start
integer
end
integer
answer
string