ComeçarComece gratuitamente

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.

Este exercício faz parte do curso

Introduction to LLMs in Python

Ver Curso

Instruções de exercício

  • Load the ROUGE metric.
  • Calculate the ROUGE scores between the predicted and reference summaries.

Exercício interativo prático

Experimente este exercício preenchendo este código de exemplo.

# 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)
Editar e executar código