--- 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](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) using the [sentence-transformers](https://www.SBERT.net) 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](https://huggingface.co/answerdotai/ModernBERT-base) - **Maximum Sequence Length:** 8192 tokens - **Number of Output Labels:** 1 label ### Model Sources - **Documentation:** [Sentence Transformers Documentation](https://sbert.net) - **Documentation:** [Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html) - **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) ## Usage ### Direct Usage (Sentence Transformers) First install the Sentence Transformers library: ```bash pip install -U sentence-transformers ``` Then you can load this model and run inference. ```python 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 [CrossEncoderRerankingEvaluator](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters: ```json { "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 [CrossEncoderRerankingEvaluator](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters: ```json { "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 [CrossEncoderNanoBEIREvaluator](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderNanoBEIREvaluator) with these parameters: ```json { "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, and label * Approximate statistics based on the first 1000 samples: | | title | abstract | label | |:--------|:------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------|:------------------------------------------------| | type | string | string | int | | details | | | | * Samples: | title | abstract | label | |:--------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------| | 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. | 1 | | 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. | 0 | | 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... | 0 | * Loss: [BinaryCrossEntropyLoss](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters: ```json { "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": 5 } ``` ### Training Hyperparameters #### Non-Default Hyperparameters - `eval_strategy`: steps - `per_device_train_batch_size`: 16 - `per_device_eval_batch_size`: 16 - `learning_rate`: 2e-05 - `num_train_epochs`: 1 - `warmup_ratio`: 0.1 - `seed`: 12 - `bf16`: True - `dataloader_num_workers`: 6 - `load_best_model_at_end`: True #### All Hyperparameters
Click to expand - `overwrite_output_dir`: False - `do_predict`: False - `eval_strategy`: steps - `prediction_loss_only`: True - `per_device_train_batch_size`: 16 - `per_device_eval_batch_size`: 16 - `per_gpu_train_batch_size`: None - `per_gpu_eval_batch_size`: None - `gradient_accumulation_steps`: 1 - `eval_accumulation_steps`: None - `torch_empty_cache_steps`: None - `learning_rate`: 2e-05 - `weight_decay`: 0.0 - `adam_beta1`: 0.9 - `adam_beta2`: 0.999 - `adam_epsilon`: 1e-08 - `max_grad_norm`: 1.0 - `num_train_epochs`: 1 - `max_steps`: -1 - `lr_scheduler_type`: linear - `lr_scheduler_kwargs`: {} - `warmup_ratio`: 0.1 - `warmup_steps`: 0 - `log_level`: passive - `log_level_replica`: warning - `log_on_each_node`: True - `logging_nan_inf_filter`: True - `save_safetensors`: True - `save_on_each_node`: False - `save_only_model`: False - `restore_callback_states_from_checkpoint`: False - `no_cuda`: False - `use_cpu`: False - `use_mps_device`: False - `seed`: 12 - `data_seed`: None - `jit_mode_eval`: False - `use_ipex`: False - `bf16`: True - `fp16`: False - `fp16_opt_level`: O1 - `half_precision_backend`: auto - `bf16_full_eval`: False - `fp16_full_eval`: False - `tf32`: None - `local_rank`: 0 - `ddp_backend`: None - `tpu_num_cores`: None - `tpu_metrics_debug`: False - `debug`: [] - `dataloader_drop_last`: False - `dataloader_num_workers`: 6 - `dataloader_prefetch_factor`: None - `past_index`: -1 - `disable_tqdm`: False - `remove_unused_columns`: True - `label_names`: None - `load_best_model_at_end`: True - `ignore_data_skip`: False - `fsdp`: [] - `fsdp_min_num_params`: 0 - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False} - `fsdp_transformer_layer_cls_to_wrap`: None - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None} - `deepspeed`: None - `label_smoothing_factor`: 0.0 - `optim`: adamw_torch - `optim_args`: None - `adafactor`: False - `group_by_length`: False - `length_column_name`: length - `ddp_find_unused_parameters`: None - `ddp_bucket_cap_mb`: None - `ddp_broadcast_buffers`: False - `dataloader_pin_memory`: True - `dataloader_persistent_workers`: False - `skip_memory_metrics`: True - `use_legacy_prediction_loop`: False - `push_to_hub`: False - `resume_from_checkpoint`: None - `hub_model_id`: None - `hub_strategy`: every_save - `hub_private_repo`: None - `hub_always_push`: False - `gradient_checkpointing`: False - `gradient_checkpointing_kwargs`: None - `include_inputs_for_metrics`: False - `include_for_metrics`: [] - `eval_do_concat_batches`: True - `fp16_backend`: auto - `push_to_hub_model_id`: None - `push_to_hub_organization`: None - `mp_parameters`: - `auto_find_batch_size`: False - `full_determinism`: False - `torchdynamo`: None - `ray_scope`: last - `ddp_timeout`: 1800 - `torch_compile`: False - `torch_compile_backend`: None - `torch_compile_mode`: None - `include_tokens_per_second`: False - `include_num_input_tokens_seen`: False - `neftune_noise_alpha`: None - `optim_target_modules`: None - `batch_eval_metrics`: False - `eval_on_start`: False - `use_liger_kernel`: False - `eval_use_gather_object`: False - `average_tokens_across_devices`: False - `prompts`: None - `batch_sampler`: batch_sampler - `multi_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 ```bibtex @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", } ```