Spaces:
Runtime error
Runtime error
update
Browse files- ranking_loss.py +4 -4
ranking_loss.py
CHANGED
@@ -41,7 +41,7 @@ Args:
|
|
41 |
references: list of reference for each prediction. Each
|
42 |
reference should be a string with tokens separated by spaces.
|
43 |
Returns:
|
44 |
-
|
45 |
another_score: description of the second score,
|
46 |
Examples:
|
47 |
Examples should be written in doctest format, and should illustrate how
|
@@ -50,7 +50,7 @@ Examples:
|
|
50 |
>>> my_new_module = evaluate.load("my_new_module")
|
51 |
>>> results = my_new_module.compute(references=[0, 1], predictions=[0, 1])
|
52 |
>>> print(results)
|
53 |
-
{'
|
54 |
"""
|
55 |
|
56 |
# TODO: Define external resources urls if needed
|
@@ -71,8 +71,8 @@ class RankingLoss(evaluate.Metric):
|
|
71 |
inputs_description=_KWARGS_DESCRIPTION,
|
72 |
# This defines the format of each prediction and reference
|
73 |
features=datasets.Features({
|
74 |
-
'predictions': datasets.
|
75 |
-
'references': datasets.
|
76 |
}),
|
77 |
# Homepage of the module for documentation
|
78 |
homepage="http://module.homepage",
|
|
|
41 |
references: list of reference for each prediction. Each
|
42 |
reference should be a string with tokens separated by spaces.
|
43 |
Returns:
|
44 |
+
ranking_loss: description of the first score,
|
45 |
another_score: description of the second score,
|
46 |
Examples:
|
47 |
Examples should be written in doctest format, and should illustrate how
|
|
|
50 |
>>> my_new_module = evaluate.load("my_new_module")
|
51 |
>>> results = my_new_module.compute(references=[0, 1], predictions=[0, 1])
|
52 |
>>> print(results)
|
53 |
+
{'ranking_loss': 1.0}
|
54 |
"""
|
55 |
|
56 |
# TODO: Define external resources urls if needed
|
|
|
71 |
inputs_description=_KWARGS_DESCRIPTION,
|
72 |
# This defines the format of each prediction and reference
|
73 |
features=datasets.Features({
|
74 |
+
'predictions': datasets.Sequence('float32'),
|
75 |
+
'references': datasets.Sequence('int64'),
|
76 |
}),
|
77 |
# Homepage of the module for documentation
|
78 |
homepage="http://module.homepage",
|