Evaluating with ROUGE
ROUGE is commonly used to evaluate summarization tasks as it checks for similarities between predictions and references. You have been provided with a model-generated summary, predictions, and a references summary for validate. Calculate the scores to see how well the model performed.
The evaluate library has been loaded for you.
Deze oefening maakt deel uit van de cursus
Introduction to LLMs in Python
Oefeninstructies
- Load the ROUGE metric.
- Calculate the ROUGE scores between the predicted and reference summaries.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Load the rouge metric
rouge = ____
predictions = ["""Pluto is a dwarf planet in our solar system, located in the Kuiper Belt beyond Neptune, and was formerly considered the ninth planet until its reclassification in 2006."""]
references = ["""Pluto is a dwarf planet in the solar system, located in the Kuiper Belt beyond Neptune, and was previously deemed as a planet until it was reclassified in 2006."""]
# Calculate the rouge scores between the predicted and reference summaries
results = ____
print("ROUGE results: ", results)