Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- cjvt/si_nli
|
4 |
+
language:
|
5 |
+
- sl
|
6 |
+
---
|
7 |
+
|
8 |
+
# CrossEncoder for Slovene NLI
|
9 |
+
The model was trained using [SentenceTransformers](https://sbert.net/) [CrossEncoder](https://www.sbert.net/examples/applications/cross-encoder/README.html) class.
|
10 |
+
It is based on [SloBerta](https://huggingface.co/EMBEDDIA/sloberta), a monolingual Slovene model.
|
11 |
+
|
12 |
+
## Training
|
13 |
+
This model was trained on the [SI-NLI](https://huggingface.co/datasets/cjvt/si_nli) and the [slovene_mnli_snli](https://huggingface.co/datasets/jacinthes/slovene_mnli_snli) datasets.
|
14 |
+
More details and the training script are available here: [repo](https://github.com/jacinthes/slovene-nli-benchmark)
|
15 |
+
|
16 |
+
## Performance
|
17 |
+
-Accuracy on the SI-NLI validation set: 77.51
|
18 |
+
|
19 |
+
## Usage
|
20 |
+
The model can be used for inference using the below code:
|
21 |
+
```python
|
22 |
+
from sentence_transformers import CrossEncoder
|
23 |
+
|
24 |
+
model = CrossEncoder('jacinthes/cross-encoder-sloberta-si-nli-snli-mnli')
|
25 |
+
premise = 'Pojdi z menoj v toplice.'
|
26 |
+
hypothesis = 'Bova lepa bova fit.'
|
27 |
+
prediction = model.predict([premise, hypothesis])
|
28 |
+
int2label = {0: 'entailment', 1: 'neutral', 2:'contradiction'}
|
29 |
+
print(int2label[prediction.argmax()])
|
30 |
+
```
|