Update app.py
Browse files
app.py
CHANGED
|
@@ -37,8 +37,15 @@ def transcribe_audio(filepath, tgt_language):
|
|
| 37 |
)['text']
|
| 38 |
print(english_transcript)
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|