CrossEncoder based on yoriis/GTE-tydi

This is a Cross Encoder model finetuned from yoriis/GTE-tydi 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: yoriis/GTE-tydi
  • Maximum Sequence Length: 512 tokens
  • Number of Output Labels: 1 label

Model Sources

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("yoriis/GTE-tydi-tafseer-quqa")
# Get scores for pairs of texts
pairs = [
    ['ู…ู† ู‡ูˆ ุงู„ุฑุณูˆู„ ุงู„ุฐูŠ ุฃุฑุณู„ู‡ ุงู„ู„ู‡ ุฅู„ู‰  ู‚ูˆู… ุนุงุฏ ุŸ', 'ูƒุฐุจุช ุซู…ูˆุฏ ุจุทุบูˆุงู‡ุง{11} ุฅุฐ ุงู†ุจุนุซ ุฃุดู‚ุงู‡ุง{12} ูู‚ุงู„ ู„ู‡ู… ุฑุณูˆู„ ุงู„ู„ู‡ ู†ุงู‚ุฉ ุงู„ู„ู‡ ูˆุณู‚ูŠุงู‡ุง{13} ููƒุฐุจูˆู‡ ูุนู‚ุฑูˆู‡ุง ูุฏู…ุฏู… ุนู„ูŠู‡ู… ุฑุจู‡ู… ุจุฐู†ุจู‡ู… ูุณูˆุงู‡ุง{14} ูˆู„ุง ูŠุฎุงู ุนู‚ุจุงู‡ุง{15}ุงู„ุดู…ุณ.'],
    ['ู…ุง ู‡ูŠ ุดุฑูˆุท ุงู„ุตู„ุงุฉ ุŸ', 'ูˆู…ุง ู…ู†ุนู‡ู… ุฃู† ุชู‚ุจู„ ู…ู†ู‡ู… ู†ูู‚ุงุชู‡ู… ุฅู„ุง ุฃู†ู‡ู… ูƒูุฑูˆุง ุจุงู„ู„ู‡ ูˆุจุฑุณูˆู„ู‡ ูˆู„ุง ูŠุฃุชูˆู† ุงู„ุตู„ุงุฉ ุฅู„ุง ูˆู‡ู… ูƒุณุงู„ู‰ ูˆู„ุง ูŠู†ูู‚ูˆู† ุฅู„ุง ูˆู‡ู… ูƒุงุฑู‡ูˆู†{54} ุงู„ุชูˆุจุฉ'],
    ['ู…ู† ุงู„ุฐูŠ ุตู†ุน ุนุฌู„ุง ู…ู† ุงู„ุญู„ูŠ ู„ุจู†ูŠ ุฅุณุฑุงุฆูŠู„ุŸ', 'ู‚ุงู„ ูู…ุง ุฎุทุจูƒ ูŠุง ุณุงู…ุฑูŠ {95} ู‚ุงู„ ุจุตุฑุช ุจู…ุง ู„ู… ูŠุจุตุฑูˆุง ุจู‡ ูู‚ุจุถุช ู‚ุจุถุฉ ู…ู† ุฃุซุฑ ุงู„ุฑุณูˆู„ ูู†ุจุฐุชู‡ุง ูˆูƒุฐู„ูƒ ุณูˆู„ุช ู„ูŠ ู†ูุณูŠ {96} ู‚ุงู„ ูุงุฐู‡ุจ ูุฅู† ู„ูƒ ููŠ ุงู„ุญูŠุงุฉ ุฃู† ุชู‚ูˆู„ ู„ุง ู…ุณุงุณ ูˆุฅู† ู„ูƒ ู…ูˆุนุฏุง ู„ู† ุชุฎู„ูู‡ ูˆุงู†ุธุฑ ุฅู„ู‰ ุฅู„ู‡ูƒ ุงู„ุฐูŠ ุธู„ุช ุนู„ูŠู‡ ุนุงูƒูุง ู„ู†ุญุฑู‚ู†ู‡ ุซู… ู„ู†ู†ุณูู†ู‡ ููŠ ุงู„ูŠู… ู†ุณูุง {97}ุทู‡'],
    ['ุงู„ุฅูŠู…ุงู† ุฃุณุงุณ ุงู„ุชู‚ูˆู‰ุŒ ู„ุฃู† ุงู„ุฅูŠู…ุงู† ุจุงู„ู„ู‡ ูˆุชู‚ูˆุงู‡ ูŠุคู‡ู„ุงู† ู„ููŠุถ ู…ู† ุจุฑูƒุงุช ุงู„ุณู…ุงุก ูˆุงู„ุฃุฑุถุŒ ุฃุฐูƒุฑ ุงู„ุขูŠุฉ ุงู„ุชูŠ ุฏู„ุช ุนู„ู‰ ู‡ุฐุง ุงู„ู…ุนู†ู‰ุŸ.', 'ูˆู…ุง ูƒุงู† ู„ุจุดุฑ ุฃู† ูŠูƒู„ู…ู‡ ุงู„ู„ู‡ ุฅู„ุง ูˆุญูŠุง ุฃูˆ ู…ู† ูˆุฑุงุก ุญุฌุงุจ ุฃูˆ ูŠุฑุณู„ ุฑุณูˆู„ุง ููŠูˆุญูŠ ุจุฅุฐู†ู‡ ู…ุง ูŠุดุงุก ุฅู†ู‡ ุนู„ูŠ ุญูƒูŠู…{51}ุงู„ุดูˆุฑู‰.'],
    ['ููŠ ุณูˆุฑุฉ ุงู„ูุงุชุญุฉ ุฐูƒุฑ ุงู„ู…ุบุถูˆุจ ุนู„ูŠู‡ู… ูู…ู† ู‡ู…ุŸ', 'ุจุฆุณู…ุง ุงุดุชุฑูˆุง ุจู‡ ุฃู†ูุณู‡ู… ุฃู† ูŠูƒูุฑูˆุง ุจู…ุง ุฃู†ุฒู„ ุงู„ู„ู‡ ุจุบูŠุง ุฃู† ูŠู†ุฒู„ ุงู„ู„ู‡ ู…ู† ูุถู„ู‡ ุนู„ู‰ ู…ู† ูŠุดุงุก ู…ู† ุนุจุงุฏู‡ ูุจุงุกูˆุง ุจุบุถุจ ุนู„ู‰ ุบุถุจ ูˆู„ู„ูƒุงูุฑูŠู† ุนุฐุงุจ ู…ู‡ูŠู†{90} ุงู„ุจู‚ุฑุฉ'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)

# Or rank different texts based on similarity to a single text
ranks = model.rank(
    'ู…ู† ู‡ูˆ ุงู„ุฑุณูˆู„ ุงู„ุฐูŠ ุฃุฑุณู„ู‡ ุงู„ู„ู‡ ุฅู„ู‰  ู‚ูˆู… ุนุงุฏ ุŸ',
    [
        'ูƒุฐุจุช ุซู…ูˆุฏ ุจุทุบูˆุงู‡ุง{11} ุฅุฐ ุงู†ุจุนุซ ุฃุดู‚ุงู‡ุง{12} ูู‚ุงู„ ู„ู‡ู… ุฑุณูˆู„ ุงู„ู„ู‡ ู†ุงู‚ุฉ ุงู„ู„ู‡ ูˆุณู‚ูŠุงู‡ุง{13} ููƒุฐุจูˆู‡ ูุนู‚ุฑูˆู‡ุง ูุฏู…ุฏู… ุนู„ูŠู‡ู… ุฑุจู‡ู… ุจุฐู†ุจู‡ู… ูุณูˆุงู‡ุง{14} ูˆู„ุง ูŠุฎุงู ุนู‚ุจุงู‡ุง{15}ุงู„ุดู…ุณ.',
        'ูˆู…ุง ู…ู†ุนู‡ู… ุฃู† ุชู‚ุจู„ ู…ู†ู‡ู… ู†ูู‚ุงุชู‡ู… ุฅู„ุง ุฃู†ู‡ู… ูƒูุฑูˆุง ุจุงู„ู„ู‡ ูˆุจุฑุณูˆู„ู‡ ูˆู„ุง ูŠุฃุชูˆู† ุงู„ุตู„ุงุฉ ุฅู„ุง ูˆู‡ู… ูƒุณุงู„ู‰ ูˆู„ุง ูŠู†ูู‚ูˆู† ุฅู„ุง ูˆู‡ู… ูƒุงุฑู‡ูˆู†{54} ุงู„ุชูˆุจุฉ',
        'ู‚ุงู„ ูู…ุง ุฎุทุจูƒ ูŠุง ุณุงู…ุฑูŠ {95} ู‚ุงู„ ุจุตุฑุช ุจู…ุง ู„ู… ูŠุจุตุฑูˆุง ุจู‡ ูู‚ุจุถุช ู‚ุจุถุฉ ู…ู† ุฃุซุฑ ุงู„ุฑุณูˆู„ ูู†ุจุฐุชู‡ุง ูˆูƒุฐู„ูƒ ุณูˆู„ุช ู„ูŠ ู†ูุณูŠ {96} ู‚ุงู„ ูุงุฐู‡ุจ ูุฅู† ู„ูƒ ููŠ ุงู„ุญูŠุงุฉ ุฃู† ุชู‚ูˆู„ ู„ุง ู…ุณุงุณ ูˆุฅู† ู„ูƒ ู…ูˆุนุฏุง ู„ู† ุชุฎู„ูู‡ ูˆุงู†ุธุฑ ุฅู„ู‰ ุฅู„ู‡ูƒ ุงู„ุฐูŠ ุธู„ุช ุนู„ูŠู‡ ุนุงูƒูุง ู„ู†ุญุฑู‚ู†ู‡ ุซู… ู„ู†ู†ุณูู†ู‡ ููŠ ุงู„ูŠู… ู†ุณูุง {97}ุทู‡',
        'ูˆู…ุง ูƒุงู† ู„ุจุดุฑ ุฃู† ูŠูƒู„ู…ู‡ ุงู„ู„ู‡ ุฅู„ุง ูˆุญูŠุง ุฃูˆ ู…ู† ูˆุฑุงุก ุญุฌุงุจ ุฃูˆ ูŠุฑุณู„ ุฑุณูˆู„ุง ููŠูˆุญูŠ ุจุฅุฐู†ู‡ ู…ุง ูŠุดุงุก ุฅู†ู‡ ุนู„ูŠ ุญูƒูŠู…{51}ุงู„ุดูˆุฑู‰.',
        'ุจุฆุณู…ุง ุงุดุชุฑูˆุง ุจู‡ ุฃู†ูุณู‡ู… ุฃู† ูŠูƒูุฑูˆุง ุจู…ุง ุฃู†ุฒู„ ุงู„ู„ู‡ ุจุบูŠุง ุฃู† ูŠู†ุฒู„ ุงู„ู„ู‡ ู…ู† ูุถู„ู‡ ุนู„ู‰ ู…ู† ูŠุดุงุก ู…ู† ุนุจุงุฏู‡ ูุจุงุกูˆุง ุจุบุถุจ ุนู„ู‰ ุบุถุจ ูˆู„ู„ูƒุงูุฑูŠู† ุนุฐุงุจ ู…ู‡ูŠู†{90} ุงู„ุจู‚ุฑุฉ',
    ]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]

Evaluation

Metrics

Cross Encoder Classification

Metric Value
accuracy 1.0
accuracy_threshold 0.8513
f1 1.0
f1_threshold 0.8513
precision 1.0
recall 1.0
average_precision 1.0

Cross Encoder Classification

Metric Value
accuracy 0.9362
accuracy_threshold 0.401
f1 0.8677
f1_threshold 0.2964
precision 0.901
recall 0.8368
average_precision 0.9243

Training Details

Training Dataset

Unnamed Dataset

  • Size: 12,128 training samples
  • Columns: sentence_0, sentence_1, and label
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1 label
    type string string float
    details
    • min: 9 characters
    • mean: 71.49 characters
    • max: 504 characters
    • min: 18 characters
    • mean: 132.95 characters
    • max: 968 characters
    • min: 0.0
    • mean: 0.26
    • max: 1.0
  • Samples:
    sentence_0 sentence_1 label
    ู…ู† ู‡ูˆ ุงู„ุฑุณูˆู„ ุงู„ุฐูŠ ุฃุฑุณู„ู‡ ุงู„ู„ู‡ ุฅู„ู‰ ู‚ูˆู… ุนุงุฏ ุŸ ูƒุฐุจุช ุซู…ูˆุฏ ุจุทุบูˆุงู‡ุง{11} ุฅุฐ ุงู†ุจุนุซ ุฃุดู‚ุงู‡ุง{12} ูู‚ุงู„ ู„ู‡ู… ุฑุณูˆู„ ุงู„ู„ู‡ ู†ุงู‚ุฉ ุงู„ู„ู‡ ูˆุณู‚ูŠุงู‡ุง{13} ููƒุฐุจูˆู‡ ูุนู‚ุฑูˆู‡ุง ูุฏู…ุฏู… ุนู„ูŠู‡ู… ุฑุจู‡ู… ุจุฐู†ุจู‡ู… ูุณูˆุงู‡ุง{14} ูˆู„ุง ูŠุฎุงู ุนู‚ุจุงู‡ุง{15}ุงู„ุดู…ุณ. 0.0
    ู…ุง ู‡ูŠ ุดุฑูˆุท ุงู„ุตู„ุงุฉ ุŸ ูˆู…ุง ู…ู†ุนู‡ู… ุฃู† ุชู‚ุจู„ ู…ู†ู‡ู… ู†ูู‚ุงุชู‡ู… ุฅู„ุง ุฃู†ู‡ู… ูƒูุฑูˆุง ุจุงู„ู„ู‡ ูˆุจุฑุณูˆู„ู‡ ูˆู„ุง ูŠุฃุชูˆู† ุงู„ุตู„ุงุฉ ุฅู„ุง ูˆู‡ู… ูƒุณุงู„ู‰ ูˆู„ุง ูŠู†ูู‚ูˆู† ุฅู„ุง ูˆู‡ู… ูƒุงุฑู‡ูˆู†{54} ุงู„ุชูˆุจุฉ 1.0
    ู…ู† ุงู„ุฐูŠ ุตู†ุน ุนุฌู„ุง ู…ู† ุงู„ุญู„ูŠ ู„ุจู†ูŠ ุฅุณุฑุงุฆูŠู„ุŸ ู‚ุงู„ ูู…ุง ุฎุทุจูƒ ูŠุง ุณุงู…ุฑูŠ {95} ู‚ุงู„ ุจุตุฑุช ุจู…ุง ู„ู… ูŠุจุตุฑูˆุง ุจู‡ ูู‚ุจุถุช ู‚ุจุถุฉ ู…ู† ุฃุซุฑ ุงู„ุฑุณูˆู„ ูู†ุจุฐุชู‡ุง ูˆูƒุฐู„ูƒ ุณูˆู„ุช ู„ูŠ ู†ูุณูŠ {96} ู‚ุงู„ ูุงุฐู‡ุจ ูุฅู† ู„ูƒ ููŠ ุงู„ุญูŠุงุฉ ุฃู† ุชู‚ูˆู„ ู„ุง ู…ุณุงุณ ูˆุฅู† ู„ูƒ ู…ูˆุนุฏุง ู„ู† ุชุฎู„ูู‡ ูˆุงู†ุธุฑ ุฅู„ู‰ ุฅู„ู‡ูƒ ุงู„ุฐูŠ ุธู„ุช ุนู„ูŠู‡ ุนุงูƒูุง ู„ู†ุญุฑู‚ู†ู‡ ุซู… ู„ู†ู†ุณูู†ู‡ ููŠ ุงู„ูŠู… ู†ุณูุง {97}ุทู‡ 1.0
  • Loss: BinaryCrossEntropyLoss with these parameters:
    {
        "activation_fn": "torch.nn.modules.linear.Identity",
        "pos_weight": null
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • num_train_epochs: 4
  • fp16: 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: 8
  • per_device_eval_batch_size: 8
  • 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: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 4
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • 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: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • 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: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • 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
  • hub_revision: None
  • 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
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss eval_average_precision
0.4386 500 0.1057 1.0
0.8772 1000 0.001 1.0000
1.0 1140 - 1.0
1.3158 1500 0.0008 1.0000
1.7544 2000 0.0005 1.0000
2.0 2280 - 1.0000
2.1930 2500 0.0005 1.0
2.6316 3000 0.0004 1.0
3.0 3420 - 1.0000
3.0702 3500 0.0004 1.0
3.5088 4000 0.0004 1.0000
3.9474 4500 0.0004 1.0
4.0 4560 - 1.0
0.3298 500 0.4486 0.9037
0.6596 1000 0.3242 0.9110
0.9894 1500 0.3305 0.9150
1.0 1516 - 0.9149
1.3193 2000 0.2919 0.9185
1.6491 2500 0.2892 0.9198
1.9789 3000 0.2665 0.9209
2.0 3032 - 0.9208
2.3087 3500 0.2782 0.9219
2.6385 4000 0.2888 0.9229
2.9683 4500 0.2502 0.9234
3.0 4548 - 0.9235
3.2982 5000 0.2584 0.9237
3.6280 5500 0.2487 0.9241
3.9578 6000 0.2701 0.9243
4.0 6064 - 0.9243

Framework Versions

  • Python: 3.11.13
  • Sentence Transformers: 5.0.0
  • Transformers: 4.55.0
  • PyTorch: 2.6.0+cu124
  • Accelerate: 1.9.0
  • Datasets: 4.0.0
  • Tokenizers: 0.21.4

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",
}
Downloads last month
9
Safetensors
Model size
135M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for yoriis/GTE-tydi-tafseer-quqa

Evaluation results