Permalink
Browse files

generate dummy pauses for second stage adaptated model punctuation ge…

…neration
  • Loading branch information...
ottokart committed May 23, 2017
1 parent 155f03a commit 76bfa094d3d6bd3bc350daeff298782716283518
Showing with 4 additions and 2 deletions.
  1. +4 −2 punctuator.py
@@ -168,7 +168,9 @@ def restore(output_file, text, word_vocabulary, reverse_punctuation_vocabulary,
text = [w for w in input_text.split() if w not in punctuation_vocabulary and w not in data.PUNCTUATION_MAPPING and not w.startswith(data.PAUSE_PREFIX)] + [data.END]
pauses = [float(s.replace(data.PAUSE_PREFIX,"").replace(">","")) for s in input_text.split() if s.startswith(data.PAUSE_PREFIX)]
if not use_pauses or len(pauses) == 0:
if not use_pauses:
restore(output_file, text, word_vocabulary, reverse_punctuation_vocabulary, predict)
else:
restore_with_pauses(output_file, text, pauses, word_vocabulary, reverse_punctuation_vocabulary, predict)
if not pauses:
pauses = [0.0 for _ in range(len(text)-1)]
restore_with_pauses(output_file, text, pauses, word_vocabulary, reverse_punctuation_vocabulary, predict)

0 comments on commit 76bfa09

Please sign in to comment.