BERT 7-Class Universal Page Classifier

Fine-tuned BERT model for classifying insurance document pages (Universal / Kinetic / RG / Wrap 7-class model).

Used for document-type signals when OpenAI classification is unavailable (e.g. Kinetic fallback) and for page routing in RG/Wrap pipelines.

Labels

ID Label
0 acord
1 contract
2 declaration
3 endorsements
4 forms
5 others
6 rating

Usage (RunPod / Foundry / any HF runtime)

import os
import torch
from transformers import AutoTokenizer, AutoModel

repo = "injala/bert-universal-classifier-7class"
token = os.environ.get("HF_TOKEN")

tokenizer = AutoTokenizer.from_pretrained(repo, token=token)
model = AutoModel.from_pretrained(repo, token=token, trust_remote_code=True)
model.eval()

text = "ACORD 25 CERTIFICATE OF LIABILITY INSURANCE ..."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
    logits = model(**inputs)["logits"]
    probs = torch.softmax(logits, dim=-1)
    pred_id = probs.argmax(dim=-1).item()
    label = model.config.id2label[str(pred_id)]

Note: Input should be full OCR page text (up to 512 tokens), not short snippets. Production uses ReLU on classifier logits (matches legacy BERT_Model inference).

Source

Exported from injala/rg_berts_21classes_7classes/best_model.pt.

Downloads last month
19
Safetensors
Model size
0.1B params
Tensor type
I64
·
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support