File size: 830 Bytes
14ce62c
0cb6239
 
 
63228ef
eae3ffd
63228ef
eae3ffd
63228ef
eae3ffd
0cb6239
eae3ffd
 
 
 
 
 
 
14ce62c
eae3ffd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import spacy

nlp = spacy.load("en_core_web_sm")

def extract_text_from_pdf(file):
    import pdfplumber
    with pdfplumber.open(file) as pdf:
        return "\n".join(page.extract_text() for page in pdf.pages if page.extract_text())

def extract_entities(text):
    doc = nlp(text)
    # Extract skills by matching tokens to skills list externally
    # Here we just return all nouns as a placeholder
    skills = [token.text for token in doc if token.pos_ in ("NOUN", "PROPN")]
    # Determine background (simplified)
    technical_skills = {"Python", "Machine Learning", "Cloud Computing", "Cybersecurity", "AI", "DevOps"}
    background = "technical" if any(skill in technical_skills for skill in skills) else "non-technical"
    # Dummy experience years
    years_exp = 3
    return list(set(skills)), background, years_exp