mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
updated
This commit is contained in:
parent
ea87b7dff9
commit
40737f760b
@ -410,10 +410,21 @@ def main():
|
|||||||
raise ValueError(f"Unsupported decoding method: {params.method}")
|
raise ValueError(f"Unsupported decoding method: {params.method}")
|
||||||
|
|
||||||
s = "\n"
|
s = "\n"
|
||||||
|
if params.method == "ctc-decoding":
|
||||||
for filename, hyp in zip(params.sound_files, hyps):
|
for filename, hyp in zip(params.sound_files, hyps):
|
||||||
words = "".join(hyp)
|
words = "".join(hyp)
|
||||||
words = words.replace("▁", " ").strip()
|
words = words.replace("▁", " ").strip()
|
||||||
s += f"{filename}:\n{words}\n\n"
|
s += f"{filename}:\n{words}\n\n"
|
||||||
|
elif params.method in [
|
||||||
|
"1best",
|
||||||
|
"nbest-rescoring",
|
||||||
|
"whole-lattice-rescoring",
|
||||||
|
]:
|
||||||
|
for filename, hyp in zip(params.sound_files, hyps):
|
||||||
|
for words in hyp:
|
||||||
|
words = " ".join(hyp)
|
||||||
|
words = words.replace("▁", " ").strip()
|
||||||
|
s += f"{filename}:\n{words}\n\n"
|
||||||
logging.info(s)
|
logging.info(s)
|
||||||
|
|
||||||
logging.info("Decoding Done")
|
logging.info("Decoding Done")
|
||||||
|
|||||||
@ -429,10 +429,21 @@ def main():
|
|||||||
raise ValueError(f"Unsupported decoding method: {params.method}")
|
raise ValueError(f"Unsupported decoding method: {params.method}")
|
||||||
|
|
||||||
s = "\n"
|
s = "\n"
|
||||||
|
if params.method == "ctc-decoding":
|
||||||
for filename, hyp in zip(params.sound_files, hyps):
|
for filename, hyp in zip(params.sound_files, hyps):
|
||||||
words = "".join(hyp)
|
words = "".join(hyp)
|
||||||
words = words.replace("▁", " ").strip()
|
words = words.replace("▁", " ").strip()
|
||||||
s += f"{filename}:\n{words}\n\n"
|
s += f"{filename}:\n{words}\n\n"
|
||||||
|
elif params.method in [
|
||||||
|
"1best",
|
||||||
|
"nbest-rescoring",
|
||||||
|
"whole-lattice-rescoring",
|
||||||
|
]:
|
||||||
|
for filename, hyp in zip(params.sound_files, hyps):
|
||||||
|
for words in hyp:
|
||||||
|
words = " ".join(hyp)
|
||||||
|
words = words.replace("▁", " ").strip()
|
||||||
|
s += f"{filename}:\n{words}\n\n"
|
||||||
logging.info(s)
|
logging.info(s)
|
||||||
|
|
||||||
logging.info("Decoding Done")
|
logging.info("Decoding Done")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user