ChaitanyaSubhakar commited on
Commit
959ba22
Β·
verified Β·
1 Parent(s): 6014d33

Update Home.py

Browse files
Files changed (1) hide show
  1. Home.py +22 -17
Home.py CHANGED
@@ -138,22 +138,27 @@ if uploaded_file:
138
 
139
  except Exception as e:
140
  st.error(f"❌ Failed to parse {filename}: {e}")
 
 
 
 
 
 
 
 
141
 
142
  if parsed_resumes:
143
- selected_skills = st.multiselect("Select required skills", sorted(unique_skills), key="skills_select")
144
-
145
- if st.button("Evaluate Resumes"):
146
- # Clear selected folder before saving new selection
147
- if os.path.exists(SELECTED_FOLDER):
148
- shutil.rmtree(SELECTED_FOLDER)
149
- os.makedirs(SELECTED_FOLDER, exist_ok=True)
150
-
151
- for resume in parsed_resumes:
152
- if all(skill in resume["Skills"] for skill in selected_skills):
153
- st.success(f"βœ… Selected: {resume['Name']}")
154
- target_path = os.path.join(SELECTED_FOLDER, os.path.basename(resume["file_path"]))
155
- shutil.copy(resume["file_path"], target_path)
156
- st.write(f"Copied {resume['file_path']} to {target_path}")
157
- st.write(f"Exists now? {os.path.exists(target_path)}")
158
- else:
159
- st.warning(f"❌ Rejected: {resume['Name']}")
 
138
 
139
  except Exception as e:
140
  st.error(f"❌ Failed to parse {filename}: {e}")
141
+ skill_categories = {
142
+ "Programming Languages" : ["Python"],
143
+ "Data Analysis & Visualisation": ["Pandas", "Numpy", "Excel", "Matplotlib", "Seaborn"],
144
+ "Database Management": ["SQL", "Power BI"],
145
+ "Deep Learning": ["ANN", "CNN", "RNN"],
146
+ "Machine Learning": ["Scikit-learn", "OpenCV", "NLP", "Supervised learning", "Optuna", "Descriptive Statistics"],
147
+ "Generative AI": ["Langchain", "LLMs"]
148
+ }
149
 
150
  if parsed_resumes:
151
+ selected_categories = st.multiselect("Select required skill categories", list(skill_categories.keys()))
152
+
153
+ if st.button("Evaluate Resumes"):
154
+ required_keywords = set()
155
+ for category in selected_categories:
156
+ required_keywords.update(skill_categories[category])
157
+
158
+ for resume in parsed_resumes:
159
+ # Match: If any required keyword is in the resume skills
160
+ if any(req_skill.lower() in (skill.lower() for skill in resume["Skills"]) for req_skill in required_keywords):
161
+ st.success(f"βœ… Selected: {resume['Name']}")
162
+ shutil.copy(resume["file_path"], os.path.join(SELECTED_FOLDER, os.path.basename(resume["file_path"])))
163
+ else:
164
+ st.warning(f"❌ Rejected: {resume['Name']}")