- class flash.text.question_answering.model.QuestionAnsweringTask(backbone='distilbert-base-uncased', loss_fn=None, optimizer='Adam', lr_scheduler=None, metrics=None, learning_rate=5e-05, enable_ort=False, n_best_size=20, version_2_with_negative=True, max_answer_length=30, null_score_diff_threshold=0.0, use_stemmer=True, rouge_newline_sep=True)¶
Taskfor extractive question answering. For more details, see question_answering.
You can change the backbone to any question answering model from HuggingFace/transformers using the
When changing the backbone, make sure you pass in the same backbone to the
DataModuleobject! Since this is a QuestionAnswering task, make sure you use a QuestionAnswering model.
optimizer¶ (~OPTIMIZER_TYPE) – Optimizer to use for training.
bool) – Enable Torch ONNX Runtime Optimization: https://onnxruntime.ai/docs/#onnx-runtime-for-training
float) – The threshold used to select the null answer: if the best answer has a score that is less than the score of the null answer minus this threshold, the null answer is selected for this example. Only useful when version_2_with_negative=True.
Return the module attributes of the model to be frozen.