MCPcopy
hub / github.com/Huanshere/VideoLingo / text_processing_section

Function text_processing_section

st.py:16–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14DUB_VIDEO = "output/output_dub.mp4"
15
16def text_processing_section():
17 st.header(t("b. Translate and Generate Subtitles"))
18 with st.container(border=True):
19 st.markdown(f"""
20 <p style='font-size: 20px;'>
21 {t("This stage includes the following steps:")}
22 <p style='font-size: 20px;'>
23 1. {t("WhisperX word-level transcription")}<br>
24 2. {t("Sentence segmentation using NLP and LLM")}<br>
25 3. {t("Summarization and multi-step translation")}<br>
26 4. {t("Cutting and aligning long subtitles")}<br>
27 5. {t("Generating timeline and subtitles")}<br>
28 6. {t("Merging subtitles into the video")}
29 """, unsafe_allow_html=True)
30
31 if not os.path.exists(SUB_VIDEO):
32 if st.button(t("Start Processing Subtitles"), key="text_processing_button"):
33 process_text()
34 st.rerun()
35 else:
36 if load_key("burn_subtitles"):
37 st.video(SUB_VIDEO)
38 download_subtitle_zip_button(text=t("Download All Srt Files"))
39
40 if st.button(t("Archive to 'history'"), key="cleanup_in_text_processing"):
41 cleanup()
42 st.rerun()
43 return True
44
45def process_text():
46 with st.spinner(t("Using Whisper for transcription...")):

Callers 1

mainFunction · 0.85

Calls 4

process_textFunction · 0.85
load_keyFunction · 0.85
cleanupFunction · 0.85

Tested by

no test coverage detected