SentenceTransformer based on intfloat/multilingual-e5-small
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-small. 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 Type: Sentence Transformer
- Base model: intfloat/multilingual-e5-small
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 384 tokens
- Similarity Function: Cosine Similarity
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': 512, 'do_lower_case': False}) with Transformer model: 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})
  (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
# Download from the 🤗 Hub
model = SentenceTransformer("Yohhei/batch32-100")
# Run inference
sentences = [
    '【貸出施設】ホール(定員300人)第1会議室(定員24人)第2会議室(定員30人)和室(1)(定員35人)和室(2)(定員15人)音楽室(定員30人)保育室として、和室(2)をご利用いただけます。【附帯設備】■ホールグランドピアノ、音響設備、マイク(有線・コードレス・ピンマイク)、反響板、照明設備、卓球台■第1会議室プロジェクター投影用スクリーン■第2会議室プロジェクター投影用スクリーン、調理器具、電子レンジ調理室としても利用できます。■音楽室アップライトピアノ■その他ラジカセ、プロジェクター、移動式マイクセット【設備】■コピー機コイン式コピー機を1階警備員室前に設置してあります。利用時間は午前8時00分~午後10時までです。用紙のサイズはB5、A4、B4、A3で、1枚10円です。■軽印刷機地域の活動やサークル活動のための資料の印刷に利用できます。A3サイズまで印刷できます。利用時間は休館日を除く、午前9時から午後9時までです。利用料金はマスター代が原稿1枚につき100円、インク代が印刷片面1000枚以上ごとに100円です。印刷用紙は利用者の持ち込みとなります。利用の際は、1階警備員室で利用のお手続きが必要です。■スピード写真撮影機証明書用スピード写真撮影機を正面玄関の手前に設置してあります。撮影料金は700円です。■その他みんなのトイレ(1階、2階)、授乳室(1階)、冷水機(1階)【関連リンク】南市民センター・施設案内(施設貸出、施設使用料金等について)https://www.city.machida.tokyo.jp/kurashi/touroku/shisetsu/03/sisetuannai.html【お問合せ先】南市民センターTEL:042-795-3165FAX:042-795-1749担当課詳細:https://www.city.machida.tokyo.jp/kurashi/touroku/shisetsu/03/accessmap.html',
    '質問:3490南市民センターにはどんな施設・設備がありますか。',
    '質問:2139児童発達支援について知りたい',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Evaluation
Metrics
Information Retrieval
- Dataset: intfloat/multilingual-e5-small
- Evaluated with InformationRetrievalEvaluator
| Metric | Value | 
|---|---|
| cosine_accuracy@1 | 0.5162 | 
| cosine_accuracy@3 | 0.7038 | 
| cosine_accuracy@5 | 0.7748 | 
| cosine_accuracy@10 | 0.8454 | 
| cosine_precision@1 | 0.5162 | 
| cosine_precision@3 | 0.2346 | 
| cosine_precision@5 | 0.155 | 
| cosine_precision@10 | 0.0845 | 
| cosine_recall@1 | 0.5162 | 
| cosine_recall@3 | 0.7038 | 
| cosine_recall@5 | 0.7748 | 
| cosine_recall@10 | 0.8454 | 
| cosine_ndcg@10 | 0.6778 | 
| cosine_mrr@10 | 0.6243 | 
| cosine_map@100 | 0.6301 | 
Training Details
Training Dataset
Unnamed Dataset
- Size: 14,690 training samples
- Columns: positiveandanchor
- Approximate statistics based on the first 1000 samples:positive anchor type string string details - min: 14 tokens
- mean: 186.01 tokens
- max: 512 tokens
 - min: 7 tokens
- mean: 19.95 tokens
- max: 56 tokens
 
- Samples:positive anchor ■住所や名義が変わった場合は変更登録や移転登録の手続きが必要です。通知文書については軽自動車の変更手続きを行わずに転出された方を対象に送付させていただいております。★原動機付自転車(排気量125cc以下のバイク)、排気量50cc以下のミニカー、バギーカー、小型特殊自動車■原動機付自転車等を所有している方が小松市から転出した場合、原則として廃車の手続をしていただくことになります。転出先でそのまま使用する場合は、新たに転出先の市区町村で登録の手続きを行ってください。その際の手続きに必要な物については、転出先市町村にお問い合わせください。■転出先から原動機付自転車を廃車にする場合は、廃車申告書に必要事項を記入、押印したものと、返信用の封筒に切手を貼ったもの、小松市のナンバープレートを同封し、郵送で小松市へ送付してください。廃車申告書については転出先市町村の廃車申告書をご利用いただいても構いません。■転出先の市町村でも廃車の手続きができます。転出先の市町村にお問い合わせください。★軽二輪(125ccを超250cc以下)、二輪の小型自動車(250cc超)■市役所ではお取り扱いしておりませんので、北陸信越運輸局 石川運輸支局へお問い合わせください。(連絡先)〒920-8213 金沢市直江東1丁目1番北陸信越運輸局 石川運輸支局 電話050-5540-2045★軽三輪・軽四輪(660cc以下)■市役所ではお取り扱いしておりませんので、軽自動車検査協会 石川県事務所へお問い合わせくだください。(連絡先)〒920-8213 金沢市直江東2丁目123番地1軽自動車検査協会 石川県事務所 電話050-3816-1853【税務課 税総合窓口グループ】(直通)0761-24-8029(内線)3124・3135【南支所】(直通)0761-44-2535(内線)2700【小松駅前行政サービスセンター】(直通)0761-23-2323(内線)4307小松市から転出後しばらくして軽自動車についての通知が届いたのですが(A)○市章(昭和33年10月1日制定)マチダのマの字2つをもって田の字型に図案化して、市民の和合団結を表しています。中央の鳥型は、平和と発展のしるしです。○市の木・けやき(昭和47年6月15日制定)日本原産で、武蔵野・相模を代表する落葉高木。空に向かって枝を広げ、すくすく伸びゆく風格ある姿は発展する町田市を表す木として、「市の木」選定の際にも高い人気を得ました。市内にも随所にけやき並木が整備され、市民に憩いをあたえています。○市の花・サルビア(昭和47年6月15日制定)ブラジル原産。シソ科の一年草。夏から秋にかけて、公園や街路などで鮮やかな紅色の花を咲かせます。エネルギッシュな容姿は町田市の若さとバイタリティを表しています。市内各地の花壇に植えられ、幅広く市民に愛されています。○市の鳥・カワセミ(平成14年6月15日制定)全国に分布し、青緑色とオレンジ色の体、長いくちばしと短い尾を持つ野鳥です。多摩丘陵の源流都市である町田市のシンボルとしてふさわしいことから市の鳥に選定されました。質問:1296市章、市の木、市の花、市の鳥を知りたい所得に応じた免除基準としています。成人健康診査・がん検診とも前年度住民税非課税世帯の方・生活保護受給者・中国残留邦人等支援給付受給者であれば、自己負担金が免除となります。ただし、胃がんリスク検診(ABC検診)は、町田市では1回限りの検診であり、受診を勧奨する年齢を定めているため、30歳および40歳の方、生活保護受給者、中国残留邦人等支援給付受給者を免除としています。※胃がんリスク検診(ABC検診)の自己負担金免除の対象年齢は、2018年度までは、40歳以上で5歳刻みの年齢でした(40歳、45歳、50歳…)。質問:2358がん検診や成人健康診査の自己負担金免除の基準は何か
- Loss: MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
- eval_strategy: steps
- per_device_train_batch_size: 32
- per_device_eval_batch_size: 32
- learning_rate: 2e-05
- num_train_epochs: 4
- warmup_ratio: 0.1
- fp16: True
- batch_sampler: no_duplicates
All Hyperparameters
Click to expand
- overwrite_output_dir: False
- do_predict: False
- eval_strategy: steps
- prediction_loss_only: True
- per_device_train_batch_size: 32
- per_device_eval_batch_size: 32
- 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: 4
- 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: 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: {'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: 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
- eval_on_start: False
- eval_use_gather_object: False
- batch_sampler: no_duplicates
- multi_dataset_batch_sampler: proportional
Training Logs
| Epoch | Step | Training Loss | intfloat/multilingual-e5-small_cosine_map@100 | 
|---|---|---|---|
| 0 | 0 | - | 0.4852 | 
| 0.2174 | 100 | 1.0389 | 0.5587 | 
| 0.4348 | 200 | 0.1562 | 0.5806 | 
| 0.6522 | 300 | 0.1347 | 0.5826 | 
| 0.8696 | 400 | 0.123 | 0.5907 | 
| 1.0870 | 500 | 0.1119 | 0.6053 | 
| 1.3043 | 600 | 0.0761 | 0.6051 | 
| 1.5217 | 700 | 0.0587 | 0.6045 | 
| 1.7391 | 800 | 0.0636 | 0.6070 | 
| 1.9565 | 900 | 0.0461 | 0.6099 | 
| 2.1739 | 1000 | 0.0473 | 0.6153 | 
| 2.3913 | 1100 | 0.0291 | 0.6130 | 
| 2.6087 | 1200 | 0.0274 | 0.6199 | 
| 2.8261 | 1300 | 0.0348 | 0.6215 | 
| 3.0435 | 1400 | 0.0267 | 0.6285 | 
| 3.2609 | 1500 | 0.0238 | 0.6307 | 
| 3.4783 | 1600 | 0.0213 | 0.6257 | 
| 3.6957 | 1700 | 0.0225 | 0.6284 | 
| 3.9130 | 1800 | 0.0228 | 0.6301 | 
Framework Versions
- Python: 3.8.10
- Sentence Transformers: 3.0.1
- Transformers: 4.44.2
- PyTorch: 2.1.2+cu121
- Accelerate: 0.32.0
- Datasets: 2.19.1
- Tokenizers: 0.19.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}
}
- Downloads last month
- 2
Model tree for Yohhei/batch32-100
Base model
intfloat/multilingual-e5-smallEvaluation results
- Cosine Accuracy@1 on intfloat/multilingual e5 smallself-reported0.516
- Cosine Accuracy@3 on intfloat/multilingual e5 smallself-reported0.704
- Cosine Accuracy@5 on intfloat/multilingual e5 smallself-reported0.775
- Cosine Accuracy@10 on intfloat/multilingual e5 smallself-reported0.845
- Cosine Precision@1 on intfloat/multilingual e5 smallself-reported0.516
- Cosine Precision@3 on intfloat/multilingual e5 smallself-reported0.235
- Cosine Precision@5 on intfloat/multilingual e5 smallself-reported0.155
- Cosine Precision@10 on intfloat/multilingual e5 smallself-reported0.085
- Cosine Recall@1 on intfloat/multilingual e5 smallself-reported0.516
- Cosine Recall@3 on intfloat/multilingual e5 smallself-reported0.704