Downloads · 30 days
0
Smutypi3/applai-confit
applai-confit is a feature extraction model from Smutypi3. Use it when you need embeddings to search or compare text. The card lists the license as mit.
A custom bidirectional cross-modal alignment model for bridging the embedding spaces of SBERT-encoded job descriptions and LayoutLMv3-encoded resumes in the AppAI recruitment matching pipeline.
Downloads · 30 days
0
Access
Public
Updated Feb 25, 2026
Repo size
23.6 MB
Likes
0
Public
Click a slice to open those files.
.pt23.6 MB · 100%
From the Hugging Face model README
A custom bidirectional cross-modal alignment model for bridging the embedding spaces of SBERT-encoded job descriptions and LayoutLMv3-encoded resumes in the AppAI recruitment matching pipeline.
ConFiT (Contrastive Fine-tuned Transformation) learns to project resume embeddings into JD space and JD embeddings into resume space, enabling direct cosine similarity comparison across the two modalities.
| Property | Value |
|---|---|
| Architecture | BidirectionalAlignmentModel (custom) |
| Base model | None — trained from scratch |
| Input dimension | 768 |
| Output dimension | 768 |
| Features | full, education, experience, leadership |
| Directions | to_jd (resume → JD space), to_resume (JD → resume space) |
BidirectionalAlignmentModel applies a learnable transformation to each embedding span independently:
Input embedding (768-dim)
→ LayerNorm (per feature)
→ Learned feature scale (abs + 0.1, ensures positive scale)
→ Shared transform (nn.Linear 768→768, bias=False, orthogonal init)
→ Per-feature transform (nn.Linear 768→768, bias=False, orthogonal init)
→ Learned blend: output = (1 - α) * shared + α * per_feature
→ 768-dim aligned embedding
Where α = sigmoid(feature_blend_weight) ∈ (0, 1) is learned independently per feature. Two independent sets of transforms are maintained — one for resume → JD, one for JD → resume.
Parameters per direction per feature:
feature_norm[feat] — LayerNorm(768)feature_scale[feat] — learned scalar (positive)transform_*_shared — shared Linear(768, 768), orthogonal inittransform_*[feat] — per-feature Linear(768, 768), orthogonal initfeature_blend_weights[feat] — learned scalar blend weightThis model is the third stage of the AppAI recruitment intelligence pipeline:
Smutypi3/applai-sbert — encodes JD text spans (SBERT)Smutypi3/applai-layoutlmv3 — encodes resume PDF spans (LayoutLMv3)After alignment, resume and JD embeddings can be directly compared with cosine similarity to produce a structured match score per feature.
pip install torch
from ai_models.services.confit_service import align_spans
# Resume embeddings (from LayoutLMv3) → project into JD space
resume_embeddings = {
"full": [...], # 768-dim list
"education": [...],
"experience": [...],
"leadership": [...],
}
aligned = align_spans(resume_embeddings, direction="to_jd")
# JD embeddings (from SBERT) → project into resume space
jd_embeddings = {"full": [...], "education": [...], ...}
aligned = align_spans(jd_embeddings, direction="to_resume")
import torch
import torch.nn.functional as F
for feature in ["full", "education", "experience", "leadership"]:
r = torch.tensor(resume_aligned[feature])
j = torch.tensor(jd_aligned[feature])
score = F.cosine_similarity(r.unsqueeze(0), j.unsqueeze(0)).item()
print(f"{feature}: {score:.4f}")
Contrastive loss over (resume span, JD span) pairs. Both alignment directions are jointly optimised so that projected resume embeddings are close to their matching JD embeddings in JD space, and vice versa.
The weights file supports two formats, both handled automatically at load time:
# Raw state dict
torch.load("confit_best_model_weights.pt")
# Checkpoint dict
{"model_state_dict": {...}, "epoch": ..., "loss": ...}
Smutypi3/applai-sbert and Smutypi3/applai-layoutlmv3 — using embeddings from other models is not supportedforward(); do not mix resume and JD embeddings in the same call@software{lucero2025applai_confit,
author = {Lucero, Jaime Emmanuel},
title = {{AppAI ConFiT}: Bidirectional Cross-Modal Embedding Alignment for Recruitment Matching},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/Smutypi3/applai-confit},
note = {Part of the AppAI recruitment intelligence pipeline}
}
MIT