Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

setup(
name="adaptive-classifier",
version="0.1.0",
version="0.1.1",
author="codelion",
author_email="[email protected]",
description="A flexible, adaptive classification system for dynamic text classification",
Expand Down
2 changes: 1 addition & 1 deletion src/adaptive_classifier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .multilabel import MultiLabelAdaptiveClassifier, MultiLabelAdaptiveHead
from huggingface_hub import ModelHubMixin

__version__ = "0.0.19"
__version__ = "0.1.1"

__all__ = [
"AdaptiveClassifier",
Expand Down
19 changes: 15 additions & 4 deletions src/adaptive_classifier/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ def _save_pretrained(
'id_to_label': {str(k): v for k, v in self.id_to_label.items()},
'train_steps': self.train_steps,
'training_history': self.training_history, # Save cumulative training counts
'config': self.config.to_dict()
'config': self.config.to_dict(),
'library_name': 'adaptive-classifier' # Tell HuggingFace Hub this requires the adaptive-classifier library
}

# Save examples in a separate file to keep config clean
Expand Down Expand Up @@ -924,7 +925,13 @@ def _generate_model_card(self) -> str:

This model is an instance of an [adaptive-classifier](https://github.com/codelion/adaptive-classifier) that allows for continuous learning and dynamic class addition.

You can install it with `pip install adaptive-classifier`.
## Installation

**IMPORTANT:** To use this model, you must first install the `adaptive-classifier` library. You do **NOT** need `trust_remote_code=True`.

```bash
pip install adaptive-classifier
```

## Model Details

Expand All @@ -941,23 +948,27 @@ def _generate_model_card(self) -> str:

## Usage

After installing the `adaptive-classifier` library, you can load and use this model:

```python
from adaptive_classifier import AdaptiveClassifier

# Load the model
# Load the model (no trust_remote_code needed!)
classifier = AdaptiveClassifier.from_pretrained("adaptive-classifier/model-name")

# Make predictions
text = "Your text here"
predictions = classifier.predict(text)
print(predictions) # List of (label, confidence) tuples

# Add new examples
# Add new examples for continuous learning
texts = ["Example 1", "Example 2"]
labels = ["class1", "class2"]
classifier.add_examples(texts, labels)
```

**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.

## Training Details

- Training Steps: {self.train_steps}
Expand Down