When reference and hypothesis RTTMs contain different recording IDs,
meeteval.der.md_eval.md_eval_22_multifile emits a logging error.
Current code:
keys = set(r.keys()) & set(h.keys())
missing = set(r.keys()) ^ set(h.keys())
if len(missing) > 0:
logging.warning(f"Missing {len(missing)} filenames:", missing)
logging.warning(f"Found {len(keys)} filenames:", keys)
Because the logging message does not contain a % placeholder, Python's
logging formatter fails when it receives missing or keys as the second
argument:
TypeError: not all arguments converted during string formatting
Message: 'Found 32 filenames:'
Arguments: ({...},)
Minimal reproduction:
from tempfile import NamedTemporaryFile
from meeteval.der.api import dscore
reference = "SPEAKER rec 1 0 1 <NA> <NA> speaker <NA> <NA>\n"
hypothesis = ""
with NamedTemporaryFile(mode="w", suffix=".rttm") as ref_file, \
NamedTemporaryFile(mode="w", suffix=".rttm") as hyp_file:
ref_file.write(reference)
hyp_file.write(hypothesis)
ref_file.flush()
hyp_file.flush()
dscore(reference=[ref_file.name], hypothesis=[hyp_file.name])
Expected behavior:
- Emit a normal warning, without a logging traceback.
When reference and hypothesis RTTMs contain different recording IDs,
meeteval.der.md_eval.md_eval_22_multifileemits a logging error.Current code:
Because the logging message does not contain a
%placeholder, Python'slogging formatter fails when it receives
missingorkeysas the secondargument:
Minimal reproduction:
Expected behavior: