CoolFace
Modelpublic

axiomepic/gte-persian-seo-keyword-embedding

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes30downloads
Model Card

SentenceTransformer based on xmanii/maux-gte-persian-v3

This is a sentence-transformers model finetuned from xmanii/maux-gte-persian-v3. It maps sentences & paragraphs to a 768-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: xmanii/maux-gte-persian-v3 <!-- at revision bfc1f208336b6aeea62db33b8453822a100e998f -->
  • —Maximum Sequence Length: 8192 tokens
  • —Output Dimensionality: 768 dimensions
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'NewModel'})
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Normalize()
)

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("axiomepic/gte-persian-seo-keyword-embedding")
# Run inference
sentences = [
    'چراغ قوه\u200c ضد انفجار',
    'دودی روشن',
    'ففدول',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.7218, 0.5096],
#         [0.7218, 1.0000, 0.5915],
#         [0.5096, 0.5915, 1.0000]])

<!--

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. -->

<!--

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: 8,721 training samples
  • —Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence1 | sentence2 | label | |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:------------------------------------------------| | type | string | string | int | | details | <ul><li>min: 3 tokens</li><li>mean: 6.51 tokens</li><li>max: 14 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 6.19 tokens</li><li>max: 18 tokens</li></ul> | <ul><li>0: ~35.90%</li><li>1: ~64.10%</li></ul> |
  • —Samples: | sentence1 | sentence2 | label | |:---------------------------|:-----------------------------------|:---------------| | <code>قیمت لباس بچه</code> | <code>بهترین سایت لباس کودک</code> | <code>1</code> | | <code>قیمت رژلب</code> | <code>قیمت ژل ابرو</code> | <code>1</code> | | <code>سیگار برگ‌</code> | <code>سیگاری</code> | <code>1</code> |
  • —Loss: <code>OnlineContrastiveLoss</code>

Evaluation Dataset

Unnamed Dataset
  • —Size: 969 evaluation samples
  • —Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
  • —Approximate statistics based on the first 969 samples: | | sentence1 | sentence2 | label | |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:------------------------------------------------| | type | string | string | int | | details | <ul><li>min: 3 tokens</li><li>mean: 6.49 tokens</li><li>max: 15 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 6.18 tokens</li><li>max: 19 tokens</li></ul> | <ul><li>0: ~33.54%</li><li>1: ~66.46%</li></ul> |
  • —Samples: | sentence1 | sentence2 | label | |:------------------------------|:-----------------------------------------|:---------------| | <code>خواص دنبه</code> | <code>خواص روغن دنبه</code> | <code>1</code> | | <code>چای ماچا</code> | <code>چای نعناع</code> | <code>1</code> | | <code>اشتراک اسپاتیفای</code> | <code>خرید اکانت پرمیوم اسپاتیفای</code> | <code>1</code> |
  • —Loss: <code>OnlineContrastiveLoss</code>

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: epoch
  • —per_device_train_batch_size: 16
  • —per_device_eval_batch_size: 64
  • —gradient_accumulation_steps: 2
  • —learning_rate: 1e-05
  • —num_train_epochs: 10
  • —warmup_ratio: 0.05
  • —log_level_replica: passive
  • —log_on_each_node: False
  • —logging_nan_inf_filter: False
  • —load_best_model_at_end: True
All Hyperparameters

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

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: epoch
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 16
  • —per_device_eval_batch_size: 64
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 2
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 1e-05
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 10
  • —max_steps: -1
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.05
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: passive
  • —log_on_each_node: False
  • —logging_nan_inf_filter: False
  • —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: True
  • —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
  • —hub_revision: None
  • —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
  • —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
  • —liger_kernel_config: None
  • —eval_use_gather_object: False
  • —average_tokens_across_devices: False
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

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

