Views
No views yet
1import torch
2from transformers import AutoModel, AutoTokenizer
3
4# Download the inference script
5# wget https://huggingface.co/commure-smislam/email-classification-simple/resolve/main/inference.py
6
7from inference import EmailClassifierInference
8
9# Load model
10classifier = EmailClassifierInference("./")
11
12# Predict
13result = classifier.predict("Patient appointment confirmation for tomorrow")
14print(result)1{
2 "text": "Patient appointment confirmation for tomorrow",
3 "category": {"label": "appointments", "confidence": 0.95},
4 "subcategory": {"label": "appointments.confirmation", "confidence": 0.92}
5}backbone/: Base transformer modeltokenizer/: Tokenizer filesclassification_heads.pt: Classification layer weightsinference.py: Inference script