CoolFace
Modelpublic

qminh369/bctn-dense_embedding

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

SentenceTransformer based on intfloat/multilingual-e5-large

This is a sentence-transformers model finetuned from intfloat/multilingual-e5-large. It maps sentences & paragraphs to a 1024-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: intfloat/multilingual-e5-large <!-- at revision ab10c1a7f42e74530fe7ae5be82e6d4f11a719eb -->
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 1024 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': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 1024, '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})
  (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 = [
    'Chương trình hành động của FPT nhằm mục đích gì?',
    'FPT tham chiếu với những mục tiêu nào khi xác lập các chương trình hành động?',
    'FPT đã hình thành được bao nhiêu hệ sinh thái và giải pháp chuyển đổi số toàn diện?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

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

<!--

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: 3,516 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: 5 tokens</li><li>mean: 27.61 tokens</li><li>max: 68 tokens</li></ul> | <ul><li>min: 81 tokens</li><li>mean: 415.23 tokens</li><li>max: 512 tokens</li></ul> |
  • Samples: | sentence0 | sentence1 | |:-------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Câu hỏi: FPT tập trung hoạt động trên những lĩnh vực nào trong năm 2018 và có những chỉ số tài chính nổi bật nào?</code> | <code>1 <br> I. DẤU ẤN FPT 30 NĂM <br>1. Các ch ỉ số cơ bản và gi ải thư ởng nổi bật năm 2018 <br>1.1. Các chỉ số cơ bản <br>Năm 2018, FPT t ập trung ho ạt động trên 03 lĩnh v ực: Công ngh ệ, Viễn thông và Giáo d ục đào t ạo sau khi <br>thoái v ốn tại lĩnh v ực Phân ph ối và Bán l ẻ. Các ch ỉ số tài chính tiêu bi ểu của FPT như sau: <br>- Doanh thu <br>✓ Tổng doanh thu: 23.214 t ỷ đồng, tăng 17,4% <br>✓ Doanh thu t ừ thị trường nư ớc ngoài: 9.109 t ỷ đồng, tăng 26,5% <br>- Lợi nhu ận LNTT <br>✓ Tổng LNTT: 3. 858 tỷ đồng, tăng 30, 6% <br>✓ Tổng LNTT t ừ thị trường nư ớc ngoài: 1.492 t ỷ đồng, tăng 23,6% <br>- Tỷ trọng doanh thu <br>✓ Doanh thu kh ối công ngh ệ/tổng doanh thu: 57,7% <br>✓ Doanh thu chuy ển đổi số/tổng doanh thu xu ất khẩu phần mềm: 20% <br>- Tỷ suất LNTT: 16,6%, g ấp 1,7 l ần năm 2017 <br>- Quy mô nhân l ực () <br>✓ Tổng nhân l ực: 27. 843 người <br>✓ Số kỹ sư, lập trình viên, chuyên gia công ngh ệ: 16.3 23 ngư ời <br>(): Do trong năm 2018, FPT Retail và Synnex FPT không còn là công ty con trong T ập đoàn nên t ổng <br>nhân l ực của Tập đoàn không bao g ồm nhân l ực tại hai công ty này. <br>1.2. Giải thưởng <br>- Top 10 Công ty tư nhân l ớn nhất Việt Nam <br>- Top 40 Thương hi ệu công ty giá tr ị nhất Việt Nam <br>- Top 50 Công ty niêm y ết tốt nhất Việt Nam <br>- Top 50 Công ty kinh doanh hi ệu quả nhất Việt Nam <br>- Đối tác tư v ấn cấp cao đ ầu tiên t ại khu v ực ASEAN - AWS Premier Consulting Partner <br>- Top 130 công ty có môi trư ờng làm vi ệc tốt nhất khu v ực châu Á <br>- Tổ chức đào t ạo CNTT xu ất sắc (ASOCIO + BrandLaureate) <br>2. Hoạt động nổi bật năm 2018 <br>2.1. Lần đầu tiên doanh nghiệp Việt Nam mua một công ty tư vấn công nghệ Mỹ <br>Với mục tiêu cung c ấp những giá tr ị cao hơn cho khách hàng trên ph ạm vi toàn c ầu và m ở rộng hơn n ữa <br>quy mô ho ạt động tại thị trường M ỹ, FPT tr ở thành công ty CNTT đ ầu tiên c ủa Việt Nam mua 90% c ổ phần <br>của công ty tư v ấn Mỹ - Intellinet.</code> | | <code>Tại sao FPT quyết định mua công ty tư vấn công nghệ Intellinet của Mỹ?</code> | <code>Hoạt động nổi bật năm 2018 <br>2.1. Lần đầu tiên doanh nghiệp Việt Nam mua một công ty tư vấn công nghệ Mỹ <br>Với mục tiêu cung c ấp những giá tr ị cao hơn cho khách hàng trên ph ạm vi toàn c ầu và m ở rộng hơn n ữa <br>quy mô ho ạt động tại thị trường M ỹ, FPT tr ở thành công ty CNTT đ ầu tiên c ủa Việt Nam mua 90% c ổ phần <br>của công ty tư v ấn Mỹ - Intellinet. Đây là m ột trong nh ững công ty tư v ấn công ngh ệ có tốc độ tăng trư ởng <br>nhanh nh ất tại Mỹ. <br>Thương v ụ này giúp FPT nâng t ầm vị thế công ngh ệ, trở thành đ ối tác cung c ấp các d ịch vụ công ngh ệ tổng <br>thể với giá tr ị cao hơn và toàn di ện hơn cho khách hàng, t ừ khâu tư v ấn chi ến lược, thi ết kế đến triển khai,</code> | | <code>Theo bạn, việc FPT mua Intellinet sẽ ảnh hưởng như thế nào đến quy mô hoạt động của FPT tại thị trường Mỹ?</code> | <code>Hoạt động nổi bật năm 2018 <br>2.1. Lần đầu tiên doanh nghiệp Việt Nam mua một công ty tư vấn công nghệ Mỹ <br>Với mục tiêu cung c ấp những giá tr ị cao hơn cho khách hàng trên ph ạm vi toàn c ầu và m ở rộng hơn n ữa <br>quy mô ho ạt động tại thị trường M ỹ, FPT tr ở thành công ty CNTT đ ầu tiên c ủa Việt Nam mua 90% c ổ phần <br>của công ty tư v ấn Mỹ - Intellinet. Đây là m ột trong nh ững công ty tư v ấn công ngh ệ có tốc độ tăng trư ởng <br>nhanh nh ất tại Mỹ. <br>Thương v ụ này giúp FPT nâng t ầm vị thế công ngh ệ, trở thành đ ối tác cung c ấp các d ịch vụ công ngh ệ tổng <br>thể với giá tr ị cao hơn và toàn di ện hơn cho khách hàng, t ừ khâu tư v ấn chi ến lược, thi ết kế đến triển khai,</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • 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: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_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: 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
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

</details>

Training Logs

EpochStepTraining Loss
0.56885000.2547
1.137710000.1518
1.706515000.0559
2.275320000.0285
2.844125000.0163
3.413030000.0062
3.981835000.0038
4.550640000.0026

Framework Versions

  • Python: 3.10.14
  • Sentence Transformers: 3.0.0
  • Transformers: 4.41.1
  • PyTorch: 2.3.0+cu118
  • Accelerate: 0.31.0
  • Datasets: 2.19.1
  • 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. -->