Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functionality to map already extracted skills #233

Open
lizgzil opened this issue Nov 4, 2024 · 0 comments
Open

Functionality to map already extracted skills #233

lizgzil opened this issue Nov 4, 2024 · 0 comments

Comments

@lizgzil
Copy link
Collaborator

lizgzil commented Nov 4, 2024

import spacy
from ojd_daps_skills.extract_skills.extract_skills import SkillsExtractor
sm = SkillsExtractor(taxonomy_name="esco")
nlp = spacy.blank('en')

skills_per_ad = [['computer IT', 'excel', 'maths skills'], ['communication']] # List of skills for each job advert
docs = []
for skills_list in skills_per_ad:
    doc = nlp("text") # it doesn't matter what this is as it won't be used
    doc._.skill_spans = skills_list
    docs.append(doc)

mapped_skills = sm.map_skills(docs)

for m in mapped_skills:
  print(f"Skill spans: {m._.skill_spans}")
  # print mapped skills to the "esco" taxonomy
  print(f"Skills mapped: {m._.mapped_skills}")
  print("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant