Downloads · 30 days
22
4% of all-time downloads
0xnbk/nbk-ats-domain-v1-en
nbk-ats-domain-v1-en is a sentence similarity model from 0xnbk. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
nbk-ats-domain-v1-en is a specialized sentence transformer fine-tuned using contrastive learning (Triplet Loss) for professional domain classification. This model excels at distinguishing between different professiona…
Downloads · 30 days
22
4% of all-time downloads
All-time downloads
626
Public
Parameters
32.7M
274 MB on disk
Likes
2
Public
Click a slice to open those files.
.onnx143 MB · 52%
From the Hugging Face model README
nbk-ats-domain-v1-en is a specialized sentence transformer fine-tuned using contrastive learning (Triplet Loss) for professional domain classification. This model excels at distinguishing between different professional domains in resumes and job descriptions, solving the critical "cross-domain score inflation" problem in ATS (Applicant Tracking System) applications.
Same-Domain Performance:
Cross-Domain Discrimination:
Nuanced Understanding:
Training Configuration:
Dataset Quality:
pip install sentence-transformers
from sentence_transformers import SentenceTransformer
import numpy as np
# Load domain-specialized model
model = SentenceTransformer('0xnbk/nbk-ats-domain-v1-en')
# Example: Resume-Job domain matching
resume_tech = """
Senior Software Engineer with 8 years of experience in Python, Django, and React.
Led development of microservices architecture serving 10M+ users. Expert in AWS,
Docker, Kubernetes, and CI/CD pipelines. Strong background in agile methodologies
and cross-functional team leadership.
"""
job_tech = """
We're seeking a Senior Backend Engineer with 5+ years Python experience.
Must have expertise in Django, microservices, and cloud platforms (AWS/GCP).
Experience with containerization (Docker/Kubernetes) and modern DevOps practices required.
"""
job_healthcare = """
Registered Nurse position in ICU requiring 3+ years critical care experience.
Must have current RN license, ACLS certification, and experience with electronic
medical records. Knowledge of patient monitoring systems and ventilator management essential.
"""
# Generate embeddings
resume_emb = model.encode(resume_tech)
tech_job_emb = model.encode(job_tech)
healthcare_job_emb = model.encode(job_healthcare)
# Calculate cosine similarity
same_domain_similarity = np.dot(resume_emb, tech_job_emb) / (
np.linalg.norm(resume_emb) * np.linalg.norm(tech_job_emb)
)
cross_domain_similarity = np.dot(resume_emb, healthcare_job_emb) / (
np.linalg.norm(resume_emb) * np.linalg.norm(healthcare_job_emb)
)
print(f"Same Domain (Tech → Tech): {same_domain_similarity:.3f}") # Expected: >0.90
print(f"Cross Domain (Tech → Healthcare): {cross_domain_similarity:.3f}") # Expected: <0.30 or negative
# Domain matching logic
def is_same_domain(similarity, threshold=0.5):
return similarity > threshold
print(f"\nDomain Match: {is_same_domain(same_domain_similarity)}") # True
print(f"Domain Match: {is_same_domain(cross_domain_similarity)}") # False
from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity
model = SentenceTransformer('0xnbk/nbk-ats-domain-v1-en')
# Multiple resumes from different domains
resumes = [
"... technology resume ...",
"... healthcare resume ...",
"... finance resume ..."
]
# Single job description
job = "... technology job description ..."
# Batch encode
resume_embeddings = model.encode(resumes, batch_size=8, show_progress_bar=True)
job_embedding = model.encode(job)
# Calculate similarities
similarities = cosine_similarity([job_embedding], resume_embeddings)[0]
# Rank by domain compatibility
for idx, score in sorted(enumerate(similarities), key=lambda x: x[1], reverse=True):
domain_match = "✅ SAME DOMAIN" if score > 0.5 else "❌ DIFFERENT DOMAIN"
print(f"Resume {idx+1}: {score:.3f} {domain_match}")
from sentence_transformers import SentenceTransformer
import numpy as np
# Load both models
semantic_model = SentenceTransformer('0xnbk/nbk-ats-semantic-v1-en')
domain_model = SentenceTransformer('0xnbk/nbk-ats-domain-v1-en')
def calculate_ats_score(resume_text, job_text):
# Semantic similarity (content quality)
resume_sem = semantic_model.encode(resume_text)
job_sem = semantic_model.encode(job_text)
semantic_similarity = np.dot(resume_sem, job_sem) / (
np.linalg.norm(resume_sem) * np.linalg.norm(job_sem)
)
# Domain compatibility (field alignment)
resume_dom = domain_model.encode(resume_text)
job_dom = domain_model.encode(job_text)
domain_similarity = np.dot(resume_dom, job_dom) / (
np.linalg.norm(resume_dom) * np.linalg.norm(job_dom)
)
# Hybrid scoring
base_score = semantic_similarity * 100
# Apply domain bonus/penalty
if domain_similarity > 0.5:
# Same domain: boost score
final_score = base_score * 1.2
else:
# Different domain: penalize
final_score = base_score * 0.6
return {
'final_score': np.clip(final_score, 0, 100),
'semantic_score': base_score,
'domain_similarity': domain_similarity,
'same_domain': domain_similarity > 0.5
}
# Example usage
result = calculate_ats_score(resume_text, job_text)
print(f"Final ATS Score: {result['final_score']:.1f}%")
print(f"Semantic Score: {result['semantic_score']:.1f}%")
print(f"Domain Similarity: {result['domain_similarity']:.3f}")
print(f"Same Domain: {result['same_domain']}")
Hardware:
Hyperparameters:
TripletLoss Configuration:
Traditional binary classifiers (cross-encoder) were hitting a performance ceiling. Contrastive learning with TripletLoss:
Results:
The model demonstrates exceptional performance across 13 professional domains:
| Domain | Recognition | Cross-Domain Separation |
|---|---|---|
| Technology | ✅ >0.90 | ✅ Strong boundaries |
| Healthcare | ✅ >0.90 | ✅ Excellent isolation |
| Finance | ✅ >0.90 | ✅ Very strong separation |
| Education | ✅ >0.90 | ✅ Clear boundaries |
| Legal | ✅ >0.90 | ✅ Strong separation |
| Sales/Marketing | ✅ >0.90 | ✅ Realistic overlap handled |
| Human Resources | ✅ >0.90 | ✅ Good separation |
| Manufacturing/Operations | ✅ >0.90 | ✅ Clear distinction |
| Design | ✅ >0.90 | ✅ Nuanced UX/UI overlap |
| Retail/Hospitality | ✅ >0.90 | ✅ Service industry distinction |
| Construction/Real Estate | ✅ >0.90 | ✅ Strong boundaries |
| Government/Nonprofit | ✅ >0.90 | ✅ Public sector clarity |
| Media/Entertainment | ✅ >0.90 | ✅ Creative field separation |
@model{nbk_ats_domain_v1,
author = {NBK},
title = {NBK ATS Domain Classifier v1 (English)},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/0xnbk/nbk-ats-domain-v1-en}
}
@dataset{resume_domain_triplets_v1,
author = {NBK},
title = {Resume-Domain Triplets Dataset v1 (English)},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/0xnbk/resume-domain-triplets-train-v1-en}
}
@model{nbk_ats_semantic_v1,
author = {NBK},
title = {NBK ATS Semantic Model v1 (English)},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/0xnbk/nbk-ats-semantic-v1-en}
}
This model is released under the Apache 2.0 License.
Copyright 2025 NBK (nbk.dev)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For questions, suggestions, or collaboration opportunities: