Spaces:
Paused
Paused
Update util.py
Browse files
util.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import pandas as pd
|
| 3 |
from docx import Document
|
| 4 |
-
from pptx import Presentation
|
| 5 |
|
| 6 |
def get_questions(file_path, level):
|
| 7 |
df = pd.read_json(file_path, lines=True)
|
|
@@ -36,20 +35,4 @@ def read_docx(file_path):
|
|
| 36 |
for para in doc.paragraphs:
|
| 37 |
text.append(para.text)
|
| 38 |
|
| 39 |
-
return "\n".join(text)
|
| 40 |
-
|
| 41 |
-
def read_pptx(file_path):
|
| 42 |
-
prs = Presentation(file_path)
|
| 43 |
-
|
| 44 |
-
text = []
|
| 45 |
-
|
| 46 |
-
for slide in prs.slides:
|
| 47 |
-
slide_text = []
|
| 48 |
-
|
| 49 |
-
for shape in slide.shapes:
|
| 50 |
-
if hasattr(shape, "text"):
|
| 51 |
-
slide_text.append(shape.text)
|
| 52 |
-
|
| 53 |
-
text.append("\n".join(slide_text))
|
| 54 |
-
|
| 55 |
-
return "\n\n".join(text)
|
|
|
|
| 1 |
import os
|
| 2 |
import pandas as pd
|
| 3 |
from docx import Document
|
|
|
|
| 4 |
|
| 5 |
def get_questions(file_path, level):
|
| 6 |
df = pd.read_json(file_path, lines=True)
|
|
|
|
| 35 |
for para in doc.paragraphs:
|
| 36 |
text.append(para.text)
|
| 37 |
|
| 38 |
+
return "\n".join(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|