SentenceTransformer based on ibm-granite/granite-embedding-107m-multilingual
This is a sentence-transformers model finetuned from ibm-granite/granite-embedding-107m-multilingual. 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 Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(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:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("RikoteMaster/embedder-granite")
sentences = [
'Antiprotozoal 923 MEFLOQUINE Mefloquine is effective therapy of other Although toxicity is mefloquine one recommended for most regions with Chemistry Mefloquine is 4-quinoline methanol is chemically quinine. can given because local irritation with parenteral and hours. Mefloquine highly uted and treat- regimen. elimination half-life about 20 allowing dosing chemoprophylaxis. With dos- drug reached over number of interval can be shortened to 4 with daily doses 250 mg, this is not and metabolites of in can be in the months completion therapy. Antimalarial Action & strong P falciparum P is hepatic stages or gametocytes. The of unknown. Sporadic mefloquine been from areas. At resistance appears to uncommon regions Asia high rates border areas resis- tance quinine resistance to Clinical in',
'CHAPTER 52 Antiprotozoal Drugs 923 MEFLOQUINE Mefloquine is effective therapy for many chloroquine-resistant strains of P falciparum and against other species. Although toxicity is a concern, mefloquine is one of the recommended chemopro- phylactic drugs for use in most malaria-endemic regions with chloroquine-resistant strains. Chemistry & Pharmacokinetics Mefloquine hydrochloride is a synthetic 4-quinoline methanol that is chemically related to quinine. It can only be given orally because severe local irritation occurs with parenteral use. It is well absorbed, and peak plasma concentrations are reached in about 18 hours. Mefloquine is highly protein-bound, extensively distrib- uted in tissues, and eliminated slowly, allowing a single-dose treat- ment regimen. The terminal elimination half-life is about 20 days, allowing weekly dosing for chemoprophylaxis. With weekly dos- ing, steady-state drug levels are reached over a number of weeks; this interval can be shortened to 4 days by beginning a course with three consecutive daily doses of 250 mg, although this is not stan- dard practice. Mefloquine and acid metabolites of the drug are slowly excreted, mainly in the feces. The drug can be detected in the blood for months after the completion of therapy. Antimalarial Action & Resistance Mefloquine has strong blood schizonticidal activity against P falciparum and P vivax, but it is not active against hepatic stages or gametocytes. The mechanism of action of mefloquine is unknown. Sporadic resistance to mefloquine has been reported from many areas. At present, resistance appears to be uncommon except in regions of Southeast Asia with high rates of multidrug resistance (especially border areas of Thailand). Mefloquine resis- tance appears to be associated with resistance to quinine and halofantrine but not with resistance to chloroquine. Clinical Uses A. Chemoprophylaxis Mefloquine is effective in prophylaxis against most strain',
'the body to colonize various organs in the process called metastasis. Such tumor stem cells thus can express clonogenic (colony-forming) capability, and they are characterized by chromosome abnormalities reflecting their genetic instability, which leads to progressive selection of subclones that can survive more readily in the multicellular environment of the host. This genetic instability also allows them to become resistant to chemotherapy and radiotherapy. The invasive and metastatic processes as well as a series of metabolic abnormalities associated with the cancer result in tumor-related symptoms and eventual death of the patient unless the neoplasm can be eradicated with treatment. 54 CAUSES OF CANCER The incidence, geographic distribution, and behavior of specific types of cancer are related to multiple factors, including sex, age, race, genetic predisposition, and exposure to environmental car- cinogens. Of these factors, environmental exposure is probably most important. Exposure to ionizing radiation has been well documented as a significant risk factor for a number of cancers, including acute leukemias, thyroid cancer, breast cancer, lung cancer, soft tissue sarcoma, and basal cell and squamous cell skin cancers. Chemical carcinogens (particularly those in tobacco smoke) as well as azo dyes, aflatoxins, asbestos, benzene, and radon have all been well documented as leading to a wide range of human cancers. Several viruses have been implicated in the etiology of various human cancers. For example, hepatitis B and hepatitis C are asso- ciated with the development of hepatocellular cancer; HIV is associated with Hodgkin’s and non-Hodgkin’s lymphomas; human papillomavirus is associated with cervical cancer and head and neck cancer; and Ebstein-Barr virus is associated with nasopharyn- geal cancer. Expression of virus-induced neoplasia may also depend on additional host and environmental factors that modu- late the transformation process. Cellular genes are known that are homologous to the transforming genes of the retroviruses, a family',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
Training Details
Training Dataset
Unnamed Dataset
Evaluation Dataset
Unnamed Dataset
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: steps
per_device_train_batch_size: 128
per_device_eval_batch_size: 128
learning_rate: 2e-05
num_train_epochs: 5
warmup_ratio: 0.1
fp16: True
dataloader_drop_last: True
dataloader_num_workers: 2
load_best_model_at_end: True
push_to_hub: True
hub_model_id: RikoteMaster/embedder-granite
hub_strategy: end
hub_private_repo: True
All Hyperparameters
Click to expand
overwrite_output_dir: False
do_predict: False
eval_strategy: steps
prediction_loss_only: True
per_device_train_batch_size: 128
per_device_eval_batch_size: 128
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: 2e-05
weight_decay: 0.0
adam_beta1: 0.9
adam_beta2: 0.999
adam_epsilon: 1e-08
max_grad_norm: 1.0
num_train_epochs: 5
max_steps: -1
lr_scheduler_type: linear
lr_scheduler_kwargs: {}
warmup_ratio: 0.1
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: True
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: True
dataloader_num_workers: 2
dataloader_prefetch_factor: None
past_index: -1
disable_tqdm: False
remove_unused_columns: True
label_names: None
load_best_model_at_end: True
ignore_data_skip: False
fsdp: []
fsdp_min_num_params: 0
fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
fsdp_transformer_layer_cls_to_wrap: None
accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': 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: True
resume_from_checkpoint: None
hub_model_id: RikoteMaster/embedder-granite
hub_strategy: end
hub_private_repo: True
hub_always_push: False
gradient_checkpointing: False
gradient_checkpointing_kwargs: None
include_inputs_for_metrics: False
include_for_metrics: []
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
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
use_liger_kernel: False
eval_use_gather_object: False
average_tokens_across_devices: False
prompts: None
batch_sampler: batch_sampler
multi_dataset_batch_sampler: proportional
Training Logs
| Epoch |
Step |
Training Loss |
Validation Loss |
| 0.1859 |
50 |
0.3983 |
- |
| 0.3717 |
100 |
0.193 |
- |
| 0.5576 |
150 |
0.0828 |
- |
| 0.7435 |
200 |
0.0409 |
0.0339 |
| 0.9294 |
250 |
0.0386 |
- |
| 1.1152 |
300 |
0.0322 |
- |
| 1.3011 |
350 |
0.0311 |
- |
| 1.4870 |
400 |
0.0275 |
0.0167 |
| 1.6729 |
450 |
0.0252 |
- |
| 1.8587 |
500 |
0.0254 |
- |
| 2.0446 |
550 |
0.0254 |
- |
| 2.2305 |
600 |
0.0227 |
0.0129 |
| 2.4164 |
650 |
0.0236 |
- |
| 2.6022 |
700 |
0.0185 |
- |
| 2.7881 |
750 |
0.0234 |
- |
| 2.9740 |
800 |
0.0274 |
0.0118 |
| 3.1599 |
850 |
0.0208 |
- |
| 3.3457 |
900 |
0.0245 |
- |
| 3.5316 |
950 |
0.0242 |
- |
| 3.7175 |
1000 |
0.0219 |
0.0112 |
| 3.9033 |
1050 |
0.0239 |
- |
| 4.0892 |
1100 |
0.0223 |
- |
| 4.2751 |
1150 |
0.0212 |
- |
| 4.461 |
1200 |
0.0223 |
0.0107 |
| 4.6468 |
1250 |
0.0228 |
- |
| 4.8327 |
1300 |
0.0196 |
- |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.17
- Sentence Transformers: 4.1.0
- Transformers: 4.52.3
- PyTorch: 2.7.0+cu126
- Accelerate: 1.7.0
- Datasets: 3.6.0
- Tokenizers: 0.21.1
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}
}