Commit
•
3a12891
1
Parent(s):
c48faaa
Update README.md
Browse files
README.md
CHANGED
@@ -182,8 +182,18 @@ The base model is [DeBERTa-v3-base from Microsoft](https://huggingface.co/micros
|
|
182 |
|
183 |
For highest performance (but less speed), I recommend using https://huggingface.co/MoritzLaurer/DeBERTa-v3-large-mnli-fever-anli-ling-wanli.
|
184 |
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
```python
|
188 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
189 |
import torch
|
|
|
182 |
|
183 |
For highest performance (but less speed), I recommend using https://huggingface.co/MoritzLaurer/DeBERTa-v3-large-mnli-fever-anli-ling-wanli.
|
184 |
|
185 |
+
|
186 |
+
### How to use the model
|
187 |
+
#### Simple zero-shot classification pipeline
|
188 |
+
```python
|
189 |
+
from transformers import pipeline
|
190 |
+
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli")
|
191 |
+
sequence_to_classify = "Angela Merkel is a politician in Germany and leader of the CDU ist eine Politikerin in Deutschland und Vorsitzende der CDU"
|
192 |
+
candidate_labels = ["politics", "economy", "entertainment", "environment"]
|
193 |
+
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
|
194 |
+
print(output)
|
195 |
+
```
|
196 |
+
#### NLI use-case
|
197 |
```python
|
198 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
199 |
import torch
|