Update README.md
Browse files
README.md
CHANGED
@@ -12,6 +12,8 @@ language:
|
|
12 |
- da
|
13 |
---
|
14 |
|
|
|
|
|
15 |
*This an updated version of [KennethTM/MiniLM-L6-danish-reranker](https://huggingface.co/KennethTM/MiniLM-L6-danish-reranker). This version is just trained on more data ([GooAQ dataset](https://huggingface.co/datasets/sentence-transformers/gooaq) translated to [Danish](https://huggingface.co/datasets/KennethTM/gooaq_pairs_danish)) and is otherwise the same*
|
16 |
|
17 |
# MiniLM-L6-danish-reranker-v2
|
@@ -60,9 +62,16 @@ import numpy as np
|
|
60 |
|
61 |
sigmoid_numpy = lambda x: 1/(1 + np.exp(-x))
|
62 |
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
print(scores)
|
67 |
print(sigmoid_numpy(scores))
|
|
|
68 |
```
|
|
|
12 |
- da
|
13 |
---
|
14 |
|
15 |
+
# Note
|
16 |
+
|
17 |
*This an updated version of [KennethTM/MiniLM-L6-danish-reranker](https://huggingface.co/KennethTM/MiniLM-L6-danish-reranker). This version is just trained on more data ([GooAQ dataset](https://huggingface.co/datasets/sentence-transformers/gooaq) translated to [Danish](https://huggingface.co/datasets/KennethTM/gooaq_pairs_danish)) and is otherwise the same*
|
18 |
|
19 |
# MiniLM-L6-danish-reranker-v2
|
|
|
62 |
|
63 |
sigmoid_numpy = lambda x: 1/(1 + np.exp(-x))
|
64 |
|
65 |
+
# Provide examples as a list of query-passage tuples
|
66 |
+
pairs = [('Kører der cykler på vejen?',
|
67 |
+
'I Danmark er cykler et almindeligt transportmiddel, og de har lige så stor ret til at bruge vejene som bilister. Cyklister skal dog følge færdselsreglerne og vise hensyn til andre trafikanter.'),
|
68 |
+
('Kører der cykler på vejen?',
|
69 |
+
'Solen skinner, og himlen er blå. Der er ingen vind, og temperaturen er perfekt. Det er den perfekte dag til at tage en tur på landet og nyde den friske luft.')]
|
70 |
+
|
71 |
+
model = CrossEncoder('KennethTM/MiniLM-L6-danish-reranker-v2', max_length=512)
|
72 |
+
scores = model.predict(pairs)
|
73 |
|
74 |
print(scores)
|
75 |
print(sigmoid_numpy(scores))
|
76 |
+
|
77 |
```
|