Skip to content

Commit 400f243

Browse files
authored
fix: add reference_topics as default required columns in TopicAdherenceScore #1564 (#1566)
An attempt to fix #1564 Let me know if my PR is lack of something else
1 parent 0f412de commit 400f243

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ragas/metrics/_topic_adherence.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ class TopicExtractionPrompt(
135135
class TopicAdherenceScore(MetricWithLLM, MultiTurnMetric):
136136
name: str = "topic_adherence" # type: ignore
137137
_required_columns: t.Dict[MetricType, t.Set[str]] = field(
138-
default_factory=lambda: {MetricType.MULTI_TURN: {"user_input"}}
138+
default_factory=lambda: {
139+
MetricType.MULTI_TURN: {
140+
"user_input",
141+
"reference_topics",
142+
}
143+
}
139144
)
140145
mode: t.Literal["precision", "recall", "f1"] = "f1"
141146
topic_extraction_prompt: PydanticPrompt = TopicExtractionPrompt()

0 commit comments

Comments
 (0)