From 2daf4fec4cba994119d8c227afd57f82418d84f8 Mon Sep 17 00:00:00 2001 From: yaozengwei Date: Wed, 20 Jul 2022 20:05:34 +0800 Subject: [PATCH] add for utt_duration --- icefall/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/icefall/utils.py b/icefall/utils.py index b495d6b5a..0271dd37c 100644 --- a/icefall/utils.py +++ b/icefall/utils.py @@ -528,7 +528,11 @@ class MetricsTracker(collections.defaultdict): if "utt_" not in k: ans_frames += str(k) + "=" + str(norm_value) + ", " else: - ans_utterances += str(k) + "=" + str(norm_value) + ", " + ans_utterances += str(k) + "=" + str(norm_value) + if k == "utt_duration": + ans_utterances += " frames, " + else: + ans_utterances += ", " frames = "%.2f" % self["frames"] ans_frames += "over " + str(frames) + " frames; " utterances = "%.2f" % self["utterances"]