Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,9 +102,7 @@ def get_pdf_text_fa_en(pdf_docs):
|
|
| 102 |
for pdf in pdf_docs:
|
| 103 |
pdf_reader = PdfReader(pdf)
|
| 104 |
for page in pdf_reader.pages:
|
| 105 |
-
txt_page=page.extract_text()
|
| 106 |
-
with open("fa.txt", "w", encoding="utf-8") as f:
|
| 107 |
-
f.write("\n\n".join(txt_page))
|
| 108 |
text += txt_page
|
| 109 |
return text
|
| 110 |
########################################################################################################
|
|
@@ -142,8 +140,9 @@ def main():
|
|
| 142 |
if st.button("Ready File"):
|
| 143 |
with st.spinner("waiting"):
|
| 144 |
text=get_pdf_text_fa_en(pdf_docs=pdf_docs)
|
| 145 |
-
st.write(text)
|
| 146 |
-
|
|
|
|
| 147 |
|
| 148 |
if st.button("Process"):
|
| 149 |
with st.spinner("Processing"):
|
|
|
|
| 102 |
for pdf in pdf_docs:
|
| 103 |
pdf_reader = PdfReader(pdf)
|
| 104 |
for page in pdf_reader.pages:
|
| 105 |
+
txt_page=page.extract_text()
|
|
|
|
|
|
|
| 106 |
text += txt_page
|
| 107 |
return text
|
| 108 |
########################################################################################################
|
|
|
|
| 140 |
if st.button("Ready File"):
|
| 141 |
with st.spinner("waiting"):
|
| 142 |
text=get_pdf_text_fa_en(pdf_docs=pdf_docs)
|
| 143 |
+
st.write(text)
|
| 144 |
+
with open('fa.txt', 'w', encoding='utf-8') as f:
|
| 145 |
+
f.write(text)
|
| 146 |
|
| 147 |
if st.button("Process"):
|
| 148 |
with st.spinner("Processing"):
|