Spaces:
Sleeping
Sleeping
Create utils.py
Browse files
utils.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
|
| 3 |
+
def clean_text(text):
|
| 4 |
+
"""Basic text cleaning"""
|
| 5 |
+
text = text.lower()
|
| 6 |
+
text = re.sub(r'[^\w\s]', '', text) # Remove punctuation
|
| 7 |
+
text = re.sub(r'\s+', ' ', text) # Remove extra whitespace
|
| 8 |
+
return text.strip()
|
| 9 |
+
|
| 10 |
+
def extract_skills(text):
|
| 11 |
+
"""Extract skills from text (simplified version)"""
|
| 12 |
+
common_skills = {
|
| 13 |
+
# Technical skills
|
| 14 |
+
'python', 'java', 'javascript', 'sql', 'html', 'css', 'react',
|
| 15 |
+
'docker', 'kubernetes', 'aws', 'machine learning', 'tensorflow',
|
| 16 |
+
'pytorch', 'git', 'linux', 'node.js', 'typescript', 'azure', 'gcp',
|
| 17 |
+
|
| 18 |
+
# Soft skills
|
| 19 |
+
'communication', 'leadership', 'problem solving', 'teamwork',
|
| 20 |
+
'project management', 'agile', 'scrum'
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
found_skills = set()
|
| 24 |
+
for skill in common_skills:
|
| 25 |
+
if skill in text:
|
| 26 |
+
found_skills.add(skill.title())
|
| 27 |
+
|
| 28 |
+
return list(found_skills)
|