Text Ranking
sentence-transformers
Safetensors
modernbert
cross-encoder
Generated from Trainer
dataset_size:554403
loss:BinaryCrossEntropyLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use Janari01/reranker-ModernBERT-base-s2orc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Janari01/reranker-ModernBERT-base-s2orc with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("Janari01/reranker-ModernBERT-base-s2orc") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
metadata
tags:
- sentence-transformers
- cross-encoder
- generated_from_trainer
- dataset_size:554403
- loss:BinaryCrossEntropyLoss
base_model: answerdotai/ModernBERT-base
pipeline_tag: text-ranking
library_name: sentence-transformers
metrics:
- map
- mrr@10
- ndcg@10
model-index:
- name: CrossEncoder based on answerdotai/ModernBERT-base
results:
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: s2orc dev
type: s2orc-dev
metrics:
- type: map
value: 0.8712
name: Map
- type: mrr@10
value: 0.8711
name: Mrr@10
- type: ndcg@10
value: 0.8765
name: Ndcg@10
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: NanoMSMARCO R100
type: NanoMSMARCO_R100
metrics:
- type: map
value: 0.4941
name: Map
- type: mrr@10
value: 0.482
name: Mrr@10
- type: ndcg@10
value: 0.5529
name: Ndcg@10
- task:
type: cross-encoder-nano-beir
name: Cross Encoder Nano BEIR
dataset:
name: NanoBEIR R100 mean
type: NanoBEIR_R100_mean
metrics:
- type: map
value: 0.4941
name: Map
- type: mrr@10
value: 0.482
name: Mrr@10
- type: ndcg@10
value: 0.5529
name: Ndcg@10
CrossEncoder based on answerdotai/ModernBERT-base
This is a Cross Encoder model finetuned from answerdotai/ModernBERT-base using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
Model Details
Model Description
- Model Type: Cross Encoder
- Base model: answerdotai/ModernBERT-base
- Maximum Sequence Length: 8192 tokens
- Number of Output Labels: 1 label
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Cross Encoder Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Cross Encoders on Hugging Face
Usage
Direct Usage (Sentence Transformers)
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("Janari01/reranker-ModernBERT-base-s2orc")
# Get scores for pairs of texts
pairs = [
["Engineering students' understanding of the role of experimentation", 'Resource constraints have forced engineering schools to reduce laboratory provisions in undergraduate courses. In many instances hands-on experimentation has been replaced by demonstrations or computer simulations. Many engineering educators have cautioned against replacing experiments with simulations on the basis that this will lead to a misunderstanding of the role of experimentation in engineering practice. However, little is known about how students conceptualize the role of experimentation in developing engineering understanding. This study is based on interviews with third-year mechanical engineering students. Findings are presented on their perceptions in relation to the role of experimentation in developing engineering knowledge and practice.'],
["Engineering students' understanding of the role of experimentation", '"Excellent engineer training plan"was a core problem for cultivating students\' engineering ability,but at present the students in engineering ability and the enterprise demand disjointed phenomenon had more commons.Based on process equipment and control engineering as an example,for the general undergraduate colleges and universities to cultivate students\' engineering ability and enterprise demand disjointed phenomenon and the existing problems were analyzed,and the relevant approach was put forward,in order to improve students\' engineering ability to provide reference ideas.'],
["Engineering students' understanding of the role of experimentation", 'This paper contributes to the discussion of pedagogical training of engineering teachers based on a case study carried out in higher education institutions in Brazil, namely in Electrical Engineering. For this purpose, the authors chose to articulate two research methods: document analysis of the courses offered in the postgraduate programs (Master and PhD) in Electrical Engineering and a survey conducted with students and teachers from 58 of these postgraduate electrical engineering programs. The data analysis indicated that most of the teachers agreed that pedagogical training should be offered to engineering students. Postgraduate students also showed interest in enrolling courses with pedagogic focus. With this analysis we can state that there is a need to rethink engineering education, in order to create conditions for the development of competences related with teaching and learning innovation. This study shows the needs and presents some recommendations to deal with these issues in this field.'],
["Engineering students' understanding of the role of experimentation", 'Engineering practical teaching reform in higher institutions centers on improving students’ comprehensive quality,developing their innovative spirit and engineering practice ability,building teaching system for engineering training and demonstration center for engineering training.The article implements practical teaching reform on metalworking practice and electronic practice and provides students with a platform for integrated engineering training,leading them toward competence,quality and innovation development.'],
["Engineering students' understanding of the role of experimentation", 'Lisa Benson is an Associate Professor of Engineering and Science Education at Clemson University, with a joint appointment in Bioengineering. Her research focuses on the interactions between student motivation and their learning experiences. Her projects involve the study of student perceptions, beliefs and attitudes towards becoming engineers and scientists, and their problem solving processes. Other projects in the Benson group include effects of student-centered active learning, self-regulated learning, and incorporating engineering into secondary science and mathematics classrooms. Her education includes a B.S. in Bioengineering from the University of Vermont, and M.S. and Ph.D. in Bioengineering from Clemson University.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
"Engineering students' understanding of the role of experimentation",
[
'Resource constraints have forced engineering schools to reduce laboratory provisions in undergraduate courses. In many instances hands-on experimentation has been replaced by demonstrations or computer simulations. Many engineering educators have cautioned against replacing experiments with simulations on the basis that this will lead to a misunderstanding of the role of experimentation in engineering practice. However, little is known about how students conceptualize the role of experimentation in developing engineering understanding. This study is based on interviews with third-year mechanical engineering students. Findings are presented on their perceptions in relation to the role of experimentation in developing engineering knowledge and practice.',
'"Excellent engineer training plan"was a core problem for cultivating students\' engineering ability,but at present the students in engineering ability and the enterprise demand disjointed phenomenon had more commons.Based on process equipment and control engineering as an example,for the general undergraduate colleges and universities to cultivate students\' engineering ability and enterprise demand disjointed phenomenon and the existing problems were analyzed,and the relevant approach was put forward,in order to improve students\' engineering ability to provide reference ideas.',
'This paper contributes to the discussion of pedagogical training of engineering teachers based on a case study carried out in higher education institutions in Brazil, namely in Electrical Engineering. For this purpose, the authors chose to articulate two research methods: document analysis of the courses offered in the postgraduate programs (Master and PhD) in Electrical Engineering and a survey conducted with students and teachers from 58 of these postgraduate electrical engineering programs. The data analysis indicated that most of the teachers agreed that pedagogical training should be offered to engineering students. Postgraduate students also showed interest in enrolling courses with pedagogic focus. With this analysis we can state that there is a need to rethink engineering education, in order to create conditions for the development of competences related with teaching and learning innovation. This study shows the needs and presents some recommendations to deal with these issues in this field.',
'Engineering practical teaching reform in higher institutions centers on improving students’ comprehensive quality,developing their innovative spirit and engineering practice ability,building teaching system for engineering training and demonstration center for engineering training.The article implements practical teaching reform on metalworking practice and electronic practice and provides students with a platform for integrated engineering training,leading them toward competence,quality and innovation development.',
'Lisa Benson is an Associate Professor of Engineering and Science Education at Clemson University, with a joint appointment in Bioengineering. Her research focuses on the interactions between student motivation and their learning experiences. Her projects involve the study of student perceptions, beliefs and attitudes towards becoming engineers and scientists, and their problem solving processes. Other projects in the Benson group include effects of student-centered active learning, self-regulated learning, and incorporating engineering into secondary science and mathematics classrooms. Her education includes a B.S. in Bioengineering from the University of Vermont, and M.S. and Ph.D. in Bioengineering from Clemson University.',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
Evaluation
Metrics
Cross Encoder Reranking
- Dataset:
s2orc-dev - Evaluated with
CrossEncoderRerankingEvaluatorwith these parameters:{ "at_k": 10, "always_rerank_positives": false }
| Metric | Value |
|---|---|
| map | 0.8712 (+0.1333) |
| mrr@10 | 0.8711 (+0.1351) |
| ndcg@10 | 0.8765 (+0.1106) |
Cross Encoder Reranking
- Dataset:
NanoMSMARCO_R100 - Evaluated with
CrossEncoderRerankingEvaluatorwith these parameters:{ "at_k": 10, "always_rerank_positives": true }
| Metric | Value |
|---|---|
| map | 0.4941 (+0.0045) |
| mrr@10 | 0.4820 (+0.0045) |
| ndcg@10 | 0.5529 (+0.0124) |
Cross Encoder Nano BEIR
- Dataset:
NanoBEIR_R100_mean - Evaluated with
CrossEncoderNanoBEIREvaluatorwith these parameters:{ "dataset_names": [ "msmarco" ], "rerank_k": 100, "at_k": 10, "always_rerank_positives": true }
| Metric | Value |
|---|---|
| map | 0.4941 (+0.0045) |
| mrr@10 | 0.4820 (+0.0045) |
| ndcg@10 | 0.5529 (+0.0124) |
Training Details
Training Dataset
Unnamed Dataset
- Size: 554,403 training samples
- Columns:
title,abstract, andlabel - Approximate statistics based on the first 1000 samples:
title abstract label type string string int details - min: 33 characters
- mean: 83.77 characters
- max: 162 characters
- min: 91 characters
- mean: 678.94 characters
- max: 1023 characters
- 0: ~81.80%
- 1: ~18.20%
- Samples:
title abstract label Engineering students' understanding of the role of experimentationResource constraints have forced engineering schools to reduce laboratory provisions in undergraduate courses. In many instances hands-on experimentation has been replaced by demonstrations or computer simulations. Many engineering educators have cautioned against replacing experiments with simulations on the basis that this will lead to a misunderstanding of the role of experimentation in engineering practice. However, little is known about how students conceptualize the role of experimentation in developing engineering understanding. This study is based on interviews with third-year mechanical engineering students. Findings are presented on their perceptions in relation to the role of experimentation in developing engineering knowledge and practice.1Engineering students' understanding of the role of experimentation"Excellent engineer training plan"was a core problem for cultivating students' engineering ability,but at present the students in engineering ability and the enterprise demand disjointed phenomenon had more commons.Based on process equipment and control engineering as an example,for the general undergraduate colleges and universities to cultivate students' engineering ability and enterprise demand disjointed phenomenon and the existing problems were analyzed,and the relevant approach was put forward,in order to improve students' engineering ability to provide reference ideas.0Engineering students' understanding of the role of experimentationThis paper contributes to the discussion of pedagogical training of engineering teachers based on a case study carried out in higher education institutions in Brazil, namely in Electrical Engineering. For this purpose, the authors chose to articulate two research methods: document analysis of the courses offered in the postgraduate programs (Master and PhD) in Electrical Engineering and a survey conducted with students and teachers from 58 of these postgraduate electrical engineering programs. The data analysis indicated that most of the teachers agreed that pedagogical training should be offered to engineering students. Postgraduate students also showed interest in enrolling courses with pedagogic focus. With this analysis we can state that there is a need to rethink engineering education, in order to create conditions for the development of competences related with teaching and learning innovation. This study shows the needs and presents some recommendations to deal with these issues...0 - Loss:
BinaryCrossEntropyLosswith these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": 5 }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1seed: 12bf16: Truedataloader_num_workers: 6load_best_model_at_end: True
All Hyperparameters
Click to expand
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_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: 12data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Truefp16: 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: 6dataloader_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: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_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
| Epoch | Step | Training Loss | s2orc-dev_ndcg@10 | NanoMSMARCO_R100_ndcg@10 | NanoBEIR_R100_mean_ndcg@10 |
|---|---|---|---|---|---|
| -1 | -1 | - | 0.1165 (-0.6495) | 0.0426 (-0.4978) | 0.0426 (-0.4978) |
| 0.0000 | 1 | 1.0682 | - | - | - |
| 0.0144 | 500 | 1.1555 | - | - | - |
| 0.0289 | 1000 | 0.7743 | - | - | - |
| 0.0433 | 1500 | 0.538 | - | - | - |
| 0.0577 | 2000 | 0.5771 | - | - | - |
| 0.0721 | 2500 | 0.5345 | - | - | - |
| 0.0866 | 3000 | 0.4394 | - | - | - |
| 0.1010 | 3500 | 0.4607 | - | - | - |
| 0.1154 | 4000 | 0.3866 | 0.8685 (+0.1025) | 0.5469 (+0.0064) | 0.5469 (+0.0064) |
| 0.1299 | 4500 | 0.4222 | - | - | - |
| 0.1443 | 5000 | 0.3734 | - | - | - |
| 0.1587 | 5500 | 0.3558 | - | - | - |
| 0.1732 | 6000 | 0.3968 | - | - | - |
| 0.1876 | 6500 | 0.3203 | - | - | - |
| 0.2020 | 7000 | 0.3354 | - | - | - |
| 0.2164 | 7500 | 0.3579 | - | - | - |
| 0.2309 | 8000 | 0.3349 | 0.8765 (+0.1106) | 0.5529 (+0.0124) | 0.5529 (+0.0124) |
Framework Versions
- Python: 3.9.13
- Sentence Transformers: 4.1.0
- Transformers: 4.52.4
- PyTorch: 2.7.1+cu118
- Accelerate: 1.7.0
- Datasets: 3.6.0
- Tokenizers: 0.21.1
Citation
BibTeX
Sentence Transformers
@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",
}