Push model using huggingface_hub.
Browse files- README.md +74 -3
- config.json +35 -0
- examples.json +0 -0
- model.safetensors +3 -0
README.md
CHANGED
@@ -1,3 +1,74 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
You can install it with `pip install adaptive-classifier`.
|
15 |
+
|
16 |
+
## Model Details
|
17 |
+
|
18 |
+
- Base Model: distilbert-base-uncased
|
19 |
+
- Number of Classes: 3
|
20 |
+
- Total Examples: 150
|
21 |
+
- Embedding Dimension: 768
|
22 |
+
|
23 |
+
## Class Distribution
|
24 |
+
|
25 |
+
```
|
26 |
+
negative: 50 examples (33.3%)
|
27 |
+
neutral: 50 examples (33.3%)
|
28 |
+
positive: 50 examples (33.3%)
|
29 |
+
```
|
30 |
+
|
31 |
+
## Usage
|
32 |
+
|
33 |
+
```python
|
34 |
+
from adaptive_classifier import AdaptiveClassifier
|
35 |
+
|
36 |
+
# Load the model
|
37 |
+
classifier = AdaptiveClassifier.from_pretrained("adaptive-classifier/model-name")
|
38 |
+
|
39 |
+
# Make predictions
|
40 |
+
text = "Your text here"
|
41 |
+
predictions = classifier.predict(text)
|
42 |
+
print(predictions) # List of (label, confidence) tuples
|
43 |
+
|
44 |
+
# Add new examples
|
45 |
+
texts = ["Example 1", "Example 2"]
|
46 |
+
labels = ["class1", "class2"]
|
47 |
+
classifier.add_examples(texts, labels)
|
48 |
+
```
|
49 |
+
|
50 |
+
## Training Details
|
51 |
+
|
52 |
+
- Training Steps: 28
|
53 |
+
- Examples per Class: See distribution above
|
54 |
+
- Prototype Memory: Active
|
55 |
+
- Neural Adaptation: Active
|
56 |
+
|
57 |
+
## Limitations
|
58 |
+
|
59 |
+
This model:
|
60 |
+
- Requires at least 5 examples per class
|
61 |
+
- Has a maximum of 50 examples per class
|
62 |
+
- Updates prototypes every 25 examples
|
63 |
+
|
64 |
+
## Citation
|
65 |
+
|
66 |
+
```bibtex
|
67 |
+
@software{adaptive_classifier,
|
68 |
+
title = {Adaptive Classifier: Dynamic Text Classification with Continuous Learning},
|
69 |
+
author = {Sharma, Asankhaya},
|
70 |
+
year = {2025},
|
71 |
+
publisher = {GitHub},
|
72 |
+
url = {https://github.com/codelion/adaptive-classifier}
|
73 |
+
}
|
74 |
+
```
|
config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"batch_size": 32,
|
4 |
+
"device_map": "auto",
|
5 |
+
"early_stopping_patience": 3,
|
6 |
+
"epochs": 10,
|
7 |
+
"ewc_lambda": 100.0,
|
8 |
+
"gradient_checkpointing": false,
|
9 |
+
"learning_rate": 0.001,
|
10 |
+
"max_examples_per_class": 50,
|
11 |
+
"max_length": 128,
|
12 |
+
"min_confidence": 0.1,
|
13 |
+
"min_examples_per_class": 5,
|
14 |
+
"neural_weight": 0.3,
|
15 |
+
"num_representative_examples": 10,
|
16 |
+
"prototype_update_frequency": 25,
|
17 |
+
"prototype_weight": 0.7,
|
18 |
+
"quantization": null,
|
19 |
+
"similarity_threshold": 0.6,
|
20 |
+
"warmup_steps": 0
|
21 |
+
},
|
22 |
+
"embedding_dim": 768,
|
23 |
+
"id_to_label": {
|
24 |
+
"0": "neutral",
|
25 |
+
"1": "positive",
|
26 |
+
"2": "negative"
|
27 |
+
},
|
28 |
+
"label_to_id": {
|
29 |
+
"negative": 2,
|
30 |
+
"neutral": 0,
|
31 |
+
"positive": 1
|
32 |
+
},
|
33 |
+
"model_name": "distilbert-base-uncased",
|
34 |
+
"train_steps": 28
|
35 |
+
}
|
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:19381b0916d2223edf789cc7d472a6fc52db77a718bac7300ef938343ecb23fc
|
3 |
+
size 3558204
|