Upload Chayan 4-model calibrated router (69.05% accuracy)
Browse files- README.md +85 -0
- config.json +55 -0
- examples.json +0 -0
- model.safetensors +3 -0
- onnx/config.json +24 -0
- onnx/model.onnx +3 -0
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: multilingual
|
| 3 |
+
tags:
|
| 4 |
+
- adaptive-classifier
|
| 5 |
+
- text-classification
|
| 6 |
+
- continuous-learning
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Adaptive Classifier
|
| 11 |
+
|
| 12 |
+
This model is an instance of an [adaptive-classifier](https://github.com/codelion/adaptive-classifier) that allows for continuous learning and dynamic class addition.
|
| 13 |
+
|
| 14 |
+
## Installation
|
| 15 |
+
|
| 16 |
+
**IMPORTANT:** To use this model, you must first install the `adaptive-classifier` library. You do **NOT** need `trust_remote_code=True`.
|
| 17 |
+
|
| 18 |
+
```bash
|
| 19 |
+
pip install adaptive-classifier
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
## Model Details
|
| 23 |
+
|
| 24 |
+
- Base Model: bert-base-uncased
|
| 25 |
+
- Number of Classes: 4
|
| 26 |
+
- Total Examples: 809
|
| 27 |
+
- Embedding Dimension: 768
|
| 28 |
+
|
| 29 |
+
## Class Distribution
|
| 30 |
+
|
| 31 |
+
```
|
| 32 |
+
google/gemini-2.5-flash: 34 examples (4.2%)
|
| 33 |
+
google/gemini-2.5-flash-lite: 99 examples (12.2%)
|
| 34 |
+
openai/gpt-4o: 215 examples (26.6%)
|
| 35 |
+
openai/gpt-4o-mini: 461 examples (57.0%)
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
## Usage
|
| 39 |
+
|
| 40 |
+
After installing the `adaptive-classifier` library, you can load and use this model:
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from adaptive_classifier import AdaptiveClassifier
|
| 44 |
+
|
| 45 |
+
# Load the model (no trust_remote_code needed!)
|
| 46 |
+
classifier = AdaptiveClassifier.from_pretrained("adaptive-classifier/model-name")
|
| 47 |
+
|
| 48 |
+
# Make predictions
|
| 49 |
+
text = "Your text here"
|
| 50 |
+
predictions = classifier.predict(text)
|
| 51 |
+
print(predictions) # List of (label, confidence) tuples
|
| 52 |
+
|
| 53 |
+
# Add new examples for continuous learning
|
| 54 |
+
texts = ["Example 1", "Example 2"]
|
| 55 |
+
labels = ["class1", "class2"]
|
| 56 |
+
classifier.add_examples(texts, labels)
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
**Note:** This model uses the `adaptive-classifier` library distributed via PyPI. You do **NOT** need to set `trust_remote_code=True` - just install the library first.
|
| 60 |
+
|
| 61 |
+
## Training Details
|
| 62 |
+
|
| 63 |
+
- Training Steps: 1
|
| 64 |
+
- Examples per Class: See distribution above
|
| 65 |
+
- Prototype Memory: Active
|
| 66 |
+
- Neural Adaptation: Active
|
| 67 |
+
|
| 68 |
+
## Limitations
|
| 69 |
+
|
| 70 |
+
This model:
|
| 71 |
+
- Requires at least 3 examples per class
|
| 72 |
+
- Has a maximum of 1000 examples per class
|
| 73 |
+
- Updates prototypes every 100 examples
|
| 74 |
+
|
| 75 |
+
## Citation
|
| 76 |
+
|
| 77 |
+
```bibtex
|
| 78 |
+
@software{adaptive_classifier,
|
| 79 |
+
title = {Adaptive Classifier: Dynamic Text Classification with Continuous Learning},
|
| 80 |
+
author = {Sharma, Asankhaya},
|
| 81 |
+
year = {2025},
|
| 82 |
+
publisher = {GitHub},
|
| 83 |
+
url = {https://github.com/codelion/adaptive-classifier}
|
| 84 |
+
}
|
| 85 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"config": {
|
| 3 |
+
"batch_size": 32,
|
| 4 |
+
"cost_coefficients": {},
|
| 5 |
+
"cost_function_type": "separable",
|
| 6 |
+
"device_map": "auto",
|
| 7 |
+
"early_stopping_patience": 3,
|
| 8 |
+
"enable_strategic_mode": false,
|
| 9 |
+
"epochs": 10,
|
| 10 |
+
"ewc_lambda": 100.0,
|
| 11 |
+
"gradient_checkpointing": false,
|
| 12 |
+
"learning_rate": 0.001,
|
| 13 |
+
"max_examples_per_class": 1000,
|
| 14 |
+
"max_length": 512,
|
| 15 |
+
"min_confidence": 0.1,
|
| 16 |
+
"min_examples_per_class": 3,
|
| 17 |
+
"neural_weight": 0.3,
|
| 18 |
+
"num_representative_examples": 5,
|
| 19 |
+
"prototype_update_frequency": 100,
|
| 20 |
+
"prototype_weight": 0.7,
|
| 21 |
+
"quantization": null,
|
| 22 |
+
"similarity_threshold": 0.6,
|
| 23 |
+
"strategic_blend_regular_weight": 0.6,
|
| 24 |
+
"strategic_blend_strategic_weight": 0.4,
|
| 25 |
+
"strategic_lambda": 0.1,
|
| 26 |
+
"strategic_prediction_head_weight": 0.5,
|
| 27 |
+
"strategic_prediction_proto_weight": 0.5,
|
| 28 |
+
"strategic_robust_head_weight": 0.2,
|
| 29 |
+
"strategic_robust_proto_weight": 0.8,
|
| 30 |
+
"strategic_training_frequency": 10,
|
| 31 |
+
"warmup_steps": 0
|
| 32 |
+
},
|
| 33 |
+
"embedding_dim": 768,
|
| 34 |
+
"id_to_label": {
|
| 35 |
+
"0": "google/gemini-2.5-flash",
|
| 36 |
+
"1": "google/gemini-2.5-flash-lite",
|
| 37 |
+
"2": "openai/gpt-4o",
|
| 38 |
+
"3": "openai/gpt-4o-mini"
|
| 39 |
+
},
|
| 40 |
+
"label_to_id": {
|
| 41 |
+
"google/gemini-2.5-flash": 0,
|
| 42 |
+
"google/gemini-2.5-flash-lite": 1,
|
| 43 |
+
"openai/gpt-4o": 2,
|
| 44 |
+
"openai/gpt-4o-mini": 3
|
| 45 |
+
},
|
| 46 |
+
"library_name": "adaptive-classifier",
|
| 47 |
+
"model_name": "bert-base-uncased",
|
| 48 |
+
"train_steps": 1,
|
| 49 |
+
"training_history": {
|
| 50 |
+
"google/gemini-2.5-flash": 34,
|
| 51 |
+
"google/gemini-2.5-flash-lite": 99,
|
| 52 |
+
"openai/gpt-4o": 215,
|
| 53 |
+
"openai/gpt-4o-mini": 461
|
| 54 |
+
}
|
| 55 |
+
}
|
examples.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11d0194f8ab9c7fe2190ad378a9a6806f8f5ec8e8331fae30f38611be3d2ca3a
|
| 3 |
+
size 3562952
|
onnx/config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertForMaskedLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"classifier_dropout": null,
|
| 7 |
+
"gradient_checkpointing": false,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.1,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 3072,
|
| 13 |
+
"layer_norm_eps": 1e-12,
|
| 14 |
+
"max_position_embeddings": 512,
|
| 15 |
+
"model_type": "bert",
|
| 16 |
+
"num_attention_heads": 12,
|
| 17 |
+
"num_hidden_layers": 12,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"position_embedding_type": "absolute",
|
| 20 |
+
"transformers_version": "4.53.3",
|
| 21 |
+
"type_vocab_size": 2,
|
| 22 |
+
"use_cache": true,
|
| 23 |
+
"vocab_size": 30522
|
| 24 |
+
}
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5f360a375f3cd7c16ff404927d861d1314cdc350ca20bc3e0da42fc9d846503
|
| 3 |
+
size 435801390
|