Skip to content

Commit

Permalink
chore: bumped version
Browse files Browse the repository at this point in the history
fix: resolved failing tests zero-shot
  • Loading branch information
davidberenstein1957 committed Jun 18, 2023
1 parent 58fb254 commit 7e30e49
Show file tree
Hide file tree
Showing 6 changed files with 1,591 additions and 1,273 deletions.
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ repos:
rev: 22.3.0
hooks:
- id: black
# Execute isort on all changed files (make sure the version is the same as in pyproject)
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort

# Execute flake8 on all changed files (make sure the version is the same as in pyproject)
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Classy Classification
Have you every struggled with needing a [Spacy TextCategorizer](https://spacy.io/api/textcategorizer) but didn't have the time to train one from scratch? Classy Classification is the way to go! For few-shot classification using [sentence-transformers](https://github.com/UKPLab/sentence-transformers) or [spaCy models](https://spacy.io/usage/models), provide a dictionary with labels and examples, or just provide a list of labels for zero shot-classification with [Hugginface zero-shot classifiers](https://huggingface.co/models?pipeline_tag=zero-shot-classification).
Have you ever struggled with needing a [Spacy TextCategorizer](https://spacy.io/api/textcategorizer) but didn't have the time to train one from scratch? Classy Classification is the way to go! For few-shot classification using [sentence-transformers](https://github.com/UKPLab/sentence-transformers) or [spaCy models](https://spacy.io/usage/models), provide a dictionary with labels and examples, or just provide a list of labels for zero shot-classification with [Hugginface zero-shot classifiers](https://huggingface.co/models?pipeline_tag=zero-shot-classification).

[![Current Release Version](https://img.shields.io/github/release/pandora-intelligence/classy-classification.svg?style=flat-square&logo=github)](https://github.com/pandora-intelligence/classy-classification/releases)
[![pypi Version](https://img.shields.io/pypi/v/classy-classification.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.org/project/classy-classification/)
Expand All @@ -9,7 +9,7 @@ Have you every struggled with needing a [Spacy TextCategorizer](https://spacy.io
# Install
``` pip install classy-classification```

or install with faster inference using onnx.
Or, install with faster inference using ONNX.

``` pip install classy-classification[onnx]```

Expand All @@ -19,6 +19,7 @@ or install with faster inference using onnx.

ONNX does show some issues when pickling the data.
### M1

Some [installation issues](https://github.com/onnx/onnx/issues/3129) might occur, which can be fixed by these commands.

```
Expand Down
5 changes: 4 additions & 1 deletion classy_classification/classifiers/classy_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def __init__(

self.multi_label = multi_label

self.data = collections.OrderedDict(sorted(data.items()))
if isinstance(data, dict):
self.data = collections.OrderedDict(sorted(data.items()))
elif isinstance(data, list): # in case of zero-shot classification
self.data = data

self.name = name
self.nlp = nlp
Expand Down
5 changes: 4 additions & 1 deletion classy_classification/classifiers/classy_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def __init__(
}.
"""
self.multi_label = multi_label
self.data = collections.OrderedDict(sorted(data.items()))
if isinstance(data, dict):
self.data = collections.OrderedDict(sorted(data.items()))
elif isinstance(data, list): # in case of zero-shot classification
self.data = data
self.model = model
self.device = device
self.verbose = verbose
Expand Down
Loading

0 comments on commit 7e30e49

Please sign in to comment.