simplified to not make output that is pipe-able, made google and amazon work with and without speaker IDs

This commit is contained in:
2019-03-08 14:26:16 -05:00
parent 0301b3be23
commit 8f63320be4
5 changed files with 80 additions and 42 deletions

View File

@@ -1,17 +1,22 @@
import json
def universal_transcript(self, pretty=False):
return json.dumps(self.converted_words, indent=4 if pretty else None)
def universal(self):
return json.dumps(self.converted_words, indent=4)
def viral_overlay(self, pretty=False):
return json.dumps([
{'start': word['start'],
'stop': word['end'],
'text': word['word'].title()
if word['always_capitalized'] else word['word']
}
def vo(self):
transcript = []
for word in self.converted_words]
, indent=4 if pretty else None
)
for word in self.converted_words:
if word['always_capitalized']:
word_word = word['word'].title()
else:
word_word['word']
transcript.append({
'start': word['start'],
'stop': word['end'],
'text': word_word,
})
return json.dumps(transcript, indent=4)