sentence-transformers/natural-questions
Viewer • Updated • 100k • 3k • 45
How to use cnmoro/inference-free-splade-co-condenser-en-ptbr-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("cnmoro/inference-free-splade-co-condenser-en-ptbr-v2")
sentences = [
"That is a happy person",
"That is a happy dog",
"That is a very happy person",
"Today is a sunny day"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This model is a sparse retriever trained with Sentence Transformers' SPLADE stack, using a merged multilingual corpus (English + Portuguese).
from sentence_transformers import SparseEncoder
sparse_model = SparseEncoder("cnmoro/inference-free-splade-co-condenser-en-ptbr-v2")
sparse_embeddings = sparse_model.encode(["Hello", "World"], show_progress_bar=True)
Luyu/co-condenser-marcoThe training corpus was built by row-wise concatenation of:
sentence-transformers/natural-questionscnmoro/GPT4-500k-Augmented-PTBR-Cleancnmoro/WizardVicuna-PTBR-Instruct-CleanFinal merged size:
12SpladeLoss(SparseMultipleNegativesRankingLoss)0.0302e-50.1fp16=TrueNO_DUPLICATESquery -> query, answer -> documentlearning_rate: 2e-05lr_scheduler_type: cosinewarmup_steps: 0.1weight_decay: 0.01gradient_accumulation_steps: 4max_grad_norm: 5.0fp16: Truedisable_tqdm: Truedataloader_num_workers: 4batch_sampler: no_duplicatesrouter_mapping: {'query': 'query', 'answer': 'document'}learning_rate_mapping: {'\.query\.0\.': 0.001}@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
@misc{formal2022distillationhardnegativesampling,
title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and Stéphane Clinchant},
year={2022},
eprint={2205.04733},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2205.04733},
}
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}
@article{paria2020minimizing,
title={Minimizing flops to learn efficient sparse representations},
author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
journal={arXiv preprint arXiv:2004.05665},
year={2020}
}
Base model
Luyu/co-condenser-marco