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:
positive
andanchor
- 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:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 32per_device_eval_batch_size
: 32learning_rate
: 2e-05num_train_epochs
: 4warmup_ratio
: 0.1fp16
: Truebatch_sampler
: no_duplicates
All Hyperparameters
Click to expand
overwrite_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.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 4max_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
: 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
: Falseignore_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}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
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Falsehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseeval_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
: Falseeval_use_gather_object
: Falsebatch_sampler
: no_duplicatesmulti_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
- 13
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
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