Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,13 +35,13 @@ def main():
|
|
| 35 |
captions_list.append({"Timestamp": timestamp, "Language": lang, "Text": text})
|
| 36 |
|
| 37 |
if translated_captions:
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
if lang == "
|
| 43 |
-
captions_list
|
| 44 |
-
|
| 45 |
df = pd.DataFrame(captions_list)
|
| 46 |
|
| 47 |
start_index = st.session_state.get('start_index', 0)
|
|
|
|
| 35 |
captions_list.append({"Timestamp": timestamp, "Language": lang, "Text": text})
|
| 36 |
|
| 37 |
if translated_captions:
|
| 38 |
+
captions_list = []
|
| 39 |
+
for original_line, translated_line in zip(captions_list, translated_captions):
|
| 40 |
+
lang, timestamp, text = original_line.split(" ", 2)
|
| 41 |
+
lang_trans, timestamp_trans, text_trans = translated_line.split(" ", 2)
|
| 42 |
+
if lang == "en:" or lang == "fr:": # Assuming lines starting with "fr:" or "en:"
|
| 43 |
+
captions_list.append({"Timestamp": timestamp, "Language": lang, "Text": text, "Translated": text_trans})
|
| 44 |
+
|
| 45 |
df = pd.DataFrame(captions_list)
|
| 46 |
|
| 47 |
start_index = st.session_state.get('start_index', 0)
|