Downloads · 30 days
6
3% of all-time downloads
mathurvarun84/supply-chain-distilbert-risk
supply-chain-distilbert-risk is a text classification model from mathurvarun84. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
Fine-tuned distilbert-base-uncased for 4-class electronics supply chain risk: LOW | MEDIUM | HIGH | CRITICAL
Downloads · 30 days
6
3% of all-time downloads
All-time downloads
214
Public
Parameters
67M
4 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.7 GB · 62%
From the Hugging Face model README
Fine-tuned distilbert-base-uncased for 4-class electronics supply chain risk:
LOW | MEDIUM | HIGH | CRITICAL
Trained on lite_master rows from the supply-chain-disrupter project.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
model_id = "mathurvarun84/supply-chain-distilbert-risk"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
text = "Region: Eastern Asia. Product: DRAM. Delivery: Late delivery. ..."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
pred = model(**inputs).logits.argmax(-1).item()
labels = ["LOW", "MEDIUM", "HIGH", "CRITICAL"]
print(labels[pred])
Set in .env:
DISTILBERT_MODEL_ID=mathurvarun84/supply-chain-distilbert-risk