Hello,
I am trying to display the output of speech to text with speaker labels and start and end time.
Is there a way to show the time in hrs, min, sec?
I have done a conversion from milisec to sec by dividing by 1000 but that is not user-friendly.
And here is my code:
DEFAULT_TEXT = result['text']
ALL_WORDS = result['utterances']
for dic in ALL_WORDS:
st.write("Speaker", dic['speaker']+":",
dic['start']/1000, dic['end']/1000, dic['text'], )
print("Speaker", dic['speaker'])
print(dic['text'])
spacy_model = "en_core_web_sm"
# text = st.text_area("Text to analyze", DEFAULT_TEXT)
# all_words = st.text_area("All of the words", ALL_WORDS)
#doc = spacy_streamlit.process_text(spacy_model, text)
doc = spacy_streamlit.process_text(spacy_model, DEFAULT_TEXT)
spacy_streamlit.visualize_ner(
doc,
labels=["PERSON", "DATE", "GPE"],
show_table=True,
title="Persons, dates and locations",
)
st.text(f"Analyzed using spaCy model {spacy_model}")
print(doc)
Thanks in advance
