Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 384, '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("philipp-zettl/bge-micro-v2-mtg")
5# Run inference
6sentences = [
7 '141a031d-f899-497b-adf7-4af142078085_0367fac8-6990-4544-ac7d-ed363b55a9cf',
8 "Title: Quirion Explorer\nCost: {1}{G}\nColors: ['G']\nType: Creature — Elf Druid Scout\nDesc: {T}: Add one mana of any color that a land an opponent controls could produce.",
9 "Title: Savage Hunger\nCost: {2}{G}\nColors: ['G']\nType: Enchantment — Aura\nDesc: Enchant creature\nEnchanted creature gets +1/+0 and has trample.\nCycling {2} ({2}, Discard this card: Draw a card.)",
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 384]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]sts-dev and sts-testEmbeddingSimilarityEvaluator| Metric | sts-dev | sts-test |
|---|---|---|
| pearson_cosine | 0.6089 | 0.6049 |
| spearman_cosine | 0.6631 | 0.6608 |
uuid, sentence_1, sentence_2, image_1, image_2, and score| uuid | sentence_1 | sentence_2 | image_1 | image_2 | score | |
|---|---|---|---|---|---|---|
| type | string | string | string | string | string | float |
| details |
|
|
|
|
|
|
| uuid | sentence_1 | sentence_2 | image_1 | image_2 | score |
|---|---|---|---|---|---|
08f9b863-10b7-46d6-badd-97381e6c7c5e_4330efa7-a11b-4776-9fb0-1cae8aed67b1 | Title: Blast Zone[object Object]Type: Land[object Object]Desc: This land enters with a charge counter on it.[object Object]{T}: Add {C}.[object Object]{X}{X}, {T}: Put X charge counters on this land.[object Object]{3}, {T}, Sacrifice this land: Destroy each nonland permanent with mana value equal to the number of charge counters on this land. | Title: Tom van de Logt Bio (2000)[object Object]Type: Card[object Object]Desc: Quarterfinalist Tom van de Logt posted a perfect 6—0 record during the Standard portion of this year's World Championships. The 19-year-old Groesbeek, Holland native was playing a deck that had a big impact on the metagame this year, "Replenish." This deck used cards like Attunement and Frantic Search to put powerful enchantments, such as Parallax Wave and Opalescence, into the graveyard and then used Replenish to put them all back into play at once. | [object Object] | [object Object] | 0.25 |
abe9cf1e-d398-41e0-8b11-afe1015e4fd9_40cb67f7-b4e1-423b-8f55-d44ed383e778 | Title: Coral Net[object Object]Cost: {U}[object Object]Colors: ['U'][object Object]Type: Enchantment — Aura[object Object]Desc: Enchant green or white creature[object Object]Enchanted creature has "At the beginning of your upkeep, sacrifice this creature unless you discard a card." | Title: Silumgar Butcher[object Object]Cost: {4}{B}[object Object]Colors: ['B'][object Object]Type: Creature — Zombie Djinn[object Object]Desc: Exploit (When this creature enters, you may sacrifice a creature.)[object Object]When this creature exploits a creature, target creature gets -3/-3 until end of turn. | [object Object] | [object Object] | -1.0 |
3dd13408-b4db-42e7-bf3c-d46716538a7c_05a6dc90-3997-4911-8bd6-854c85eca35b | Title: Rishadan Brigand[object Object]Cost: {4}{U}[object Object]Colors: ['U'][object Object]Type: Creature — Human Pirate[object Object]Desc: Flying[object Object]When this creature enters, each opponent sacrifices a permanent of their choice unless they pay {3}.[object Object]This creature can block only creatures with flying. | Title: Banishing Stroke[object Object]Cost: {5}{W}[object Object]Colors: ['W'][object Object]Type: Instant[object Object]Desc: Put target artifact, creature, or enchantment on the bottom of its owner's library.[object Object]Miracle {W} (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.) | [object Object] | [object Object] | -1.0 |
CosineSimilarityLoss with these parameters:
1{
2 "loss_fct": "torch.nn.modules.loss.MSELoss"
3}uuid, sentence_1, sentence_2, image_1, image_2, and score| uuid | sentence_1 | sentence_2 | image_1 | image_2 | score | |
|---|---|---|---|---|---|---|
| type | string | string | string | string | string | float |
| details |
|
|
|
|
|
|
| uuid | sentence_1 | sentence_2 | image_1 | image_2 | score |
|---|---|---|---|---|---|
6bdd8645-aee9-44cb-acaa-2674f55cdf2f_b34bb149-2e50-462e-8b83-5c8339bb3aff | Title: Syr Cadian, Knight Owl[object Object]Cost: {3}{W}{W}[object Object]Colors: ['W'][object Object]Type: Legendary Creature — Bird Knight[object Object]Desc: Knightlifelink (Damage dealt by Knights you control also causes you to gain that much life.)[object Object]{W}: Syr Cadian gains vigilance until end of turn. Activate only from sunrise to sunset.[object Object]{B}: Syr Cadian gains flying until end of turn. Activate only from sunset to sunrise. | Title: Non-Human Cannonball[object Object]Cost: {2}{R}[object Object]Colors: ['R'][object Object]Type: Artifact Creature — Clown Robot[object Object]Desc: When this creature dies, roll a six-sided die. If the result is 4 or less, this creature deals that much damage to you. | [object Object] | [object Object] | 0.25 |
860f4304-38f1-4c2f-a122-2590619522fd_08d6db9b-b2da-4148-aa49-8c2fecac6e32 | Title: Hindering Light[object Object]Cost: {W}{U}[object Object]Colors: ['U', 'W'][object Object]Type: Instant[object Object]Desc: Counter target spell that targets you or a permanent you control.[object Object]Draw a card. | Title: Gleam of Resistance[object Object]Cost: {4}{W}[object Object]Colors: ['W'][object Object]Type: Instant[object Object]Desc: Creatures you control get +1/+2 until end of turn. Untap those creatures.[object Object]Basic landcycling {1}{W} ({1}{W}, Discard this card: Search your library for a basic land card, reveal it, put it into your hand, then shuffle.) | [object Object] | [object Object] | 0.25 |
91b448f4-aa0c-42c7-a771-e8dd20e0520c_46f810c2-310e-42f5-ab1f-d56396cf5124 | Title: Practiced Tactics[object Object]Cost: {W}[object Object]Colors: ['W'][object Object]Type: Instant[object Object]Desc: Choose target attacking or blocking creature. Practiced Tactics deals damage to that creature equal to twice the number of creatures in your party. (Your party consists of up to one each of Cleric, Rogue, Warrior, and Wizard.) | Title: Anointer Priest[object Object]Cost: {1}{W}[object Object]Colors: ['W'][object Object]Type: Creature — Human Cleric[object Object]Desc: Whenever a creature token you control enters, you gain 1 life.[object Object]Embalm {3}{W} ({3}{W}, Exile this card from your graveyard: Create a token that's a copy of it, except it's a white Zombie Human Cleric with no mana cost. Embalm only as a sorcery.) | [object Object] | [object Object] | 0.25 |
CosineSimilarityLoss with these parameters:
1{
2 "loss_fct": "torch.nn.modules.loss.MSELoss"
3}eval_strategy: stepsper_device_train_batch_size: 64per_device_eval_batch_size: 64learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1log_level_replica: passivelog_on_each_node: Falselogging_nan_inf_filter: Falsepush_to_hub: Trueresume_from_checkpoint: ./models/bge-micro-v2-mtg/hub_model_id: philipp-zettl/bge-micro-v2-mtghub_always_push: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: passivelog_on_each_node: Falselogging_nan_inf_filter: Falsesave_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: Falsefp16_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}tp_size: 0fsdp_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: Trueresume_from_checkpoint: ./models/bge-micro-v2-mtg/hub_model_id: philipp-zettl/bge-micro-v2-mtghub_strategy: every_savehub_private_repo: Nonehub_always_push: Truegradient_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 | sts-dev_spearman_cosine | sts-test_spearman_cosine |
|---|---|---|---|---|---|
| -1 | -1 | - | - | 0.3031 | - |
| 0.0113 | 500 | 0.8624 | - | - | - |
| 0.0225 | 1000 | 0.3681 | - | - | - |
| 0.0338 | 1500 | 0.3505 | - | - | - |
| 0.0451 | 2000 | 0.3485 | - | - | - |
| 0.0563 | 2500 | 0.3467 | - | - | - |
| 0.0676 | 3000 | 0.3475 | - | - | - |
| 0.0789 | 3500 | 0.3469 | - | - | - |
| 0.0901 | 4000 | 0.3465 | - | - | - |
| 0.1014 | 4500 | 0.3477 | - | - | - |
| 0.1127 | 5000 | 0.3465 | 0.3498 | 0.6792 | - |
| 0.1240 | 5500 | 0.3491 | - | - | - |
| 0.1352 | 6000 | 0.3461 | - | - | - |
| 0.1465 | 6500 | 0.3454 | - | - | - |
| 0.1578 | 7000 | 0.3448 | - | - | - |
| 0.1690 | 7500 | 0.3432 | - | - | - |
| 0.1803 | 8000 | 0.3424 | - | - | - |
| 0.1916 | 8500 | 0.3442 | - | - | - |
| 0.2028 | 9000 | 0.3439 | - | - | - |
| 0.2141 | 9500 | 0.3465 | - | - | - |
| 0.2254 | 10000 | 0.3422 | 0.3447 | 0.6660 | - |
| 0.2366 | 10500 | 0.3422 | - | - | - |
| 0.2479 | 11000 | 0.3436 | - | - | - |
| 0.2592 | 11500 | 0.3453 | - | - | - |
| 0.2704 | 12000 | 0.3472 | - | - | - |
| 0.2817 | 12500 | 0.3459 | - | - | - |
| 0.2930 | 13000 | 0.3481 | - | - | - |
| 0.3043 | 13500 | 0.3438 | - | - | - |
| 0.3155 | 14000 | 0.3494 | - | - | - |
| 0.3268 | 14500 | 0.3444 | - | - | - |
| 0.3381 | 15000 | 0.3457 | 0.3438 | 0.6606 | - |
| 0.3493 | 15500 | 0.3438 | - | - | - |
| 0.3606 | 16000 | 0.3434 | - | - | - |
| 0.3719 | 16500 | 0.343 | - | - | - |
| 0.3831 | 17000 | 0.3441 | - | - | - |
| 0.3944 | 17500 | 0.345 | - | - | - |
| 0.4057 | 18000 | 0.3419 | - | - | - |
| 0.4169 | 18500 | 0.3415 | - | - | - |
| 0.4282 | 19000 | 0.3401 | - | - | - |
| 0.4395 | 19500 | 0.3407 | - | - | - |
| 0.4507 | 20000 | 0.3424 | 0.3397 | 0.6610 | - |
| 0.4620 | 20500 | 0.3402 | - | - | - |
| 0.4733 | 21000 | 0.3393 | - | - | - |
| 0.4846 | 21500 | 0.3439 | - | - | - |
| 0.4958 | 22000 | 0.3429 | - | - | - |
| 0.5071 | 22500 | 0.3428 | - | - | - |
| 0.5184 | 23000 | 0.3408 | - | - | - |
| 0.5296 | 23500 | 0.3402 | - | - | - |
| 0.5409 | 24000 | 0.3396 | - | - | - |
| 0.5522 | 24500 | 0.3405 | - | - | - |
| 0.5634 | 25000 | 0.3377 | 0.3365 | 0.6642 | - |
| 0.5747 | 25500 | 0.3378 | - | - | - |
| 0.5860 | 26000 | 0.341 | - | - | - |
| 0.5972 | 26500 | 0.3382 | - | - | - |
| 0.6085 | 27000 | 0.3399 | - | - | - |
| 0.6198 | 27500 | 0.3354 | - | - | - |
| 0.6310 | 28000 | 0.3407 | - | - | - |
| 0.6423 | 28500 | 0.3356 | - | - | - |
| 0.6536 | 29000 | 0.3375 | - | - | - |
| 0.6648 | 29500 | 0.3373 | - | - | - |
| 0.6761 | 30000 | 0.3348 | 0.3328 | 0.6661 | - |
| 0.6874 | 30500 | 0.3357 | - | - | - |
| 0.6987 | 31000 | 0.336 | - | - | - |
| 0.7099 | 31500 | 0.3378 | - | - | - |
| 0.7212 | 32000 | 0.3374 | - | - | - |
| 0.7325 | 32500 | 0.3389 | - | - | - |
| 0.7437 | 33000 | 0.3353 | - | - | - |
| 0.7550 | 33500 | 0.339 | - | - | - |
| 0.7663 | 34000 | 0.3334 | - | - | - |
| 0.7775 | 34500 | 0.3354 | - | - | - |
| 0.7888 | 35000 | 0.3348 | 0.3294 | 0.6604 | - |
| 0.8001 | 35500 | 0.3352 | - | - | - |
| 0.8113 | 36000 | 0.3325 | - | - | - |
| 0.8226 | 36500 | 0.3324 | - | - | - |
| 0.8339 | 37000 | 0.3345 | - | - | - |
| 0.8451 | 37500 | 0.3323 | - | - | - |
| 0.8564 | 38000 | 0.3321 | - | - | - |
| 0.8677 | 38500 | 0.3332 | - | - | - |
| 0.8790 | 39000 | 0.335 | - | - | - |
| 0.8902 | 39500 | 0.3341 | - | - | - |
| 0.9015 | 40000 | 0.3346 | 0.3273 | 0.6631 | - |
| 0.9128 | 40500 | 0.3352 | - | - | - |
| 0.9240 | 41000 | 0.336 | - | - | - |
| 0.9353 | 41500 | 0.3319 | - | - | - |
| 0.9466 | 42000 | 0.3323 | - | - | - |
| 0.9578 | 42500 | 0.3326 | - | - | - |
| 0.9691 | 43000 | 0.333 | - | - | - |
| 0.9804 | 43500 | 0.3316 | - | - | - |
| 0.9916 | 44000 | 0.3303 | - | - | - |
| -1 | -1 | - | - | - | 0.6608 |
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}