What is the purpose of the 'context' input in hf.questionAnswering? #263
Answered
by
julien-c
ArsalaBangash
asked this question in
Q&A
-
BackgroundThe args for QuestionAnswering are context and question. export type QuestionAnsweringArgs = BaseArgs & {
inputs: {
context: string;
question: string;
};
}; The example in the docs is await hf.questionAnswering({
model: 'deepset/roberta-base-squad2',
inputs: {
question: 'What is the capital of France?',
context: 'The capital of France is Paris.'
}
}) QuestionWhat is the purpose of the context input? Could the model return the right answer without it? Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
julien-c
Oct 19, 2023
Replies: 1 comment 1 reply
-
This is "classical" question answering, so the output is always extracted from the context (a span of text taken from the context) Play with the widget here https://huggingface.co/deepset/roberta-base-squad2 to check it out |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ArsalaBangash
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is "classical" question answering, so the output is always extracted from the context (a span of text taken from the context)
Play with the widget here https://huggingface.co/deepset/roberta-base-squad2 to check it out