Update README.md
Browse files
README.md
CHANGED
@@ -1,45 +1,46 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
-
|
4 |
-
|
|
|
5 |
---
|
6 |
|
7 |
-
|
8 |
-
probably proofread and complete it, then remove this comment. -->
|
9 |
-
|
10 |
-
# zero-shot-explicit-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 |
-
-
|
43 |
-
-
|
44 |
-
-
|
45 |
-
-
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
tags:
|
3 |
+
- transformers
|
4 |
+
- sentence-transformers
|
5 |
+
- zeroshot_classifier
|
6 |
---
|
7 |
|
8 |
+
# Zero-shot Explicit 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 via explicit training 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-explicit-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 |
+
[[6.8812753e-04 9.9931192e-01]
|
40 |
+
[9.9974447e-01 2.5556990e-04]
|
41 |
+
[9.9978167e-01 2.1833177e-04]
|
42 |
+
[1.6187031e-03 9.9838126e-01]
|
43 |
+
[9.9965131e-01 3.4869535e-04]
|
44 |
+
[9.9413908e-01 5.8608940e-03]
|
45 |
+
[9.9685740e-01 3.1425431e-03]]
|
46 |
+
```
|