Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,7 @@ def text_summary(text, translate_fa, maxlength=None):
|
|
| 10 |
translatedtext = GoogleTranslator(source='auto', target='en').translate(text)
|
| 11 |
#create summary instance
|
| 12 |
summary = Summary()
|
| 13 |
-
|
| 14 |
-
result = summary(text)
|
| 15 |
if translate_fa:
|
| 16 |
result = GoogleTranslator(source='auto', target='en').translate(result)
|
| 17 |
return result
|
|
@@ -24,7 +23,7 @@ def extract_text_from_pdf(file_path):
|
|
| 24 |
text = page.extract_text()
|
| 25 |
return text
|
| 26 |
|
| 27 |
-
choice = st.
|
| 28 |
translate_fa = st.toggle('Translate to Persian', value=True)
|
| 29 |
|
| 30 |
if choice == "Summarize Text":
|
|
|
|
| 10 |
translatedtext = GoogleTranslator(source='auto', target='en').translate(text)
|
| 11 |
#create summary instance
|
| 12 |
summary = Summary()
|
| 13 |
+
result = summary(translatedtext)
|
|
|
|
| 14 |
if translate_fa:
|
| 15 |
result = GoogleTranslator(source='auto', target='en').translate(result)
|
| 16 |
return result
|
|
|
|
| 23 |
text = page.extract_text()
|
| 24 |
return text
|
| 25 |
|
| 26 |
+
choice = st.selectbox("Select your choice", ["Summarize Text", "Summarize Document"])
|
| 27 |
translate_fa = st.toggle('Translate to Persian', value=True)
|
| 28 |
|
| 29 |
if choice == "Summarize Text":
|