Spaces:
Runtime error
Runtime error
fixed config
Browse files
README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1 |
---
|
2 |
-
title: Resume
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
-
sdk:
|
7 |
-
sdk_version:
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
-
|
13 |
# resume-ranker
|
14 |
<hr>
|
15 |
|
|
|
1 |
---
|
2 |
+
title: Resume Ranking
|
3 |
+
emoji: ๐
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: indigo
|
6 |
+
sdk: streamlit
|
7 |
+
sdk_version: 1.21.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
11 |
|
|
|
12 |
# resume-ranker
|
13 |
<hr>
|
14 |
|
app.py
CHANGED
@@ -14,50 +14,43 @@ def inference(query, files, embedding_type):
|
|
14 |
prob_per_documents = {result['name']: result['similarity'] for result in results}
|
15 |
return prob_per_documents
|
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 |
-
if
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
st.progress(similarity, text=f"{similarity:.2%}")
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
if __name__ == '__main__':
|
63 |
-
main()
|
|
|
14 |
prob_per_documents = {result['name']: result['similarity'] for result in results}
|
15 |
return prob_per_documents
|
16 |
|
17 |
+
sample_files = [
|
18 |
+
"documents/business.pdf",
|
19 |
+
"documents/data_science.pdf",
|
20 |
+
]
|
21 |
+
|
22 |
+
sample_job_descriptions = {
|
23 |
+
"Software Engineer": """We are looking for a software engineer with experience in Python and web development. The ideal candidate should have a strong background in building scalable and robust applications. Knowledge of frameworks such as Flask and Django is a plus. Experience with front-end technologies like HTML, CSS, and JavaScript is desirable. The candidate should also have a good understanding of databases and SQL. Strong problem-solving and communication skills are required for this role.
|
24 |
+
""",
|
25 |
+
"Data Scientist": """We are seeking a data scientist with expertise in machine learning and statistical analysis. The candidate should have a solid understanding of data manipulation, feature engineering, and model development. Proficiency in Python and popular data science libraries such as NumPy, Pandas, and Scikit-learn is required. Experience with deep learning frameworks like TensorFlow or PyTorch is a plus. Strong analytical and problem-solving skills are essential for this position.
|
26 |
+
"""
|
27 |
+
}
|
28 |
+
st.sidebar.header("Sample Files")
|
29 |
+
for sample_file in sample_files:
|
30 |
+
st.sidebar.markdown(f"[{sample_file}](./sample_files/{sample_file})")
|
31 |
+
|
32 |
+
st.sidebar.header("Sample Job Descriptions")
|
33 |
+
selected_job = st.sidebar.selectbox("Select a job description", list(sample_job_descriptions.keys()))
|
34 |
+
st.sidebar.markdown("```")
|
35 |
+
st.sidebar.code(sample_job_descriptions[selected_job])
|
36 |
+
st.title("๐จ๐ผโ๐Resume Ranker ")
|
37 |
+
|
38 |
+
query = st.text_area("Job Description", height=200, value=sample_job_descriptions[selected_job])
|
39 |
+
uploaded_files = st.file_uploader("Upload Resume", accept_multiple_files=True, type=["txt", "pdf"])
|
40 |
+
embedding_type = st.selectbox("Embedding Type", ["bert", "minilm", "tfidf"])
|
41 |
+
|
42 |
+
if st.button("Submit"):
|
43 |
+
if not query:
|
44 |
+
st.warning("Please enter a job description.")
|
45 |
+
elif not uploaded_files:
|
46 |
+
st.warning("Please upload one or more resumes.")
|
47 |
+
else:
|
48 |
+
with st.spinner("Processing..."):
|
49 |
+
results = inference(query, uploaded_files,embedding_type)
|
50 |
+
st.subheader("Results")
|
51 |
+
for document, similarity in results.items():
|
52 |
+
# make similiarty round to 2 decimal place
|
53 |
+
if similarity >= 1:
|
54 |
+
similarity = round(similarity, 2)
|
55 |
+
st.write(f"- {document}:")
|
56 |
+
st.progress(similarity, text=f"{similarity:.2%}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|