Update README.md
Browse files
README.md
CHANGED
|
@@ -1,45 +1,39 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
-
|
| 4 |
-
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
-
|
| 8 |
-
probably proofread and complete it, then remove this comment. -->
|
| 9 |
-
|
| 10 |
-
# zero-shot-vanilla-binary-bert
|
| 11 |
-
|
| 12 |
-
This model was trained from scratch on an unknown dataset.
|
| 13 |
-
It achieves the following results on the evaluation set:
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## Model description
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
## Intended uses & limitations
|
| 21 |
-
|
| 22 |
-
More information needed
|
| 23 |
-
|
| 24 |
-
## Training and evaluation data
|
| 25 |
-
|
| 26 |
-
More information needed
|
| 27 |
-
|
| 28 |
-
## Training procedure
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
The following hyperparameters were used during training:
|
| 33 |
-
- optimizer: None
|
| 34 |
-
- training_precision: float32
|
| 35 |
|
| 36 |
-
|
| 37 |
|
|
|
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
- Transformers 4.16.2
|
| 43 |
-
- TensorFlow 2.12.0
|
| 44 |
-
- Datasets 2.12.0
|
| 45 |
-
- Tokenizers 0.11.0
|
|
|
|
| 1 |
---
|
| 2 |
+
tags:
|
| 3 |
+
- transformers
|
| 4 |
+
- sentence-transformers
|
| 5 |
+
- zeroshot_classifier
|
| 6 |
---
|
| 7 |
|
| 8 |
+
# Zero-shot Vanilla Binary BERT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
This model is a BERT model.
|
| 11 |
+
It was introduced in the Findings of ACL'23 Paper **Label Agnostic Pre-training for Zero-shot Text Classification** by ***Christopher Clarke, Yuzhao Heng, Yiping Kang, Krisztian Flautner, Lingjia Tang and Jason Mars***.
|
| 12 |
+
The code for training and evaluating this model can be found [here](https://github.com/ChrisIsKing/zero-shot-text-classification/tree/master).
|
| 13 |
|
| 14 |
## Model description
|
| 15 |
|
| 16 |
+
This model was trained via the binary classification framework. It is intended for zero-shot text classification.
|
| 17 |
+
It was trained and evaluated as a baseline with the aspect-normalized [UTCD](https://huggingface.co/datasets/claritylab/UTCD) dataset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
- **Finetuned from model:** [`bert-base-uncased`](https://huggingface.co/bert-base-uncased)
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
## Usage
|
| 23 |
|
| 24 |
+
You can use the model like this:
|
| 25 |
|
| 26 |
+
```python
|
| 27 |
+
from zeroshot_classifier.models import BinaryBertCrossEncoder
|
| 28 |
+
model = BinaryBertCrossEncoder(model_name='claritylab/zero-shot-vanilla-binary-bert')
|
| 29 |
|
| 30 |
+
text = "I'd like to have this track onto my Classical Relaxations playlist."
|
| 31 |
+
labels = [
|
| 32 |
+
'Add To Playlist', 'Book Restaurant', 'Get Weather', 'Play Music', 'Rate Book', 'Search Creative Work',
|
| 33 |
+
'Search Screening Event'
|
| 34 |
+
]
|
| 35 |
+
query = [[text, lb] for lb in labels]
|
| 36 |
+
logits = model.predict(query, apply_softmax=True)
|
| 37 |
+
print(logits)
|
| 38 |
+
```
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|