imporved segment timesteps readability
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
import time
|
||||||
from sympy import Segment
|
|
||||||
|
|
||||||
ALPHABET = [*"abcdefghijklmnopqrstuvwxyz"]
|
ALPHABET = [*"abcdefghijklmnopqrstuvwxyz"]
|
||||||
|
|
||||||
@@ -84,8 +83,10 @@ class Transcript:
|
|||||||
speaker = seq["speaker"]
|
speaker = seq["speaker"]
|
||||||
|
|
||||||
segm = seq["segment"]
|
segm = seq["segment"]
|
||||||
|
sseg = time.strftime("%H:%M:%S",time.gmtime(segm[0]))
|
||||||
|
eseg = time.strftime("%H:%M:%S",time.gmtime(segm[1]))
|
||||||
|
|
||||||
fstring += f"{speaker} {segm}: {seq['text']}\n"
|
fstring += f"{speaker} ({sseg} ; {eseg}): {seq['text']}\n"
|
||||||
return fstring
|
return fstring
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
@@ -125,7 +126,6 @@ class Transcript:
|
|||||||
|
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
def get_md(self) -> str:
|
def get_md(self) -> str:
|
||||||
return self.get_html()
|
return self.get_html()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user