Skip to content

Answer Question

Extractive question answering that runs locally in your browser (DistilBERT-SQuAD on transformers.js). Given a question and a passage, it returns the span of the passage that answers it. Private, offline, no cost.

Runs an on-device extractive-QA model over the context passage to find the substring that best answers the question, with a confidence score.

Pull a specific fact out of a document, email, or scraped page — the answer comes verbatim from your text, so there’s no hallucination and nothing is sent to a server.

SettingNotes
ModelAny installed question-answering model.
QuestionThe question to answer.
ContextThe passage to find the answer in.

Returns { answer, score }:

  • answer — the extracted answer string (empty if none found).
  • score — the model’s confidence.
  • Empty or wrong answer — make sure the answer actually appears in the context; extractive QA can only return spans that are present.
  • Empty picker — install a question-answering model first.