Yash7766 commited on
Commit
30acf6b
·
verified ·
1 Parent(s): 5b5a526

Upload folder using huggingface_hub

Browse files
Files changed (6) hide show
  1. README.md +83 -0
  2. config.json +49 -0
  3. examples.json +0 -0
  4. model.safetensors +3 -0
  5. onnx/config.json +31 -0
  6. onnx/model.onnx +3 -0
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: microsoft/deberta-v3-small
25
+ - Number of Classes: 2
26
+ - Total Examples: 1976
27
+ - Embedding Dimension: 768
28
+
29
+ ## Class Distribution
30
+
31
+ ```
32
+ NO: 1000 examples (50.6%)
33
+ YES: 976 examples (49.4%)
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ After installing the `adaptive-classifier` library, you can load and use this model:
39
+
40
+ ```python
41
+ from adaptive_classifier import AdaptiveClassifier
42
+
43
+ # Load the model (no trust_remote_code needed!)
44
+ classifier = AdaptiveClassifier.from_pretrained("adaptive-classifier/model-name")
45
+
46
+ # Make predictions
47
+ text = "Your text here"
48
+ predictions = classifier.predict(text)
49
+ print(predictions) # List of (label, confidence) tuples
50
+
51
+ # Add new examples for continuous learning
52
+ texts = ["Example 1", "Example 2"]
53
+ labels = ["class1", "class2"]
54
+ classifier.add_examples(texts, labels)
55
+ ```
56
+
57
+ **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.
58
+
59
+ ## Training Details
60
+
61
+ - Training Steps: 1
62
+ - Examples per Class: See distribution above
63
+ - Prototype Memory: Active
64
+ - Neural Adaptation: Active
65
+
66
+ ## Limitations
67
+
68
+ This model:
69
+ - Requires at least 3 examples per class
70
+ - Has a maximum of 1000 examples per class
71
+ - Updates prototypes every 100 examples
72
+
73
+ ## Citation
74
+
75
+ ```bibtex
76
+ @software{adaptive_classifier,
77
+ title = {Adaptive Classifier: Dynamic Text Classification with Continuous Learning},
78
+ author = {Sharma, Asankhaya},
79
+ year = {2025},
80
+ publisher = {GitHub},
81
+ url = {https://github.com/codelion/adaptive-classifier}
82
+ }
83
+ ```
config.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "NO",
36
+ "1": "YES"
37
+ },
38
+ "label_to_id": {
39
+ "NO": 0,
40
+ "YES": 1
41
+ },
42
+ "library_name": "adaptive-classifier",
43
+ "model_name": "microsoft/deberta-v3-small",
44
+ "train_steps": 1,
45
+ "training_history": {
46
+ "NO": 1024,
47
+ "YES": 976
48
+ }
49
+ }
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:efb89f3fd324b97b24d19107a2e884ba341578b3d32cfeeb948de995f7b5b516
3
+ size 3553496
onnx/config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "attention_probs_dropout_prob": 0.1,
3
+ "hidden_act": "gelu",
4
+ "hidden_dropout_prob": 0.1,
5
+ "hidden_size": 768,
6
+ "initializer_range": 0.02,
7
+ "intermediate_size": 3072,
8
+ "layer_norm_eps": 1e-07,
9
+ "legacy": true,
10
+ "max_position_embeddings": 512,
11
+ "max_relative_positions": -1,
12
+ "model_type": "deberta-v2",
13
+ "norm_rel_ebd": "layer_norm",
14
+ "num_attention_heads": 12,
15
+ "num_hidden_layers": 6,
16
+ "pad_token_id": 0,
17
+ "pooler_dropout": 0,
18
+ "pooler_hidden_act": "gelu",
19
+ "pooler_hidden_size": 768,
20
+ "pos_att_type": [
21
+ "p2c",
22
+ "c2p"
23
+ ],
24
+ "position_biased_input": false,
25
+ "position_buckets": 256,
26
+ "relative_attention": true,
27
+ "share_att_key": true,
28
+ "transformers_version": "4.57.6",
29
+ "type_vocab_size": 0,
30
+ "vocab_size": 128100
31
+ }
onnx/model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15e6536dbbb7ae616ef341a4db342a9be8f89442eda2c3d780de5a376a379cd2
3
+ size 565627879