Spaces:
Running
Running
Update similarity_score_refined.py
Browse files
similarity_score_refined.py
CHANGED
@@ -51,7 +51,7 @@ genai.configure(api_key=api_key_google)
|
|
51 |
|
52 |
model = genai.GenerativeModel('gemini-pro')
|
53 |
|
54 |
-
def similarity_main(
|
55 |
"""
|
56 |
Use Gemini Pro to evaluate the relevance score between a tailored resume and job description.
|
57 |
|
@@ -62,6 +62,9 @@ def similarity_main(tailored_resume, job_description):
|
|
62 |
Returns:
|
63 |
- dict: A dictionary containing the 'score' (scaled to 0–100) and 'reason'.
|
64 |
"""
|
|
|
|
|
|
|
65 |
prompt = f"""
|
66 |
You are a recruitment expert evaluating how well a tailored resume aligns with a job description. Provide a realistic and concise evaluation based on the following criteria:
|
67 |
1. Relevance of skills and experience: Do the candidate’s skills, accomplishments, and experience meet the job's core requirements?
|
@@ -73,7 +76,7 @@ Score: [Score between 0 and 1]
|
|
73 |
Reason: [One or two sentences explaining the score]
|
74 |
Here is the tailored resume:
|
75 |
[Resume Start]
|
76 |
-
{
|
77 |
[Resume End]
|
78 |
And the job description below:
|
79 |
[Job Description Start]
|
|
|
51 |
|
52 |
model = genai.GenerativeModel('gemini-pro')
|
53 |
|
54 |
+
def similarity_main(tailored_resume_path, job_description_path):
|
55 |
"""
|
56 |
Use Gemini Pro to evaluate the relevance score between a tailored resume and job description.
|
57 |
|
|
|
62 |
Returns:
|
63 |
- dict: A dictionary containing the 'score' (scaled to 0–100) and 'reason'.
|
64 |
"""
|
65 |
+
|
66 |
+
resume_text = read_file(tailored_resume_path)
|
67 |
+
job_description = read_file(job_description_path)
|
68 |
prompt = f"""
|
69 |
You are a recruitment expert evaluating how well a tailored resume aligns with a job description. Provide a realistic and concise evaluation based on the following criteria:
|
70 |
1. Relevance of skills and experience: Do the candidate’s skills, accomplishments, and experience meet the job's core requirements?
|
|
|
76 |
Reason: [One or two sentences explaining the score]
|
77 |
Here is the tailored resume:
|
78 |
[Resume Start]
|
79 |
+
{resume_text}
|
80 |
[Resume End]
|
81 |
And the job description below:
|
82 |
[Job Description Start]
|