Downloads · 30 days
136
11% of all-time downloads
yenstdi/ntu-bge-small-zh-simcse-job-talent-matching
ntu-bge-small-zh-simcse-job-talent-matching is a sentence similarity model from yenstdi. Use it when you need a score for how close two texts are. It is set up for transformers.
Fine-tuned BAAI/bge-small-zh-v1.5 using Supervised SimCSE for job-talent matching.
Downloads · 30 days
136
11% of all-time downloads
All-time downloads
1.2K
Public
Parameters
24M
95.8 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors95.8 MB · 99%
From the Hugging Face model README
Fine-tuned BAAI/bge-small-zh-v1.5 using Supervised SimCSE for job-talent matching.
from transformers import AutoTokenizer, AutoModel
import torch
tokenizer = AutoTokenizer.from_pretrained("yenstdi/ntu-bge-small-zh-simcse-job-talent-matching")
model = AutoModel.from_pretrained("yenstdi/ntu-bge-small-zh-simcse-job-talent-matching")
def encode(texts):
inputs = tokenizer(texts, padding=True, truncation=True, max_length=512, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
mask = inputs["attention_mask"].unsqueeze(-1)
embeddings = (outputs.last_hidden_state * mask).sum(1) / mask.sum(1).clamp(min=1e-6)
return torch.nn.functional.normalize(embeddings, dim=-1)
job_emb = encode(["Software Engineer - Python, ML experience required"])
talent_emb = encode(["5 years Python developer with ML projects"])
score = (job_emb @ talent_emb.T).item()
print(f"Cosine similarity: {score:.4f}")
National Taiwan University (NTU)