Skip to content

chores: fix typo #1370

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

Merged
merged 1 commit into from
Sep 27, 2024
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
6 changes: 3 additions & 3 deletions docs/concepts/metrics/faithfulness.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ await scorer.single_turn_ascore(sample)

```python
from ragas.database_schema import SingleTurnSample
from ragas.metrics import FaithulnesswithHHEM
from ragas.metrics import FaithfulnesswithHHEM


sample = SingleTurnSample(
Expand All @@ -43,7 +43,7 @@ sample = SingleTurnSample(
"The First AFL–NFL World Championship Game was an American football game played on January 15, 1967, at the Los Angeles Memorial Coliseum in Los Angeles."
]
)
scorer = FaithulnesswithHHEM()
scorer = FaithfulnesswithHHEM()
await scorer.single_turn_ascore(sample)

```
Expand All @@ -55,7 +55,7 @@ You can load the model onto a specified device by setting the `device` argument
my_device = "cuda:0"
my_batch_size = 10

scorer = FaithulnesswithHHEM(device=my_device, batch_size=my_batch_size)
scorer = FaithfulnesswithHHEM(device=my_device, batch_size=my_batch_size)
await scorer.single_turn_ascore(sample)
```

Expand Down
4 changes: 2 additions & 2 deletions src/ragas/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
RubricsScoreWithReference,
)
from ragas.metrics._factual_correctness import FactualCorrectness
from ragas.metrics._faithfulness import Faithfulness, FaithulnesswithHHEM, faithfulness
from ragas.metrics._faithfulness import Faithfulness, FaithfulnesswithHHEM, faithfulness
from ragas.metrics._goal_accuracy import (
AgentGoalAccuracyWithoutReference,
AgentGoalAccuracyWithReference,
Expand All @@ -58,7 +58,7 @@
"answer_correctness",
"Faithfulness",
"faithfulness",
"FaithulnesswithHHEM",
"FaithfulnesswithHHEM",
"AnswerSimilarity",
"answer_similarity",
"ContextPrecision",
Expand Down
4 changes: 3 additions & 1 deletion src/ragas/metrics/_faithfulness.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def save(self, cache_dir: t.Optional[str] = None) -> None:


@dataclass
class FaithulnesswithHHEM(Faithfulness):
class FaithfulnesswithHHEM(Faithfulness):
name: str = "faithfulness_with_hhem" # type: ignore
device: str = "cpu"
batch_size: int = 10
Expand Down Expand Up @@ -402,3 +402,5 @@ async def _ascore(self: t.Self, row: t.Dict, callbacks: Callbacks) -> float:


faithfulness = Faithfulness()


Loading