Skip to content

md_eval_22_multifile emits a logging traceback for mismatched RTTM recording IDs #130

Description

@alexanderwerning

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions