Views
No views yet
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'DistilBertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("kwondw/distilbert-base-uncased-msmarco-margin-mse")
5# Run inference
6queries = [
7 'average pay of it analyst in austin texas',
8]
9documents = [
10 'How much does an IT Analyst in Austin, TX make? The average IT Analyst salary in Austin, TX is approximately $26.79 per hour, which is 26% below the national average. Salary information comes from 76 data points collected directly from employees, users, and past and present job advertisements on Indeed in the past 24 months.',
11 'The best city between Austin, TX and Santa Fe, NM to meet is Lubbock, Texas which is about 34 miles from the exact midpoint. The town that marks the exact halfway point is actually Close City, Texas.',
12 'Food and cosmetic use. Arrowroot powder is a natural powdered root starch that is white in color and very lightweight. It is derived from the tropical South American plant Maranta arundinacea. The plant was given the name â\x80\x9cArrowrootâ\x80\x9d because it was once used to treat those injured with wounds from poisoned arrows.',
13]
14query_embeddings = model.encode_query(queries)
15document_embeddings = model.encode_document(documents)
16print(query_embeddings.shape, document_embeddings.shape)
17# [1, 768] [3, 768]
18
19# Get the similarity scores for the embeddings
20similarities = model.similarity(query_embeddings, document_embeddings)
21print(similarities)
22# tensor([[46.6321, 42.2351, 35.4387]])NanoMSMARCOInformationRetrievalEvaluator| Metric | Value |
|---|---|
| dot_accuracy@1 | 0.02 |
| dot_accuracy@3 | 0.04 |
| dot_accuracy@5 | 0.08 |
| dot_accuracy@10 | 0.14 |
| dot_precision@1 | 0.02 |
| dot_precision@3 | 0.0133 |
| dot_precision@5 | 0.016 |
| dot_precision@10 | 0.014 |
| dot_recall@1 | 0.02 |
| dot_recall@3 | 0.04 |
| dot_recall@5 | 0.08 |
| dot_recall@10 | 0.14 |
| dot_ndcg@10 | 0.0683 |
| dot_mrr@10 | 0.0469 |
| dot_map@100 | 0.0689 |
score, query, positive, and negative| score | query | positive | negative | |
|---|---|---|---|---|
| type | float | string | string | string |
| details |
|
|
|
|
| score | query | positive | negative |
|---|---|---|---|
18.26768692334493 | weisskopf syndrome | Dinno-Shearer-Weisskopf syndrome: Introduction. Dinno-Shearer-Weisskopf syndrome: A very rare syndrome characterized mainly by long limbs, tall stature, large head, ataxia and facial anomalies. More detailed information about the symptoms, causes, and treatments of Dinno-Shearer-Weisskopf syndrome is available below. | Related posts: 1 Charles Bonnet Syndrome - Treatment, Symptoms and Causes. 2 Refeeding Syndrome - Symptoms, Causes, Diagnosis, Treatment Guidelines. 3 Dubowitz Syndrome. |
21.609440167744957 | weather in beirut, lebanon | Beirut: Annual Weather Averages. August is the hottest month in Beirut with an average temperature of 28°C (82°F) and the coldest is February at 13°C (55°F) with the most daily sunshine hours at 14 in July. The wettest month is January with an average of 130mm of rain. | When Brant and his Mohawk warriors joined the fortunes. of the Johnson family in Canada, the influence of President. Whelock, of Lebanon Institute, where Brant had received his. early education, was brought to bear upon the crisis. |
15.881475607554119 | what are the clots in my period | Blood Clots during Period. It is normal to pass blood clots during menses, as along with the blood the thickened lining of the uterus is also being shed and expelled outside the body. In case the abnormal blood clots during period occur, visit your gynecologist as it may then be an indication of other serious medical illnesses. | Heparin lock flush is used for: Preventing blood clots from forming in intravenous (IV) lines or catheters. Heparin lock flush is an anticoagulant. It works by preventing blood clots from forming in intravenous lines when they are not in use. Do NOT use heparin lock flush if: |
MarginMSELoss with these parameters:
1{
2 "similarity_fct": "pairwise_dot_score"
3}per_device_train_batch_size: 32per_device_eval_batch_size: 32num_train_epochs: 1warmup_steps: 0.1fp16: Truedo_predict: Falseprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 32gradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_ratio: Nonewarmup_steps: 0.1log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Trueenable_jit_checkpoint: Falsesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseuse_cpu: Falseseed: 42data_seed: Nonebf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: -1ddp_backend: Nonedebug: []dataloader_drop_last: Truedataloader_num_workers: 0dataloader_prefetch_factor: Nonedisable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}accelerator_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: Nonegroup_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: Truepush_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_for_metrics: []eval_do_concat_batches: Trueauto_find_batch_size: Falsefull_determinism: Falseddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_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: Trueuse_cache: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | NanoMSMARCO_dot_ndcg@10 |
|---|---|---|---|
| -1 | -1 | - | 0.0683 |
| 1.0 | 1 | 186.3345 | 0.0683 |
| -1 | -1 | - | 0.0683 |
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{hofstätter2021improving,
2 title={Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation},
3 author={Sebastian Hofstätter and Sophia Althammer and Michael Schröder and Mete Sertkan and Allan Hanbury},
4 year={2021},
5 eprint={2010.02666},
6 archivePrefix={arXiv},
7 primaryClass={cs.IR}
8}