Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,12 +39,17 @@ def extract_text_from_txt(file_path):
|
|
| 39 |
# return text
|
| 40 |
|
| 41 |
def extract_text_from_doc(file_path):
|
| 42 |
-
text = ""
|
| 43 |
-
doc = docx.Document(file_path)
|
| 44 |
-
for texts in doc.paragraphs:
|
| 45 |
-
|
| 46 |
|
| 47 |
-
return texts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
|
| 50 |
|
|
|
|
| 39 |
# return text
|
| 40 |
|
| 41 |
def extract_text_from_doc(file_path):
|
| 42 |
+
# text = ""
|
| 43 |
+
# doc = docx.Document(file_path)
|
| 44 |
+
# for texts in doc.paragraphs:
|
| 45 |
+
# text+= texts.text + "\n"
|
| 46 |
|
| 47 |
+
# return texts
|
| 48 |
+
doc = docx.Document(file_path)
|
| 49 |
+
fullText = []
|
| 50 |
+
for para in doc.paragraphs:
|
| 51 |
+
fullText.append(para.text)
|
| 52 |
+
return '\n'.join(fullText)
|
| 53 |
|
| 54 |
|
| 55 |
|