metadata
language:
- en
license: apache-2.0
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:8959
- loss:CoSENTLoss
base_model: prajjwal1/bert-tiny
widget:
- source_sentence: >-
This card is treated as a Normal Monster while face-up on the field or in
the GY. While this card is face-up on the field, you can Normal Summon it
to have it become an Effect Monster with this effect. During your End
Phase: You can target 1 Equip Spell Card in your GY; add that target to
your hand. You can only use this effect of "Knight Day Grepher" once per
turn.
sentences:
- >-
You can Ritual Summon this card with "Primal Cry". Once per turn: You
can reveal 1 monster in your hand, then target 1 face-up monster on the
field; that target's Level becomes equal to the Level the revealed
monster had, until the end of this turn. Once per turn, if another
monster is Tributed from your hand or field (except during the Damage
Step): You can target 1 monster in your GY; add it to your hand.
- >-
If you control an Insect monster: You can Special Summon this card from
your hand. During your Main Phase: You can inflict 200 damage to your
opponent for each "Battlewasp - Pin the Bullseye" you control. You can
only use each effect of "Battlewasp - Pin the Bullseye" once per turn.
- "Add 1 \"Great Sand Sea - Gold Golgonda\" from your Deck to your hand. If \"Great Sand Sea - Gold Golgonda\" is in your Field Zone, you can apply this effect instead.\r\n● Add 1 \"Springans\" monster from your Deck to your hand, and if you do, send 1 \"Springans\" monster from your Deck to the GY.\r\nYou can only activate 1 \"Springans Watch\" per turn."
- source_sentence: >-
You can target 1 face-up card you control; destroy it, and if you do,
Special Summon 1 "Zoodiac" monster from your Deck. You can only use this
effect of "Zoodiac Barrage" once per turn. If this card is destroyed by a
card effect and sent to the GY: You can target 1 "Zoodiac" Xyz Monster you
control; attach this card from your GY to that Xyz Monster as Xyz
Material.
sentences:
- While you control a monster(s), you take no Battle Damage.
- >-
1 Dragon-Type Tuner + 1 or more non-Tuner Winged Beast-Type monsters If
this card attacks or is attacked, during the Damage Step you can remove
from play 1 (only) Winged Beast-Type monster from your GY, to have this
card gain the ATK of that monster until the End Phase.
- >-
Activate this card by discarding 1 card: Special Summon as many copies
of "Harpie Lady" as possible from your GY. When this face-up card leaves
the field, destroy those monsters.
- source_sentence: >-
Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters from
your hand or your side of the field as Fusion Materials.
sentences:
- >-
1 "Elemental HERO" monster + 1 WIND monster
Must be Fusion Summoned and cannot be Special Summoned by other ways.
When this card is Fusion Summoned: Halve the ATK and DEF of all face-up
monsters your opponent controls.
- >-
When a "roid" monster you control is destroyed by battle and sent to the
GY, you can return that monster to its owner's hand.
- >-
Target 1 "Raidraptor" monster you control; Special Summon 1 monster with
the same name as that monster on the field from your hand or Deck in
Defense Position. You can only activate 1 "Raidraptor - Call" per turn.
You cannot Special Summon monsters during the turn you activate this
card, except "Raidraptor" monsters.
- source_sentence: >-
2 Cyberse monsters If this card is Link Summoned: You can add 1 "Cynet
Fusion" from your Deck to your hand. If a monster(s) is Special Summoned
to a zone(s) this card points to (except during the Damage Step): You can
target 1 Level 4 or lower Cyberse monster in your GY; Special Summon it,
but negate its effects, also you cannot Special Summon monsters from the
Extra Deck for the rest of this turn, except Fusion Monsters. You can only
use each effect of "Clock Spartoi" once per turn.
sentences:
- A zombie shark that can deliver its lethal curse with a spell.
- >-
Pay 500 Life Points. Destroy a face-up "Blaze Accelerator" card you
control and destroy all monsters on the field. Then, Special Summon 1
"Wild Fire Token" (Pyro-Type/FIRE/LEVEL 3/ATK 1000/DEF 1000) in Attack
Position. Also, you cannot declare an attack this turn.
- >-
You can banish 1 "Virtual World" card from your GY, then target 1
face-up monster on the field; negate its effects until the end of this
turn (even if this card leaves the field). You can banish this card from
your GY; add 1 "Virtual World" monster from your Deck to your hand, then
send 1 card from your hand to the GY. You can only use each effect of
"Virtual World Gate - Qinglong" once per turn.
- source_sentence: >-
When this card destroys an opponent's monster by battle and sends it to
the GY: You can discard 1 WATER monster to the GY; Special Summon 1
"Mermail" monster from your Deck in face-up Defense Position. You can only
use the effect of "Mermail Abyssnose" once per turn.
sentences:
- >-
If "Obsidim, the Ashened City" is in the Field Zone, you can Special
Summon this card (from your hand). You can only Special Summon "King of
the Ashened City" once per turn this way. During your Main Phase: You
can Special Summon 1 "Ashened" monster from your hand, except "King of
the Ashened City", or if your opponent controls a monster with 2800 or
more ATK, you can Special Summon it from your Deck instead. You can only
use this effect of "King of the Ashened City" once per turn.
- >-
You can Tribute this card; Special Summon 1 Level 7 or lower "Red-Eyes"
monster from your Deck, except "Red-Eyes B. Chick". If this card is in
your GY: You can target 1 Level 7 or lower "Red-Eyes" monster in your
GY, except "Red-Eyes B. Chick"; shuffle it into the Deck, and if you do,
add this card to your hand. You can only use 1 "The Black Stone of
Legend" effect per turn, and only once that turn.
- >-
Activate only when your opponent declares a direct attack and you
control no monsters. Special Summon 1 Level 4 or lower Beast-Type
monster from your hand in face-up Attack Position.
datasets:
- Tien09/pair_similarity_new_1
pipeline_tag: sentence-similarity
library_name: sentence-transformers
MPNet base trained on AllNLI triplets
This is a sentence-transformers model finetuned from prajjwal1/bert-tiny on the pair_similarity_new_1 dataset. It maps sentences & paragraphs to a 128-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: prajjwal1/bert-tiny
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 128 dimensions
- Similarity Function: Cosine Similarity
- Training Dataset:
- Language: en
- License: apache-2.0
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 128, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
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 SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("Tien09/tiny_bert_ft_sim_score_2")
# Run inference
sentences = [
'When this card destroys an opponent\'s monster by battle and sends it to the GY: You can discard 1 WATER monster to the GY; Special Summon 1 "Mermail" monster from your Deck in face-up Defense Position. You can only use the effect of "Mermail Abyssnose" once per turn.',
'If "Obsidim, the Ashened City" is in the Field Zone, you can Special Summon this card (from your hand). You can only Special Summon "King of the Ashened City" once per turn this way. During your Main Phase: You can Special Summon 1 "Ashened" monster from your hand, except "King of the Ashened City", or if your opponent controls a monster with 2800 or more ATK, you can Special Summon it from your Deck instead. You can only use this effect of "King of the Ashened City" once per turn.',
'Activate only when your opponent declares a direct attack and you control no monsters. Special Summon 1 Level 4 or lower Beast-Type monster from your hand in face-up Attack Position.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 128]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Training Details
Training Dataset
pair_similarity_new_1
- Dataset: pair_similarity_new_1 at a250d43
- Size: 8,959 training samples
- Columns:
effect_text
,score
, andeffect_text2
- Approximate statistics based on the first 1000 samples:
effect_text score effect_text2 type string float string details - min: 9 tokens
- mean: 73.57 tokens
- max: 204 tokens
- min: 0.0
- mean: 0.43
- max: 1.0
- min: 4 tokens
- mean: 71.17 tokens
- max: 193 tokens
- Samples:
effect_text score effect_text2 When your opponent's monster attacks a face-up Level 4 or lower Toon Monster on your side of the field, you can make the attack a direct attack to your Life Points.
0.0
During either player's Main Phase: Special Summon this card as a Normal Monster (Reptile-Type/EARTH/Level 4/ATK 1600/DEF 1800). (This card is also still a Trap Card.)
When your opponent Special Summons a monster, you can discard 1 card to Special Summon this card from your hand. Your opponent cannot remove cards from play.
1.0
Activate this card by discarding 1 monster, then target 1 monster in your GY whose Level is lower than the discarded monster's original Level; Special Summon it and equip it with this card. The equipped monster has its effects negated. You can only activate 1 "Overdone Burial" per turn.
Mystical Elf" + "Curtain of the Dark Ones
0.0
A lost dog that wandered off 1000 years ago. He's still waiting for his master to come for him.
- Loss:
CoSENTLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "pairwise_cos_sim" }
Evaluation Dataset
pair_similarity_new_1
- Dataset: pair_similarity_new_1 at a250d43
- Size: 1,920 evaluation samples
- Columns:
effect_text
,score
, andeffect_text2
- Approximate statistics based on the first 1000 samples:
effect_text score effect_text2 type string float string details - min: 6 tokens
- mean: 72.29 tokens
- max: 190 tokens
- min: 0.0
- mean: 0.43
- max: 1.0
- min: 8 tokens
- mean: 71.47 tokens
- max: 199 tokens
- Samples:
effect_text score effect_text2 2+ Level 4 monsters
This Xyz Summoned card gains 500 ATK x the total Link Rating of Link Monsters linked to this card. You can detach 2 materials from this card, then target 1 4 Cyberse Link Monster in your GY; Special Summon it to your field so it points to this card, also you cannot Special Summon other monsters or attack directly for the rest of this turn.1.0
3 Level 4 monsters Once per turn, you can also Xyz Summon "Zoodiac Tigermortar" by using 1 "Zoodiac" monster you control with a different name as Xyz Material. (If you used an Xyz Monster, any Xyz Materials attached to it also become Xyz Materials on this card.) This card gains ATK and DEF equal to the ATK and DEF of all "Zoodiac" monsters attached to it as Materials. Once per turn: You can detach 1 Xyz Material from this card, then target 1 Xyz Monster you control and 1 "Zoodiac" monster in your GY; attach that "Zoodiac" monster to that Xyz Monster as Xyz Material.
1 Tuner + 1 or more non-Tuner Pendulum Monsters Once per turn: You can target 1 Pendulum Monster on the field or 1 card in the Pendulum Zone; destroy it, and if you do, shuffle 1 card on the field into the Deck. Once per turn: You can Special Summon 1 "Dracoslayer" monster from your Deck in Defense Position, but it cannot be used as a Synchro Material for a Summon.
0.0
If this card is Special Summoned: You can add 1 "Performapal" monster from your Deck to your hand, except a Pendulum Monster. You can only use this effect of "Performapal Longphone Bull" once per turn.
If you control an Illusion or Spellcaster monster: Add 1 "White Forest" monster from your Deck to your hand. If this card is sent to the GY to activate a monster effect: You can Set this card. You can only use each effect of "Tales of the White Forest" once per turn.
0.25
Cannot be destroyed by your opponent's card effects while "Multi-Universe" is on the field. You can only use each of the following effects of "Krishnerd Witch" once per turn. If a card(s) in the Field Zone leaves the field by card effect (except during the Damage Step): You can Special Summon this card from your hand. When a Field Spell that is already face-up on the field activates its effect (Quick Effect): You can shuffle 1 of your monsters that is banished or in your GY into the Deck, or if that monster mentions that Field Spell, you can Special Summon it instead.
- Loss:
CoSENTLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "pairwise_cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 16per_device_eval_batch_size
: 16num_train_epochs
: 5warmup_ratio
: 0.1fp16
: Truebatch_sampler
: no_duplicates
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
: 5e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 5max_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
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Falsefp16
: Truefp16_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
: Falseignore_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
: Nonedispatch_batches
: Nonesplit_batches
: 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
: no_duplicatesmulti_dataset_batch_sampler
: proportional
Training Logs
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.1786 | 100 | 4.5375 | 4.3247 |
0.3571 | 200 | 4.3729 | 4.2788 |
0.5357 | 300 | 4.2836 | 4.2434 |
0.7143 | 400 | 4.243 | 4.2069 |
0.8929 | 500 | 4.2876 | 4.1737 |
1.0714 | 600 | 4.2072 | 4.1358 |
1.25 | 700 | 4.2417 | 4.0977 |
1.4286 | 800 | 4.0938 | 4.0738 |
1.6071 | 900 | 4.016 | 4.0435 |
1.7857 | 1000 | 4.0259 | 4.0422 |
1.9643 | 1100 | 4.0137 | 4.0215 |
2.1429 | 1200 | 4.0241 | 4.0208 |
2.3214 | 1300 | 3.9952 | 3.9968 |
2.5 | 1400 | 3.9033 | 3.9860 |
2.6786 | 1500 | 3.8599 | 3.9398 |
2.8571 | 1600 | 3.8683 | 3.9286 |
3.0357 | 1700 | 3.8999 | 3.9003 |
3.2143 | 1800 | 3.899 | 3.9110 |
3.3929 | 1900 | 3.8398 | 3.8958 |
3.5714 | 2000 | 3.7397 | 3.8939 |
3.75 | 2100 | 3.8227 | 3.8797 |
3.9286 | 2200 | 3.7507 | 3.9167 |
4.1071 | 2300 | 3.7835 | 3.8933 |
4.2857 | 2400 | 3.8219 | 3.9044 |
4.4643 | 2500 | 3.7115 | 3.9060 |
4.6429 | 2600 | 3.7014 | 3.8887 |
4.8214 | 2700 | 3.7751 | 3.8855 |
5.0 | 2800 | 3.7999 | 3.8872 |
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.3.1
- Transformers: 4.47.1
- PyTorch: 2.5.1+cu121
- Accelerate: 1.2.1
- Datasets: 3.2.0
- Tokenizers: 0.21.0
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",
}
CoSENTLoss
@online{kexuefm-8847,
title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
author={Su Jianlin},
year={2022},
month={Jan},
url={https://kexue.fm/archives/8847},
}