David commited on
Commit ·
806bfaf
1
Parent(s): c0d3369
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,14 +12,18 @@ widget:
|
|
| 12 |
- text: "El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo"
|
| 13 |
candidate_labels: "cultura, sociedad, economia, salud, deportes"
|
| 14 |
---
|
| 15 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
## Usage
|
| 18 |
|
| 19 |
```python
|
| 20 |
from transformers import pipeline
|
| 21 |
classifier = pipeline("zero-shot-classification",
|
| 22 |
-
model="Recognai/
|
| 23 |
|
| 24 |
classifier(
|
| 25 |
"El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo",
|
|
@@ -28,6 +32,26 @@ classifier(
|
|
| 28 |
)
|
| 29 |
```
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
## Training
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
- text: "El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo"
|
| 13 |
candidate_labels: "cultura, sociedad, economia, salud, deportes"
|
| 14 |
---
|
| 15 |
+
# Zero-shot SELECTRA: A zero-shot classifier based on SELECTRA
|
| 16 |
+
|
| 17 |
+
*Zero-shot SELECTRA* is a [SELECTRA model](https://huggingface.co/Recognai/selectra_small) fine-tuned on the Spanish portion of the [XNLI dataset](https://huggingface.co/datasets/xnli). You can use it with Hugging Face's [Zero-shot pipeline](https://huggingface.co/transformers/master/main_classes/pipelines.html#transformers.ZeroShotClassificationPipeline) to make [zero-shot classifications](https://joeddav.github.io/blog/2020/05/29/ZSL.html).
|
| 18 |
+
|
| 19 |
+
In comparison to our previous zero-shot classifier [based on BETO](https://huggingface.co/Recognai/bert-base-spanish-wwm-cased-xnli), zero-shot SELECTRA is **much more lightweight**. As shown in the *Metrics* section, the *small* version (5 times fewer parameters) performs slightly worse, while the *medium* version (3 times fewer parameters) **outperforms** the BETO based zero-shot classifier.
|
| 20 |
|
| 21 |
## Usage
|
| 22 |
|
| 23 |
```python
|
| 24 |
from transformers import pipeline
|
| 25 |
classifier = pipeline("zero-shot-classification",
|
| 26 |
+
model="Recognai/zeroshot_selectra_medium")
|
| 27 |
|
| 28 |
classifier(
|
| 29 |
"El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo",
|
|
|
|
| 32 |
)
|
| 33 |
```
|
| 34 |
|
| 35 |
+
## Metrics
|
| 36 |
+
|
| 37 |
+
| Model | Params | XNLI (acc) | \*MLSUM (acc) |
|
| 38 |
+
| --- | --- | --- | --- |
|
| 39 |
+
| zs BETO | 110M | 0.799 | 0.530 |
|
| 40 |
+
| zs SELECTRA medium | 41M | **0.807** | **0.589** |
|
| 41 |
+
| zs SELECTRA small | **22M** | 0.795 | 0.446 |
|
| 42 |
+
|
| 43 |
+
\*evaluated with zero-shot learning (ZSL)
|
| 44 |
+
|
| 45 |
+
- **XNLI**: The stated accuracy refers to the test portion of the [XNLI dataset](https://huggingface.co/datasets/xnli), after finetuning the model on the training portion.
|
| 46 |
+
- **MLSUM**: For this accuracy we take the test set of the [MLSUM dataset](https://huggingface.co/datasets/mlsum) and classify the summaries of 5 selected labels. For details, check out our [evaluation notebook](https://github.com/recognai/selectra/blob/main/zero-shot_classifier/evaluation.ipynb)
|
| 47 |
+
|
| 48 |
## Training
|
| 49 |
|
| 50 |
+
Check out our [training notebook](https://github.com/recognai/selectra/blob/main/zero-shot_classifier/training.ipynb) for all the details.
|
| 51 |
+
|
| 52 |
+
## Authors
|
| 53 |
+
|
| 54 |
+
- David Fidalgo ([GitHub](https://github.com/dcfidalgo))
|
| 55 |
+
- Daniel Vila ([GitHub](https://github.com/dvsrepo))
|
| 56 |
+
- Francisco Aranda ([GitHub](https://github.com/frascuchon))
|
| 57 |
+
- Javier Lopez ([GitHub](https://github.com/javispp))
|