SQuAD Exact Match and Token F1

~18 mincode completion

Implement squad_scores(prediction, gold) returning the list [exact_match, f1] as floats.

Where this shows up

~18 min

8 employers weight this skill

3 AI product companies, 2 frontier labs, 1 health and bio company, 1 big tech firm, 1 autonomy company. Top match scores 92.

Python
import re
import string
from collections import Counter


def squad_scores(prediction, gold):
    """
    SQuAD exact match and token F1 after standard normalization.

    Args:
        prediction: the model's answer string
        gold:       the reference answer string

    Returns:
        list [exact_match, f1], both floats in [0, 1]
    """
    # YOUR CODE HERE
    pass
Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.