
# alime-reranker-large-zh

The alime reranker model.

# Usage
```python

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

pairs = [["西湖在哪？", "西湖风景名胜区位于浙江省杭州市"],["今天天气不错","你吓死我了"]]

if torch.cuda.is_available():
    device = torch.device("cuda")
else:
    device = torch.device("cpu")

tokenizer = AutoTokenizer.from_pretrained("Pristinenlp/alime-reranker-large-zh")
model = AutoModelForSequenceClassification.from_pretrained("Pristinenlp/alime-reranker-large-zh").to(device)

inputs = tokenizer(pairs, padding=True, truncation=True, return_tensors='pt', max_length=512).to(device)
scores = model(**inputs, return_dict=True).logits.view(-1, ).float()
print(scores.tolist())

```
{"tags": ["mteb"], "model-index": [{"name": "alime-reranker-large-zh", "results": [{"task": {"type": "Reranking"}, "dataset": {"name": "MTEB CMedQAv1", "type": "C-MTEB/CMedQAv1-reranking", "config": "default", "split": "test", "revision": "None"}, "metrics": [{"type": "map", "value": 82.32176162633382}, {"type": "mrr", "value": 84.91440476190478}]}, {"task": {"type": "Reranking"}, "dataset": {"name": "MTEB CMedQAv2", "type": "C-MTEB/CMedQAv2-reranking", "config": "default", "split": "test", "revision": "None"}, "metrics": [{"type": "map", "value": 84.08586457179406}, {"type": "mrr", "value": 86.9011507936508}]}, {"task": {"type": "Reranking"}, "dataset": {"name": "MTEB MMarcoReranking", "type": "C-MTEB/Mmarco-reranking", "config": "default", "split": "dev", "revision": "None"}, "metrics": [{"type": "map", "value": 35.497382125464284}, {"type": "mrr", "value": 35.29206349206349}]}, {"task": {"type": "Reranking"}, "dataset": {"name": "MTEB T2Reranking", "type": "C-MTEB/T2Reranking", "config": "default", "split": "dev", "revision": "None"}, "metrics": [{"type": "map", "value": 68.25849742148222}, {"type": "mrr", "value": 78.64202157956387}]}]}]}
transformers pytorch xlm-roberta text-classification mteb model-index autotrain_compatible endpoints_compatible has_space region:us