File size: 1,065 Bytes
0d67717
 
3d319f0
 
0d67717
3d319f0
 
 
 
0a3e1a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
license: cc-by-sa-4.0
language:
- pl
---
Part of **BEIR-PL: Zero Shot Information Retrieval Benchmark for the Polish Language**.

Link to arxiv: https://arxiv.org/pdf/2305.19840.pdf

Contact: [email protected]


How to use:

With sentence transformers:
```
from sentence_transformers import CrossEncoder
model_path = "clarin-knext/herbert-base-reranker-msmarco"
model = CrossEncoder(model_path, max_length=512)
scores = model.predict([('Query', 'Paragraph1'), ('Query', 'Paragraph2') , ('Query', 'Paragraph3')])
```

With transformers:
```
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_path = "clarin-knext/herbert-base-reranker-msmarco"
model = AutoModelForSequenceClassification.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
features = tokenizer(['Jakie miasto jest stolica Polski?', 'Stolicą Polski jest Warszawa.'],  padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
    scores = model(**features).logits
    print(scores)
```