Skip to content

Commit e7987e5

Browse files
authored
fix: typo: ROUGE is a metric, ROGUE is a scoundrel (#1585)
Fixes the typo 'rogue' with referring to 'rouge' score. Because this changes a file name and param name, it can be considered a breaking change
1 parent 5773a4b commit e7987e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ragas/metrics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
multimodal_relevance,
5454
)
5555
from ragas.metrics._noise_sensitivity import NoiseSensitivity
56-
from ragas.metrics._rogue_score import RougeScore
56+
from ragas.metrics._rouge_score import RougeScore
5757
from ragas.metrics._sql_semantic_equivalence import LLMSQLEquivalence
5858
from ragas.metrics._string import (
5959
DistanceMeasure,

src/ragas/metrics/_rogue_score.py renamed to src/ragas/metrics/_rouge_score.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class RougeScore(SingleTurnMetric):
1414
_required_columns: t.Dict[MetricType, t.Set[str]] = field(
1515
default_factory=lambda: {MetricType.SINGLE_TURN: {"reference", "response"}}
1616
)
17-
rogue_type: t.Literal["rouge1", "rougeL"] = "rougeL"
17+
rouge_type: t.Literal["rouge1", "rougeL"] = "rougeL"
1818
measure_type: t.Literal["fmeasure", "precision", "recall"] = "fmeasure"
1919

2020
def __post_init__(self):
@@ -34,9 +34,9 @@ async def _single_turn_ascore(
3434
) -> float:
3535
assert isinstance(sample.reference, str), "Sample reference must be a string"
3636
assert isinstance(sample.response, str), "Sample response must be a string"
37-
scorer = self.rouge_scorer.RougeScorer([self.rogue_type], use_stemmer=True)
37+
scorer = self.rouge_scorer.RougeScorer([self.rouge_type], use_stemmer=True)
3838
scores = scorer.score(sample.reference, sample.response)
39-
return getattr(scores[self.rogue_type], self.measure_type)
39+
return getattr(scores[self.rouge_type], self.measure_type)
4040

4141
async def _ascore(self, row: t.Dict, callbacks: Callbacks) -> float:
4242
return await self._single_turn_ascore(SingleTurnSample(**row), callbacks)

0 commit comments

Comments
 (0)