Multi-Task Product and Hazard Classifier This model performs multi-task classification to predict both product categories and hazard categories from text descriptions. It's based on DeBERTa-v3 architecture and trained to identify product types and potential hazards simultaneously. Model Description
Model Type: Multi-task classification (DeBERTa-v3 large) Languages: English Pipeline Tag: text-classification Max Sequence Length: 1024 tokens
Usage pythonCopyfrom transformers import AutoTokenizer, AutoModel import torch from torch.nn import functional as F
Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("your-username/model-name") model = AutoModel.from_pretrained("your-username/model-name")
Prepare your text
text = "Your product description here"
Tokenize and prepare input
inputs = tokenizer( text, padding=True, truncation=True, max_length=1024, return_tensors="pt", return_token_type_ids=False )
Run inference
with torch.no_grad(): outputs = model(**inputs) product_logits = outputs['product_logits'] hazard_logits = outputs['hazard_logits']
product_probs = F.softmax(product_logits, dim=-1)
hazard_probs = F.softmax(hazard_logits, dim=-1)
Get predictions
product_predictions = product_probs.cpu().numpy() hazard_predictions = hazard_probs.cpu().numpy() Prediction Labels Product Categories pythonCopyproduct_labels = { '0': 'label_0', '1': 'label_1', # Add your product category labels here } Hazard Categories pythonCopyhazard_labels = { '0': 'label_0', '1': 'label_1', # Add your hazard category labels here } Model Limitations
The model is designed for English text only Maximum input length is 1024 tokens Performance may vary for texts significantly different from the training data
Training Data The model was trained on a dataset containing product descriptions with their corresponding product categories and hazard classifications. The training data includes various product types and potential hazards commonly found in consumer products. Evaluation Results [Add your model's evaluation metrics here] Intended Uses & Limitations Intended Uses:
Product categorization Hazard identification in product descriptions Safety analysis of product text
Limitations:
Should not be used as the sole decision maker for safety-critical applications Requires human verification for important safety decisions May not recognize new or unusual product types/hazards
Citation [Add citation information if applicable] Contact [Your contact information or where to report issues]
- Downloads last month
- 5
Model tree for Quintu/deberta-multitask-v0
Base model
microsoft/deberta-v3-large