Spaces:
Runtime error
Runtime error
update reqs
Browse files- ResumeReader.py +6 -7
- app.py +1 -1
ResumeReader.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import re
|
2 |
import os
|
3 |
import logging
|
4 |
-
import docx
|
5 |
import pdfplumber
|
6 |
|
7 |
class ResumeReader:
|
@@ -17,11 +16,12 @@ class ResumeReader:
|
|
17 |
:rtype: str
|
18 |
"""
|
19 |
|
20 |
-
doc = docx.Document(docx_file)
|
21 |
-
allText = []
|
22 |
-
for docpara in doc.paragraphs:
|
23 |
-
allText.append(docpara.text)
|
24 |
-
text = ' '.join(allText)
|
|
|
25 |
try:
|
26 |
clean_text = re.sub(r'\n+', '\n', text)
|
27 |
clean_text = clean_text.replace("\r", "\n").replace("\t", " ") # Normalize text blob
|
@@ -95,6 +95,5 @@ class ResumeReader:
|
|
95 |
else:
|
96 |
resume_lines = None
|
97 |
|
98 |
-
# print(resume_lines)
|
99 |
|
100 |
return resume_lines
|
|
|
1 |
import re
|
2 |
import os
|
3 |
import logging
|
|
|
4 |
import pdfplumber
|
5 |
|
6 |
class ResumeReader:
|
|
|
16 |
:rtype: str
|
17 |
"""
|
18 |
|
19 |
+
# doc = docx.Document(docx_file)
|
20 |
+
# allText = []
|
21 |
+
# for docpara in doc.paragraphs:
|
22 |
+
# allText.append(docpara.text)
|
23 |
+
# text = ' '.join(allText)
|
24 |
+
text = ""
|
25 |
try:
|
26 |
clean_text = re.sub(r'\n+', '\n', text)
|
27 |
clean_text = clean_text.replace("\r", "\n").replace("\t", " ") # Normalize text blob
|
|
|
95 |
else:
|
96 |
resume_lines = None
|
97 |
|
|
|
98 |
|
99 |
return resume_lines
|
app.py
CHANGED
@@ -11,7 +11,7 @@ def parse_cv(cv):
|
|
11 |
|
12 |
description = """A demo for a CV parser built with HuggingFace's transformers."""
|
13 |
article = "Find the code on GitHub <a href='https://github.com/asimokby/cv-parser-huggingface'>here</a>."
|
14 |
-
file_input = gr.inputs.File(file_count="single", type="file", label="Upload a CV", optional=False)
|
15 |
iface = gr.Interface(fn=parse_cv, inputs=file_input, outputs="json", allow_flagging="never",
|
16 |
allow_screenshot=False, title="CV Parser", theme="dark", description=description, article=article)
|
17 |
|
|
|
11 |
|
12 |
description = """A demo for a CV parser built with HuggingFace's transformers."""
|
13 |
article = "Find the code on GitHub <a href='https://github.com/asimokby/cv-parser-huggingface'>here</a>."
|
14 |
+
file_input = gr.inputs.File(file_count="single", type="file", label="Upload a CV: .PDF Or .TXT", optional=False)
|
15 |
iface = gr.Interface(fn=parse_cv, inputs=file_input, outputs="json", allow_flagging="never",
|
16 |
allow_screenshot=False, title="CV Parser", theme="dark", description=description, article=article)
|
17 |
|