Views
No views yet
report_to=["wandb"])1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3# Load tokenizer and model from Hugging Face Hub
4tokenizer = AutoTokenizer.from_pretrained("lengocquangLAB/phobert-large-job-title-match")
5model = AutoModelForSequenceClassification.from_pretrained("lengocquangLAB/phobert-large-job-title-match")
6
7# Example input: Job title vs Job title
8inputs = tokenizer("AI Engineer", "Machine Learning Engineer", return_tensors="pt")
9outputs = model(**inputs)
10
11# Prediction: 0 = no match, 1 = match
12pred = outputs.logits.argmax(dim=-1)
13print(pred)