Downloads · 30 days
1.1K
8% of all-time downloads
sdadas/mmlw-retrieval-e5-large
mmlw-retrieval-e5-large is a sentence similarity model from sdadas. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
<h1 align="center"MMLW-retrieval-e5-large</h1
Downloads · 30 days
1.1K
8% of all-time downloads
All-time downloads
14.2K
Public
Parameters
560M
3.4 GB on disk
Likes
3
Public
Click a slice to open those files.
.bin1.1 GB · 50%
From the Hugging Face model README
MMLW (muszę mieć lepszą wiadomość) are neural text encoders for Polish. This model is optimized for information retrieval tasks. It can transform queries and passages to 1024 dimensional vectors. The model was developed using a two-step procedure:
⚠️ 2023-12-26: We have updated the model to a new version with improved results. You can still download the previous version using the v1 tag: AutoModel.from_pretrained("sdadas/mmlw-retrieval-e5-large", revision="v1") ⚠️
⚠️ Our dense retrievers require the use of specific prefixes and suffixes when encoding texts. For this model, queries should be prefixed with "query: " and passages with "passage: " ⚠️
You can use the model like this with sentence-transformers:
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
query_prefix = "query: "
answer_prefix = "passage: "
queries = [query_prefix + "Jak dożyć 100 lat?"]
answers = [
answer_prefix + "Trzeba zdrowo się odżywiać i uprawiać sport.",
answer_prefix + "Trzeba pić alkohol, imprezować i jeździć szybkimi autami.",
answer_prefix + "Gdy trwała kampania politycy zapewniali, że rozprawią się z zakazem niedzielnego handlu."
]
model = SentenceTransformer("sdadas/mmlw-retrieval-e5-large")
queries_emb = model.encode(queries, convert_to_tensor=True, show_progress_bar=False)
answers_emb = model.encode(answers, convert_to_tensor=True, show_progress_bar=False)
best_answer = cos_sim(queries_emb, answers_emb).argmax().item()
print(answers[best_answer])
# Trzeba zdrowo się odżywiać i uprawiać sport.
The model achieves NDCG@10 of 58.30 on the Polish Information Retrieval Benchmark. See PIRB Leaderboard for detailed results.
This model was trained with the A100 GPU cluster support delivered by the Gdansk University of Technology within the TASK center initiative.
@inproceedings{dadas2024pirb,
title={PIRB: A Comprehensive Benchmark of Polish Dense and Hybrid Text Retrieval Methods},
author={Dadas, Slawomir and Pere{\l}kiewicz, Micha{\l} and Po{\'s}wiata, Rafa{\l}},
booktitle={Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
pages={12761--12774},
year={2024}
}