CoolFace
Modelpublic

magnifi/bge-small-en-v1.5-ft-orc-0813

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes86downloads
Model Card

SentenceTransformer based on BAAI/bge-small-en-v1.5

This is a sentence-transformers model finetuned from BAAI/bge-small-en-v1.5. 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: BAAI/bge-small-en-v1.5 <!-- at revision 5c38ec7c405ec4b44b94cc5a9bb96e735b38267a -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 384 tokens
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 384, '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("sentence_transformers_model_id")
# Run inference
sentences = [
    'how should I play [TICKER] futures contracts',
    '[]',
    '[{"get_attribute([\'<TICKER1>\'],[\'returns\'],\'<DATES>\')": "live_price_<TICKER1>"}]',
]
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

Information Retrieval
MetricValue
cosine_accuracy@10.7192
cosine_accuracy@30.9247
cosine_accuracy@50.9521
cosine_accuracy@100.9795
cosine_precision@10.7192
cosine_precision@30.3082
cosine_precision@50.1904
cosine_precision@100.0979
cosine_recall@10.02
cosine_recall@30.0257
cosine_recall@50.0264
cosine_recall@100.0272
cosine_ndcg@100.1887
cosine_mrr@100.8171
cosine_map@1000.0227
dot_accuracy@10.7192
dot_accuracy@30.9247
dot_accuracy@50.9521
dot_accuracy@100.9795
dot_precision@10.7192
dot_precision@30.3082
dot_precision@50.1904
dot_precision@100.0979
dot_recall@10.02
dot_recall@30.0257
dot_recall@50.0264
dot_recall@100.0272
dot_ndcg@100.1887
dot_mrr@100.8171
dot_map@1000.0227

<!--

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: 491 training samples
  • —Columns: <code>sentence0</code> and <code>sentence1</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | |:--------|:---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 4 tokens</li><li>mean: 11.9 tokens</li><li>max: 26 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 67.55 tokens</li><li>max: 194 tokens</li></ul> |
  • —Samples: | sentence0 | sentence1 | |:------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------| | <code>Profitability of [TICKER]</code> | <code>[{"getattribute(['<TICKER1>'],['cash flow profitability'],'<DATES>')": "profitability<TICKER1>"}]</code> | | <code>[TICKER] momentum</code> | <code>[{"getattribute(['<TICKER1>'],['momentum'],'<DATES>')": "momentum<TICKER1>"}]</code> | | <code>what was the total return of [TICKER] for 2023</code> | <code>[{"getattribute(['<TICKER1>'],['returns'],'<DATES>')": "performancedata_<TICKER1>"}]</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 10
  • —per_device_eval_batch_size: 10
  • —num_train_epochs: 6
  • —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: 10
  • —per_device_eval_batch_size: 10
  • —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: 6
  • —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: False
  • —hub_always_push: False
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —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
  • —eval_use_gather_object: False
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: round_robin

</details>

Training Logs

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

EpochStepcosine_map@100
0.0420.0137
0.0840.0137
0.1260.0138
0.1680.0142
0.2100.0144
0.24120.0147
0.28140.0149
0.32160.0151
0.36180.0155
0.4200.0166
0.44220.0170
0.48240.0174
0.52260.0179
0.56280.0181
0.6300.0184
0.64320.0186
0.68340.0189
0.72360.0191
0.76380.0192
0.8400.0195
0.84420.0195
0.88440.0195
0.92460.0195
0.96480.0196
1.0500.0197
1.04520.0196
1.08540.0198
1.12560.0200
1.16580.0202
1.2600.0202
1.24620.0205
1.28640.0206
1.32660.0207
1.3600680.0208
1.4700.0208
1.44720.0209
1.48740.0210
1.52760.0211
1.56780.0211
1.6800.0209
1.6400820.0210
1.6800840.0209
1.72860.0209
1.76880.0210
1.8900.0211
1.8400920.0211
1.88940.0211
1.92960.0214
1.96980.0216
2.01000.0218
2.041020.0217
2.081040.0217
2.121060.0219
2.161080.0221
2.21100.0219
2.241120.0217
2.28001140.0217
2.321160.0217
2.361180.0218
2.41200.0219
2.441220.0219
2.481240.0219
2.521260.0222
2.561280.0220
2.61300.0221
2.641320.0221
2.681340.0221
2.72001360.0221
2.761380.0222
2.81400.0222
2.841420.0224
2.881440.0224
2.921460.0223
2.961480.0224
3.01500.0223
3.041520.0223
3.081540.0223
3.121560.0223
3.161580.0223
3.21600.0223
3.241620.0223
3.28001640.0223
3.321660.0223
3.361680.0223
3.41700.0223
3.441720.0224
3.481740.0224
3.521760.0225
3.561780.0224
3.61800.0224
3.641820.0224
3.681840.0225
3.72001860.0225
3.761880.0225
3.81900.0225
3.841920.0225
3.881940.0225
3.921960.0226
3.961980.0226
4.02000.0226
4.042020.0226
4.082040.0226
4.122060.0226
4.162080.0225
4.22100.0225
4.242120.0225
4.282140.0225
4.322160.0225
4.362180.0226
4.42200.0227

</details>

Framework Versions

  • —Python: 3.10.9
  • —Sentence Transformers: 3.0.1
  • —Transformers: 4.44.0
  • —PyTorch: 2.4.0+cu121
  • —Accelerate: 0.33.0
  • —Datasets: 2.20.0
  • —Tokenizers: 0.19.1

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",
}
MultipleNegativesRankingLoss
bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply}, 
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

<!--

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