Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
13 |
-
|
|
|
|
|
|
|
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):
|