Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -100,7 +100,7 @@ def display_resume(file, index):
|
|
| 100 |
st.error(f"Unsupported file type for {file.name}. Please upload a PDF or DOCX file.")
|
| 101 |
|
| 102 |
def analyze_multiple_resumes(resumes, job_description):
|
| 103 |
-
"""Analyze multiple resumes
|
| 104 |
match_percentages = []
|
| 105 |
|
| 106 |
for index, resume in enumerate(resumes):
|
|
@@ -113,21 +113,17 @@ def analyze_multiple_resumes(resumes, job_description):
|
|
| 113 |
elif file_type == 'docx':
|
| 114 |
text = extract_text_from_docx(resume)
|
| 115 |
|
| 116 |
-
# Analyze the resume
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
analysis = analyze_documents(text, job_description)
|
| 120 |
-
match_percentage = extract_match_percentage(analysis)
|
| 121 |
-
analysis_results.append(match_percentage)
|
| 122 |
|
| 123 |
-
#
|
| 124 |
-
|
| 125 |
-
match_percentages.append(avg_match_percentage)
|
| 126 |
|
| 127 |
# Display the result
|
| 128 |
-
st.write(f"###
|
| 129 |
-
st.progress(
|
| 130 |
-
|
| 131 |
# Overall match percentage across all resumes
|
| 132 |
if match_percentages:
|
| 133 |
avg_overall_match = sum(match_percentages) / len(match_percentages)
|
|
|
|
| 100 |
st.error(f"Unsupported file type for {file.name}. Please upload a PDF or DOCX file.")
|
| 101 |
|
| 102 |
def analyze_multiple_resumes(resumes, job_description):
|
| 103 |
+
"""Analyze multiple resumes."""
|
| 104 |
match_percentages = []
|
| 105 |
|
| 106 |
for index, resume in enumerate(resumes):
|
|
|
|
| 113 |
elif file_type == 'docx':
|
| 114 |
text = extract_text_from_docx(resume)
|
| 115 |
|
| 116 |
+
# Analyze the resume once
|
| 117 |
+
analysis = analyze_documents(text, job_description)
|
| 118 |
+
match_percentage = extract_match_percentage(analysis)
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
+
# Store the result
|
| 121 |
+
match_percentages.append(match_percentage)
|
|
|
|
| 122 |
|
| 123 |
# Display the result
|
| 124 |
+
st.write(f"### Match Percentage for {resume.name}: {match_percentage}%")
|
| 125 |
+
st.progress(match_percentage / 100) # Convert to decimal format
|
| 126 |
+
|
| 127 |
# Overall match percentage across all resumes
|
| 128 |
if match_percentages:
|
| 129 |
avg_overall_match = sum(match_percentages) / len(match_percentages)
|