Valutare con EM
Exact Match è utile per valutare i modelli nelle attività di question answering estrattivo, perché cerca — come puoi immaginare — corrispondenze esatte! Ancora una volta, ti sono state fornite alcune predictions e references per la valutazione. La libreria evaluate è già stata caricata per te.
Questo esercizio fa parte del corso
Introduzione agli LLM in Python
Istruzioni dell'esercizio
- Carica la metrica Exact Match.
- Calcola il punteggio Exact Match e stampa i risultati.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Load the metric
exact_match = ___
predictions = ["It's a wonderful day", "I love dogs", "DataCamp has great AI courses", "Sunshine and flowers"]
references = ["What a wonderful day", "I love cats", "DataCamp has great AI courses", "Sunsets and flowers"]
# Compute the exact match and print the results
results = ____
print("EM results: ", ____)