You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `MultiLabelAdaptiveClassifier` extends adaptive classification to handle scenarios where each text can belong to multiple categories simultaneously. It automatically handles threshold adaptation for scenarios with many labels.
301
+
302
+
### Key Features
303
+
304
+
-**🎯 Automatic Threshold Adaptation**: Dynamically adjusts thresholds based on the number of labels to prevent empty predictions
305
+
-**📊 Sigmoid Activation**: Uses proper multi-label architecture with BCE loss instead of softmax
306
+
-**⚙️ Configurable Limits**: Set minimum and maximum number of predictions per input
307
+
-**📈 Label-Specific Thresholds**: Automatically adjusts thresholds based on label frequency
308
+
-**🔄 Incremental Learning**: Add new labels and examples without retraining from scratch
309
+
310
+
### Usage
311
+
312
+
```python
313
+
from adaptive_classifier import MultiLabelAdaptiveClassifier
314
+
315
+
# Initialize with configuration
316
+
classifier = MultiLabelAdaptiveClassifier(
317
+
"distilbert/distilbert-base-cased",
318
+
default_threshold=0.5,
319
+
min_predictions=1,
320
+
max_predictions=5
321
+
)
322
+
323
+
# Multi-label training data
324
+
texts = [
325
+
"Breaking: Scientists discover AI can help predict climate change patterns",
326
+
"Tech giant announces breakthrough in quantum computing for healthcare",
327
+
"Olympic committee adopts new sports technology for athlete performance"
0 commit comments