Update README.md
Browse files
README.md
CHANGED
@@ -38,15 +38,15 @@ classifier = pipeline("zero-shot-classification", model="NBAiLab/nb-bert-base-mn
|
|
38 |
```
|
39 |
You can then use this pipeline to classify sequences into any of the class names you specify.
|
40 |
```python
|
41 |
-
sequence_to_classify =
|
42 |
-
candidate_labels = [
|
43 |
-
hypothesis_template =
|
44 |
classifier(sequence_to_classify, candidate_labels, hypothesis_template=hypothesis_template, multi_class=True)
|
45 |
|
|
|
|
|
|
|
46 |
|
47 |
-
#{'labels': ['travel', 'dancing', 'cooking'],
|
48 |
-
# 'scores': [0.9938651323318481, 0.0032737774308770895, 0.002861034357920289],
|
49 |
-
# 'sequence': 'one day I will see the world'}
|
50 |
```
|
51 |
|
52 |
## More information
|
|
|
38 |
```
|
39 |
You can then use this pipeline to classify sequences into any of the class names you specify.
|
40 |
```python
|
41 |
+
sequence_to_classify = 'Folkehelseinstituttets mest optimistiske anslag er at alle over 18 år er ferdigvaksinert innen midten av september.'
|
42 |
+
candidate_labels = ['politikk, helse, sport, religion']
|
43 |
+
hypothesis_template = 'Denne teksten handler om {}.'
|
44 |
classifier(sequence_to_classify, candidate_labels, hypothesis_template=hypothesis_template, multi_class=True)
|
45 |
|
46 |
+
#{'labels': ['helse', 'politikk', 'sport', 'religion'],
|
47 |
+
#'scores': [0.4210019111633301, 0.0674605593085289, 0.000840459018945694, 0.0007541406666859984],
|
48 |
+
# 'sequence': 'Folkehelseinstituttets mest optimistiske anslag er at alle over 18 år er ferdigvaksinert innen midten av september.'}
|
49 |
|
|
|
|
|
|
|
50 |
```
|
51 |
|
52 |
## More information
|