Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,9 +44,11 @@ def analyze_resume(resume_file, job_description_file):
|
|
44 |
# Get embeddings and compute similarity
|
45 |
resume_embedding = model.encode(resume_text)
|
46 |
job_description_embedding = model.encode(job_description)
|
47 |
-
similarity
|
|
|
|
|
48 |
|
49 |
-
return entities, similarity, job_description
|
50 |
|
51 |
# Create a Gradio interface
|
52 |
iface = gr.Interface(
|
|
|
44 |
# Get embeddings and compute similarity
|
45 |
resume_embedding = model.encode(resume_text)
|
46 |
job_description_embedding = model.encode(job_description)
|
47 |
+
# Calculate similarity and convert to percentage
|
48 |
+
similarity = util.pytorch_cos_sim(resume_embedding, job_description_embedding).item() * 100
|
49 |
+
similarity = round(similarity, 2) # Round to two decimal places
|
50 |
|
51 |
+
return entities, f"{similarity}%", job_description
|
52 |
|
53 |
# Create a Gradio interface
|
54 |
iface = gr.Interface(
|