zhuolisam commited on
Commit
6452d92
โ€ข
1 Parent(s): 38070e5

fixed config

Browse files
Files changed (2) hide show
  1. README.md +6 -7
  2. app.py +40 -47
README.md CHANGED
@@ -1,15 +1,14 @@
1
  ---
2
- title: Resume Ranker
3
- emoji: ๐Ÿข
4
- colorFrom: green
5
- colorTo: pink
6
- sdk: gradio
7
- sdk_version: 3.33.1
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
- def main():
18
- sample_files = [
19
- "documents/business.pdf",
20
- "documents/data_science.pdf",
21
- ]
22
-
23
- sample_job_descriptions = {
24
- "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.
25
- """,
26
- "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.
27
- """
28
- }
29
- st.sidebar.header("Sample Files")
30
- for sample_file in sample_files:
31
- st.sidebar.markdown(f"[{sample_file}](./sample_files/{sample_file})")
32
-
33
- st.sidebar.header("Sample Job Descriptions")
34
- selected_job = st.sidebar.selectbox("Select a job description", list(sample_job_descriptions.keys()))
35
- st.sidebar.markdown("```")
36
- st.sidebar.code(sample_job_descriptions[selected_job])
37
- st.title("๐Ÿ‘จ๐Ÿผโ€๐ŸŽ“Resume Ranker ")
38
-
39
- query = st.text_area("Job Description", height=200, value=sample_job_descriptions[selected_job])
40
- uploaded_files = st.file_uploader("Upload Resume", accept_multiple_files=True, type=["txt", "pdf"])
41
- embedding_type = st.selectbox("Embedding Type", ["bert", "minilm", "tfidf"])
42
-
43
- if st.button("Submit"):
44
- if not query:
45
- st.warning("Please enter a job description.")
46
- elif not uploaded_files:
47
- st.warning("Please upload one or more resumes.")
48
- else:
49
- with st.spinner("Processing..."):
50
- results = inference(query, uploaded_files,embedding_type)
51
- st.subheader("Results")
52
- for document, similarity in results.items():
53
- # make similiarty round to 2 decimal place
54
- if similarity >= 1:
55
- similarity = round(similarity, 2)
56
- st.write(f"- {document}:")
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%}")