File size: 689 Bytes
5f0cd59 1e6518e 1e300e7 4557fc9 1e300e7 4557fc9 1e6518e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
---
license: mit
---
### Usage
First, install [Sentence-Transformers](https://www.sbert.net/)
Then,
```python
from sentence_transformers import CrossEncoder
model_name="ragarwal/deberta-v3-base-nli-mixer"
model = CrossEncoder(model_name, max_length=256)
sentence = "During its monthly call, the National Oceanic and Atmospheric Administration warned of \
increased temperatures and low precipitation"
labels = ["Computer", "Climate Change", "Tablet", "Football", "Artificial Intelligence", "Global Warming"]
scores = model.predict([[sentence, l] for l in labels])
print(scores)
#array([0.04118565, 0.2435827 , 0.03941465, 0.00203637, 0.00501176, 0.1423797], dtype=float32)
``` |