ShubhamD95 commited on
Commit
7c8d169
Β·
verified Β·
1 Parent(s): cdf6731

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -9,8 +9,11 @@ kw_model = KeyBERT(model)
9
 
10
  # πŸ” Helper: Clean keywords from text (split on commas, newlines)
11
  def clean_keywords(text):
12
- keywords = re.split(r"[,\n]", text.lower())
13
- return set(kw.strip() for kw in keywords if kw.strip())
 
 
 
14
 
15
  # πŸ” Main function
16
  def extract_keywords(job_desc, resume_text, analyze_with_jd):
 
9
 
10
  # πŸ” Helper: Clean keywords from text (split on commas, newlines)
11
  def clean_keywords(text):
12
+ # Lowercase, remove special characters, and split on space/comma
13
+ text = re.sub(r"[^a-zA-Z0-9\s]", " ", text.lower())
14
+ words = re.split(r"\s+", text)
15
+ return set(w for w in words if w and len(w) > 2) # ignore very short words
16
+
17
 
18
  # πŸ” Main function
19
  def extract_keywords(job_desc, resume_text, analyze_with_jd):