fix: add support for when "annotation" key exists but is None

This commit is contained in:
Hervé Bredin committed 2020-10-02 12:23:40 +02:00
1 parent 212db34bc8
commit b8d623596e
1 file changed
+2 -2
+2 -2
View File
@@ -628,14 +628,14 @@ def apply_pretrained(
pipeline.write_rttm(fp, hypothesis)
# compute evaluation metric (when possible)
if "annotation" not in current_file:
reference = current_file.get("annotation", None)
if reference is None:
metric = None
# compute evaluation metric (when available)
if metric is None:
continue
reference = current_file["annotation"]
uem = get_annotated(current_file)
_ = metric(reference, hypothesis, uem=uem)