Downloads · 30 days
17
20% of all-time downloads
vtt-qsts-ai/multilabel-indicator-classification-roberta-base
multilabel-indicator-classification-roberta-base is a machine learning model from vtt-qsts-ai. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model fine-tunes roberta-base for multilabel classification of policies, targets, and themes.
Downloads · 30 days
17
20% of all-time downloads
All-time downloads
83
Public
Parameters
125M
499 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
This model fine-tunes roberta-base for multilabel classification of policies, targets, and themes.
Classify policy documents descriptions into thematic categories.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import numpy as np
import joblib
import requests
model_path = "vtt-qsts-ai/multilabel-indicator-classification-roberta-base"
model = AutoModelForSequenceClassification.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
mlb_url = "https://huggingface.co/vtt-qsts-ai/multilabel-indicator-classification-roberta-base/resolve/main/mlb.pkl"
mlb_path = "mlb.pkl"
with open(mlb_path, "wb") as f:
f.write(requests.get(mlb_url).content)
mlb = joblib.load(mlb_path)
text = "This program supports clean technology and sustainable development in industries."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
model.eval()
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.sigmoid(logits).squeeze().numpy()
# Threshold
binary_preds = (probs > 0.25).astype(int)
predicted_labels = [label for i, label in enumerate(mlb.classes_) if binary_preds[i] == 1]
print("Predicted Labels:", predicted_labels)
# Predicted Labels: ['PI007', 'PI008', 'TG20', 'TG21', 'TG22', 'TG25', 'TG29', 'TG31', 'TH31']