Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertModel'})
(1): Pooling({'word_embedding_dimension': 384, '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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("along26/all-MiniLM-L6-v2_multilingual_malaysian-v2")
5# Run inference
6sentences = [
7 'How can we design small molecule inhibitors of viral protein targets to prevent the replication of the influenza virus?',
8 'Bagaimanakah kita boleh mereka bentuk perencat molekul kecil sasaran protein virus untuk mencegah replikasi virus influenza?',
9 "How does the Malaysian government's authoritarian approach to dissent and free speech stifle progressive movements and limit the potential for democratic reform?",
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 384]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.0462, 0.9062],
19# [0.0462, 1.0000, 0.0619],
20# [0.9062, 0.0619, 1.0000]])TripletEvaluator| Metric | Value |
|---|---|
| cosine_accuracy | 0.0044 |
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
How has the culture of corruption and cronyism under Najib Razak's administration affected the Malaysian economy and social fabric? | Bagaimanakah budaya rasuah dan kronisme di bawah pentadbiran Najib Razak menjejaskan ekonomi dan fabrik sosial Malaysia? | What is the role of the pancreas in the human digestive system and how does its anatomy support this function? |
Why have some opposition politicians in Malaysia criticized the government's handling of the 1MDB scandal and called for more transparency? | Mengapa beberapa ahli politik pembangkang di Malaysia mengkritik pengendalian kerajaan terhadap skandal 1MDB dan meminta lebih ketelusan? | The formation of heavy elements (nucleosynthesis) inside a star involves several processes, which are affected by the star's evolution. These processes include:[object Object][object Object]1. Hydrogen burning (nuclear fusion): This is the initial stage of a star's life, where hydrogen nuclei (protons) combine to form helium nuclei (alpha particles) through a series of reactions called the proton-proton chain or the CNO cycle (carbon-nitrogen-oxygen). This process releases a large amount of energy in the form of light and heat, which causes the star to shine.[object Object][object Object]2. Helium burning (triple-alpha process): As the hydrogen in the core of the star is depleted, the core contracts and heats up, initiating the fusion of helium nuclei into heavier elements like carbon and oxygen. This process involves the combination of three helium nuclei (alpha particles) to form a carbon nucleus.[object Object][object Object]3. Carbon burning: In more massive stars, the core temperature increases further, allowing carbon nuclei to fuse with helium nuclei to form ox... |
How has Najib Razak's corruption allegedly contributed to social inequality and poverty in Malaysia? | Bagaimanakah rasuah Najib Razak didakwa menyumbang kepada ketidaksamaan sosial dan kemiskinan di Malaysia? | To estimate the age of a supermassive black hole with a mass of 1 billion solar masses, we can assume that it formed shortly after the Big Bang. The age of the universe is approximately 13.8 billion years old, so the black hole's age would be close to this value.[object Object][object Object]Now, let's discuss the theoretical process for the formation and evolution of supermassive black holes in the early universe based on current astrophysical models.[object Object][object Object]1. Direct collapse: In the early universe, some regions with high-density gas could have collapsed directly into black holes without forming stars first. These black holes, called "seed" black holes, could then grow by accreting mass from their surroundings. This process is more efficient in the early universe due to the higher density of gas and the absence of supernova explosions, which can disperse gas and hinder black hole growth.[object Object][object Object]2. Stellar remnants: Massive stars in the early universe could have collapsed into black holes after their lifetimes. These black ... |
TripletLoss with these parameters:
1{
2 "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
3 "triplet_margin": 5
4}anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
Consider a graph with 8 vertices and 12 edges. Determine if the graph contains a perfect matching. If it does, provide one example of a perfect matching. If it does not, explain why a perfect matching is not possible. | Pertimbangkan graf dengan 8 bucu dan 12 tepi. Tentukan sama ada graf mengandungi padanan sempurna. Jika ya, berikan satu contoh padanan yang sempurna. Jika tidak, jelaskan mengapa padanan yang sempurna tidak dapat dilakukan. | The 1MDB scandal and the corruption charges against former Malaysian Prime Minister Najib Razak offer several important lessons for Malaysia and other countries:[object Object][object Object]1. Stronger checks and balances: The 1MDB scandal highlighted the need for stronger checks and balances in government agencies and institutions. Malaysia should consider implementing additional measures to prevent the misuse of power and public funds, including more robust auditing and oversight mechanisms, as well as stronger whistleblower protections.[object Object]2. Transparency and accountability: The lack of transparency and accountability surrounding 1MDB contributed to the scandal. Malaysia should prioritize transparency in government operations, including procurement processes and financial transactions. Implementing measures such as open data initiatives and requiring greater disclosure from government-linked companies could help promote accountability and reduce opportunities for corruption.[object Object]3. Strengthening law enforcement: The... |
What is the probability of flipping a fair coin three times and getting exactly two heads in a row? | Apakah kebarangkalian membalikkan syiling saksama tiga kali dan mendapat tepat dua kepala berturut-turut? | Why is corruption so rampant in Malaysia, with politicians and government officials often caught engaging in unethical practices? |
Why have there been allegations of corruption and mismanagement in Malaysia's state-owned enterprises, and what measures have been taken to address these issues? | Mengapa terdapat tuduhan rasuah dan salah urus dalam perusahaan milik kerajaan Malaysia, dan apakah langkah-langkah yang telah diambil untuk menangani isu-isu ini? | What is the pKa value of acetic acid, and how does it affect its acid strength when compared to other organic acids such as citric acid or benzoic acid? Provide an explanation for your answer using acid-base reaction principles in organic chemistry. |
TripletLoss with these parameters:
1{
2 "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
3 "triplet_margin": 5
4}eval_strategy: stepsper_device_train_batch_size: 32per_device_eval_batch_size: 32learning_rate: 2e-05weight_decay: 0.01num_train_epochs: 5warmup_steps: 100fp16: Trueload_best_model_at_end: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 32per_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.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 5max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_steps: 100log_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: 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: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_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: Falsehub_revision: Nonegradient_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: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | cosine_accuracy |
|---|---|---|---|---|
| 0.0077 | 100 | 3.5959 | - | - |
| 0.0154 | 200 | 1.5715 | - | - |
| 0.0231 | 300 | 1.3926 | - | - |
| 0.0308 | 400 | 1.3807 | - | - |
| 0.0385 | 500 | 1.3662 | - | - |
| 0.0462 | 600 | 1.3368 | - | - |
| 0.0539 | 700 | 1.2831 | - | - |
| 0.0616 | 800 | 1.3723 | - | - |
| 0.0693 | 900 | 1.3459 | - | - |
| 0.0770 | 1000 | 1.3367 | 0.0005 | 0.0004 |
| 0.0847 | 1100 | 1.3124 | - | - |
| 0.0924 | 1200 | 1.2657 | - | - |
| 0.1001 | 1300 | 1.3098 | - | - |
| 0.1078 | 1400 | 1.2936 | - | - |
| 0.1155 | 1500 | 1.3058 | - | - |
| 0.1232 | 1600 | 1.2791 | - | - |
| 0.1309 | 1700 | 1.2446 | - | - |
| 0.1386 | 1800 | 1.2979 | - | - |
| 0.1463 | 1900 | 1.2658 | - | - |
| 0.1540 | 2000 | 1.2784 | 0.0001 | 0.0118 |
| 0.1617 | 2100 | 1.3043 | - | - |
| 0.1694 | 2200 | 1.2761 | - | - |
| 0.1771 | 2300 | 1.2647 | - | - |
| 0.1848 | 2400 | 1.2108 | - | - |
| 0.1925 | 2500 | 1.2773 | - | - |
| 0.2002 | 2600 | 1.3119 | - | - |
| 0.2079 | 2700 | 1.1856 | - | - |
| 0.2156 | 2800 | 1.2066 | - | - |
| 0.2233 | 2900 | 1.2455 | - | - |
| 0.2310 | 3000 | 1.1985 | 0.0003 | 0.0032 |
| 0.2387 | 3100 | 1.1875 | - | - |
| 0.2464 | 3200 | 1.1878 | - | - |
| 0.2541 | 3300 | 1.124 | - | - |
| 0.2618 | 3400 | 1.2539 | - | - |
| 0.2695 | 3500 | 1.2484 | - | - |
| 0.2772 | 3600 | 1.2123 | - | - |
| 0.2849 | 3700 | 1.1964 | - | - |
| 0.2926 | 3800 | 1.248 | - | - |
| 0.3003 | 3900 | 1.237 | - | - |
| 0.308 | 4000 | 1.161 | 0.0 | 0.0082 |
| 0.3157 | 4100 | 1.1645 | - | - |
| 0.3234 | 4200 | 1.2455 | - | - |
| 0.3311 | 4300 | 1.2235 | - | - |
| 0.3388 | 4400 | 1.2132 | - | - |
| 0.3465 | 4500 | 1.2001 | - | - |
| 0.3542 | 4600 | 1.2245 | - | - |
| 0.3619 | 4700 | 1.1759 | - | - |
| 0.3696 | 4800 | 1.1745 | - | - |
| 0.3773 | 4900 | 1.1852 | - | - |
| 0.3850 | 5000 | 1.2363 | 0.0014 | 0.0008 |
| 0.3927 | 5100 | 1.1454 | - | - |
| 0.4004 | 5200 | 1.0854 | - | - |
| 0.4081 | 5300 | 1.1228 | - | - |
| 0.4158 | 5400 | 1.0358 | - | - |
| 0.4235 | 5500 | 1.1722 | - | - |
| 0.4312 | 5600 | 1.1373 | - | - |
| 0.4389 | 5700 | 1.0926 | - | - |
| 0.4466 | 5800 | 1.1233 | - | - |
| 0.4543 | 5900 | 1.1422 | - | - |
| 0.4620 | 6000 | 1.0646 | 0.0005 | 0.0018 |
| 0.4697 | 6100 | 1.1371 | - | - |
| 0.4774 | 6200 | 1.1478 | - | - |
| 0.4851 | 6300 | 1.0805 | - | - |
| 0.4928 | 6400 | 1.095 | - | - |
| 0.5005 | 6500 | 1.2009 | - | - |
| 0.5082 | 6600 | 1.0456 | - | - |
| 0.5159 | 6700 | 1.11 | - | - |
| 0.5236 | 6800 | 1.0818 | - | - |
| 0.5313 | 6900 | 1.0727 | - | - |
| 0.5390 | 7000 | 1.0805 | 0.0019 | 0.0044 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{hermans2017defense,
2 title={In Defense of the Triplet Loss for Person Re-Identification},
3 author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
4 year={2017},
5 eprint={1703.07737},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV}
8}