Skip to content

Commit

Permalink
generate dummy pauses for second stage adaptated model punctuation ge…
Browse files Browse the repository at this point in the history
…neration
  • Loading branch information
ottokart committed May 23, 2017
1 parent 155f03a commit 76bfa09
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions punctuator.py
Original file line number Diff line number Diff line change
@@ -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.