cjvt/si_nli
Viewer • Updated • 5.94k • 12
How to use jacinthes/cross-encoder-sloberta-si-nli with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="jacinthes/cross-encoder-sloberta-si-nli") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("jacinthes/cross-encoder-sloberta-si-nli")
model = AutoModelForSequenceClassification.from_pretrained("jacinthes/cross-encoder-sloberta-si-nli")The model was trained using the SentenceTransformers CrossEncoder class.
It is based on SloBerta, a monolingual Slovene model.
This model was trained on the SI-NLI dataset.
More details and the training script are available here: repo
The model achieves the following metrics:
The model can be used for inference using the below code:
from sentence_transformers import CrossEncoder
model = CrossEncoder('jacinthes/cross-encoder-sloberta-si-nli')
premise = 'Pojdi z menoj v toplice.'
hypothesis = 'Bova lepa bova fit.'
prediction = model.predict([premise, hypothesis])
int2label = {0: 'entailment', 1: 'neutral', 2:'contradiction'}
print(int2label[prediction.argmax()])