Skip to content

Commit

Permalink
Merge pull request #25 from mr-gpt/feature/add-overall-score
Browse files Browse the repository at this point in the history
Feature/add overall score
  • Loading branch information
jwongster2 authored Aug 21, 2023
2 parents 6fd0a53 + ed56440 commit 11599bc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
33 changes: 33 additions & 0 deletions docs/docs/measuring_llm_performance/alert_score.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Alert Score

Alert score checks if a generated output is good or bad. It automatically checks for:

- Factual consistency
- Answer relevancy
- Toxicness (coming soon)

It then takes the minimum of those scores to alert.

## Assert Alert Score

```python
from deepeval.metrics.alert_score import assert_alert_score
assert_alert_score(
generated_text="Who won the FIFA World Cup in 2018?",
expected_output="French national football team",
context="The FIFA World Cup in 2018 was won by the French national football team. They defeated Croatia 4-2 in the final match to claim the championship.",
minimum_score=0.3
)
```

## Metric

```python
from deepeval.metrics.alert_score import AlertScoreMetric
metric = AlertScoreMetric()
score = metric.measure(
generated_text="Who won the FIFA World Cup in 2018?",
expected_output="French national football team"
)
score
```
3 changes: 2 additions & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ const sidebars = {
type: 'category',
label: 'Evaluating LLMs',
items: [
"measuring_llm_performance/alert_score",
'measuring_llm_performance/factual_consistency',
'measuring_llm_performance/answer_relevancy',
"measuring_llm_performance/ranking_similarity",
"measuring_llm_performance/conceptual_similarity"
"measuring_llm_performance/conceptual_similarity",
]
},
{
Expand Down

0 comments on commit 11599bc

Please sign in to comment.