Welcome to the Hugging Face tasks series.
In this video, we will take a look at the Question Answering task.
Question answering is the task of extracting an answer in a given document.
Question answering models take a context, which is the document you want to search in,
and a question and return an answer. Note that the answer is not generated,
but extracted from the context. This type of question answering is called extractive.
The task is evaluated on two metrics, exact match and F1-Score.
As the name implies, exact match looks for an
exact match between the predicted answer and the correct answer.
A common metric used is the F1-Score, which is calculated over tokens that are predicted
correctly and incorrectly. It is calculated over the average of two metrics called
precision and recall which are metrics that are used widely in classification problems.
An example dataset used for this task is called SQuAD. This dataset contains contexts, questions
and the answers that are obtained from English Wikipedia articles.
You can use question answering models to automatically answer the questions asked
by your customers. You simply need a document containing information about your business
and query through that document with the questions asked by your customers.
For more information about the Question Answering task, check out the Hugging Face course.