Instructions to use kumarabd1996/agent-triage-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use kumarabd1996/agent-triage-classifier with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: convaiinnovations/laya
|
| 4 |
+
language: [en]
|
| 5 |
+
tags:
|
| 6 |
+
- laya
|
| 7 |
+
- decision-model
|
| 8 |
+
- text-classification
|
| 9 |
+
- agent-routing
|
| 10 |
+
- system-1
|
| 11 |
+
library_name: laya
|
| 12 |
+
pipeline_tag: text-classification
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# agent-triage-classifier
|
| 16 |
+
|
| 17 |
+
A fine-tuned [laya](https://huggingface.co/convaiinnovations/laya) checkpoint that decides **what a personal-assistant agent should do
|
| 18 |
+
with a request**, not what the request is about. It is the companion of
|
| 19 |
+
[agent-task-classifier](https://huggingface.co/kumarabd1996/agent-task-classifier), which says what *shape* of work a request is
|
| 20 |
+
(plan, research, diagnose, ...); this one says whether to answer, ask, start a long task, schedule it, or act on existing records.
|
| 21 |
+
|
| 22 |
+
Same interface as every laya checkpoint: text in, one typed `choice` decision out, one forward pass, no generation. English, ~0.2 s/query on CPU.
|
| 23 |
+
|
| 24 |
+
## The six decisions
|
| 25 |
+
|
| 26 |
+
| decision | meaning |
|
| 27 |
+
|---|---|
|
| 28 |
+
| `answer` | a question, remark, greeting, thanks or status check: reply directly, no task |
|
| 29 |
+
| `ask` | the request cannot be done without one detail only the person has (a destination, a recipient, an amount, a time) |
|
| 30 |
+
| `start_task` | work wanted now that is a long multi-step procedure: planning a gameweek, a trip or a party, setting up a goal, budget or routine, reviewing history. Also a scheduled job that has come due |
|
| 31 |
+
| `schedule` | something to record or do later: a reminder, task, event or watch, or any request naming a later time or a repeat |
|
| 32 |
+
| `act` | change something that already exists (move, rename, complete, delete) or a short procedure done inline (a lookup, a conversion) |
|
| 33 |
+
| `unsure` | none of the above fits clearly: hand over to a stronger model |
|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
import json
|
| 39 |
+
import laya
|
| 40 |
+
from huggingface_hub import hf_hub_download
|
| 41 |
+
|
| 42 |
+
agent = laya.load("kumarabd1996/agent-triage-classifier", device="cpu")
|
| 43 |
+
questions = json.load(open(hf_hub_download("kumarabd1996/agent-triage-classifier", "questions.json")))
|
| 44 |
+
out = agent.predict("remind me to call Sam at 5pm tomorrow", questions)["answers"]["decision"]
|
| 45 |
+
print(out["choice"], out["probabilities"]) # schedule, with the whole distribution
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
For a follow-up, pass `"Earlier request: <previous request>\nNew request: <this request>"`. The probabilities are calibrated enough to pick
|
| 49 |
+
a threshold; below it, treat the answer as `unsure`.
|
| 50 |
+
|
| 51 |
+
## Training data (874 train / 97 dev rows)
|
| 52 |
+
|
| 53 |
+
| source | rows | notes |
|
| 54 |
+
|---|---|---|
|
| 55 |
+
| synthetic | ~490 | hand-written templates over personal-assistant domains (sports-fantasy planning, goals, finance, health, trips, reminders and watches, tool questions), with voice-transcript style noise |
|
| 56 |
+
| [MASSIVE](https://huggingface.co/datasets/SetFit/amazon_massive_intent_en-US) en-US | 312 | intents mapped onto the six decisions (alarm/calendar/list creation -> `schedule`; device and playback control -> `act`; queries and Q&A -> `answer`); CC BY 4.0, FitzGerald et al. 2022 |
|
| 57 |
+
| hand-labelled real messages | 76 | one user's assistant sessions, labelled by hand; the messages are not published |
|
| 58 |
+
|
| 59 |
+
No public dataset matched `start_task` or `ask` as defined here, so those come from the synthetic and real rows only. Full fine-tune from the
|
| 60 |
+
English laya base, 6 epochs, effective batch 16.
|
| 61 |
+
|
| 62 |
+
## Results
|
| 63 |
+
|
| 64 |
+
- Own dev split (97 rows from the same sources): accuracy 0.887 (untrained base 0.196), ECE 0.063.
|
| 65 |
+
- 46 triage cases from the author's agent evaluation (23 dev + 23 held-out): **41/46**, 21/23 and 20/23. **Treat this as optimistic**: those cases
|
| 66 |
+
and the synthetic rows come from the same domain and the same author, and near-duplicates are likely. For comparison, LLM triage on the dev
|
| 67 |
+
half scored 68-75% in the same harness. Independent validation on fresh traffic is still to come (this model is first run in shadow mode).
|
| 68 |
+
|
| 69 |
+
## Limitations
|
| 70 |
+
|
| 71 |
+
- It sees only the message (and optionally the one before it). It does not see which skills matched, whether a task is already running, or
|
| 72 |
+
the date, all of which matter to the real decision.
|
| 73 |
+
- Weakest on a named later time attached to a long task ("in 2 min, plan my gameweek"): `start_task` and `schedule` can come out nearly tied.
|
| 74 |
+
Read the probabilities, not just the label.
|
| 75 |
+
- English only; skewed to the domains above; replies that only make sense with the assistant's previous message ("yes, go ahead") were left
|
| 76 |
+
out of training and are not reliable.
|
| 77 |
+
- A routing hint for an agent, not a safety or moderation classifier.
|