CoolFace
Modelpublic

Aikoa/trait-embeddings-1

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes72downloads
Model Card

SentenceTransformer

This is a sentence-transformers model trained. It maps sentences & paragraphs to a 384-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: Unknown -->
  • Maximum Sequence Length: 128 tokens
  • Output Dimensionality: 384 dimensions
  • Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, '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})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'gravel parking',
    'asfalterad uppfart',
    'rauhallinen naapurusto',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Semantic Similarity
MetricValue
pearson_cosine0.7845
spearman_cosine0.8182

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • Size: 1,290,285 training samples
  • Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>label</code>
  • Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | label | |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 3 tokens</li><li>mean: 5.36 tokens</li><li>max: 12 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 5.47 tokens</li><li>max: 11 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.34</li><li>max: 0.9</li></ul> |
  • Samples: | sentence0 | sentence1 | label | |:------------------------------------|:----------------------------|:-----------------| | <code>kerrostalo</code> | <code>puuaita</code> | <code>0.1</code> | | <code>corner unit</code> | <code>large yard</code> | <code>0.3</code> | | <code>easy access to highway</code> | <code>oma pysäköinti</code> | <code>0.3</code> |
  • Loss: <code>_main_.TemperatureScaledCosineSimilarityLoss</code> with these parameters:
json
  {
      "loss_fct": "torch.nn.modules.loss.MSELoss"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • eval_strategy: steps
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • num_train_epochs: 5
  • multi_dataset_batch_sampler: round_robin
All Hyperparameters

<details><summary>Click to expand</summary>

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • 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: 5
  • 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: False
  • 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: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': 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
  • 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
  • dispatch_batches: None
  • split_batches: 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
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Losstrait-eval_spearman_cosine
0.02485000.1261-
0.049610000.11550.2026
0.074415000.119-
0.099220000.11930.2516
0.124025000.118-
0.148830000.11510.2638
0.173635000.1152-
0.198440000.10930.2700
0.223245000.1077-
0.248050000.1090.2942
0.272855000.1015-
0.297660000.10590.3171
0.322465000.1052-
0.347270000.10420.3114
0.372075000.1006-
0.396880000.10070.3328
0.421685000.1013-
0.446490000.09380.3407
0.471295000.0971-
0.4960100000.09760.3430
0.5208105000.0945-
0.5456110000.09370.3603
0.5704115000.0919-
0.5952120000.08930.3916
0.6200125000.0904-
0.6448130000.08660.3931
0.6696135000.087-
0.6944140000.08480.4178
0.7192145000.087-
0.7440150000.08270.4218
0.7688155000.0851-
0.7936160000.08070.4414
0.8184165000.0803-
0.8432170000.08030.4526
0.8680175000.0784-
0.8928180000.07760.4592
0.9176185000.0761-
0.9424190000.07390.4856
0.9672195000.0724-
0.9920200000.07380.4928
1.020161-0.4863
1.0168205000.0707-
1.0416210000.06990.4950
1.0664215000.0637-
1.0912220000.06770.5000
1.1160225000.0638-
1.1408230000.06530.5306
1.1656235000.0661-
1.1904240000.06790.5292
1.2152245000.0618-
1.2400250000.06160.5253
1.2648255000.0626-
1.2896260000.06240.5422
1.3144265000.0613-
1.3392270000.06230.5515
1.3640275000.0601-
1.3888280000.05890.5606
1.4136285000.06-
1.4384290000.05980.5774
1.4632295000.0553-
1.4880300000.05960.5812
1.5128305000.0547-
1.5376310000.05420.5956
1.5624315000.0547-
1.5872320000.05450.6053
1.6120325000.0525-
1.6368330000.05450.6137
1.6616335000.0532-
1.6864340000.05250.6213
1.7112345000.0529-
1.7360350000.05150.6152
1.7608355000.0506-
1.7856360000.05020.6211
1.8104365000.0513-
1.8352370000.04760.6344
1.8600375000.0491-
1.8848380000.04850.6438
1.9096385000.0488-
1.9344390000.04710.6591
1.9592395000.049-
1.9840400000.04860.6692
2.040322-0.6619
2.0088405000.044-
2.0336410000.04070.6729
2.0584415000.0422-
2.0832420000.04270.6775
2.1080425000.0425-
2.1328430000.0430.6772
2.1576435000.0426-
2.1824440000.040.6877
2.2072445000.041-
2.2320450000.04220.6885
2.2568455000.04-
2.2816460000.03990.6903
2.3064465000.0414-
2.3312470000.03970.7008
2.3560475000.0406-
2.3808480000.03950.7004
2.4056485000.0375-
2.4304490000.03910.6964
2.4552495000.0378-
2.4800500000.03790.7092
2.5048505000.0394-
2.5296510000.03990.7122
2.5544515000.0357-
2.5792520000.03620.7170
2.6040525000.0383-
2.6288530000.03960.7218
2.6536535000.037-
2.6784540000.03720.7312
2.7032545000.0372-
2.7280550000.03650.7303
2.7528555000.0364-
2.7776560000.03560.7366
2.8024565000.034-
2.8272570000.0360.7415
2.8520575000.035-
2.8768580000.03550.7402
2.9016585000.0331-
2.9264590000.03450.7475
2.9512595000.0345-
2.9760600000.03480.7489
3.060483-0.7500
3.0008605000.0351-
3.0256610000.02940.7537
3.0504615000.0297-
3.0752620000.03010.7557
3.1000625000.0311-
3.1248630000.03140.7628
3.1496635000.0288-
3.1744640000.03110.7713
3.1992645000.03-
3.2240650000.03070.7728
3.2488655000.0321-
3.2736660000.0280.7726
3.2984665000.031-
3.3232670000.02830.7717
3.3480675000.0302-
3.3728680000.03020.7808
3.3976685000.0303-
3.4224690000.02850.7790
3.4472695000.0304-
3.4720700000.02870.7856
3.4969705000.0301-
3.5217710000.02850.7886
3.5465715000.0295-
3.5713720000.02960.7899
3.5961725000.0269-
3.6209730000.02780.7911
3.6457735000.0299-
3.6705740000.02850.7898
3.6953745000.0286-
3.7201750000.02810.7891
3.7449755000.0308-
3.7697760000.02880.7893
3.7945765000.0283-
3.8193770000.02640.7953
3.8441775000.0265-
3.8689780000.02710.7942
3.8937785000.0263-
3.9185790000.02780.7932
3.9433795000.0258-
3.9681800000.0280.7996
3.9929805000.0284-
4.080644-0.8017
4.0177810000.02580.8022
4.0425815000.027-
4.0673820000.02280.8034
4.0921825000.0259-
4.1169830000.02570.8057
4.1417835000.0248-
4.1665840000.0250.8060
4.1913845000.024-
4.2161850000.02670.8084
4.2409855000.0244-
4.2657860000.02610.8058
4.2905865000.0256-
4.3153870000.02520.8061
4.3401875000.0246-
4.3649880000.02430.8095
4.3897885000.0243-
4.4145890000.02510.8113
4.4393895000.0247-
4.4641900000.02390.8109
4.4889905000.0248-
4.5137910000.02350.8129
4.5385915000.0246-
4.5633920000.02310.8132
4.5881925000.0254-
4.6129930000.02490.8140
4.6377935000.0229-
4.6625940000.0250.8143
4.6873945000.0244-
4.7121950000.02270.8158
4.7369955000.0223-
4.7617960000.02320.8166
4.7865965000.024-
4.8113970000.02430.8170
4.8361975000.0229-
4.8609980000.02430.8172
4.8857985000.0223-
4.9105990000.02520.8176
4.9353995000.0242-
4.96011000000.02210.8182
4.98491005000.022-
5.0100805-0.8182

</details>

Framework Versions

  • Python: 3.13.2
  • Sentence Transformers: 3.4.1
  • Transformers: 4.49.0
  • PyTorch: 2.7.0.dev20250221+cu128
  • Accelerate: 1.4.0
  • Datasets: 3.3.2
  • Tokenizers: 0.21.0

Citation

BibTeX

Sentence Transformers
bibtex
@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",
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->