Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# Email Classification Model (Simple Version)
|
| 3 |
+
|
| 4 |
+
A dual-head transformer model for classifying healthcare emails into categories and subcategories.
|
| 5 |
+
|
| 6 |
+
## Model Details
|
| 7 |
+
- **Base Model**: distilbert-base-uncased
|
| 8 |
+
- **Categories**: 6
|
| 9 |
+
- **Subcategories**: 14
|
| 10 |
+
|
| 11 |
+
## Categories
|
| 12 |
+
appointments, denials, eligibility, other, patient_balance, submission
|
| 13 |
+
|
| 14 |
+
## Usage
|
| 15 |
+
|
| 16 |
+
```python
|
| 17 |
+
import torch
|
| 18 |
+
from transformers import AutoModel, AutoTokenizer
|
| 19 |
+
|
| 20 |
+
# Download the inference script
|
| 21 |
+
# wget https://huggingface.co/commure-smislam/email-classification-simple/resolve/main/inference.py
|
| 22 |
+
|
| 23 |
+
from inference import EmailClassifierInference
|
| 24 |
+
|
| 25 |
+
# Load model
|
| 26 |
+
classifier = EmailClassifierInference("./")
|
| 27 |
+
|
| 28 |
+
# Predict
|
| 29 |
+
result = classifier.predict("Patient appointment confirmation for tomorrow")
|
| 30 |
+
print(result)
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
## Expected Output
|
| 34 |
+
```json
|
| 35 |
+
{
|
| 36 |
+
"text": "Patient appointment confirmation for tomorrow",
|
| 37 |
+
"category": {"label": "appointments", "confidence": 0.95},
|
| 38 |
+
"subcategory": {"label": "appointments.confirmation", "confidence": 0.92}
|
| 39 |
+
}
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Files
|
| 43 |
+
- `backbone/`: Base transformer model
|
| 44 |
+
- `tokenizer/`: Tokenizer files
|
| 45 |
+
- `classification_heads.pt`: Classification layer weights
|
| 46 |
+
- `inference.py`: Inference script
|