Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed MetricWithLLM from SemanticSimilarity #1678

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/ragas/metrics/_answer_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ def __post_init__(self):
def init(self, run_config: RunConfig):
super().init(run_config)
if self.answer_similarity is None and self.weights[1] != 0:
self.answer_similarity = AnswerSimilarity(
llm=self.llm, embeddings=self.embeddings
)
self.answer_similarity = AnswerSimilarity(embeddings=self.embeddings)

def _compute_statement_presence(
self, prediction: ClassificationWithReason
Expand Down
3 changes: 1 addition & 2 deletions src/ragas/metrics/_answer_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from ragas.metrics.base import (
MetricType,
MetricWithEmbeddings,
MetricWithLLM,
SingleTurnMetric,
)

Expand All @@ -23,7 +22,7 @@


@dataclass
class SemanticSimilarity(MetricWithLLM, MetricWithEmbeddings, SingleTurnMetric):
class SemanticSimilarity(MetricWithEmbeddings, SingleTurnMetric):
"""
Scores the semantic similarity of ground truth with generated answer.
cross encoder score is used to quantify semantic similarity.
Expand Down
Loading