bainskarman commited on
Commit
fc45a55
·
verified ·
1 Parent(s): e913fd2

Update ATS_score.py

Browse files
Files changed (1) hide show
  1. ATS_score.py +8 -14
ATS_score.py CHANGED
@@ -1,17 +1,11 @@
1
- #find ats score
2
- from sklearn.feature_extraction.text import TfidfVectorizer
3
- from sklearn.metrics.pairwise import cosine_similarity
4
- from sklearn.feature_extraction import _stop_words
5
- from convert import ExtractPDFText
6
-
7
- def calculateATSscore(resume_data, job_description):
8
- stopwords = list(_stop_words.ENGLISH_STOP_WORDS)
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