David
commited on
Commit
·
7ce5c13
1
Parent(s):
03b48b6
Update README.md
Browse files
README.md
CHANGED
|
@@ -14,4 +14,16 @@ widget:
|
|
| 14 |
---
|
| 15 |
# ZERO-SHOT SELECTRA: A zero-shot classifier based on SELECTRA
|
| 16 |
|
|
|
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
# ZERO-SHOT SELECTRA: A zero-shot classifier based on SELECTRA
|
| 16 |
|
| 17 |
+
## Usage
|
| 18 |
|
| 19 |
+
```python
|
| 20 |
+
from transformers import pipeline
|
| 21 |
+
classifier = pipeline("zero-shot-classification",
|
| 22 |
+
model="Recognai/zeroshot_selectra_small")
|
| 23 |
+
|
| 24 |
+
classifier(
|
| 25 |
+
"El autor se perfila, a los 50 años de su muerte, como uno de los grandes de su siglo",
|
| 26 |
+
candidate_labels=["cultura", "sociedad", "economia", "salud", "deportes"],
|
| 27 |
+
hypothesis_template="Este ejemplo es {}."
|
| 28 |
+
)
|
| 29 |
+
```
|