Spaces:
Build error
Build error
Refactor code to extract ISCO codes from predictions and references
Browse files
isco_hierarchical_accuracy.py
CHANGED
@@ -273,8 +273,14 @@ class ISCO_Hierarchical_Accuracy(evaluate.Metric):
|
|
273 |
"""Returns the accuracy scores."""
|
274 |
# Convert the inputs to strings
|
275 |
if len(predictions[0]) > 4:
|
276 |
-
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
predictions = [str(p) for p in predictions]
|
279 |
references = [str(r) for r in references]
|
280 |
|
|
|
273 |
"""Returns the accuracy scores."""
|
274 |
# Convert the inputs to strings
|
275 |
if len(predictions[0]) > 4:
|
276 |
+
extracted_predictions = []
|
277 |
+
extracted_references = []
|
278 |
+
for p in predictions:
|
279 |
+
extracted_predictions.append(self._extract_isco_code(p))
|
280 |
+
for r in references:
|
281 |
+
extracted_references.append(self._extract_isco_code(r))
|
282 |
+
predictions = extracted_predictions
|
283 |
+
references = extracted_references
|
284 |
predictions = [str(p) for p in predictions]
|
285 |
references = [str(r) for r in references]
|
286 |
|