mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
Refactor transcribe segment
This commit is contained in:
@@ -95,14 +95,13 @@ class Transcriber:
|
|||||||
vad_parameters={"min_silence_duration_ms": 500},
|
vad_parameters={"min_silence_duration_ms": 500},
|
||||||
)
|
)
|
||||||
|
|
||||||
text = ""
|
segments = list(segments)
|
||||||
words = []
|
text = "".join(segment.text for segment in segments)
|
||||||
for segment in segments:
|
words = [
|
||||||
text += segment.text
|
{"word": word.word, "start": word.start, "end": word.end}
|
||||||
words.extend(
|
for segment in segments
|
||||||
{"word": word.word, "start": word.start, "end": word.end}
|
for word in segment.words
|
||||||
for word in segment.words
|
]
|
||||||
)
|
|
||||||
|
|
||||||
return {"text": text, "words": words}
|
return {"text": text, "words": words}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user