Text Classification
Scikit-learn
Joblib
ai-systems
agents
agent-tasks
routing
automation
tool-use
multi-agent
Instructions to use ai-systems/agent-task-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use ai-systems/agent-task-classifier with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("ai-systems/agent-task-classifier", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Upload 6 files
Browse files- README.md +146 -0
- agent-task-classifier.joblib +3 -0
- classifier_config.json +24 -0
- example_usage.py +14 -0
- labels.json +15 -0
- requirements.txt +2 -0
README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: sklearn
|
| 4 |
+
pipeline_tag: text-classification
|
| 5 |
+
tags:
|
| 6 |
+
- ai-systems
|
| 7 |
+
- agents
|
| 8 |
+
- agent-tasks
|
| 9 |
+
- routing
|
| 10 |
+
- automation
|
| 11 |
+
- tool-use
|
| 12 |
+
- multi-agent
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Agent Task Classifier
|
| 16 |
+
|
| 17 |
+
**Agent Task Classifier** is a lightweight reference model that maps short agent-task descriptions to practical operational categories.
|
| 18 |
+
|
| 19 |
+
It is published under the **ai-systems** handle as a transparent example for agent routing, task decomposition, and AI-system prototyping.
|
| 20 |
+
|
| 21 |
+
## Task Labels
|
| 22 |
+
|
| 23 |
+
- `browser`
|
| 24 |
+
- `coding`
|
| 25 |
+
- `communication`
|
| 26 |
+
- `control`
|
| 27 |
+
- `data-analysis`
|
| 28 |
+
- `memory`
|
| 29 |
+
- `multi-agent`
|
| 30 |
+
- `planning`
|
| 31 |
+
- `research`
|
| 32 |
+
- `retrieval`
|
| 33 |
+
- `tool-use`
|
| 34 |
+
- `verification`
|
| 35 |
+
- `workflow-automation`
|
| 36 |
+
|
| 37 |
+
## Examples
|
| 38 |
+
|
| 39 |
+
Input:
|
| 40 |
+
|
| 41 |
+
```text
|
| 42 |
+
Search the web for recent papers and summarize the findings.
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
Expected category:
|
| 46 |
+
|
| 47 |
+
```text
|
| 48 |
+
research
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
Input:
|
| 52 |
+
|
| 53 |
+
```text
|
| 54 |
+
Fix a bug in a Python project and run the tests.
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
Expected category:
|
| 58 |
+
|
| 59 |
+
```text
|
| 60 |
+
coding
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
Input:
|
| 64 |
+
|
| 65 |
+
```text
|
| 66 |
+
Require human approval before sending the final message.
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Expected category:
|
| 70 |
+
|
| 71 |
+
```text
|
| 72 |
+
control
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
## Usage
|
| 76 |
+
|
| 77 |
+
```python
|
| 78 |
+
from joblib import load
|
| 79 |
+
|
| 80 |
+
classifier = load("agent-task-classifier.joblib")
|
| 81 |
+
|
| 82 |
+
text = "Delegate subtasks to specialized agents and merge their results"
|
| 83 |
+
prediction = classifier.predict([text])[0]
|
| 84 |
+
|
| 85 |
+
print(prediction)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## Model Architecture
|
| 89 |
+
|
| 90 |
+
The model uses:
|
| 91 |
+
|
| 92 |
+
- TF-IDF text features
|
| 93 |
+
- unigram and bigram features
|
| 94 |
+
- logistic regression classification
|
| 95 |
+
|
| 96 |
+
It is intentionally small and easy to inspect.
|
| 97 |
+
|
| 98 |
+
## Training Data
|
| 99 |
+
|
| 100 |
+
The reference model was trained on a small curated set of agent-task descriptions covering:
|
| 101 |
+
|
| 102 |
+
- research
|
| 103 |
+
- coding
|
| 104 |
+
- browser interaction
|
| 105 |
+
- data analysis
|
| 106 |
+
- retrieval
|
| 107 |
+
- communication
|
| 108 |
+
- workflow automation
|
| 109 |
+
- planning
|
| 110 |
+
- verification
|
| 111 |
+
- memory
|
| 112 |
+
- tool use
|
| 113 |
+
- multi-agent coordination
|
| 114 |
+
- control and approval
|
| 115 |
+
|
| 116 |
+
## Intended Use
|
| 117 |
+
|
| 118 |
+
Suitable for:
|
| 119 |
+
|
| 120 |
+
- agent-routing demos
|
| 121 |
+
- task taxonomies
|
| 122 |
+
- educational examples
|
| 123 |
+
- workflow prototypes
|
| 124 |
+
- lightweight agent orchestration experiments
|
| 125 |
+
- AI-system documentation
|
| 126 |
+
|
| 127 |
+
## Limitations
|
| 128 |
+
|
| 129 |
+
This is a **reference model**, not a production-grade task router.
|
| 130 |
+
|
| 131 |
+
The training set is intentionally small, so ambiguous or out-of-domain requests may be misclassified.
|
| 132 |
+
|
| 133 |
+
It should not be used to make medical, legal, financial, safety-critical, or other high-impact decisions.
|
| 134 |
+
|
| 135 |
+
## Related Dataset
|
| 136 |
+
|
| 137 |
+
`ai-systems/ai-system-patterns`
|
| 138 |
+
|
| 139 |
+
## Related Models
|
| 140 |
+
|
| 141 |
+
- `ai-systems/system-router`
|
| 142 |
+
- `ai-systems/capability-classifier`
|
| 143 |
+
|
| 144 |
+
## License
|
| 145 |
+
|
| 146 |
+
Apache-2.0
|
agent-task-classifier.joblib
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f828a16fb66e6664185605511ead68765ad988ea231333c1214d4a8f56d91583
|
| 3 |
+
size 90164
|
classifier_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "sklearn-text-classifier",
|
| 3 |
+
"name": "agent-task-classifier",
|
| 4 |
+
"owner": "ai-systems",
|
| 5 |
+
"task": "text-classification",
|
| 6 |
+
"labels": [
|
| 7 |
+
"browser",
|
| 8 |
+
"coding",
|
| 9 |
+
"communication",
|
| 10 |
+
"control",
|
| 11 |
+
"data-analysis",
|
| 12 |
+
"memory",
|
| 13 |
+
"multi-agent",
|
| 14 |
+
"planning",
|
| 15 |
+
"research",
|
| 16 |
+
"retrieval",
|
| 17 |
+
"tool-use",
|
| 18 |
+
"verification",
|
| 19 |
+
"workflow-automation"
|
| 20 |
+
],
|
| 21 |
+
"training_examples": 65,
|
| 22 |
+
"intended_use": "Classify short agent task descriptions into operational task categories.",
|
| 23 |
+
"limitations": "Small curated reference model; not intended for production-critical routing."
|
| 24 |
+
}
|
example_usage.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from joblib import load
|
| 2 |
+
|
| 3 |
+
classifier = load("agent-task-classifier.joblib")
|
| 4 |
+
|
| 5 |
+
examples = [
|
| 6 |
+
"Search the web for relevant sources and summarize them",
|
| 7 |
+
"Fix a failing test in a Python repository",
|
| 8 |
+
"Require human approval before sending the message"
|
| 9 |
+
]
|
| 10 |
+
|
| 11 |
+
for text in examples:
|
| 12 |
+
label = classifier.predict([text])[0]
|
| 13 |
+
confidence = classifier.predict_proba([text])[0].max()
|
| 14 |
+
print(f"{text}\n -> {label} ({confidence:.2f})")
|
labels.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
"browser",
|
| 3 |
+
"coding",
|
| 4 |
+
"communication",
|
| 5 |
+
"control",
|
| 6 |
+
"data-analysis",
|
| 7 |
+
"memory",
|
| 8 |
+
"multi-agent",
|
| 9 |
+
"planning",
|
| 10 |
+
"research",
|
| 11 |
+
"retrieval",
|
| 12 |
+
"tool-use",
|
| 13 |
+
"verification",
|
| 14 |
+
"workflow-automation"
|
| 15 |
+
]
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
scikit-learn>=1.4
|
| 2 |
+
joblib>=1.3
|