Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,11 +25,13 @@ def extract_text_from_pdf(pdf_file):
|
|
| 25 |
|
| 26 |
def generate_ai_prompt(resume_text, job_desc=None):
|
| 27 |
"""Generates smart analysis prompt for AI"""
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
return f"""
|
| 30 |
Analyze this resume comprehensively:
|
| 31 |
{resume_text[:10000]}
|
| 32 |
-
{
|
| 33 |
Return JSON with:
|
| 34 |
{{
|
| 35 |
"score": 0-100 (overall quality),
|
|
@@ -43,8 +45,7 @@ def generate_ai_prompt(resume_text, job_desc=None):
|
|
| 43 |
}},
|
| 44 |
"detected_skills": ["list", "of", "skills", "with", "variants"],
|
| 45 |
"strengths": ["list", "of", "2-3", "key", "strengths"],
|
| 46 |
-
"improvements": ["3-5", "specific", "actionable", "suggestions"]
|
| 47 |
-
"missing_keywords": ["important", "missing", "terms"]{" if job_desc else ""}
|
| 48 |
}}
|
| 49 |
"""
|
| 50 |
|
|
|
|
| 25 |
|
| 26 |
def generate_ai_prompt(resume_text, job_desc=None):
|
| 27 |
"""Generates smart analysis prompt for AI"""
|
| 28 |
+
job_desc_section = f"\nCompare against this job description: {job_desc[:2000]}" if job_desc else ""
|
| 29 |
+
missing_keywords_section = ',\n "missing_keywords": ["important", "missing", "terms"]' if job_desc else ""
|
| 30 |
+
|
| 31 |
return f"""
|
| 32 |
Analyze this resume comprehensively:
|
| 33 |
{resume_text[:10000]}
|
| 34 |
+
{job_desc_section}
|
| 35 |
Return JSON with:
|
| 36 |
{{
|
| 37 |
"score": 0-100 (overall quality),
|
|
|
|
| 45 |
}},
|
| 46 |
"detected_skills": ["list", "of", "skills", "with", "variants"],
|
| 47 |
"strengths": ["list", "of", "2-3", "key", "strengths"],
|
| 48 |
+
"improvements": ["3-5", "specific", "actionable", "suggestions"]{missing_keywords_section}
|
|
|
|
| 49 |
}}
|
| 50 |
"""
|
| 51 |
|