Spaces:
Runtime error
Runtime error
Commit
·
69fee20
1
Parent(s):
2229429
Update tranlate function
Browse files
app.py
CHANGED
@@ -6,7 +6,10 @@ import streamlit as st
|
|
6 |
|
7 |
def translate_text(text):
|
8 |
blob = TextBlob(text)
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
def sentiment_classification(sentence, vader_object):
|
12 |
|
|
|
6 |
|
7 |
def translate_text(text):
|
8 |
blob = TextBlob(text)
|
9 |
+
try:
|
10 |
+
return str(blob.translate(from_lang="pt", to="en"))
|
11 |
+
except:
|
12 |
+
return text
|
13 |
|
14 |
def sentiment_classification(sentence, vader_object):
|
15 |
|