Share via


RougeScoreEvaluator Class

Evaluator for computes the ROUGE scores between two strings.

ROUGE (Recall-Oriented Understudy for Gisting Evaluation) is a set of metrics used to evaluate automatic summarization and machine translation. It measures the overlap between generated text and reference summaries. ROUGE focuses on recall-oriented measures to assess how well the generated text covers the reference text. Text summarization and document comparison are among optimal use cases for ROUGE, particularly in scenarios where text coherence and relevance are critical.

Usage


   eval_fn = RougeScoreEvaluator(rouge_type=RougeType.ROUGE_1)
   result = eval_fn(
       response="Tokyo is the capital of Japan.",
       ground_truth="The capital of Japan is Tokyo.")

Output format


   {
       "rouge_precision": 1.0,
       "rouge_recall": 1.0,
       "rouge_f1_score": 1.0
   }

Constructor

RougeScoreEvaluator(rouge_type: RougeType)

Parameters

Name Description
rouge_type
Required