Downloads · 30 days
8
1% of all-time downloads
carles-undergrad-thesis/indobert-crossencoder-mmarco
indobert-crossencoder-mmarco is a text classification model from carles-undergrad-thesis. Use it when you need a label for a piece of text. It is set up for transformers.
This is a Cross-Encoder model for ID that can be used for passage re-ranking. It was trained on the multilingual version of MS Marco Passage Ranking task.
Downloads · 30 days
8
1% of all-time downloads
All-time downloads
926
Public
Repo size
885 MB
Likes
0
Public
Click a slice to open those files.
.bin442 MB · 100%
From the Hugging Face model README
This is a Cross-Encoder model for ID that can be used for passage re-ranking. It was trained on the multilingual version of MS Marco Passage Ranking task.
The model can be used for Information Retrieval: See SBERT.net Retrieve & Re-rank.
When you have SentenceTransformers installed, you can use the model like this:
from sentence_transformers import CrossEncoder
model = CrossEncoder('model_name', max_length=512)
query = 'How many people live in Berlin?'
docs = ['Berlin has a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.', 'New York City is famous for the Metropolitan Museum of Art.']
pairs = [(query, doc) for doc in docs]
scores = model.predict(pairs)
With the transformers library, you can use the model like this:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained('model_name')
tokenizer = AutoTokenizer.from_pretrained('model_name')
features = tokenizer(['How many people live in Berlin?', 'How many people live in Berlin?'], ['Berlin has a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.', 'New York City is famous for the Metropolitan Museum of Art.'], padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
scores = model(**features).logits
print(scores)
| Model | Mmarco Dev | MrTyDi Test | Miracal Test | |||
|---|---|---|---|---|---|---|
| MRR@10 | R@1000 | MRR@10 | R@1000 | NCDG@10 | R@1K | |
| $\text{BM25 (Elastic Search)}$ | .114 | .642 | .279 | .858 | .391 | .971 |
| $\text{IndoBERT}_{\text{CAT}}$ | .181 | .642 | .447 | .858 | .455 | .971 |