Jeet Paul commited on
Commit
1fe926a
·
1 Parent(s): 3677a4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -71,7 +71,7 @@ def calculate_similarity(job_description, cvs, cv_file_names):
71
 
72
  return ranked_cvs
73
 
74
- def rank_and_shortlist(job_description, cv_files, threshold=0.2):
75
  cv_texts = [extract_text_from_pdf(cv_file.read()) for cv_file in cv_files]
76
  cv_file_names = [cv_file.name for cv_file in cv_files]
77
  cvs = [clean_pdf_text(cv_text) for cv_text in cv_texts]
@@ -103,8 +103,13 @@ def main():
103
 
104
  # Display shortlisted candidates with larger text
105
  st.markdown("### Shortlisted Candidates:")
106
- for rank, score in shortlisted_cvs:
107
- st.markdown(f"**File Name:** {rank}, **Similarity Score:** {score:.2f}")
 
 
 
 
 
108
 
109
  if __name__ == "__main__":
110
- main()
 
71
 
72
  return ranked_cvs
73
 
74
+ def rank_and_shortlist(job_description, cv_files, threshold=0.15):
75
  cv_texts = [extract_text_from_pdf(cv_file.read()) for cv_file in cv_files]
76
  cv_file_names = [cv_file.name for cv_file in cv_files]
77
  cvs = [clean_pdf_text(cv_text) for cv_text in cv_texts]
 
103
 
104
  # Display shortlisted candidates with larger text
105
  st.markdown("### Shortlisted Candidates:")
106
+ if not shortlisted_cvs: # Check if the shortlisted_cvs list is empty
107
+ st.markdown("None")
108
+ else:
109
+ for rank, score in shortlisted_cvs:
110
+ st.markdown(f"**File Name:** {rank}, **Similarity Score:** {score:.2f}")
111
+ else:
112
+ st.write("Please upload both the job description and resumes to proceed.")
113
 
114
  if __name__ == "__main__":
115
+ main()