Spaces:
Sleeping
Sleeping
added handling of multilabel
Browse files- jaccard_similarity.py +11 -4
jaccard_similarity.py
CHANGED
@@ -77,10 +77,17 @@ class JaccardSimilarity(evaluate.Metric):
|
|
77 |
description=_DESCRIPTION,
|
78 |
citation=_CITATION,
|
79 |
inputs_description=_KWARGS_DESCRIPTION,
|
80 |
-
features=datasets.Features(
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
reference_urls=[
|
85 |
"https://scikit-learn.org/stable/modules/generated/sklearn.metrics.jaccard_score.html",
|
86 |
"https://en.wikipedia.org/wiki/Jaccard_index"
|
|
|
77 |
description=_DESCRIPTION,
|
78 |
citation=_CITATION,
|
79 |
inputs_description=_KWARGS_DESCRIPTION,
|
80 |
+
features=datasets.Features(
|
81 |
+
{
|
82 |
+
"predictions": datasets.Sequence(datasets.Value("int32")),
|
83 |
+
"references": datasets.Sequence(datasets.Value("int32")),
|
84 |
+
}
|
85 |
+
if self.config_name == "multilabel"
|
86 |
+
else {
|
87 |
+
"predictions": datasets.Value("int32"),
|
88 |
+
"references": datasets.Value("int32"),
|
89 |
+
}
|
90 |
+
),
|
91 |
reference_urls=[
|
92 |
"https://scikit-learn.org/stable/modules/generated/sklearn.metrics.jaccard_score.html",
|
93 |
"https://en.wikipedia.org/wiki/Jaccard_index"
|