Skip to content

Commit 2a3c3ab

Browse files
authored
renaming ground_truths to ground_truth. (#640)
## Description Noticed that there were still references to `ground_truths` in the code and documentation (barring the validation function of course) after we updated this to `ground_truth`. This PR cleans that part up. Also updated the raise_exceptions error message to read `raise_exceptions=False` instead of `raise_exception=False`
1 parent ca525c2 commit 2a3c3ab

File tree

18 files changed

+33
-33
lines changed

18 files changed

+33
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ os.environ["OPENAI_API_KEY"] = "your-openai-key"
7171

7272
# prepare your huggingface dataset in the format
7373
# Dataset({
74-
# features: ['question', 'contexts', 'answer', 'ground_truths'],
74+
# features: ['question', 'contexts', 'answer', 'ground_truth'],
7575
# num_rows: 25
7676
# })
7777

docs/concepts/metrics/answer_correctness.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ answer_correctness = AnswerCorrectness(
2424
)
2525
2626
# Dataset({
27-
# features: ['answer','ground_truths'],
27+
# features: ['answer','ground_truth'],
2828
# num_rows: 25
2929
# })
3030
dataset: Dataset

docs/concepts/metrics/context_recall.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ context_recall = ContextRecall(
3737
3838
)
3939
# Dataset({
40-
# features: ['contexts','ground_truths'],
40+
# features: ['contexts','ground_truth'],
4141
# num_rows: 25
4242
# })
4343
dataset: Dataset

docs/concepts/metrics/semantic_similarity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ answer_similarity = AnswerSimilarity()
2424
2525
2626
# Dataset({
27-
# features: ['answer','ground_truths'],
27+
# features: ['answer','ground_truth'],
2828
# num_rows: 25
2929
# })
3030
dataset: Dataset

docs/howtos/applications/compare_llms.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def generate_responses(query_engine, test_questions, test_answers):
110110
"contexts": contexts,
111111
}
112112
if test_answers is not None:
113-
dataset_dict["ground_truths"] = test_answers
113+
dataset_dict["ground_truth"] = test_answers
114114
ds = Dataset.from_dict(dataset_dict)
115115
return ds
116116
```
@@ -214,4 +214,4 @@ analysis(
214214
### Score distribution analysis
215215
<p align="left">
216216
<img src="../../_static/imgs/compare-llm-result.png" alt="results" width="800" height="600" />
217-
</p>
217+
</p>

docs/howtos/applications/custom_prompts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ amnesty_dataset
1717
```{code-block} bash
1818
DatasetDict({
1919
train: Dataset({
20-
features: ['question', 'ground_truths', 'answer', 'contexts'],
20+
features: ['question', 'ground_truth', 'answer', 'contexts'],
2121
num_rows: 20
2222
})
2323
})
@@ -103,4 +103,4 @@ evaluating with [faithfulness]
103103
100%|██████████| 1/1 [02:31<00:00, 151.79s/it]
104104
105105
{'faithfulness': 0.7879}
106-
```
106+
```

docs/howtos/applications/data_preparation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data_samples = {
2424
'answer': ['The first superbowl was held on January 15, 1967', 'The most super bowls have been won by The New England Patriots'],
2525
'contexts' : [['The Super Bowl....season since 1966,','replacing the NFL...in February.'],
2626
['The Green Bay Packers...Green Bay, Wisconsin.','The Packers compete...Football Conference']],
27-
'ground_truths': [['The first superbowl was held on January 15, 1967'], ['The New England Patriots have won the Super Bowl a record six times']]
27+
'ground_truth': [['The first superbowl was held on January 15, 1967'], ['The New England Patriots have won the Super Bowl a record six times']]
2828
}
2929
dataset = Dataset.from_dict(data_samples)
3030
```

docs/howtos/applications/use_prompt_adaptation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ hindi_dataset
2121
```{code-block}
2222
DatasetDict({
2323
train: Dataset({
24-
features: ['question', 'ground_truths', 'answer', 'contexts'],
24+
features: ['question', 'ground_truth', 'answer', 'contexts'],
2525
num_rows: 20
2626
})
2727
})
@@ -153,4 +153,4 @@ distributions = {
153153
# generate testset
154154
testset = generator.generate_with_langchain_docs(documents, 10,distributions,with_debugging_logs=True)
155155
testset.to_pandas()
156-
```
156+
```

docs/howtos/customisations/aws-bedrock.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"text/plain": [
164164
"DatasetDict({\n",
165165
" eval: Dataset({\n",
166-
" features: ['question', 'ground_truths', 'answer', 'contexts'],\n",
166+
" features: ['question', 'ground_truth', 'answer', 'contexts'],\n",
167167
" num_rows: 20\n",
168168
" })\n",
169169
"})"
@@ -257,7 +257,7 @@
257257
" <tr style=\"text-align: right;\">\n",
258258
" <th></th>\n",
259259
" <th>question</th>\n",
260-
" <th>ground_truths</th>\n",
260+
" <th>ground_truth</th>\n",
261261
" <th>answer</th>\n",
262262
" <th>contexts</th>\n",
263263
" <th>faithfulness</th>\n",
@@ -310,7 +310,7 @@
310310
"1 Which companies are the main contributors to G... \n",
311311
"2 Which private companies in the Americas are th... \n",
312312
"\n",
313-
" ground_truths \\\n",
313+
" ground_truth \\\n",
314314
"0 [The global implications of the USA Supreme Co... \n",
315315
"1 [According to the Carbon Majors database, the ... \n",
316316
"2 [The largest private companies in the Americas... \n",

docs/howtos/customisations/azure-openai.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"text/plain": [
6161
"DatasetDict({\n",
6262
" baseline: Dataset({\n",
63-
" features: ['question', 'ground_truths', 'answer', 'contexts'],\n",
63+
" features: ['question', 'ground_truth', 'answer', 'contexts'],\n",
6464
" num_rows: 30\n",
6565
" })\n",
6666
"})"
@@ -285,7 +285,7 @@
285285
" <tr style=\"text-align: right;\">\n",
286286
" <th></th>\n",
287287
" <th>question</th>\n",
288-
" <th>ground_truths</th>\n",
288+
" <th>ground_truth</th>\n",
289289
" <th>answer</th>\n",
290290
" <th>contexts</th>\n",
291291
" <th>faithfulness</th>\n",
@@ -368,7 +368,7 @@
368368
"3 Applying for and receiving business credit \n",
369369
"4 401k Transfer After Business Closure \n",
370370
"\n",
371-
" ground_truths \\\n",
371+
" ground_truth \\\n",
372372
"0 [Have the check reissued to the proper payee.J... \n",
373373
"1 [Sure you can. You can fill in whatever you w... \n",
374374
"2 [You're confusing a lot of things here. Compan... \n",

0 commit comments

Comments
 (0)