Views
No views yet
HIGH, MEDIUM, or LOW — based on the urgency and nature of the text.
It supports both Nepali and English inputs and uses a hybrid ML + rule-based approach to ensure robustness, especially on small datasets.| Component | Description |
|---|---|
| Embedder | sentence-transformers/all-MiniLM-L6-v2 |
| Classifier | Logistic Regression (multiclass, balanced weights) |
| Rule-based Layer | Keyword-based fallback for urgency terms in Nepali and English |
| Features | SBERT embeddings + priority keyword preservation |
| Hybrid Inference | Combines ML prediction confidence with rules for safer decisions |
| Metric | Value |
|---|---|
| Total raw samples | 266 |
| After preprocessing & augmentation | 594 |
| Train/Test Split | 445 / 149 |
| Embedding Dimension | 384 |
| Classes | HIGH, MEDIUM, LOW |
| Test Accuracy | 72.5% |
| Macro F1-score | 0.72 |
| Label | Count |
|---|---|
| HIGH | 203 |
| MEDIUM | 29 |
| LOW | 34 |
| Label | Count |
|---|---|
| HIGH | 200 |
| MEDIUM | 194 |
| LOW | 200 |
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| HIGH | 0.73 | 0.66 | 0.69 | 50 |
| MEDIUM | 0.74 | 0.80 | 0.76 | 49 |
| LOW | 0.71 | 0.72 | 0.71 | 50 |
| Overall Accuracy | 0.725 | 149 |
1from huggingface_hub import hf_hub_download
2import joblib
3from priority_det import Embedder, predict_priority
4
5# Download the model
6model_path = hf_hub_download(repo_id="your-username/priority-classifier", filename="classifier.joblib")
7
8# Load the classifier
9bundle = joblib.load(model_path)
10clf = bundle["clf"]
11label_map = bundle["label_map"]
12
13# Initialize the embedder
14embedder = Embedder()
15
16# Predict
17text = "पानी आपूर्ति बन्द छ। तत्काल समाधान चाहिन्छ।"
18result = predict_priority(text, embedder, clf, label_map, use_hybrid=True)
19print(result)