-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstreamlit_app.py
More file actions
69 lines (52 loc) · 1.67 KB
/
streamlit_app.py
File metadata and controls
69 lines (52 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import streamlit as st
import textract
import spacy
import tempfile
from utils import get_skills, clean_resume, plot_pie, get_matching_skills
@st.experimental_singleton
def get_model():
nlp = spacy.load("en_core_web_sm")
entity_pattern = "temp.jsonl"
ruler = nlp.add_pipe("entity_ruler")
ruler.from_disk(entity_pattern)
return nlp
st.write("Hello world")
model = get_model()
#required_skills = st.text_input(
# "Enter skills seperated by a commma").lower().split(',')
uploaded_file = st.file_uploader("Upload pdf")
text = ''
if st.button("Parse resume and get skills"):
st.write('Parsing')
context = None
with tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") as temp:
temp.write(uploaded_file.getvalue())
temp.flush()
context = textract.process(temp.name)
text = context.decode("UTF-8")
clean_text = clean_resume(text)
skills = list(get_skills(model, clean_text))
print(skills)
#matching, missing = get_matching_skills(required_skills, skills)
#print(matching)
st.write(skills)
#sk_miss = st.checkbox("Show only missing skills")
'''
if sk_miss:
sk_found = st.checkbox('Show all skills found', disabled=True)
sk_match = st.checkbox("Show matching skills", disabled=True)
st.write("Missing skills")
st.write(missing)
else:
sk_found = st.checkbox('Show all skills found', disabled=False)
sk_match = st.checkbox("Show matching skills", disabled=False)
if sk_match and sk_found:
full = matching+missing
st.write(full)
else:
if sk_match:
st.write(matching)
'''
#fig = plot_pie(required_skills, skills)
# st.pyplot(fig)
# st.write(count/len(required_skills))