JaMugen commited on
Commit
dd57dd7
·
1 Parent(s): 3a9d436

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -27,23 +27,16 @@ def main():
27
 
28
  if url:
29
  captions, translated_captions, original_file, translated_file = Milestone5API.download_video_transcript(url)
30
- print(captions)
31
- print(translated_captions)
32
  if captions and translated_captions:
33
  captions_list = []
34
- translated_list = []
35
  for line in captions.split("\n"):
36
  if line.strip():
37
  timestamp, text = line.split(" ", 1)
38
  captions_list.append({"Timestamp": timestamp, "Original": text})
39
 
40
- for line in translated_captions.split("\n"):
41
- if line.strip():
42
- timestamp, text = line.split(" ", 1)
43
- translated_list.append(text)
44
-
45
  df = pd.DataFrame(captions_list)
46
- df['Translated'] = translated_list
47
  df['Translated Timestamp'] = df['Timestamp'] # Assuming the timestamps align
48
 
49
  st.write("## Caption Table")
 
27
 
28
  if url:
29
  captions, translated_captions, original_file, translated_file = Milestone5API.download_video_transcript(url)
30
+
 
31
  if captions and translated_captions:
32
  captions_list = []
 
33
  for line in captions.split("\n"):
34
  if line.strip():
35
  timestamp, text = line.split(" ", 1)
36
  captions_list.append({"Timestamp": timestamp, "Original": text})
37
 
 
 
 
 
 
38
  df = pd.DataFrame(captions_list)
39
+ df['Translated'] = translated_captions
40
  df['Translated Timestamp'] = df['Timestamp'] # Assuming the timestamps align
41
 
42
  st.write("## Caption Table")