Model Details

Model Description

HR onboarding document type classifier

  • Developed by: Orkun Gedik

Training Hyperparameters

  • learning_rate=2e-5,
  • num_train_epochs=3,
  • weight_decay=0.01,

Uses

from datasets import load_dataset
from transformers import ViTImageProcessor, ViTForImageClassification
import torch

# Convert the image to RGB
example = example["image"].convert('RGB')

model_name = "orkungedik/hr-onboaring-doc-classifier"
processor = ViTImageProcessor.from_pretrained(model_name)
model = ViTForImageClassification.from_pretrained(model_name)

inputs = processor(images=example, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
    logits = outputs.logits

predicted_class_idx = logits.argmax(-1).item()
label = model.config.id2label[predicted_class_idx]

print(f"Predicted class: {label}")

probs = torch.nn.functional.softmax(logits, dim=-1)
top5 = torch.topk(probs, 5)

for i in range(5):
    idx = top5.indices[0][i].item()
    prob = top5.values[0][i].item()
    print(f"{model.config.id2label[idx]}: {prob:.4f}")
Downloads last month
219
Safetensors
Model size
85.8M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for orkungedik/hr-onboaring-doc-classifier

Finetuned
(909)
this model