vsrinivas commited on
Commit
b1dccff
1 Parent(s): 9b98443

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -37,8 +37,15 @@ def transcribe_audio(filepath, tgt_language):
37
  )['text']
38
  print(english_transcript)
39
 
40
- output = translator(english_transcript, src_lang="eng_Latn",
41
- tgt_lang=flores_200_df.loc[int(tgt_language),'FLORES_200_code'])[0]['translation_text']
 
 
 
 
 
 
 
42
 
43
  print(output)
44
  return output
 
37
  )['text']
38
  print(english_transcript)
39
 
40
+ transcripts = english_transcript.split('.')
41
+
42
+ translations = []
43
+ for tscript in transcripts:
44
+ translation = translator(tscript, src_lang="eng_Latn",
45
+ tgt_lang=flores_200_df.loc[int(tgt_language),'FLORES_200_code'])[0]['translation_text']
46
+ translations.append(translation+'.')
47
+
48
+ output = ' '.join(translations)
49
 
50
  print(output)
51
  return output