Spaces:
Running
Running
bainskarman
commited on
Update ATS_score.py
Browse files- ATS_score.py +8 -14
ATS_score.py
CHANGED
@@ -1,17 +1,11 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
vectorizer = TfidfVectorizer(stop_words=stopwords)
|
10 |
-
vectors = vectorizer.fit_transform([job_description, resume_data])
|
11 |
-
similarity_value = cosine_similarity(vectors)
|
12 |
-
print(similarity_value)
|
13 |
-
# return similarity_value[0,1]
|
14 |
-
return similarity_value[0,1]
|
15 |
|
16 |
|
17 |
|
|
|
1 |
+
from sentence_transformers import SentenceTransformer, util
|
2 |
+
|
3 |
+
def calculateATSscore_with_bert(resume_data, job_description):
|
4 |
+
model = SentenceTransformer('paraphrase-MiniLM-L6-v2') # Pre-trained BERT model
|
5 |
+
resume_embedding = model.encode(resume_data)
|
6 |
+
job_desc_embedding = model.encode(job_description)
|
7 |
+
similarity_value = util.cos_sim(resume_embedding, job_desc_embedding)
|
8 |
+
return similarity_value.item()
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
|
11 |
|