Team Ai
Modelpublic

Starkdoorstep12/entity-resolution-biencoder

sourceHugging Faceupdated 1d agoView on Hugging Face
0likes12downloads
Model Card

SentenceTransformer based on sentence-transformers/LaBSE

This is a sentence-transformers model finetuned from sentence-transformers/LaBSE. It maps inputs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: sentence-transformers/LaBSE <!-- at revision 836121a0533e5664b21c7aacc5d22951f2b8b25b -->
  • —Maximum Sequence Length: 256 tokens
  • —Output Dimensionality: 768 dimensions
  • —Similarity Function: Cosine Similarity
  • —Supported Modality: Text <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
  (1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'cls', 'include_prompt': True})
  (2): Dense({'in_features': 768, 'out_features': 768, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh', 'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
  (3): Normalize({'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
queries = [
    'Stag | 122 Bruce Street, Scotia, NY',
]
documents = [
    'Stag Corporation | BRUCE STREET, SCOTIA, NY',
    '#2 HUB CO | 142 COTTAGE STREET, LEWISTON, ME',
    'ORTHOPEDIC  PHYSICIANS | 75, ALTOONA, AL',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[ 0.7677,  0.1634, -0.0688]])

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Information Retrieval
MetricValue
cosine_accuracy@10.929
cosine_accuracy@51.0
cosine_accuracy@101.0
cosine_accuracy@301.0
cosine_precision@10.929
cosine_precision@30.3333
cosine_precision@50.2
cosine_precision@100.1
cosine_recall@10.929
cosine_recall@31.0
cosine_recall@51.0
cosine_recall@101.0
cosine_ndcg@100.9733
cosine_mrr@100.9638
cosine_map@1000.9638

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 623,829 training samples
  • —Columns: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 100 samples: | | anchor | positive | |:---------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | modality | text | text | | details | <ul><li>min: 18 tokens</li><li>mean: 31.59 tokens</li><li>max: 55 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 33.45 tokens</li><li>max: 64 tokens</li></ul> |
  • —Samples: | anchor | positive | |:----------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------| | <code>Bangalore South Automotive Private Limited \| C-901, Goyalco Orchid, Lakeview, Bangalore South, Bangalore, Karnataka</code> | <code>Bangalore South Automotive Limited Private \| C-901., GOYALCO ORCHID, LAKEVIEW, BANGALORE SOUTH, ಕರ್ನಾಟಕ</code> | | <code>Bangalore South Automotive Private Limited \| C-901, Goyalco Orchid, Lakeview, Bangalore South, Bangalore, Karnataka</code> | <code>Bangalore Sóuth Automotive Private Limited \| </code> | | <code>Software Pinnacle Tourism \| 3016/5, 1St Floor, Ranjit Nagar, New Delhi, Central Delhi, Delhi</code> | <code>Software Pinnacle Tóurism \| A-3016/5, 1ST FLOOR, RANJIT NAGAR, NEW DELHI, दिल्ली</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false,
      "directions": [
          "query_to_doc"
      ],
      "partition_mode": "joint",
      "hardness_mode": null,
      "hardness_strength": 0.0
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 64
  • —num_train_epochs: 2
  • —learning_rate: 2e-05
  • —warmup_steps: 0.1
All Hyperparameters

<details><summary>Click to expand</summary>

  • —per_device_train_batch_size: 64
  • —num_train_epochs: 2
  • —max_steps: -1
  • —learning_rate: 2e-05
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: None
  • —warmup_steps: 0.1
  • —optim: adamwtorchfused
  • —optim_args: None
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —optim_target_modules: None
  • —gradient_accumulation_steps: 1
  • —average_tokens_across_devices: True
  • —max_grad_norm: 1.0
  • —label_smoothing_factor: 0.0
  • —bf16: False
  • —fp16: False
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —use_liger_kernel: False
  • —liger_kernel_config: None
  • —use_cache: False
  • —neftune_noise_alpha: None
  • —torch_empty_cache_steps: None
  • —auto_find_batch_size: False
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —include_num_input_tokens_seen: no
  • —log_level: passive
  • —log_level_replica: warning
  • —disable_tqdm: False
  • —project: huggingface
  • —trackio_space_id: None
  • —trackio_bucket_id: None
  • —trackio_static_space_id: None
  • —per_device_eval_batch_size: 8
  • —prediction_loss_only: True
  • —eval_on_start: False
  • —eval_do_concat_batches: True
  • —eval_use_gather_object: False
  • —eval_accumulation_steps: None
  • —include_for_metrics: []
  • —batch_eval_metrics: False
  • —save_only_model: False
  • —save_on_each_node: False
  • —enable_jit_checkpoint: False
  • —push_to_hub: False
  • —hub_private_repo: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_always_push: False
  • —hub_revision: None
  • —load_best_model_at_end: False
  • —ignore_data_skip: False
  • —restore_callback_states_from_checkpoint: False
  • —full_determinism: False
  • —seed: 42
  • —data_seed: None
  • —use_cpu: False
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —dataloader_prefetch_factor: None
  • —dataloader_multiprocessing_context: None
  • —dataloader_in_order: True
  • —remove_unused_columns: True
  • —label_names: None
  • —train_sampling_strategy: random
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —ddp_static_graph: None
  • —ddp_backend: None
  • —ddp_timeout: 1800
  • —fsdp: None
  • —fsdp_config: None
  • —deepspeed: None
  • —debug: []
  • —skip_memory_metrics: True
  • —do_predict: False
  • —resume_from_checkpoint: None
  • —local_rank: -1
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional
  • —router_mapping: {}
  • —learning_rate_mapping: {}
  • —warmup_ratio: None

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Lossbiencoder-val_cosine_ndcg@10
0.0051500.2099-
0.01031000.0801-
0.01541500.0250-
0.02052000.0196-
0.02562500.0155-
0.03083000.0151-
0.03593500.0150-
0.04104000.0117-
0.04624500.0124-
0.05135000.0111-
0.05645500.0070-
0.06166000.0107-
0.06676500.0091-
0.07187000.0060-
0.07697500.0094-
0.08218000.0067-
0.08728500.0061-
0.09239000.0076-
0.09759500.0060-
0.102610000.0047-
0.107710500.0071-
0.112811000.0063-
0.118011500.0046-
0.123112000.0039-
0.128212500.0049-
0.133413000.0055-
0.138513500.0038-
0.143614000.0041-
0.148714500.0060-
0.153915000.0055-
0.159015500.0053-
0.164116000.0047-
0.169316500.0044-
0.174417000.0071-
0.179517500.0044-
0.184718000.0025-
0.189818500.0055-
0.194919000.0053-
0.200019500.0045-
0.205220000.0047-
0.210320500.0048-
0.215421000.0041-
0.220621500.0030-
0.225722000.0037-
0.230822500.0047-
0.235923000.0042-
0.241123500.0027-
0.246224000.0047-
0.251324500.0028-
0.256525000.0043-
0.261625500.0063-
0.266726000.0027-
0.271926500.0021-
0.277027000.0028-
0.282127500.0024-
0.287228000.0045-
0.292428500.0033-
0.297529000.0048-
0.302629500.0021-
0.307830000.0031-
0.312930500.0027-
0.318031000.0033-
0.323131500.0040-
0.328332000.0012-
0.333432500.0031-
0.338533000.0033-
0.343733500.0020-
0.348834000.0028-
0.353934500.0022-
0.359035000.0025-
0.364235500.0026-
0.369336000.0028-
0.374436500.0035-
0.379637000.0023-
0.384737500.0029-
0.389838000.0031-
0.395038500.0042-
0.400139000.0027-
0.405239500.0035-
0.410340000.0026-
0.415540500.0017-
0.420641000.0022-
0.425741500.0020-
0.430942000.0025-
0.436042500.0024-
0.441143000.0025-
0.446243500.0025-
0.451444000.0021-
0.456544500.0011-
0.461645000.0018-
0.466845500.0039-
0.471946000.0016-
0.477046500.0023-
0.482247000.0012-
0.487347500.0027-
0.492448000.0020-
0.497548500.0022-
0.502749000.0022-
0.507849500.0016-
0.512950000.0027-
0.518150500.0017-
0.523251000.0020-
0.528351500.0024-
0.533452000.0024-
0.538652500.0024-
0.543753000.0022-
0.548853500.0029-
0.554054000.0016-
0.559154500.0010-
0.564255000.0017-
0.569355500.0029-
0.574556000.0017-
0.579656500.0021-
0.584757000.0019-
0.589957500.0021-
0.595058000.0030-
0.600158500.0015-
0.605359000.0028-
0.610459500.0022-
0.615560000.0020-
0.620660500.0021-
0.625861000.0017-
0.630961500.0021-
0.636062000.0015-
0.641262500.0010-
0.646363000.0018-
0.651463500.0011-
0.656564000.0035-
0.661764500.0015-
0.666865000.0022-
0.671965500.0019-
0.677166000.0017-
0.682266500.0011-
0.687367000.0021-
0.692467500.0017-
0.697668000.0014-
0.702768500.0024-
0.707869000.0012-
0.713069500.0032-
0.718170000.0020-
0.723270500.0013-
0.728471000.0038-
0.733571500.0018-
0.738672000.0019-
0.743772500.0038-
0.748973000.0013-
0.754073500.0025-
0.759174000.0022-
0.764374500.0014-
0.769475000.0015-
0.774575500.0030-
0.779676000.0016-
0.784876500.0017-
0.789977000.0013-
0.795077500.0036-
0.800278000.0022-
0.805378500.0015-
0.810479000.0010-
0.815679500.0021-
0.820780000.0019-
0.825880500.0011-
0.830981000.0012-
0.836181500.0026-
0.841282000.0011-
0.846382500.0019-
0.851583000.0017-
0.856683500.0011-
0.861784000.0012-
0.866884500.0018-
0.872085000.0008-
0.877185500.0017-
0.882286000.0023-
0.887486500.0010-
0.892587000.0011-
0.897687500.0022-
0.902788000.0023-
0.907988500.0013-
0.913089000.0015-
0.918189500.0034-
0.923390000.0011-
0.928490500.0018-
0.933591000.0013-
0.938791500.0009-
0.943892000.0008-
0.948992500.0013-
0.954093000.0012-
0.959293500.0012-
0.964394000.0008-
0.969494500.0011-
0.974695000.0008-
0.979795500.0015-
0.984896000.0014-
0.989996500.0013-
0.995197000.0006-
1.09748-0.9733
1.000297500.0014-
1.005398000.0006-
1.010598500.0005-
1.015699000.0011-
1.020799500.0011-
1.0259100000.0009-
1.0310100500.0013-
1.0361101000.0008-
1.0412101500.0008-
1.0464102000.0006-
1.0515102500.0006-
1.0566103000.0010-
1.0618103500.0026-
1.0669104000.0007-
1.0720104500.0007-
1.0771105000.0010-
1.0823105500.0016-
1.0874106000.0014-
1.0925106500.0007-
1.0977107000.0006-
1.1028107500.0021-
1.1079108000.0027-
1.1130108500.0006-
1.1182109000.0006-
1.1233109500.0012-
1.1284110000.0016-
1.1336110500.0015-
1.1387111000.0026-
1.1438111500.0008-
1.1490112000.0007-
1.1541112500.0007-
1.1592113000.0012-
1.1643113500.0010-
1.1695114000.0005-
1.1746114500.0008-
1.1797115000.0006-
1.1849115500.0005-
1.1900116000.0016-
1.1951116500.0009-
1.2002117000.0011-
1.2054117500.0006-
1.2105118000.0014-
1.2156118500.0006-
1.2208119000.0006-
1.2259119500.0015-
1.2310120000.0005-
1.2362120500.0037-
1.2413121000.0006-
1.2464121500.0005-
1.2515122000.0007-
1.2567122500.0016-
1.2618123000.0006-
1.2669123500.0015-
1.2721124000.0005-
1.2772124500.0007-
1.2823125000.0006-
1.2874125500.0009-
1.2926126000.0005-
1.2977126500.0004-
1.3028127000.0011-
1.3080127500.0006-
1.3131128000.0006-
1.3182128500.0006-
1.3233129000.0004-
1.3285129500.0015-
1.3336130000.0013-
1.3387130500.0008-
1.3439131000.0010-
1.3490131500.0007-
1.3541132000.0013-
1.3593132500.0005-
1.3644133000.0017-
1.3695133500.0020-
1.3746134000.0004-
1.3798134500.0004-
1.3849135000.0009-
1.3900135500.0004-
1.3952136000.0009-
1.4003136500.0004-
1.4054137000.0007-
1.4105137500.0013-
1.4157138000.0007-
1.4208138500.0010-
1.4259139000.0010-
1.4311139500.0008-
1.4362140000.0009-
1.4413140500.0015-
1.4465141000.0008-
1.4516141500.0007-
1.4567142000.0007-
1.4618142500.0011-
1.4670143000.0023-
1.4721143500.0011-
1.4772144000.0004-
1.4824144500.0009-
1.4875145000.0005-
1.4926145500.0009-
1.4977146000.0004-
1.5029146500.0004-
1.5080147000.0004-
1.5131147500.0011-
1.5183148000.0020-
1.5234148500.0007-
1.5285149000.0005-
1.5336149500.0004-
1.5388150000.0004-
1.5439150500.0009-
1.5490151000.0005-
1.5542151500.0006-
1.5593152000.0008-
1.5644152500.0006-
1.5696153000.0023-
1.5747153500.0006-
1.5798154000.0006-
1.5849154500.0013-
1.5901155000.0006-
1.5952155500.0004-
1.6003156000.0020-
1.6055156500.0016-
1.6106157000.0005-
1.6157157500.0004-
1.6208158000.0011-
1.6260158500.0014-
1.6311159000.0005-
1.6362159500.0011-
1.6414160000.0007-
1.6465160500.0005-
1.6516161000.0008-
1.6568161500.0003-
1.6619162000.0012-
1.6670162500.0004-
1.6721163000.0003-
1.6773163500.0003-
1.6824164000.0022-
1.6875164500.0004-
1.6927165000.0005-
1.6978165500.0004-
1.7029166000.0006-
1.7080166500.0007-
1.7132167000.0009-
1.7183167500.0004-
1.7234168000.0014-
1.7286168500.0012-
1.7337169000.0005-
1.7388169500.0008-
1.7439170000.0006-
1.7491170500.0007-
1.7542171000.0004-
1.7593171500.0012-
1.7645172000.0013-
1.7696172500.0010-
1.7747173000.0009-
1.7799173500.0004-
1.7850174000.0003-
1.7901174500.0007-
1.7952175000.0004-
1.8004175500.0004-
1.8055176000.0005-
1.8106176500.0004-
1.8158177000.0003-
1.8209177500.0004-
1.8260178000.0014-
1.8311178500.0004-
1.8363179000.0008-
1.8414179500.0004-
1.8465180000.0004-
1.8517180500.0007-
1.8568181000.0003-
1.8619181500.0004-
1.8670182000.0019-
1.8722182500.0005-
1.8773183000.0007-
1.8824183500.0004-
1.8876184000.0014-
1.8927184500.0006-
1.8978185000.0004-
1.9030185500.0004-
1.9081186000.0003-
1.9132186500.0006-
1.9183187000.0008-
1.9235187500.0005-
1.9286188000.0003-
1.9337188500.0003-
1.9389189000.0003-
1.9440189500.0007-
1.9491190000.0003-
1.9542190500.0008-
1.9594191000.0007-
1.9645191500.0004-
1.9696192000.0004-
1.9748192500.0014-
1.9799193000.0009-
1.9850193500.0004-
1.9902194000.0012-
1.9953194500.0010-
2.019496-0.9733

</details>

Training Time

  • —Training: 1.0 hours
  • —Evaluation: 1.8 seconds
  • —Total: 1.0 hours

Framework Versions

  • —Python: 3.10.12
  • —Sentence Transformers: 6.1.0
  • —Transformers: 5.17.0
  • —PyTorch: 2.14.0+cu130
  • —Accelerate: 1.15.0
  • —Datasets: 5.0.1
  • —Tokenizers: 0.23.2

Additional Resources

Citation

BibTeX

Sentence Transformers
bibtex
@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
bibtex
@misc{oord2019representationlearningcontrastivepredictive,
      title={Representation Learning with Contrastive Predictive Coding},
      author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
      year={2019},
      eprint={1807.03748},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1807.03748},
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->