Update app.py
Browse files
app.py
CHANGED
@@ -204,7 +204,7 @@ def translate_transcriptions(df, selected_translation_lang_2, selected_source_la
|
|
204 |
if selected_translation_lang_2 != selected_source_lang_2:
|
205 |
|
206 |
text_combined = ""
|
207 |
-
for i, sentence in enumerate(
|
208 |
if i == 0:
|
209 |
text_combined = sentence
|
210 |
else:
|
@@ -218,7 +218,7 @@ def translate_transcriptions(df, selected_translation_lang_2, selected_source_la
|
|
218 |
|
219 |
# Print the response from the server
|
220 |
translated_sentences = json.loads(response.text)
|
221 |
-
translated_sentences['translations'][0]['text'].split('\n')
|
222 |
df['translation'] = translated_sentences
|
223 |
else:
|
224 |
df['translation'] = df['text']
|
|
|
204 |
if selected_translation_lang_2 != selected_source_lang_2:
|
205 |
|
206 |
text_combined = ""
|
207 |
+
for i, sentence in enumerate(df['text']):
|
208 |
if i == 0:
|
209 |
text_combined = sentence
|
210 |
else:
|
|
|
218 |
|
219 |
# Print the response from the server
|
220 |
translated_sentences = json.loads(response.text)
|
221 |
+
translated_sentences = translated_sentences['translations'][0]['text'].split('\n')
|
222 |
df['translation'] = translated_sentences
|
223 |
else:
|
224 |
df['translation'] = df['text']
|