Spaces:
Runtime error
Runtime error
Update classificator.py
Browse files- classificator.py +2 -1
classificator.py
CHANGED
|
@@ -51,6 +51,7 @@ def predict(cv, job, weight):
|
|
| 51 |
major_similarity = cosine_similarity(st.encode(cv['userMajors']).reshape(1,-1), st.encode(job['majors']).reshape(1,-1))[0][0] if cv['userMajors'] != '[]' else 0
|
| 52 |
skill_similarity = cosine_similarity(st.encode(cv['skills']).reshape(1,-1), st.encode(job['skills']).reshape(1,-1))[0][0] if cv['skills'] != '[]' else 0
|
| 53 |
# score_yoe = 0.5 if diffYoe == -1 else (0 if diffYoe < 0 else 1)
|
|
|
|
| 54 |
coords_1 = get_coordinates(cv['location'])
|
| 55 |
coords_2 = get_coordinates(job['location'])
|
| 56 |
distance = 999999
|
|
@@ -60,7 +61,7 @@ def predict(cv, job, weight):
|
|
| 60 |
else:
|
| 61 |
raise ValueError("Could not get coordinates for one or both cities.")
|
| 62 |
|
| 63 |
-
score = weight['exp'] * role_req_exp + weight['position'] * role_pos + weight['major'] * major_similarity + weight['diffYoe']* diffYoe + weight['skills'] * skill_similarity + weight['location'] * (1 / (1 + distance))
|
| 64 |
# data = [{
|
| 65 |
# 'role_req-exp': role_req_exp,
|
| 66 |
# 'role_pos': role_pos,
|
|
|
|
| 51 |
major_similarity = cosine_similarity(st.encode(cv['userMajors']).reshape(1,-1), st.encode(job['majors']).reshape(1,-1))[0][0] if cv['userMajors'] != '[]' else 0
|
| 52 |
skill_similarity = cosine_similarity(st.encode(cv['skills']).reshape(1,-1), st.encode(job['skills']).reshape(1,-1))[0][0] if cv['skills'] != '[]' else 0
|
| 53 |
# score_yoe = 0.5 if diffYoe == -1 else (0 if diffYoe < 0 else 1)
|
| 54 |
+
|
| 55 |
coords_1 = get_coordinates(cv['location'])
|
| 56 |
coords_2 = get_coordinates(job['location'])
|
| 57 |
distance = 999999
|
|
|
|
| 61 |
else:
|
| 62 |
raise ValueError("Could not get coordinates for one or both cities.")
|
| 63 |
|
| 64 |
+
score = weight['exp'] * role_req_exp + weight['position'] * role_pos + weight['major'] * major_similarity + weight['diffYoe']* diffYoe/job['minYoE'] + weight['skills'] * skill_similarity + weight['location'] * (1 / (1 + distance))
|
| 65 |
# data = [{
|
| 66 |
# 'role_req-exp': role_req_exp,
|
| 67 |
# 'role_pos': role_pos,
|