Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,16 @@ def extract_text_from_docx(docx_file):
|
|
| 16 |
doc = Document(docx_file)
|
| 17 |
text = "\n".join([para.text for para in doc.paragraphs])
|
| 18 |
return text
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Function to extract information from a resume
|
| 21 |
def extract_info_from_resume(resume_path):
|
| 22 |
if resume_path.name.endswith('.pdf'):
|
|
|
|
| 16 |
doc = Document(docx_file)
|
| 17 |
text = "\n".join([para.text for para in doc.paragraphs])
|
| 18 |
return text
|
| 19 |
+
def extract_text_from_pdf(pdf_file):
|
| 20 |
+
text = ""
|
| 21 |
+
pdf = PdfReader(pdf_file)
|
| 22 |
+
|
| 23 |
+
if not pdf.pages:
|
| 24 |
+
raise ValueError("The PDF file is empty.")
|
| 25 |
+
|
| 26 |
+
for page in pdf.pages:
|
| 27 |
+
text += page.extract_text()
|
| 28 |
+
return text
|
| 29 |
# Function to extract information from a resume
|
| 30 |
def extract_info_from_resume(resume_path):
|
| 31 |
if resume_path.name.endswith('.pdf'):
|