iambestfeed/phobert-base-v2-finetuned-raw_data_wseg-lr2e-05-1-epochs-bs-32
SentenceTransformer based on vinai/phobert-base-v2
This is a sentence-transformers model finetuned from vinai/phobert-base-v2 on the vnexpress-data-similarity dataset. 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: vinai/phobert-base-v2 <!-- at revision e2375d266bdf39c6e8e9a87af16a5da3190b0cc8 -->
- Maximum Sequence Length: 256 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Training Dataset:
- vnexpress-data-similarity <!-- - Language: Unknown --> <!-- - License: Unknown -->
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: RobertaModel
(1): Pooling({'word_embedding_dimension': 768, '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:
pip install -U sentence-transformersThen you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("iambestfeed/phobert-base-v2-finetuned-raw_data_wseg-lr2e-05")
# Run inference
sentences = [
'Sau 27 năm gia_nhập làng giải_trí , MC - diễn_viên Thanh_Mai hiện hoạt_động nghệ_thuật cầm_chừng , chủ_yếu tập_trung kinh_doanh . - Ngôi_sao',
'Anh_Tuấn \n - Showbiz \n - Thời_trang \n - Làm_đẹp \n - Xem \n - Ăn_chơi \n - Lối_sống \n - Thể_thao \n - Thời_cuộc \n - Podcasts \n - Thương_trường \n - Trắc_nghiệm \n - Video \n - Ảnh \n - Reviews & Deals \n Sau 27 năm gia_nhập làng giải_trí , MC - diễn_viên Thanh_Mai hiện hoạt_động nghệ_thuật cầm_chừng , chủ_yếu tập_trung kinh_doanh . \n Anh_Tuấn',
'Phòng Cảnh_sát hình_sự Công_an tỉnh Quảng_Nam cho biết Vũ_Viết Hải , trú thị_trấn Trà_My , huyện Bắc_Trà_My , bị bắt 7h sáng nay khi đang trốn ở phường Trường_Xuân , thành_phố Tam_Kỳ . \n Hải đang đối_mặt với cáo_buộc cướp tài_sản . \n Trước đó , tối 26 / 11 , Hải đi xe_máy mang biển số giả đến cây_xăng bán_lẻ Tiên_Cảnh ở xã Tiên_Cảnh , huyện Tiên_Phước , chờ khách vãn mới đi vào , đề_nghị đổ xăng cho xe_máy của mình . Khi chủ cây_xăng đang bơm xăng , nghi can rút liềm trong người , từ phía sau quàng tay dí vào cổ uy_hiếp . \n Thời_điểm này , cây_xăng có một nhân_viên ngồi phía trong kiểm_đếm tiền và ghi sổ_sách . Hải yêu_cầu chủ cây_xăng đưa hết tiền trong túi , tổng_cộng hơn 15 triệu đồng . \n Theo đại_tá Trần_Văn_Xuân , Trưởng_Phòng Cảnh_sát hình_sự Công_an tỉnh Quảng_Nam , Hải khai trốn ở nhiều nơi . Sáng 5 / 12 , Hải về thành_phố Tam_Kỳ , mượn xe_máy và giật túi_xách của một phụ_nữ trên đường Bạch_Đằng , bên trong có 100.000 đồng và một điện_thoại . \n Nghi_vụ cướp này và cướp tiền ở cây_xăng Tiên_Cảnh có liên_quan , Công_an thành_phố Tam_Kỳ lần theo dấu_vết đã phát_hiện ra Hải . \n Hải không nghề_nghiệp ổn_định , theo cha_mẹ từ huyện Chương Mỹ , Hà_Nội vào lập_nghiệp ở thị_trấn Trà_My , huyện Bắc_Trà_My theo diện kinh_tế mới .',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# 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
vnexpress-data-similarity
- Dataset: vnexpress-data-similarity at e6cb542
- Size: 349,711 training samples
- Columns: <code>anchor</code> and <code>positive</code>
- Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 5 tokens</li><li>mean: 29.65 tokens</li><li>max: 70 tokens</li></ul> | <ul><li>min: 22 tokens</li><li>mean: 205.8 tokens</li><li>max: 256 tokens</li></ul> |
- Samples: | anchor | positive | |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Tôi ở chungcư , dịp cuối tuần hoặc ngày lễ là người hàngxóm lại rủ bạnbè đến nhậu , lôi loa kẹo kéo ra hànhlang hát , & quot ; tratấn & quot ; cả tầng trong nhiều giờ . - VnExpress</code> | <code>Họ vặn loa hết cỡ , hát từ trưa đến chiều . Cănhộ tôi ở sát bên , dù đã đóng hết cửa nhưng các con tôi vẫn không ngủ được . <br> Trước đó , trưởng tầng từng gópý với giađình này , tôi cũng báo bảovệ chungcư lên nhắcnhở , nhưng họ vẫn táidiễn . Tôi không biết hànhvi này có bị xửphạt vì gây ônhiễm tiếng ồn không ? Tôi nên làm gì để tìnhtrạng này được xửlý dứtđiểm ? ( NgọcDung )</code> | | <code>ViệtNam nằm trong số năm nước có khốilượng giaodịch lớn nhất trên sàn Binance với số tiền 20 tỷ USD trong tháng 5 . - VnExpress</code> | <code>Theo thốngkê của WSJ , các nhà đầutư ViệtNam giaodịch khoảng 20 tỷ USD trên sàn tiền số lớn nhất thếgiới và hìnhthức chiếm 90 % là Future ( hợpđồng tươnglai ) . Consố này đạt gần 5 % trong tổng khốilượng giaodịch toàncầu của Binance . <br> Nước có lượng giaodịch hàng tháng cao nhất là TrungQuốc với 90 tỷ USD , tiếptheo là HànQuốc và ThổNhĩKỳ với 60 tỷ và 45 tỷ USD. Khuvực còn lại trong top 5 là Quầnđảo Virgin của Anh với 18 tỷ USD. <br> Sốliệu thốngkê gây bấtngờ khi TrungQuốc chiếm 20 % tổng khốilượng giaodịch toàncầu của Binance , trong khi chínhphủ nước này cấm tấtcả hoạtđộng giaodịch và đầutư tiền số từ 2021 . Bên cạnh đó , Binance cũng tuyênbố không còn hoạtđộng tại đây . Theo nguồn tin nộibộ , hiện có 900.000 nhà đầutư TrungQuốc hoạtđộng trên Binance , còn tổngsố nhà đầutư tiền số nóichung tại quốcgia này là 5,6 triệu . Để lách luật , Binance điều hướng người dùng TrungQuốc đến các trangweb có tênmiền thuộc quốcgia này trước khi chuyển tới s...</code> | | <code>Màn giả gái của JangDongYoon trong ' TheTale of Nokdu ' lên top tìmkiếm mạng xãhội Hàn .</code> | <code>Dramacổ trang TheTale of Nokdu lên sóng 2 tập đầuvào thứ hai - thứ ba vừaqua . Phim của đài KBS có rating đứng đầu trong các phim cùng khung giờ . Theo chỉsố từ NielsenKorea , hai tập đầu TheTale of Nokdu có rating trungbình lầnlượt là 6,5 % và 8,3 % , thờiđiểm rating cao nhất lên 9,6 % . Đã lâu rồi đài KBS mới có phim đạt rating cao nhưvậy . Tácphẩm trước của đài này là I Wanna Hear Your Song chỉ có rating ở mức 3,6 - 4.0 % . <br> TheTale of Nokdu kể về Jeon NokDu ( do JangDongYoonthủ vai ) , một chàng trai lưulạc đến ngôi làng toàn góa phụ . Để sống được ở đây , NokDu phải giả gái và nhận DongDongJoo ( Kim SoHyun ) làm con gái nuôi , hướngdẫn cô các kỹnăng để trởthành một kỹnữ . <br> Trong 2 tập đầu , NokDu đã tìm đến ngôi làng . Vì phải giả gái , anhchàng tạo ra biếtbao tìnhhuống dở khóc dở cười . Nam diễnviên JangDongYoon nhận được lời khen qua cách thểhiện sự bốirối khi phải mặc trangphục nữgiới , đồngthời diễnvẻ điệuđà , tinhtế của phụ_nữ ở từng...</code> |
- Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 32learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1save_safetensors: Falsefp16: Truepush_to_hub: Truehub_model_id: iambestfeed/phobert-base-v2-finetuned-rawdatawseg-lr2e-05batch_sampler: no_duplicates
All Hyperparameters
<details><summary>Click to expand</summary>
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 8per_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: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Falsesave_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: Truefp16_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: Truedataloader_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: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': 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: Nonehub_model_id: iambestfeed/phobert-base-v2-finetuned-rawdatawseg-lr2e-05hub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsegradient_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
</details>
Training Logs
<details><summary>Click to expand</summary>
</details>
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.3.1
- Transformers: 4.47.0
- PyTorch: 2.5.1+cu121
- Accelerate: 1.2.1
- Datasets: 3.3.1
- Tokenizers: 0.21.0
Citation
BibTeX
Sentence Transformers
@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
@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. -->
