Extracts the answer to a question from a passage with a HuggingFace QA reader: takes a question String and a context String, finds the span of the context that answers it (default DeBERTa-v3-large SQuAD2.0), and emits the answer String or a QAAnswer record tagged with its char offsets + score.
Post a question and a passage over HTTP and publish the extracted answer span as JSON for a downstream service.
Read a document from a text file, ask a fixed question about it, and return the answer span with its character offsets and confidence over HTTP.
String and the second is the context String (the passage the answer is extracted from). The answer is always a span copied verbatim from the context, never generated; the downstream sink selects whether the output is the answer String or a QAAnswer record (`{answer, start, end, score}`) where `start` / `end` are character offsets into the context.max_input_tokens is tokenised into overlapping sliding windows of doc_stride overlap so a long context still answers; max_input_tokens is clamped down to that real budget so it can never overflow.max_answer_len caps the answer span length in tokens and n_best widens the start/end span search per window. A larger doc_stride keeps more overlap (an answer near a window boundary is less likely to be split) at the cost of more windows per call.String or an empty-text QAAnswer record -- rather than crashing or dropping; every input emits exactly one output.model is hot-swappable at runtime and triggers a reload (and a GPU memory reclaim on CUDA) on the next call, producing a one-call latency spike. device is captured once at startup.Automated release