-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Problem
The collections API has two implementations that appear to be identical:
SemanticSimilarity(_semantic_similarity.py)AnswerSimilarity(_answer_similarity.py)
The implementations are 100% identical - same cosine similarity algorithm, same parameters. The only differences are:
- Class name
- Default metric name:
"semantic_similarity"vs"answer_similarity"
Context
In the legacy API (_answer_similarity.py), AnswerSimilarity was simply a subclass alias of SemanticSimilarity:
class AnswerSimilarity(SemanticSimilarity):
name: str = "answer_similarity"When migrating to collections API, both were implemented as separate standalone classes with duplicated code.
Current State
SemanticSimilarityhas documentation and is in the metrics indexAnswerSimilarityhas no documentation and is not in the metrics index- Both are exported in
ragas.metrics.collections.__all__
Question
Should we consolidate these, or is there a reason to keep both as separate implementations?
dosubot
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested