Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -49,7 +49,7 @@ def compare():
|
|
49 |
|
50 |
for i, job_e in enumerate(job_embeddings):
|
51 |
job_e_tensor = torch.from_numpy(job_e).unsqueeze(0)
|
52 |
-
similarity_score = cosine_similarity(employee_embeddings_tensor, job_e_tensor, dim=1)
|
53 |
similarity_scores.append({"job": jobs_skills[i], "similarity_score": similarity_score.item()})
|
54 |
|
55 |
return jsonify(similarity_scores)
|
|
|
49 |
|
50 |
for i, job_e in enumerate(job_embeddings):
|
51 |
job_e_tensor = torch.from_numpy(job_e).unsqueeze(0)
|
52 |
+
similarity_score = cosine_similarity(employee_embeddings_tensor, job_e_tensor, dim=1)[0]
|
53 |
similarity_scores.append({"job": jobs_skills[i], "similarity_score": similarity_score.item()})
|
54 |
|
55 |
return jsonify(similarity_scores)
|