Downloads · 30 days
214
16% of all-time downloads
redis/langcache-reranker-v2-mnrl
langcache-reranker-v2-mnrl is a text ranking model from redis. Use it for the text ranking task on the model card, and read the license before you ship it in a product. It is set up for sentence-transformers. The card lists the license as apache-2.0.
This is a Cross Encoder model finetuned from Alibaba-NLP/gte-reranker-modernbert-base on the [LangCache Sentence Pairs (subsets=['all'], train+val=True)](https://huggingface.co/datasets/aditeyabaral-redis/langcache-se…
Downloads · 30 days
214
16% of all-time downloads
All-time downloads
1.3K
Public
Parameters
150M
14.1 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors299 MB · 99%
From the Hugging Face model README
This is a Cross Encoder model finetuned from Alibaba-NLP/gte-reranker-modernbert-base on the LangCache Sentence Pairs (subsets=['all'], train+val=True) dataset using the sentence-transformers library. It computes scores for pairs of texts, which can be used for sentence pair classification.
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import CrossEncoder
# Download from the 🤗 Hub
model = CrossEncoder("redis/langcache-reranker-v2-softmnrl-triplet")
# Get scores for pairs of texts
pairs = [
[' What high potential jobs are there other than computer science?', ' What high potential jobs are there other than computer science?'],
[' Would India ever be able to develop a missile system like S300 or S400 missile?', ' Would India ever be able to develop a missile system like S300 or S400 missile?'],
[' water from the faucet is being drunk by a yellow dog', 'A yellow dog is drinking water from the faucet'],
[' water from the faucet is being drunk by a yellow dog', 'The yellow dog is drinking water from a bottle'],
['! colspan = `` 14 `` `` Players who appeared for Colchester who left during the season ``', '! colspan = `` 14 `` `` Players who appeared for Colchester who left during the season ``'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
' What high potential jobs are there other than computer science?',
[
' What high potential jobs are there other than computer science?',
' Would India ever be able to develop a missile system like S300 or S400 missile?',
'A yellow dog is drinking water from the faucet',
'The yellow dog is drinking water from a bottle',
'! colspan = `` 14 `` `` Players who appeared for Colchester who left during the season ``',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
| anchor | positive | negative_1 | |
|---|---|---|---|
| type | string | string | string |
| details | <ul><li>min: 6 characters</li><li>mean: 55.35 characters</li><li>max: 1131 characters</li></ul> | <ul><li>min: 5 characters</li><li>mean: 55.02 characters</li><li>max: 1131 characters</li></ul> | <ul><li>min: 8 characters</li><li>mean: 76.33 characters</li><li>max: 560 characters</li></ul> |
| anchor | positive | negative_1 |
|---|---|---|
| <code><br>"There aren't many places in Gold Coast where you can find a wide variety of wedding dresses."</code> | <code><br>"There aren't many places in Gold Coast where you can find a wide variety of wedding dresses."</code> | <code>Where can I get a wide variety of wedding dresses in Gold Coast?</code> |
| <code><br>It's easy to say it's good having siblings, but people often suggest it as a universal truth without considering that not everyone enjoys sibling relationships. Having siblings can lead to conflicts, competition, and stress, which might overshadow any potential benefits like companionship or support. Additionally, individual experiences with siblings can vary greatly depending on personality, family dynamics, and cultural background.</code> | <code><br>It's easy to say it's good having siblings, but people often suggest it as a universal truth without considering that not everyone enjoys sibling relationships. Having siblings can lead to conflicts, competition, and stress, which might overshadow any potential benefits like companionship or support. Additionally, individual experiences with siblings can vary greatly depending on personality, family dynamics, and cultural background.</code> | <code>What's it like having siblings?</code> |
| <code><br>To reconcile the idea that 'Education is the Key to Success' with the presence of underemployed graduates and successful criminals, it's important to emphasize that education is one among many factors that contribute to success. Education equips individuals with knowledge, critical thinking skills, and problem-solving abilities, which are essential tools for navigating life's challenges and seizing opportunities. However, success is also influenced by other elements such as personal drive, social connections, opportunities presented, and sometimes sheer luck. Education does not guarantee success on its own; rather, it provides a foundation upon which individuals can build their careers and personal lives. Additionally, the definition of success can be subjective and varies across different cultures and individuals. It's crucial to address practical considerations like ensuring that educational curricula are relevant to the current job market and fostering environments where both hard ...</code> | <code><br>To reconcile the idea that 'Education is the Key to Success' with the presence of underemployed graduates and successful criminals, it's important to emphasize that education is one among many factors that contribute to success. Education equips individuals with knowledge, critical thinking skills, and problem-solving abilities, which are essential tools for navigating life's challenges and seizing opportunities. However, success is also influenced by other elements such as personal drive, social connections, opportunities presented, and sometimes sheer luck. Education does not guarantee success on its own; rather, it provides a foundation upon which individuals can build their careers and personal lives. Additionally, the definition of success can be subjective and varies across different cultures and individuals. It's crucial to address practical considerations like ensuring that educational curricula are relevant to the current job market and fostering environments where both hard ...</code> | <code>How do you convince the upcoming generation that "Education is The Key of Success " when we are surrounded by poor graduates and rich criminals?</code> |
{
"scale": 20.0,
"num_negatives": 1,
"activation_fn": "torch.nn.modules.activation.Sigmoid"
}
| anchor | positive | negative_1 | |
|---|---|---|---|
| type | string | string | string |
| details | <ul><li>min: 3 characters</li><li>mean: 96.44 characters</li><li>max: 314 characters</li></ul> | <ul><li>min: 3 characters</li><li>mean: 95.52 characters</li><li>max: 314 characters</li></ul> | <ul><li>min: 10 characters</li><li>mean: 72.75 characters</li><li>max: 244 characters</li></ul> |
| anchor | positive | negative_1 |
|---|---|---|
| <code> What high potential jobs are there other than computer science?</code> | <code> What high potential jobs are there other than computer science?</code> | <code>Why IT or Computer Science jobs are being over rated than other Engineering jobs?</code> |
| <code> Would India ever be able to develop a missile system like S300 or S400 missile?</code> | <code> Would India ever be able to develop a missile system like S300 or S400 missile?</code> | <code>Should India buy the Russian S400 air defence missile system?</code> |
| <code> water from the faucet is being drunk by a yellow dog</code> | <code>A yellow dog is drinking water from the faucet</code> | <code>Childlessness is low in Eastern European countries.</code> |
{
"scale": 20.0,
"num_negatives": 1,
"activation_fn": "torch.nn.modules.activation.Sigmoid"
}
@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",
}
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->