jeevitha-app commited on
Commit
0788209
·
verified ·
1 Parent(s): 392f089

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -0
app.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from sentence_transformers import SentenceTransformer
2
+ from sklearn.metrics.pairwise import cosine_similarity
3
+ import gradio as gr
4
+
5
+ model = SentenceTransformer("all-MiniLM-L6-v2")
6
+
7
+ def get_embedding(text):
8
+ return model.encode([text])[0]
9
+
10
+ def compute_similarity(resume, jd):
11
+ resume_emb = get_embedding(resume)
12
+ jd_emb = get_embedding(jd)
13
+ similarity = cosine_similarity([resume_emb], [jd_emb])[0][0]
14
+ return round(similarity * 100, 2)
15
+
16
+ def check_resume(resume_text, jd_text):
17
+ score = compute_similarity(resume_text, jd_text)
18
+ result = f"Similarity Score: {score}%\n\n"
19
+ if score > 75:
20
+ result += "✅ Resume is highly aligned with the Job Description."
21
+ elif score > 50:
22
+ result += "⚠️ Resume is partially aligned. Consider refining keywords and skills."
23
+ else:
24
+ result += "❌ Resume is not aligned. May contain irrelevant or fake claims."
25
+ return result
26
+
27
+ gr.Interface(
28
+ fn=check_resume,
29
+ inputs=[
30
+ gr.Textbox(label="Paste Resume Text", lines=20, placeholder="Copy your resume content here..."),
31
+ gr.Textbox(label="Paste Job Description", lines=20, placeholder="Copy the job description here...")
32
+ ],
33
+ outputs=gr.Textbox(label="Analysis Result"),
34
+ title="🧾 Resume-JD Alignment Detector",
35
+ description="Check if your resume genuinely matches the job description using LLM-based similarity."
36
+ ).launch()