Back to Case Studies

Long-Entity NER for Job Descriptions

Extracting Salary, Benefits, Education, Experience and Skills

ProductionResearchHR & RecruitmentMay 2020 – Sep 2020NLP, Knowledge Systems & Generative AI
0.89
F1, up from 0.83 in the paper
5
Fields, from salary to skills
4+ words
Typical entity length
1,200
Job descriptions labelled by hand

My Role

Role
Solo engineer, end to end
At HeyML
Team
Solo, with the CEO
Stage reached
In production, handed over
Key decisions
  • Keep only postings of 300+ words
  • Label each benefit as its own entity
  • spaCy CNN NER with word2vec for long entities

Approach at a Glance

Details
  1. 1Dataset from Job Portals
  2. 2Labeling Rules and Manual Labeling
  3. 3CNN-Based NER for Long Entities
  4. 4From Research to Production
  5. 5Web App and API

Executive Summary

A system that reads free-text job postings and pulls out the five parameters a candidate or recruiter cares about most: salary, benefits, education, work experience and skills. Users submit a posting through a web app or an API and get it back with each parameter highlighted in the text.

What made the problem unusual is the length of the entities. Classic named entity recognition finds short spans like a person's name or a city. Here, a single entity is often a whole phrase: "5+ years of experience working on deployment teams, ideally using Agile", or "Bachelor's or Master's degree in Computer Science or a related field". The model has to recognise a long, loosely structured piece of text as one entity, with its value and its field.

I scraped and hand-labeled 1,200 job descriptions and trained a spaCy CNN-based NER model on them. The research version reached F1 0.83, and the final production model reached about 0.89. I built it as the only engineer, working with our CEO, including the scraping, model, web app, API and deployment. The research behind it was later published at IEEE CSIT-2021.


Client Profile

The client works in recruiting and job-market technology and processes large numbers of job postings from many portals. To compare offers, match candidates or analyse the market, it needs the key conditions of each job as structured data, but postings are free text with no common format.

That made extraction hard:

  • No structure: every employer writes differently. Salary, benefits and requirements can appear anywhere, in any wording.
  • Long, fuzzy entities: requirements are phrases, not keywords. "Experience" includes how much and in what, and "education" includes the degree and the field.
  • Many forms of the same thing: a salary can be hourly, monthly or yearly, a range or a single figure, and named in different ways.

Technical Approach

  1. Dataset from Job Portals – I scraped job postings from several job portals with BeautifulSoup and Selenium, and kept texts of at least 300 words, long enough to contain full requirement phrases. That gave 1,200 job descriptions: 1,000 for training and 200 for validation.

  2. Labeling Rules and Manual Labeling – Each text was labeled by hand in doccano and stored as JSONL with start position, end position and label. Long entities need clear rules, so we fixed them before training:

    • education and experience include not only the degree or duration, but also the field;
    • benefits are labeled one by one, one benefit per entity;
    • salary is labeled in all its forms and periods, including ranges.
  3. CNN-Based NER for Long Entities – The model is spaCy's CNN-based NER with pre-trained word2vec vectors. Convolutions over the word vectors capture the context of a phrase, and a sliding window lets an entity span many words. Training ran on an NVIDIA GTX 1080 GPU, and labeling rules were refined between experiments.

  4. From Research to Production – The research version reached F1 0.83 on the validation set (precision 0.88, recall 0.79). The final production model, which also extracts skills, reached about 0.89.

  5. Web App and API – A Flask application gives users a GUI to submit a posting and see the parameters highlighted in the text, plus an API for other systems. It runs on Google Cloud, with PostgreSQL for storage.


Business Outcome

The client got job postings turned into structured data automatically: salary, benefits, education, experience and skills extracted from free text, with no fixed format required. The final model reached F1 of about 0.89 on these long, loosely structured entities, and because job postings vary so much, it also generalised to texts from sources outside the training set. The platform and API were delivered to production and handed over to the client.

The research was later published as Named Entity Recognition Problem for Long Entities in English Texts at IEEE CSIT-2021 (IEEE Xplore, open access).

Technologies

NLPNamed Entity RecognitionspaCyCNNword2vecdoccanoWeb ScrapingBeautifulSoupSeleniumFlaskPostgreSQLGoogle Cloud

Planning something similar?

Tell me about it on a short call. New projects can start within 2 weeks