ragarwal's picture
Update README.md
1e300e7
|
raw
history blame
689 Bytes
metadata
license: mit

Usage

First, install Sentence-Transformers

Then,

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)