Skip to content

Commit

Permalink
add comment why header field is not printed
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoLegends committed Sep 11, 2024
1 parent da557e8 commit 4297d2b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions returnn/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@ def run(self):
d = eval(util.uopen(self.recog_words_file.get_path(), "rt").read())
assert isinstance(d, dict), "only search output file with dict format is supported"
with util.uopen(self.out_ctm_file.get_path(), "wt") as out:
# Do not print optional [n-best] header, some downstream evaluation pipelines
# use the number of headers for validation. Since we do not print n-best-list
# information this validation fails and discards the entire search outputs.
#
# See https://github.com/rwth-i6/i6_core/pull/542.
out.write(";; <name> <track> <start> <duration> <word> <confidence>\n")
for seg in corpus.segments():
seg_start = 0.0 if seg.start == float("inf") else seg.start
Expand Down Expand Up @@ -541,6 +546,11 @@ def run(self):
else:
seq_order = d.keys()
with util.uopen(self.out_ctm_file.get_path(), "wt") as out:
# Do not print optional [n-best] header, some downstream evaluation pipelines
# use the number of headers for validation. Since we do not print n-best-list
# information this validation fails and discards the entire search outputs.
#
# See https://github.com/rwth-i6/i6_core/pull/542.
out.write(";; <name> <track> <start> <duration> <word> <confidence>\n")
for seg_fullname in seq_order:
assert isinstance(
Expand Down

0 comments on commit 4297d2b

Please sign in to comment.