Views
No views yet
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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("Tien09/tiny_bert_ft_sim_score_1")
5# Run inference
6sentences = [
7 '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.',
8 '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.',
9 'Remove from play 1 "Assault Mode Activate" from your GY. Destroy all monsters you control and Special Summon 1 "/Assault Mode" monster from your GY, ignoring its Summoning conditions. Its effect(s) is negated, and it cannot be Tributed. If it is removed from the field, remove it from play.',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 128]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]effect_text, score, and effect_text2| effect_text | score | effect_text2 | |
|---|---|---|---|
| type | string | float | string |
| details |
|
|
|
| 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 destructive machine discovered in the Ruins of the Ancients. |
CoSENTLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "pairwise_cos_sim"
4}effect_text, score, and effect_text2| effect_text | score | effect_text2 | |
|---|---|---|---|
| type | string | float | string |
| details |
|
|
|
| effect_text | score | effect_text2 |
|---|---|---|
2+ Level 4 monsters[object Object]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.5 | You can Ritual Summon this card with a "Recipe" card. If this card is Special Summoned: You can target 1 Spell/Trap on the field; destroy it. When a card or effect is activated that targets this card on the field, or when this card is targeted for an attack (Quick Effect): You can Tribute this card and 1 Attack Position monster on either field, and if you do, Special Summon 1 Level 3 or 4 "Nouvelles" Ritual Monster from your hand or Deck. You can only use each effect of "Confiras de Nouvelles" 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. | 1.0 | If you control no monsters, you can Special Summon this card (from your hand). You can only use each of the following effects of "Kashtira Fenrir" once per turn. During your Main Phase: You can add 1 "Kashtira" monster from your Deck to your hand. When this card declares an attack, or if your opponent activates a monster effect (except during the Damage Step): You can target 1 face-up card your opponent controls; banish it, face-down. |
CoSENTLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "pairwise_cos_sim"
4}eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16num_train_epochs: 5warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_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| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.1786 | 100 | 4.6579 | 4.3287 |
| 0.3571 | 200 | 4.3378 | 4.2222 |
| 0.5357 | 300 | 4.2299 | 4.1919 |
| 0.7143 | 400 | 4.2124 | 4.1616 |
| 0.8929 | 500 | 4.1399 | 4.1370 |
| 1.0714 | 600 | 4.2017 | 4.1200 |
| 1.25 | 700 | 4.1343 | 4.1058 |
| 1.4286 | 800 | 4.0805 | 4.1072 |
| 1.6071 | 900 | 4.0843 | 4.0773 |
| 1.7857 | 1000 | 4.01 | 4.0771 |
| 1.9643 | 1100 | 4.0615 | 4.0627 |
| 2.1429 | 1200 | 4.0847 | 4.0468 |
| 2.3214 | 1300 | 3.9798 | 4.0659 |
| 2.5 | 1400 | 3.9663 | 4.0551 |
| 2.6786 | 1500 | 3.9625 | 4.0335 |
| 2.8571 | 1600 | 3.9096 | 4.0306 |
| 3.0357 | 1700 | 4.0127 | 4.0105 |
| 3.2143 | 1800 | 3.9753 | 4.0077 |
| 3.3929 | 1900 | 3.8669 | 4.0188 |
| 3.5714 | 2000 | 3.8983 | 4.0174 |
| 3.75 | 2100 | 3.9077 | 4.0025 |
| 3.9286 | 2200 | 3.8346 | 4.0218 |
| 4.1071 | 2300 | 3.9618 | 3.9921 |
| 4.2857 | 2400 | 3.8631 | 3.9981 |
| 4.4643 | 2500 | 3.8456 | 4.0014 |
| 4.6429 | 2600 | 3.8655 | 3.9976 |
| 4.8214 | 2700 | 3.8248 | 4.0031 |
| 5.0 | 2800 | 3.8935 | 4.0016 |
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}1@online{kexuefm-8847,
2 title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
3 author={Su Jianlin},
4 year={2022},
5 month={Jan},
6 url={https://kexue.fm/archives/8847},
7}