
From Keyword Matching to Semantic Matching: Using BERT Embeddings for Resume Screening
A practical look at improving resume-to-job-description matching by moving from TF-IDF keyword similarity to BERT-based semantic embeddings.
A resume screening system has a simple goal: given a job description and a collection of resumes, identify the candidates whose experience and skills are most relevant to the role.
At first glance, this sounds like a keyword-matching problem. If a job description contains terms such as Python, SQL, machine learning, and AWS, we can search for those same terms in a resume and calculate a similarity score.
That approach works as a baseline, but it has an important limitation: matching words is not the same as matching meaning.
For example, a job description might mention "natural language processing," while a resume describes experience with "NLP." A keyword-based system may treat these as different terms even though they represent the same skill.
For a resume screening project, I wanted to explore how semantic similarity could improve this process. I therefore started with a TF-IDF baseline and then introduced BERT-based embeddings using a Sentence Transformer model.
The TF-IDF Baseline
TF-IDF, or Term Frequency-Inverse Document Frequency, is a useful starting point for text similarity.
The basic idea is to represent documents as numerical vectors based on the words they contain. Words that are frequent in a particular document but less common across the overall collection receive more importance.
For resume screening, I can represent both the job description and a candidate's resume using TF-IDF vectors and then calculate cosine similarity between them.
The workflow looks roughly like this:
Resume → Text Extraction → TF-IDF Vector → Similarity Score
and:
Job Description → TF-IDF Vector → Compare with Resume
This approach is fast, interpretable, and easy to implement. It also provides a useful baseline against which more advanced approaches can be compared.
However, TF-IDF primarily focuses on lexical overlap. It does not deeply understand the semantic relationship between words and phrases.
Why Semantic Embeddings?
Consider these two examples:
- "Developed machine learning models using Python."
- "Built predictive models with Python for data-driven applications."
A purely keyword-oriented approach may not recognize the strength of the relationship between these sentences because several words are different.
Semantic embeddings approach the problem differently.
Instead of representing text primarily through individual words, a transformer-based model maps text into a numerical vector space where semantically similar pieces of text can have similar representations.
This makes it possible to compare the meaning of a resume and a job description rather than relying entirely on exact word overlap.
Using BERT-Based Sentence Embeddings
For my implementation, I used a Sentence Transformer model,
all-MiniLM-L6-v2 , to generate embeddings.The high-level pipeline became:
Resume → Text Extraction → Sentence Transformer → Embedding
Job Description → Sentence Transformer → Embedding
Embeddings → Cosine Similarity → Relevance Score
The model converts the input text into a fixed-size numerical representation. I can then calculate cosine similarity between the job-description embedding and resume embedding.
A simplified Python example looks like this:
from sentence_transformers import SentenceTransformerfrom sklearn.metrics.pairwise import cosine_similarity
model = SentenceTransformer("all-MiniLM-L6-v2")
resume_embedding = model.encode([resume_text])jd_embedding = model.encode([job_description])
score = cosine_similarity( resume_embedding, jd_embedding)[0][0]
print(f"Semantic similarity: {score:.3f}")The important part is not simply replacing one algorithm with another. The goal is to create a pipeline where the embedding model becomes one component of a broader screening system.
Combining Semantic Similarity with Skill Matching
Semantic similarity alone is not enough for recruitment.
A candidate could have generally similar experience to a job description while still missing an important required skill.
For that reason, my screening system separates different aspects of relevance.
The scoring pipeline considers factors such as:
- Skill matching
- Experience relevance
- Semantic similarity between the resume and job description
- Matched skills
- Missing skills
This produces a more useful candidate profile than relying on one similarity number.
For example, two candidates might have similar semantic scores, but one candidate may explicitly possess several required technologies that the other candidate does not.
This distinction is important because a screening tool should help a recruiter understand why a candidate received a particular score.
Building the End-to-End Pipeline
The overall system follows a layered workflow.
First, resumes are ingested from supported formats such as PDF and DOCX.
The text extraction layer converts those files into usable text.
The next layer processes the text and identifies useful information such as candidate details and skills.
The job description is processed in a similar way.
The scoring layer then combines the different signals, including semantic similarity from the BERT-based embedding model.
Finally, the results are presented through a Streamlit interface where recruiters can compare candidates, inspect matched and missing skills, and review the score breakdown.
This separation makes it easier to experiment with different models without rebuilding the entire application.
What I Learned
The biggest lesson from this project was that a strong NLP system does not necessarily require replacing every component with a more advanced model.
TF-IDF was valuable because it gave me a simple baseline and helped establish how a traditional similarity approach behaves.
BERT-based embeddings added semantic information that keyword-based matching could miss.
The more important engineering decision was therefore to treat the two approaches as stages of development rather than viewing the baseline as something that had to be discarded.
I also learned that model output needs to be explainable to the end user. A recruiter is more likely to trust a screening system when it can show matched skills, missing skills, and the reasoning behind a relevance score instead of presenting an unexplained number.
##Key Takeaways
Moving from TF-IDF to BERT-based semantic embeddings changed the way I approached resume screening.
TF-IDF remains a useful and efficient baseline, but transformer-based embeddings provide a stronger way to capture relationships in natural language.
For my project, the final goal was not simply to produce a higher similarity score. It was to build a screening workflow that combines semantic understanding with concrete recruitment signals such as skills and experience.
This project gave me a practical introduction to applying transformer embeddings to a real NLP problem and showed me how traditional machine-learning baselines and modern language models can work together in the same system.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article