Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -155,13 +155,13 @@ def analyze_resume(resume_text):
|
|
155 |
f"This resume shows strong managerial responsibilities: {resume_text}",
|
156 |
f"This resume demonstrates excellent leadership skills: {resume_text}",
|
157 |
f"This resume indicates significant work experience: {resume_text}",
|
158 |
-
f"This resume
|
159 |
]
|
160 |
|
161 |
-
# Analyze each prompt using the model
|
162 |
results = []
|
163 |
for prompt in prompts:
|
164 |
-
|
|
|
165 |
outputs = model(**inputs)
|
166 |
predicted_class = torch.argmax(outputs.logits).item()
|
167 |
results.append(predicted_class)
|
@@ -208,20 +208,6 @@ if uploaded_file and job_description:
|
|
208 |
data['Email'] = email if email != "Not Available" else "Not Available"
|
209 |
data['Contact'] = contact if contact != "Not Available" else "Not Available"
|
210 |
|
211 |
-
# Extract team leadership and management experience
|
212 |
-
team_leadership_years = extract_experience_years(resume_text)
|
213 |
-
management_years = extract_experience_years(resume_text)
|
214 |
-
data['Direct_Team_Leadership_Experience_Years'] = team_leadership_years if team_leadership_years > 0 else "Not Available"
|
215 |
-
data['Direct_Management_Experience_Years'] = management_years if management_years > 0 else "Not Available"
|
216 |
-
|
217 |
-
# Extract skills using the NER model
|
218 |
-
relevant_skills = extract_skills(resume_text)
|
219 |
-
data['Relevant_Skills_and_Qualifications'] = relevant_skills if relevant_skills != "Not Available" else "Not Available"
|
220 |
-
|
221 |
-
# Extract education using the NER model or regex
|
222 |
-
educational_background = extract_education(resume_text)
|
223 |
-
data['Educational_Background'] = educational_background if educational_background != "Not Available" else "Not Available"
|
224 |
-
|
225 |
# Calculate match percentage dynamically
|
226 |
match_percentage = calculate_match_percentage(resume_text, job_description)
|
227 |
data['Match_Percentage'] = match_percentage
|
|
|
155 |
f"This resume shows strong managerial responsibilities: {resume_text}",
|
156 |
f"This resume demonstrates excellent leadership skills: {resume_text}",
|
157 |
f"This resume indicates significant work experience: {resume_text}",
|
158 |
+
f"This resume indicates at least 2 years of relevant experience: {resume_text}"
|
159 |
]
|
160 |
|
|
|
161 |
results = []
|
162 |
for prompt in prompts:
|
163 |
+
# Tokenize the prompt with truncation
|
164 |
+
inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
|
165 |
outputs = model(**inputs)
|
166 |
predicted_class = torch.argmax(outputs.logits).item()
|
167 |
results.append(predicted_class)
|
|
|
208 |
data['Email'] = email if email != "Not Available" else "Not Available"
|
209 |
data['Contact'] = contact if contact != "Not Available" else "Not Available"
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
# Calculate match percentage dynamically
|
212 |
match_percentage = calculate_match_percentage(resume_text, job_description)
|
213 |
data['Match_Percentage'] = match_percentage
|