Provide a context paragraph and ask a question — the model extracts the answer span directly from the text. Uses DistilBERT fine-tuned on SQuAD. Model runs in a Web Worker; first run downloads ~250 MB.
const model = await pool.load('question-answering', {
model: 'Xenova/distilbert-base-uncased-distilled-squad',
});
const result = await model.run({ context, question });
// { answer: '330 metres', score: 0.98, start: 220, end: 230 }