Views
No views yet
CrossEncoder(
(0): Transformer({'transformer_task': 'sequence-classification', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'scores', 'architecture': 'DebertaV2ForSequenceClassification'})
)pip install -U sentence-transformers1from sentence_transformers import CrossEncoder
2
3# Download from the 🤗 Hub
4model = CrossEncoder("kelompoknlp2026dsindo/deberta-v3-xsmall-nli-finetuned")
5# Get scores for pairs of inputs
6pairs = [
7 ['[South Australia] has the most expensive electricity in the world.', '[citation needed] South Australia has the highest retail price for electricity in the country.'],
8 ['[South Australia] has the most expensive electricity in the world.', '"South Australia has the highest power prices in the world".'],
9 ['when 3 per cent of total annual global emissions of carbon dioxide are from humans and Australia prod\xaduces 1.3 per cent of this 3 per cent, then no amount of emissions reductio\xadn here will have any effect on global climate.', 'The 2011 UNEP Green Economy report states that "[a]agricultural operations, excluding land use changes, produce approximately 13 per cent of anthropogenic global GHG emissions.'],
10 ['when 3 per cent of total annual global emissions of carbon dioxide are from humans and Australia prod\xaduces 1.3 per cent of this 3 per cent, then no amount of emissions reductio\xadn here will have any effect on global climate.', 'With a market share of 30% and (potentially) clean electricity, heat pumps could reduce global CO 2 emissions by 8% annually.'],
11 ['when 3 per cent of total annual global emissions of carbon dioxide are from humans and Australia prod\xaduces 1.3 per cent of this 3 per cent, then no amount of emissions reductio\xadn here will have any effect on global climate.', 'In the modern era, emissions to the atmosphere from volcanoes are approximately 0.645 billion tonnes of CO 2 per year, whereas humans contribute 29 billion tonnes of CO 2 each year.'],
12]
13scores = model.predict(pairs)
14print(scores)
15# [[-5.1375 3.7547 -0.2361]
16# [-4.5641 3.9137 -1.1062]
17# [ 1.3195 -2.9018 1.4899]
18# [ 0.1377 -2.4617 2.3478]
19# [ 1.4282 -2.7619 1.3155]]DeBERTa-xsmall-finetune-dev, Claim-Evidence-train and Claim-Evidence-3Class-devCrossEncoderClassificationEvaluator| Metric | DeBERTa-xsmall-finetune-dev | Claim-Evidence-train | Claim-Evidence-3Class-dev |
|---|---|---|---|
| f1_macro | 0.7113 | 0.9316 | 0.713 |
| f1_micro | 0.7344 | 0.9287 | 0.7367 |
| f1_weighted | 0.7344 | 0.9287 | 0.7366 |
claim, evidence, and label| claim | evidence | label | |
|---|---|---|---|
| type | string | string | int |
| details |
|
|
|
| claim | evidence | label |
|---|---|---|
El Niño drove record highs in global temperatures suggesting rise may not be down to man-made emissions. | While ‘climate change’ can be due to natural forces or human activity, there is now substantial evidence to indicate that human activity – and specifically increased greenhouse gas (GHGs) emissions – is a key factor in the pace and extent of global temperature increases. | 0 |
El Niño drove record highs in global temperatures suggesting rise may not be down to man-made emissions. | This acceleration is due mostly to human-caused global warming, which is driving thermal expansion of seawater and the melting of land-based ice sheets and glaciers. | 0 |
In 1946, PDO switched to a cool phase. | There is evidence of reversals in the prevailing polarity (meaning changes in cool surface waters versus warm surface waters within the region) of the oscillation occurring around 1925, 1947, and 1977; the last two reversals corresponded with dramatic shifts in salmon production regimes in the North Pacific Ocean. | 1 |
CrossEntropyLossclaim, evidence, and label| claim | evidence | label | |
|---|---|---|---|
| type | string | string | int |
| details |
|
|
|
| claim | evidence | label |
|---|---|---|
[South Australia] has the most expensive electricity in the world. | [citation needed] South Australia has the highest retail price for electricity in the country. | 1 |
[South Australia] has the most expensive electricity in the world. | "South Australia has the highest power prices in the world". | 1 |
when 3 per cent of total annual global emissions of carbon dioxide are from humans and Australia produces 1.3 per cent of this 3 per cent, then no amount of emissions reduction here will have any effect on global climate. | The 2011 UNEP Green Economy report states that "[a]agricultural operations, excluding land use changes, produce approximately 13 per cent of anthropogenic global GHG emissions. | 2 |
CrossEntropyLossper_device_train_batch_size: 16gradient_accumulation_steps: 2learning_rate: 3e-05weight_decay: 0.05num_train_epochs: 5lr_scheduler_type: cosinewarmup_steps: 0.1load_best_model_at_end: Truedo_predict: Falseprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 8gradient_accumulation_steps: 2eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 3e-05weight_decay: 0.05adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 5max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: Nonewarmup_ratio: Nonewarmup_steps: 0.1log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Trueenable_jit_checkpoint: Falsesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseuse_cpu: Falseseed: 42data_seed: Nonebf16: Falsefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: -1ddp_backend: Nonedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonedisable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Nonegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Truepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_for_metrics: []eval_do_concat_batches: Trueauto_find_batch_size: Falsefull_determinism: Falseddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueuse_cache: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | DeBERTa-xsmall-finetune-dev_f1_macro | Claim-Evidence-train_f1_macro | Claim-Evidence-3Class-dev_f1_macro |
|---|---|---|---|---|---|---|
| 0.4274 | 50 | 1.6490 | 0.9456 | 0.5752 | - | - |
| 0.8547 | 100 | 0.8194 | 0.7744 | 0.6204 | - | - |
| 1.2821 | 150 | 0.6911 | 0.8904 | 0.6485 | - | - |
| 1.7094 | 200 | 0.6048 | 0.8325 | 0.6564 | - | - |
| 2.1368 | 250 | 0.5231 | 0.8821 | 0.6783 | - | - |
| 2.5641 | 300 | 0.3898 | 0.9131 | 0.6917 | - | - |
| 2.9915 | 350 | 0.3996 | 0.9402 | 0.6767 | - | - |
| 3.4188 | 400 | 0.2743 | 0.9794 | 0.7206 | - | - |
| 3.8462 | 450 | 0.3070 | 1.0230 | 0.7115 | - | - |
| 4.2735 | 500 | 0.2496 | 1.0124 | 0.7101 | - | - |
| 4.7009 | 550 | 0.2757 | 1.0294 | 0.7113 | - | - |
| -1 | -1 | - | - | - | 0.9316 | 0.7130 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}