Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- cs
|
4 |
+
base_model:
|
5 |
+
- fav-kky/FERNET-C5
|
6 |
+
---
|
7 |
+
|
8 |
+
This is fav-kky/FERNET-C5, fine-tuned with the **Cross-Encoder** architecture on the Czech News Dataset for Semantic Textual Similarity and DaReCzech. The Cross-Encoder architecture processes both input text pieces simultaneously, enabling better accuracy.
|
9 |
+
|
10 |
+
The model can be used both for Semantic Textual Similarity and re-ranking.
|
11 |
+
|
12 |
+
**Semantic Textual Similarity**: The model takes two input sentences and evaluates how similar their meanings are.
|
13 |
+
|
14 |
+
```python
|
15 |
+
from sentence_transformers import CrossEncoder
|
16 |
+
|
17 |
+
model = CrossEncoder('ctu-aic/CE-fernet-c5-sfle256 ', max_length=256)
|
18 |
+
|
19 |
+
scores = model.predict([["sentence_1", "sentence_2"]])
|
20 |
+
print(scores)
|
21 |
+
|
22 |
+
```
|
23 |
+
|
24 |
+
**Re-ranking task**: Given a query, the model assesses all potential passages and ranks them in descending order of relevance.
|
25 |
+
|
26 |
+
|
27 |
+
```python
|
28 |
+
from sentence_transformers import CrossEncoder
|
29 |
+
|
30 |
+
model = CrossEncoder('ctu-aic/CE-fernet-c5-sfle256 ', max_length=256)
|
31 |
+
|
32 |
+
query = "Example query for."
|
33 |
+
|
34 |
+
documents = [
|
35 |
+
"Example document one.",
|
36 |
+
"Example document two.",
|
37 |
+
"Example document three."
|
38 |
+
]
|
39 |
+
|
40 |
+
top_k = 3
|
41 |
+
return_documents = True
|
42 |
+
|
43 |
+
results = model.rank(
|
44 |
+
query=query,
|
45 |
+
documents=documents,
|
46 |
+
top_k=top_k,
|
47 |
+
return_documents=return_documents
|
48 |
+
)
|
49 |
+
|
50 |
+
for i, res in enumerate(results):
|
51 |
+
print(f"{i+1}. {res['text']}")
|
52 |
+
```
|