Zero-Shot Classification
PyTorch
Transformers
sentence-transformers
English
zeroshot_classifier
bert
text-classification
Instructions to use claritylab/zero-shot-implicit-binary-bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use claritylab/zero-shot-implicit-binary-bert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="claritylab/zero-shot-implicit-binary-bert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("claritylab/zero-shot-implicit-binary-bert") model = AutoModelForSequenceClassification.from_pretrained("claritylab/zero-shot-implicit-binary-bert", device_map="auto") - sentence-transformers
How to use claritylab/zero-shot-implicit-binary-bert with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("claritylab/zero-shot-implicit-binary-bert") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -49,11 +49,11 @@ You can use the model like this:
|
|
| 49 |
>>> logits = model.predict(query, apply_softmax=True)
|
| 50 |
>>> print(logits)
|
| 51 |
|
| 52 |
-
[[
|
| 53 |
-
[9.
|
| 54 |
-
[9.
|
| 55 |
-
[1.
|
| 56 |
-
[9.
|
| 57 |
-
[9.
|
| 58 |
-
[9.
|
| 59 |
```
|
|
|
|
| 49 |
>>> logits = model.predict(query, apply_softmax=True)
|
| 50 |
>>> print(logits)
|
| 51 |
|
| 52 |
+
[[7.3497969e-04 9.9926502e-01]
|
| 53 |
+
[9.9988127e-01 1.1870124e-04]
|
| 54 |
+
[9.9988961e-01 1.1033980e-04]
|
| 55 |
+
[1.9227572e-03 9.9807727e-01]
|
| 56 |
+
[9.9985313e-01 1.4685343e-04]
|
| 57 |
+
[9.9938977e-01 6.1021477e-04]
|
| 58 |
+
[9.9838030e-01 1.6197052e-03]]
|
| 59 |
```
|