Spaces:
Sleeping
Sleeping
Raise value error if a reference string is empty to match behaviour of WER
Browse files- phone_distance.py +1 -1
phone_distance.py
CHANGED
@@ -112,7 +112,7 @@ def phone_error_rate(prediction:str, reference: str, distance_computer:panphon.d
|
|
112 |
|
113 |
return phone_edits / len(ref_phones)
|
114 |
else:
|
115 |
-
|
116 |
|
117 |
|
118 |
@evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
|
|
|
112 |
|
113 |
return phone_edits / len(ref_phones)
|
114 |
else:
|
115 |
+
raise ValueError("one or more references are empty strings")
|
116 |
|
117 |
|
118 |
@evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
|