Downloads · 30 days
3
6% of all-time downloads
guvenyilmaz/resume-matcher-endpoint
resume-matcher-endpoint is a machine learning model from guvenyilmaz. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as mit.
This is a LoRA fine-tuned version of BAAI/bge-large-en-v1.5 for matching resumes with job descriptions.
Downloads · 30 days
3
6% of all-time downloads
All-time downloads
48
Public
Repo size
132 B
Likes
0
Public
Click a slice to open those files.
.py4.6 KB · 51%
From the Hugging Face model README
This is a LoRA fine-tuned version of BAAI/bge-large-en-v1.5 for matching resumes with job descriptions.
Here's how to use this model:
from transformers import AutoModel, AutoTokenizer
from peft import PeftModel
import torch
import torch.nn.functional as F
# Load models
base_model = AutoModel.from_pretrained("BAAI/bge-large-en-v1.5")
model = PeftModel.from_pretrained(base_model, "shashu2325/resume-job-matcher-lora")
tokenizer = AutoTokenizer.from_pretrained("BAAI/bge-large-en-v1.5")
# Example texts
resume_text = "Software engineer with Python experience"
job_text = "Looking for Python developer"
# Process texts
resume_inputs = tokenizer(resume_text, return_tensors="pt", max_length=512, padding="max_length", truncation=True)
job_inputs = tokenizer(job_text, return_tensors="pt", max_length=512, padding="max_length", truncation=True)
# Get embeddings
with torch.no_grad():
# Get embeddings using mean pooling
resume_outputs = model(**resume_inputs)
job_outputs = model(**job_inputs)
# Mean pooling
resume_emb = resume_outputs.last_hidden_state.mean(dim=1)
job_emb = job_outputs.last_hidden_state.mean(dim=1)
# Normalize and calculate similarity
resume_emb = F.normalize(resume_emb, p=2, dim=1)
job_emb = F.normalize(job_emb, p=2, dim=1)
similarity = torch.sum(resume_emb * job_emb, dim=1)
match_score = torch.sigmoid(similarity).item()
print(f"Match score: {match_score:.4f}")