Instructions to use kumarabd1996/agent-task-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use kumarabd1996/agent-task-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
card: correct corpus count (5,280) + dataset link
Browse files
README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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-task-classifier
|
| 16 |
+
|
| 17 |
+
*(laya loop-taxonomy v1)*
|
| 18 |
+
|
| 19 |
+
A fine-tuned [laya](https://huggingface.co/convaiinnovations/laya) checkpoint that classifies a
|
| 20 |
+
user request to a personal-assistant agent by **the agent-loop shape it demands** — the skeleton
|
| 21 |
+
of the high-level process required to fulfil it — rather than by topic.
|
| 22 |
+
|
| 23 |
+
Same interface as every laya checkpoint: text in, one typed `choice` decision out, one forward
|
| 24 |
+
pass, no generation. English, ~0.3 s/query on CPU.
|
| 25 |
+
|
| 26 |
+
## The eleven labels
|
| 27 |
+
|
| 28 |
+
| label | the loop it demands |
|
| 29 |
+
|---|---|
|
| 30 |
+
| `conversation` | answer/act directly — the default, safe fallback |
|
| 31 |
+
| `diagnose` | find the cause of a specific malfunction or anomaly |
|
| 32 |
+
| `research` | assemble understanding from investigation (multi-source, synthesis) |
|
| 33 |
+
| `arrange` | commit a real-world arrangement — book, reserve, schedule, hire |
|
| 34 |
+
| `acquire` | obtain a purchasable good, and verify it arrived |
|
| 35 |
+
| `execute` | complete a known, externally-defined procedure (renew, file, claim) |
|
| 36 |
+
| `make` | produce an artifact judged against a standard (tests, spec, taste) |
|
| 37 |
+
| `tend` | review/maintain a standing concern (budget, health, home, wardrobe) |
|
| 38 |
+
| `learn` | build the user's own ability over sessions (practice, tutoring) |
|
| 39 |
+
| `companion` | inner-life support with no outcome in the world (reflection, therapy) |
|
| 40 |
+
| `react` | urgent/deteriorating situation — act before full understanding |
|
| 41 |
+
|
| 42 |
+
Boundary rule: two requests share a label iff they demand the same loop skeleton — same phases,
|
| 43 |
+
same iteration driver, same exit criterion. Topic is irrelevant (`conversation` spans finance,
|
| 44 |
+
wardrobe, memories; `make` spans code, letters, meal plans).
|
| 45 |
+
|
| 46 |
+
## Usage
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
import laya
|
| 50 |
+
|
| 51 |
+
agent = laya.load("kumarabd1996/agent-task-classifier", device="cpu")
|
| 52 |
+
questions = {
|
| 53 |
+
"loop": {
|
| 54 |
+
"type": "choice",
|
| 55 |
+
"instructions": "What does this request (or the request it continues) demand?",
|
| 56 |
+
"criteria": { ... }, # shipped as questions.json in this repo
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
out = agent.predict("the user's message", questions)
|
| 60 |
+
out["answers"]["loop"]["choice"] # e.g. "arrange"
|
| 61 |
+
out["answers"]["loop"]["probabilities"] # calibrated (temperatures fitted at train time)
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
Continuations: pass the request being continued in the state, the format the model was trained on:
|
| 65 |
+
|
| 66 |
+
```
|
| 67 |
+
Earlier request: What are my biggest categories?
|
| 68 |
+
New request: Continue the bulk update
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Training
|
| 72 |
+
|
| 73 |
+
- **Base**: `convaiinnovations/laya` (English checkpoint; ModernBERT-large + decision head), Apache-2.0.
|
| 74 |
+
- **Corpus**: 5,280 items, 8 sources — MultiWOZ 2.1 booking utterances (~990, arrange), MASSIVE
|
| 75 |
+
en-US slices (~920, acquire/arrange/conversation), OASST2 prompts + continuations (~1,060,
|
| 76 |
+
teacher-labeled), synthetic items (~2,315) covering all eleven shapes (labels by construction,
|
| 77 |
+
incl. 34 hand-written boundary cases), and 1,056 continuation-form items
|
| 78 |
+
(`Earlier request: … / New request: …`). Per-class caps keep the largest class ≤ ~28%.
|
| 79 |
+
Released as a dataset: `kumarabd1996/agent-task-classifier-dataset`.
|
| 80 |
+
- **Hyperparameters**: 4 epochs, effective batch 64 (micro 4 × accum 16), encoder lr 2.5e-5 /
|
| 81 |
+
head lr 1e-4, RLCD objective (default), option-order augmentation, max-len 256.
|
| 82 |
+
- **Hardware**: one Mac, CPU only (~2 hours). A frozen-encoder variant failed to learn the
|
| 83 |
+
taxonomy (37% in-distribution); encoder adaptation is required — matching laya's own findings.
|
| 84 |
+
- Temperatures fitted automatically on a held-out calibration slice (choice temperature ≈ 3.82).
|
| 85 |
+
|
| 86 |
+
## Evaluation
|
| 87 |
+
|
| 88 |
+
Boundary drills: 24 held-out hand-written cases targeting the taxonomy's hard boundaries
|
| 89 |
+
(info-vs-procedure, understanding-vs-commitment, urgency-vs-worry, artifact-vs-investigation).
|
| 90 |
+
|
| 91 |
+
| | accuracy | ECE | mean confidence |
|
| 92 |
+
|---|---|---|---|
|
| 93 |
+
| base `convaiinnovations/laya` (zero-shot) | 0.29 (7/24) | 0.54 | 0.83 (miscalibrated) |
|
| 94 |
+
| **this checkpoint** | **0.83 (20/24)** | **0.13** | 0.96 |
|
| 95 |
+
|
| 96 |
+
The 4 remaining misses, all at genuine boundaries: "Is Bali worth visiting in December?"
|
| 97 |
+
(research, predicted arrange), "What does renewing a passport require?" (conversation,
|
| 98 |
+
predicted execute), "Why have I been so tired lately?" (diagnose, predicted conversation),
|
| 99 |
+
"Sign me up for the best EV lease deal you find." (arrange, predicted conversation).
|
| 100 |
+
|
| 101 |
+
## Limitations
|
| 102 |
+
|
| 103 |
+
- Trained largely on synthetic + public chat corpora; real user traffic is under-represented.
|
| 104 |
+
- English only (the base multilingual checkpoint was not used).
|
| 105 |
+
- The eleven labels are fixed; requests outside them resolve to `conversation` by design.
|
| 106 |
+
- Continuations require the caller to supply the continued request in the state.
|
| 107 |
+
- Not a safety classifier — do not use for guardrails or moderation.
|
| 108 |
+
|
| 109 |
+
## Training data provenance
|
| 110 |
+
|
| 111 |
+
MultiWOZ 2.1 (research use, MIT-licensed distribution) · MASSIVE en-US (CC-BY-4.0, Amazon) ·
|
| 112 |
+
OASST2 (Apache-2.0, OpenAssistant) · synthetic/generated items (Apache-2.0 with this release).
|
| 113 |
+
No user/private data was used in training.
|
| 114 |
+
|
| 115 |
+
## Files
|
| 116 |
+
|
| 117 |
+
`model.safetensors` (weights, incl. encoder) · `encoder/config.json` · `tokenizer/` ·
|
| 118 |
+
`questions.json` (the taxonomy question, ready to pass to `predict`) ·
|
| 119 |
+
`rl_agent_config.json` (fitted temperatures, training config) · `train_report.json`
|
| 120 |
+
(before/after metrics).
|