NamCr17/bkai-fine-tuned-dermatology
bkai-fine-tuned-dermatology
This is a sentence-transformers model finetuned from bkai-foundation-models/vietnamese-bi-encoder on the json 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: bkai-foundation-models/vietnamese-bi-encoder <!-- at revision 84f9d9ada0d1a3c37557398b9ae9fcedcdf40be0 -->
- Maximum Sequence Length: 256 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Training Dataset:
- json
- Language: vi
- License: apache-2.0
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("NamCr17/bkai-fine-tuned-dermatology")
# Run inference
sentences = [
'Điều_trị prurigo nodularis nhằm mục_đích giảm ngứa và viêm , bao_gồm : 1 . Điều_trị tại_chỗ : Thuốc_mỡ hoặc kem bôi có chứa corticosteroid , capsaicin hoặc chất ức_chế calcineurin . 2 . Thuốc uống : Corticosteroid , thuốc kháng histamine hoặc thuốc ảnh_hưởng đến hệ miễn_dịch . 3 . Liệu_pháp ánh_sáng : Phương_pháp này bao_gồm việc chiếu một_số loại ánh_sáng nhất_định vào da để giúp giảm ngứa và viêm . 4 . Liệu_pháp lạnh : Đông_lạnh các nốt sần bằng nitơ lỏng để giúp giảm kích_thước . Hãy nhớ luôn tham_khảo ý_kiến chuyên_gia chăm_sóc sức_khỏe trước khi bắt_đầu bất_kỳ phương_pháp điều_trị nào .',
'Phương_pháp điều_trị bệnh prurigo nodularis là gì ?',
'Nguyên_nhân gây bệnh vẩy_nến là gì , triệu_chứng của bệnh là gì và cách kiểm_soát như thế_nào ?',
]
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. -->
Evaluation
Metrics
Information Retrieval
- Dataset:
dim_768 - Evaluated with <code>InformationRetrievalEvaluator</code> with these parameters:
{
"truncate_dim": 768
}Information Retrieval
- Dataset:
dim_512 - Evaluated with <code>InformationRetrievalEvaluator</code> with these parameters:
{
"truncate_dim": 512
}Information Retrieval
- Dataset:
dim_256 - Evaluated with <code>InformationRetrievalEvaluator</code> with these parameters:
{
"truncate_dim": 256
}Information Retrieval
- Dataset:
dim_128 - Evaluated with <code>InformationRetrievalEvaluator</code> with these parameters:
{
"truncate_dim": 128
}Information Retrieval
- Dataset:
dim_64 - Evaluated with <code>InformationRetrievalEvaluator</code> with these parameters:
{
"truncate_dim": 64
}<!--
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
json
- Dataset: json
- Size: 1,168 training samples
- Columns: <code>positive</code> and <code>anchor</code>
- Approximate statistics based on the first 1000 samples: | | positive | anchor | |:--------|:-------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 44 tokens</li><li>mean: 145.24 tokens</li><li>max: 235 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 15.36 tokens</li><li>max: 33 tokens</li></ul> |
- Samples: | positive | anchor | |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------| | <code>Rosacea là một tìnhtrạng da mãntính gây ra mẩn đỏ , sưng tấy và đôikhi là những nốt mụn nhỏ chứa mủ trên mặt . Nguyênnhân chínhxác vẫn chưa được biết rõ , nhưng cóthể do các yếutố như nhiệtđộ khắcnghiệt , đồ ăn cay , rượu , căngthẳng , ánh nắng mặttrời hoặc gió , mộtsố loại mỹphẩm và mộtsố loại thuốc gây ra . Các triệuchứng phổbiến của bệnh rosacea baogồm đỏ mặt , các nốt mụn đỏ sưng tấy , các vấnđề về mắt ( nhiều người bị bệnh rosacea cũng bị khô , kíchứng , sưng mắt và mí mắt đỏ sưng tấy ) và mũi to . Mặcdù không có cách chữa khỏi bệnh rosacea , nhưng các phươngpháp điềutrị cóthể kiểmsoát và làm giảm các dấuhiệu và triệuchứng . Các lựachọn baogồm thuốc bôi ngoài da , khángsinh uống , liệupháp laser và phẫuthuật . Ngoàira , việc xácđịnh và tránh các tácnhân gây bệnh cóthể giúp kiểmsoát bệnh rosacea . Điều quantrọng là phải thamkhảo ýkiến bácsĩ chămsóc sứckhỏe hoặc bácsĩ daliễu để được chẩnđoán và lập kếhoạch điềutrị .</code> | <code>Nguyênnhân gây ra bệnh trứngcá đỏ , triệuchứng và cách điềutrị như thếnào ?</code> | | <code>Đúngvậy , giống như bấtkỳ loại thuốc nào , việc điềutrị rụng tóc từng vùng cóthể có các tácdụng phụ tiềmẩn . 1 . Corticosteroid : Sửdụng corticosteroid trong thờigian dài , dù là bôi ngoài da hay tiêm , cóthể dẫn đến da mỏng và đổi màu . Các tácdụng phụ khác cóthể baogồm dễ bị bầm tím , thayđổi phânbố mỡ trong cơthể và trong mộtsố trườnghợp , thayđổi tâmtrạng . 2 . Liệupháp miễndịch tạichỗ : Phươngpháp điềutrị này cóthể dẫn đến phảnứng dịứng , đặctrưng bởi đỏ , ngứa và khóchịu tại vịtrí bôi thuốc . 3 . Minoxidil : Tácdụng phụ của minoxidil cóthể baogồm kíchứng da đầu , mọc lông không mongmuốn ở các vùng lâncận và nhịp tim nhanh . 4 . Thuốc ứcchế miễndịch : Thuốc ứcchế hệ miễndịch cóthể làm tăng nguycơ nhiễmtrùng và cóthể gây ra các tácdụng phụ khác như buồnnôn , đau bụng và tổnthương gan . Điều này rất quantrọng</code> | <code>Các phươngpháp điềutrị rụng tóc từng mảng có tácdụng phụ nào không ?</code> | | <code>Mặcdù chốclở thường là một tìnhtrạng nhẹ và tự khỏi , nhưng nếu không được điềutrị , đôikhi nó cóthể dẫn đến các biếnchứng như : 1 . Viêm mô tếbào : Đây là một bệnh nhiễmtrùng da nghiêmtrọng hơn ảnhhưởng đến các lớp sâu hơn của da . 2 . Viêm thận ( viêm cầu thận sau nhiễm liên cầukhuẩn ) : Đây là một biếnchứng hiếm gặp cóthể xảy ra sau khi nhiễm liên cầukhuẩn , có khảnăng dẫn đến tổnthương thận . 3 . Sẹo : Nếu vết loét trên da lớn , chúng cóthể để lại sẹo nhỏ khi lành . 4 . MRSA ( tụ cầu vàng kháng methicillin ) : Đây là một loại vikhuẩn tụ cầu kháng nhiều loại khángsinh . Nếu bạn nghingờ mình bị chốclở , điều quantrọng là phải thamkhảo ýkiến của nhà cungcấp dịchvụ chămsóc sứckhỏe để ngănngừa những biếnchứng tiềmẩn này .</code> | <code>Những biếnchứng tiềmẩn của bệnh chốclở không được điều_trị là gì ?</code> |
- Loss: <code>MatryoshkaLoss</code> with these parameters:
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": -1
}Evaluation Dataset
json
- Dataset: json
- Size: 146 evaluation samples
- Columns: <code>positive</code> and <code>anchor</code>
- Approximate statistics based on the first 146 samples: | | positive | anchor | |:--------|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 59 tokens</li><li>mean: 142.4 tokens</li><li>max: 220 tokens</li></ul> | <ul><li>min: 9 tokens</li><li>mean: 15.07 tokens</li><li>max: 30 tokens</li></ul> |
- Samples: | positive | anchor | |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------| | <code>Mặcdù viêm mô tếbào cần được điềutrị ytế ( thường là khángsinh ) , nhưng có những bước mà ngườibệnh cóthể thựchiệntại nhà để kiểmsoát các triệuchứng và đẩy nhanh quátrình phụchồi : 1 . Nghỉngơi và nâng cao vùng bị nhiễmtrùng : Điều này cóthể giúp giảm sưng và giảm khóchịu . 2 . Sửdụng thuốc giảm đau không kê đơn : Thuốc giảm đau không kê đơn như ibuprofen hoặc acetaminophen cóthể giúp kiểmsoát cơn đau và hạ sốt . 3 . Giữ đủ nước : Uống đủ nước hỗtrợ hệthống miễndịch và sứckhỏe tổngthể của bạn . 4 . Đắp khăn mát , ẩm lên vùng bị ảnhhưởng : Điều này cóthể làm dịu da và giảm đau . Hãy nhớ rằng những biệnpháp khắcphục này chỉ nhằm mụcđích bổsung chứ không thaythế điềutrị ytế . Điều quantrọng là phải được chămsóc ytế khi bị viêm mô tếbào để tránh các biếnchứng .</code> | <code>Mộtsố biệnpháp khắcphục tại nhà hiệuquả để kiểmsoát các triệuchứng của bệnh viêm mô tếbào là gì ?</code> | | <code>Sơcứu bỏng nhẹ baogồm các bước sau : 1 . Làm mát vết bỏng : Đặt vùng bị bỏng dưới vòinước mát ( không lạnh ) đang chảy trong 10 đến 15 phút hoặc cho đến khi cơn đau dịu đi . Bạn cũng cóthể chườm gạc ướt , mát lên vùng bị bỏng . 2 . Bảovệ vết bỏng : Che vết bỏng bằng băng vôtrùng , không dính hoặc vải sạch . 3 . Giảm đau : Thuốc giảm đau không kê đơn cóthể giúp giảm đau và giảm viêm . 4 . Giữ đủ nước : Uống nhiều nước , vì bỏng cóthể khiến bạn dễ bị mất nước . 5 . Theodõi nhiễmtrùng : Theodõi vết bỏng để tìm các dấuhiệu nhiễmtrùng , chẳnghạn như đau tăng lên , đỏ , sốt , sưng hoặc rỉ dịch . Nếu nhiễmtrùng pháttriển , hãy tìmkiếm sự trợgiúp ytế ngay lậptức . Hãy nhớ rằng , các vết bỏng nghiêmtrọng cần được chuyêngia chămsóc sứckhỏe kiểmtra . Nếu vết bỏng lớn hơn , nếu nó</code> | <code>Các biệnpháp sơcứu cho vết bỏng nhẹ là gì ?</code> | | <code>Có , mộtsố thayđổi lối sống nhấtđịnh cóthể giúp kiểmsoát viêm da cơ : 1 . Tậpthểdục thườngxuyên : Mặcdù nghỉngơi rất quantrọng trong quátrình viêm hoạtđộng , nhưng hoạtđộng thểchất thườngxuyên cóthể giúp duytrì và cảithiện sứcmạnh và độ linhhoạt của cơ . 2 . Chếđộ ănuống lànhmạnh : Chếđộ ănuống cânbằng cóthể cungcấp các chất dinhdưỡng cầnthiết cho sứckhỏe tổngthể và nănglượng . 3 . Chống nắng : Bảovệ da khỏi ánh nắng mặttrời cóthể giúp ngănngừa phátban da liênquan đến viêm da cơ . 4 . Nghỉngơi : Ngủ đủ giấc và nghỉngơi cóthể giúp cơthể phụchồi và kiểmsoát tìnhtrạng mệtmỏi . 5 . Kiểmtra sứckhỏe địnhkỳ : Theodõi thườngxuyên cóthể giúp pháthiện sớm bấtkỳ thayđổi hoặc biếnchứng nào . Hãy nhớ rằng , điều quantrọng là phải thảoluận về bấtkỳ thayđổi lối sống nào với nhà cungcấp dịchvụ chămsóc sứckhỏe của bạn để đảmbảo chúng phùhợp với tìnhtrạng cụthể của bạn .</code> | <code>Có bấtkỳ thayđổi lối sống nào cóthể giúp kiểm_soát bệnh viêm da cơ không ?</code> |
- Loss: <code>MatryoshkaLoss</code> with these parameters:
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": -1
}Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: epochper_device_train_batch_size: 16per_device_eval_batch_size: 16gradient_accumulation_steps: 4learning_rate: 1e-05weight_decay: 0.1num_train_epochs: 5lr_scheduler_type: cosinewarmup_ratio: 0.1fp16: Trueload_best_model_at_end: Truegroup_by_length: Truebatch_sampler: no_duplicates
All Hyperparameters
<details><summary>Click to expand</summary>
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 4eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 1e-05weight_decay: 0.1adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 5max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_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: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_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: Truelength_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: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_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: 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
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.11.13
- Sentence Transformers: 4.1.0
- Transformers: 4.52.4
- PyTorch: 2.6.0+cu124
- Accelerate: 1.8.1
- Datasets: 3.6.0
- Tokenizers: 0.21.2
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",
}MatryoshkaLoss
@misc{kusupati2024matryoshka,
title={Matryoshka Representation Learning},
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
year={2024},
eprint={2205.13147},
archivePrefix={arXiv},
primaryClass={cs.LG}
}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. -->
