You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Adds mechanism to auto test metric. When creating a metric you now create a json file with test cases (input, output and expected results).
- move unit test to a tests/unit folder.
- fix broken metrics
---------
Co-authored-by: Copilot <[email protected]>
"""Computes the metric over a list of golds and predictions for one single sample.
1226
-
It applies normalisation (if needed) to model prediction and gold, and takes the most frequent answer of all the available ones,
1227
-
then compares it to the gold.
1231
+
It applies normalisation (if needed) to model prediction and gold, and takes the most frequent answer of all the available ones, then compares it to the gold.
1228
1232
1229
1233
Args:
1234
+
doc (Doc): The document containing gold references.
1230
1235
model_response (ModelResponse): The model's response containing predictions.
1231
-
docs (Doc): The document containing gold references.
1232
1236
**kwargs: Additional keyword arguments.
1233
1237
1234
1238
Returns:
1235
1239
float: Aggregated score over the current sample's items.
1236
1240
"""
1237
1241
ifself.kisNone:
1238
1242
raiseException("You did not set the value of k")
1239
-
golds=docs.get_golds()
1243
+
1244
+
golds=doc.get_golds()
1245
+
1240
1246
iflen(golds) >1:
1241
1247
raiseException("Cannot compute maj@k with several golds")
0 commit comments