Langcache Crossencoder V1 Ms Marco MiniLM L12 V2
A CrossEncoder model based on the Transformer architecture, fine-tuned on the Quora question pair dataset, used to calculate scores for text pairs, suitable for semantic similarity and semantic search tasks.
Downloads 281
Release Time : 6/19/2025
Model Overview
This model is a CrossEncoder model based on the Transformer architecture, fine-tuned on the Quora question pair dataset. It can calculate scores for text pairs and is suitable for sentence pair classification tasks, which is of great value in scenarios such as semantic similarity and semantic search.
Model Features
Fine-tuning on Quora question pairs
Fine-tuned on the Quora question pair dataset, specifically optimizing the ability to judge the semantic similarity of question pairs
Multi-task support
Suitable for various tasks such as text ranking, sentence pair classification, and semantic similarity calculation
Efficient inference
Based on the MiniLM architecture, providing efficient inference speed while maintaining performance
Model Capabilities
Calculate the similarity score of text pairs
Semantic similarity judgment
Question pair classification
Text sorting
Use Cases
Q&A system
Duplicate question detection
Identify duplicate or similar questions on Q&A platforms such as Quora
Accuracy: 68.01%, F1 score: 56.99%
Information retrieval
Semantic search
Sort search results based on semantic similarity
Mean average precision: 58.77%
🚀 Redis semantic caching CrossEncoder model fine-tuned on Quora Question Pairs
This is a Cross Encoder model that addresses the need for accurate semantic similarity scoring between sentence pairs. It's fine - tuned from a pre - existing model, offering enhanced performance for tasks like sentence - pair classification and semantic search.
🚀 Quick Start
Direct Usage (Sentence Transformers)
First, you need to 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("aditeyabaral-redis/langcache-crossencoder-v1-ms-marco-MiniLM-L12-v2")
# Get scores for pairs of texts
pairs = [
['How can I get a list of my Gmail accounts?', 'How can I find all my old Gmail accounts?'],
['How can I stop Quora from modifying and editing other people’s questions on Quora?', 'Can I prevent a Quora user from editing my question on Quora?'],
['How much does it cost to design a logo in india?', 'How much does it cost to design a logo?'],
['What is screenedrenters.com?', 'What is allmyapps.com?'],
['What are the best colleges for an MBA in Australia?', 'What are the top MBA schools in Australia?'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'How can I get a list of my Gmail accounts?',
[
'How can I find all my old Gmail accounts?',
'Can I prevent a Quora user from editing my question on Quora?',
'How much does it cost to design a logo?',
'What is allmyapps.com?',
'What are the top MBA schools in Australia?',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
✨ Features
- Cross - Encoder Classification: Capable of performing cross - encoder classification tasks, which is useful for determining the relationship between sentence pairs.
- Multiple Metrics: Evaluated using multiple metrics such as accuracy, F1 score, precision, recall, and average precision, ensuring comprehensive performance assessment.
📦 Model Details
Model Description
Property | Details |
---|---|
Model Type | Cross Encoder |
Base model | [cross - encoder/ms - marco - MiniLM - L12 - v2](https://huggingface.co/cross - encoder/ms - marco - MiniLM - L12 - v2) |
Maximum Sequence Length | 512 tokens |
Number of Output Labels | 1 label |
Training Dataset | Quora Question Pairs LangCache Train Set |
Language | en |
License | apache - 2.0 |
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Cross Encoder Documentation
- Repository: [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence - transformers)
- Hugging Face: [Cross Encoders on Hugging Face](https://huggingface.co/models?library=sentence - transformers&other=cross - encoder)
📚 Evaluation
Metrics
Cross Encoder Classification
- Dataset:
quora - eval
- Evaluated with
CrossEncoderClassificationEvaluator
Metric | Value |
---|---|
accuracy | 0.6801 |
accuracy_threshold | 3.2522 |
f1 | 0.5699 |
f1_threshold | 2.8498 |
precision | 0.4213 |
recall | 0.8806 |
average_precision | 0.5877 |
🔧 Training Details
Training Dataset
Quora Question Pairs LangCache Train Set
- Dataset: Quora Question Pairs LangCache Train Set
- Size: 363,861 training samples
- Columns:
sentence1
,sentence2
, andlabel
- Approximate statistics based on the first 1000 samples:
sentence1 sentence2 label type string string int details - min: 15 characters
- mean: 60.22 characters
- max: 229 characters
- min: 14 characters
- mean: 60.0 characters
- max: 274 characters
- 0: ~63.50%
- 1: ~36.50%
- Samples:
sentence1 sentence2 label Why do people believe in God and how can they say he/she exists?
Why do we kill each other in the name of God?
0
What are the chances of a bee sting when a bee buzzes around you?
How can I tell if my bees are agitated/likely to sting?
0
If a man from Syro Malankara church marries a Syro - Malabar girl, can they join a Syro - Malabar parish?
Is Malabar Hills of Mumbai anyhow related to Malabar of Kerala?
0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Evaluation Dataset
Quora Question Pairs LangCache Validation Set
- Dataset: Quora Question Pairs LangCache Validation Set
- Size: 40,429 evaluation samples
- Columns:
sentence1
,sentence2
, andlabel
- Approximate statistics based on the first 1000 samples:
sentence1 sentence2 label type string string int details - min: 13 characters
- mean: 59.91 characters
- max: 266 characters
- min: 13 characters
- mean: 59.51 characters
- max: 293 characters
- 0: ~63.80%
- 1: ~36.20%
- Samples:
sentence1 sentence2 label How can I get a list of my Gmail accounts?
How can I find all my old Gmail accounts?
1
How can I stop Quora from modifying and editing other people’s questions on Quora?
Can I prevent a Quora user from editing my question on Quora?
1
How much does it cost to design a logo in india?
How much does it cost to design a logo?
0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Training Hyperparameters
Non - Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 64per_device_eval_batch_size
: 64learning_rate
: 0.0002num_train_epochs
: 15load_best_model_at_end
: Truepush_to_hub
: Truehub_model_id
: aditeyabaral - redis/langcache - crossencoder - v1 - ms - marco - MiniLM - L12 - v2
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 64per_device_eval_batch_size
: 64per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 0.0002weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e - 08max_grad_norm
: 1.0num_train_epochs
: 15max_steps
: - 1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.0warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Falsefp16
: Falsefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 0dataloader_prefetch_factor
: Nonepast_index
: - 1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Trueignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Trueresume_from_checkpoint
: Nonehub_model_id
: aditeyabaral - redis/langcache - crossencoder - v1 - ms - marco - MiniLM - L12 - v2hub_strategy
: every_savehub_private_repo
: Nonehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseinclude_for_metrics
: []eval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falseaverage_tokens_across_devices
: Falseprompts
: Nonebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: proportional
Training Logs
Click to expand
Epoch | Step | Training Loss | Validation Loss | quora - eval_average_precision |
---|---|---|---|---|
0.0879 | 500 | 0.3912 | 0.3494 | 0.5710 |
0.1759 | 1000 | 0.3467 | 0.3193 | 0.5648 |
0.2638 | 1500 | 0.3403 | 0.3179 | 0.5698 |
0.3517 | 2000 | 0.3348 | 0.3045 | 0.6115 |
0.4397 | 2500 | 0.3275 | 0.3143 | 0.6306 |
0.5276 | 3000 | 0.3153 | 0.3034 | 0.5772 |
0.6155 | 3500 | 0.3196 | 0.2990 | 0.5759 |
0.7035 | 4000 | 0.3165 | 0.2924 | 0.5700 |
0.7914 | 4500 | 0.3052 | 0.2987 | 0.6343 |
0.8794 | 5000 | 0.3131 | 0.3184 | 0.5388 |
0.9673 | 5500 | 0.3053 | 0.2936 | 0.6038 |
1.0552 | 6000 | 0.2782 | 0.3003 | 0.6315 |
1.1432 | 6500 | 0.2599 | 0.2922 | 0.6226 |
1.2311 | 7000 | 0.2661 | 0.3477 | 0.6244 |
1.3190 | 7500 | 0.2578 | 0.3150 | 0.6438 |
1.4070 | 8000 | 0.2644 | 0.2915 | 0.6168 |
1.4949 | 8500 | 0.2635 | 0.2835 | 0.6427 |
1.5828 | 9000 | 0.266 | 0.2880 | 0.6556 |
1.6708 | 9500 | 0.2618 | 0.3050 | 0.6258 |
1.7587 | 10000 | 0.2651 | 0.2815 | 0.6488 |
1.8466 | 10500 | 0.2703 | 0.2803 | 0.5877 |
1.9346 | 11000 | 0.2601 | 0.2925 | 0.5998 |
2.0225 | 11500 | 0.2527 | 0.3401 | 0.6626 |
2.1104 | 12000 | 0.2173 | 0.2813 | 0.6109 |
2.1984 | 12500 | 0.2124 | 0.3034 | 0.6207 |
2.2863 | 13000 | 0.2221 | 0.3097 | 0.6164 |
2.3743 | 13500 | 0.2231 | 0.2929 | 0.5904 |
2.4622 | 14000 | 0.2247 | 0.3355 | 0.5872 |
2.5501 | 14500 | 0.226 | 0.3286 | 0.6354 |
2.6381 | 15000 | 0.2312 | 0.3024 | 0.5988 |
2.7260 | 15500 | 0.2382 | 0.2854 | 0.5627 |
2.8139 | 16000 | 0.2347 | 0.2991 | 0.5965 |
2.9019 | 16500 | 0.2283 | 0.2949 | 0.6256 |
2.9898 | 17000 | 0.2399 | 0.2849 | 0.6317 |
3.0777 | 17500 | 0.2024 | 0.3391 | 0.5659 |
3.1657 | 18000 | 0.1963 | 0.3010 | 0.6274 |
3.2536 | 18500 | 0.1932 | 0.3469 | 0.6255 |
3.3415 | 19000 | 0.2038 | 0.3331 | 0.6052 |
3.4295 | 19500 | 0.2005 | 0.3421 | 0.5648 |
3.5174 | 20000 | 0.2078 | 0.3266 | 0.6189 |
3.6053 | 20500 | 0.2033 | 0.3398 | 0.6279 |
3.6933 | 21000 | 0.2101 | 0.3149 | 0.6106 |
3.7812 | 21500 | 0.2255 | 0.3352 | 0.6362 |
3.8692 | 22000 | 0.2107 | 0.3216 | 0.6295 |
3.9571 | 22500 | 0.2269 | 0.2968 | 0.6251 |
4.0450 | 23000 | 0.2063 | 0.3329 | 0.5968 |
4.1330 | 23500 | 0.1872 | 0.3457 | 0.5843 |
4.2209 | 24000 | 0.1902 | 0.4201 | 0.5722 |
4.3088 | 24500 | 0.2043 | 0.3506 | 0.5670 |
4.3968 | 25000 | 0.1991 | 0.3146 | 0.5807 |
4.4847 | 25500 | 0.2061 | 0.3409 | 0.3265 |
4.5726 | 26000 | 0.2104 | 0.3690 | 0.5509 |
4.6606 | 26500 | 0.2122 | 0.3400 | 0.5678 |
4.7485 | 27000 | 0.213 | ... (truncated for brevity) |
📄 License
This model is licensed under the apache - 2.0 license.
Distilbert Base Uncased Finetuned Sst 2 English
Apache-2.0
Text classification model fine-tuned on the SST-2 sentiment analysis dataset based on DistilBERT-base-uncased, with 91.3% accuracy
Text Classification English
D
distilbert
5.2M
746
Xlm Roberta Base Language Detection
MIT
Multilingual detection model based on XLM-RoBERTa, supporting text classification in 20 languages
Text Classification
Transformers Supports Multiple Languages

X
papluca
2.7M
333
Roberta Hate Speech Dynabench R4 Target
This model improves online hate detection through dynamic dataset generation, focusing on learning from worst-case scenarios to enhance detection effectiveness.
Text Classification
Transformers English

R
facebook
2.0M
80
Bert Base Multilingual Uncased Sentiment
MIT
A multilingual sentiment analysis model fine-tuned based on bert-base-multilingual-uncased, supporting sentiment analysis of product reviews in 6 languages
Text Classification Supports Multiple Languages
B
nlptown
1.8M
371
Emotion English Distilroberta Base
A fine-tuned English text emotion classification model based on DistilRoBERTa-base, capable of predicting Ekman's six basic emotions and neutral category.
Text Classification
Transformers English

E
j-hartmann
1.1M
402
Robertuito Sentiment Analysis
Spanish tweet sentiment analysis model based on RoBERTuito, supporting POS(positive)/NEG(negative)/NEU(neutral) three-class sentiment classification
Text Classification Spanish
R
pysentimiento
1.0M
88
Finbert Tone
FinBERT is a BERT model pre-trained on financial communication texts, specializing in the field of financial natural language processing. finbert-tone is its fine-tuned version for financial sentiment analysis tasks.
Text Classification
Transformers English

F
yiyanghkust
998.46k
178
Roberta Base Go Emotions
MIT
A multi-label sentiment classification model based on RoBERTa-base, trained on the go_emotions dataset, supporting recognition of 28 emotion labels.
Text Classification
Transformers English

R
SamLowe
848.12k
565
Xlm Emo T
XLM-EMO is a multilingual sentiment analysis model fine-tuned based on the XLM-T model, supporting 19 languages and specifically designed for sentiment prediction in social media texts.
Text Classification
Transformers Other

X
MilaNLProc
692.30k
7
Deberta V3 Base Mnli Fever Anli
MIT
DeBERTa-v3 model trained on MultiNLI, Fever-NLI, and ANLI datasets, excelling in zero-shot classification and natural language inference tasks
Text Classification
Transformers English

D
MoritzLaurer
613.93k
204
Featured Recommended AI Models