HR_TOOL_V2 / modules /comparison.py
deepsu's picture
update-fix/Fixed major issues of code, api, and models. Model were updated with proper formatiing, FastAPI code is simpler and cleaner, finally the api is optimized by removing pdf parsings
f9a6bac
Raw History Blame Contribute Delete
329 Bytes
import torch.nn.functional as F
class Comparison:
def __init__(self, model):
self.model = model
def encode(self, texts):
return self.model.encode(texts, convert_to_tensor=True, normalize_embeddings=True)
def compare(self, resume, jd):
return F.cosine_similarity(jd, resume, dim=-1).tolist()