EpochStepTraining LossValidation Loss
0.003710.5054-
0.007320.5856-
0.011030.5052-
0.014741.1225-
0.018350.9045-
0.022060.9862-
0.025671.1367-
0.029381.032-
0.033091.1067-
0.0366100.5211-
0.0403111.3348-
0.0440120.7714-
0.0476130.5516-
0.0513140.8319-
0.0549150.8509-
0.0586161.1887-
0.0623171.4326-
0.0659180.8932-
0.0696190.7684-
0.0733200.6201-
0.0769211.6244-
0.0806220.786-
0.0842230.77-
0.0879240.8046-
0.0916250.7242-
0.0952260.8478-
0.0989271.0491-
0.1026280.4904-
0.1062291.277-
0.1099301.0306-
0.1136310.8367-
0.1172320.9737-
0.1209330.6155-
0.1245340.2685-
0.1282350.8825-
0.1319361.0767-
0.1355371.1151-
0.1392380.9151-
0.1429391.1762-
0.1465400.6362-
0.1502410.8624-
0.1538420.7831-
0.1575430.5686-
0.1612440.8203-
0.1648450.6298-
0.1685460.7037-
0.1722470.7446-
0.1758480.8063-
0.1795490.918-
0.1832501.2139-
0.1868510.7787-
0.1905520.4508-
0.1941530.8636-
0.1978540.8607-
0.2015551.1511-
0.2051560.7653-
0.2088570.441-
0.2125580.6974-
0.2161590.7481-
0.2198600.727-
0.2234610.8182-
0.2271620.4998-
0.2308630.949-
0.2344640.5796-
0.2381650.7822-
0.2418661.1591-
0.2454670.7478-
0.2491680.8698-
0.2527690.5906-
0.2564700.9387-
0.2601710.5571-
0.2637720.3962-
0.2674730.7237-
0.2711740.6404-
0.2747750.8193-
0.2784760.5669-
0.2821770.75-
0.2857780.6934-
0.2894790.6464-
0.2930800.6564-
0.2967810.6188-
0.3004820.6652-
0.3040830.4678-
0.3077840.7576-
0.3114850.5472-
0.3150860.7941-
0.3187870.6895-
0.3223880.6192-
0.3260890.6249-
0.3297900.6652-
0.3333910.8822-
0.3370921.0119-
0.3407930.8161-
0.3443940.6366-
0.3480950.7421-
0.3516960.8887-
0.3553970.8511-
0.3590980.5364-
0.3626990.7103-
0.36631000.4809-
0.37001010.4972-
0.37361020.711-
0.37731030.4176-
0.38101040.6275-
0.38461050.4639-
0.38831060.6699-
0.39191070.8027-
0.39561080.7053-
0.39931090.097-
0.40291100.7775-
0.40661110.4949-
0.41031120.7027-
0.41391130.3667-
0.41761140.6542-
0.42121150.5256-
0.42491160.5562-
0.42861170.365-
0.43221180.5834-
0.43591190.6584-
0.43961200.6638-
0.44321210.489-
0.44691220.5541-
0.45051230.1923-
0.45421240.4627-
0.45791250.4169-
0.46151260.3824-
0.46521270.5774-
0.46891280.3938-
0.47251290.5052-
0.47621300.6401-
0.47991310.5691-
0.48351320.5058-
0.48721330.5309-
0.49081340.4821-
0.49451350.5954-
0.49821360.3729-
0.50181370.6607-
0.50551380.5283-
0.50921390.6103-
0.51281400.456-
0.51651410.7122-
0.52011420.6458-
0.52381430.4434-
0.52751440.6982-
0.53111450.7074-
0.53481460.6441-
0.53851470.1969-
0.54211480.2974-
0.54581490.3946-
0.54951500.4603-
0.55311510.6021-
0.55681520.3643-
0.56041530.2497-
0.56411540.4532-
0.56781550.5185-
0.57141560.457-
0.57511570.4512-
0.57881580.48-
0.58241590.2682-
0.58611600.594-
0.58971610.6727-
0.59341620.7087-
0.59711630.4186-
0.60071640.4273-
0.60441650.5857-
0.60811660.2617-
0.61171670.4383-
0.61541680.4867-
0.61901690.4619-
0.62271700.1319-
0.62641710.2212-
0.63001720.5229-
0.63371730.6967-
0.63741740.338-
0.64101750.1651-
0.64471760.2449-
0.64841770.3473-
0.65201780.2902-
0.65571790.4093-
0.65931800.4406-
0.66301810.443-
0.66671820.4409-
0.67031830.7087-
0.67401840.4577-
0.67771850.3511-
0.68131860.3783-
0.68501870.5639-
0.68861880.4599-
0.69231890.4282-
0.69601900.242-
0.69961910.587-
0.70331920.67-
0.70701930.2562-
0.71061940.5278-
0.71431950.2321-
0.71791960.745-
0.72161970.6735-
0.72531980.4361-
0.72891990.3047-
0.73262000.3714-
0.73632010.8609-
0.73992020.4459-
0.74362030.1546-
0.74732040.4546-
0.75092050.4743-
0.75462060.3223-
0.75822070.4644-
0.76192080.6073-
0.76562090.5021-
0.76922100.5722-
0.77292110.237-
0.77662120.3782-
0.78022130.4302-
0.78392140.5929-
0.78752150.0646-
0.79122160.3934-
0.79492170.3317-
0.79852180.5997-
0.80222190.511-
0.80592200.384-
0.80952210.3319-
0.81322220.4738-
0.81682230.2536-
0.82052240.3429-
0.82422250.5208-
0.82782260.3044-
0.83152270.5025-
0.83522280.2541-
0.83882290.4347-
0.84252300.5067-
0.84622310.3975-
0.84982320.3168-
0.85352330.4299-
0.85712340.3067-
0.86082350.1385-
0.86452360.45-
0.86812370.7386-
0.87182380.4154-
0.87552390.287-
0.87912400.3703-
0.88282410.5419-
0.88642420.3498-
0.89012430.3481-
0.89382440.7203-
0.89742450.4363-
0.90112460.2272-
0.90482470.6132-
0.90842480.5764-
0.91212490.4819-
0.91582500.3273-
0.91942510.4039-
0.92312520.5303-
0.92672530.6131-
0.93042540.448-
0.93412550.0888-
0.93772560.4092-
0.94142570.196-
0.94512580.6282-
0.94872590.6653-
0.95242600.4198-
0.95602610.4985-
0.95972620.0-
0.96342630.2706-
0.96702640.5704-
0.97072650.4269-
0.97442660.2325-
0.97802670.4256-
0.98172680.4286-
0.98532690.3987-
0.98902700.4431-
0.99272710.578-
0.99632720.2845-
1.02730.12931.9891

</details>

Framework Versions

  • —Python: 3.11.13
  • —Sentence Transformers: 5.1.2
  • —Transformers: 4.53.3
  • —PyTorch: 2.6.0+cu124
  • —Accelerate: 1.9.0
  • —Datasets: 4.4.1
  • —Tokenizers: 0.21.2

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. -->