SQuAD¶
Module Interface¶
- torchmetrics.SQuAD[source]
alias of
torchmetrics.text._deprecated._SQuAD
Functional Interface¶
- torchmetrics.functional.squad(preds, target)[source]
Wrapper for deprecated import.
>>> preds = [{"prediction_text": "1976", "id": "56e10a3be3433e1400422b22"}] >>> target = [{"answers": {"answer_start": [97], "text": ["1976"]},"id": "56e10a3be3433e1400422b22"}] >>> _squad(preds, target) {'exact_match': tensor(100.), 'f1': tensor(100.)}