Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 13
How to use shreyaspullehf/superconductor-search-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("shreyaspullehf/superconductor-search-v1")
sentences = [
"how sputtering operates",
"Brian David Josephson (born 4 January 1940) is a British theoretical physicist and emeritus professor at the University of Cambridge. He shared the 1973 Nobel Prize in Physics with Leo Esaki and Ivar Giaever for his discovery of the Josephson effect, made in 1962 when he was a Ph.D. student at Cambridge.\nJosephson has spent his academic career as a member of the Theory of Condensed Matter Group in Cambridge's Cavendish Laboratory. He has been a Fellow of Trinity College, Cambridge, since 1962, and served as Professor of Physics from 1974 until 2007.\nIn the early 1970s, Josephson took up Transcendental Meditation and turned his attention to issues outside the boundaries of mainstream science. He set up the Mind–Matter Unification Project at Cavendish to explore the idea of intelligence in nature, the relationship between quantum mechanics and consciousness, and the synthesis of science and Eastern mysticism, broadly known as quantum mysticism. He has expressed support for topics such as parapsychology, water memory and cold fusion, which has made him a focus of criticism from fellow scientists.\n\n\n== Education ==\nBrian David Josephson was born on 4 January 1940 in Cardiff, Wales, to Jewish parents, Abraham Josephson and Mimi Weisbard. He attended Cardiff High School, where he credits some of the school masters for having helped him, particularly the physics master, Emrys Jones, who introduced him to theoretical physics. In 1957, he went up to Cambridge, where he initially read mathematics at Trinity College, Cambridge. After completing Maths Part II in two years, and finding it somewhat sterile, he decided to switch to physics.\nJosephson was known at Cambridge as a brilliant but shy student. Physicist John Waldram recalled overhearing Nicholas Kurti, an examiner from Oxford, discuss Josephson's exam results with David Shoenberg, Reader in Physics at Cambridge, and asking: \"Who is this chap Josephson? He seems to be going through the theory like a knife through butter.",
"arXiv:1008.4418v1 [cond-mat.supr-con] 26 Aug 2010 The Physical Origins of the Meissner Effect and London Penetration Depth X. Q. Huang1,2∗ 1Department of Physics and National Laboratory of Solid State Microstructure, Nanjing University, Nanjing 210093, China 2Department of Telecommunications Engineering ICE, PLAUST, Nanjing 210016, China Based on the recent developed real-space theory of superconductivity (arXiv:0910.5511 and arXiv:1001.5067), we study the physical nature of the Meissner effect and London penetration depth in conventional and non-conventional superconductors. It is argued that they originate from an exactly the same reason of the real-space quasi-one-dimensional periodic dynamic charge stripes in the superconductors. The fundamental relationship between the London penetration depth and the superconducting electron density is qualitatively determined. PACS numbers: 74.20.z, 74.25.Ha Introduction: The Meissner Effect is the most fundamen- tal and the most dazzling property of materials in the super- conducting state [1]. To explain the Meissner effect that no magnetic field exists in the interior of a superconductor, the London brothers proposed two equations to describe the mi- croscopic electric field E and magnetic field B within the su- perconductor [2]. The first London equation is in fact the sim- ply Newton’s second law for the superconducting electrons: ∂Js ∂t = nse2 me E, (1) where Js = nsevs is the supercurrent density, ns is the su- perconducting electron density and vs is the superfluid veloc- ity. Taking into account Maxwell’s equation of ∇× E = −∂B/∂t, then the second London equation can be written as ∇× Js = −nse2 me B. (2) The London equations (1) and (2) imply a characteristic length scale λL = p me/µ0nse2, the so-called London pen- etration depth, which gives the length scale over which an external applied field is exponentially suppressed. For most superconductors, the London penetration depth λL is on the order of 100 nm. In 1950, Ginzbu",
"Unconventional superconductors are materials that display superconductivity which is not explained by the usual BCS theory or its extension, the Eliashberg theory. The pairing in unconventional superconductors may originate from some other mechanism than the electron–phonon interaction. Alternatively, a superconductor is unconventional if the superconducting order parameter transforms according to a non-trivial irreducible representation of the point group or space group of the system. Per definition, superconductors that break additional symmetries to U (1) symmetry are known as unconventional superconductors. \n\n\n== History ==\nThe superconducting properties of CeCu2Si2, a type of\nheavy fermion material, were reported in 1979 by Frank Steglich. For a long time it was believed that CeCu2Si2 was a singlet d-wave superconductor, but since the mid-2010s, this notion has been strongly contested. In the early eighties, many more unconventional, heavy fermion superconductors were discovered, including UBe13, UPt3 and URu2Si2. In each of these materials, the anisotropic nature of the pairing was implicated by the power-law dependence of the nuclear magnetic resonance (NMR) relaxation rate and specific heat capacity on temperature. The presence of nodes in the superconducting gap of UPt3 was confirmed in 1986 from the polarization dependence of the ultrasound attenuation.\nThe first unconventional triplet superconductor, organic material (TMTSF)2PF6, was discovered by Denis Jerome, Klaus Bechgaard and coworkers in 1980 (TMTSF = Tetramethyltetraselenafulvalenium, see Fulvalene). Experimental works by Paul Chaikin's and Michael Naughton's groups as well as theoretical analysis of their data by Andrei Lebed have firmly confirmed unconventional nature of superconducting pairing in (TMTSF)2X (X=PF6, ClO4, etc.) organic materials.\nHigh-temperature singlet d-wave superconductivity was discovered by J.G. Bednorz and K.A. Müller in 1986, who also discovered that the lanthanum-based"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model finetuned from sentence-transformers/all-mpnet-base-v2. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 384, 'do_lower_case': False, 'architecture': 'MPNetModel'})
(1): Pooling({'word_embedding_dimension': 768, '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()
)
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("sentence_transformers_model_id")
# Run inference
sentences = [
'can magnets float on superconductors',
'We discuss the spatial structure of the Cooper pair in dilute neutron matter\nand neutron-rich nuclei by means of the BCS theory and the\nSkyrme-Hartree-Fock-Bogioliubov model, respectively. The neutron pairing in\ndilute neutron matter is close to the region of the BCS-BEC crossover in a wide\ndensity range, giving rise to spatially compact Cooper pair whose size is\nsmaller than the average interaparticle distance. This behavior extends to\nmoderate low density ($\\sim 10^{-1}$ of the saturation density) where the\nCooper pair size becomes smallerst ($\\sim 5$ fm). The Cooper pair in finite\nnuclei also exhibits the spatial correlation favoring the coupling of neutrons\nat small relative distances $r \\lesim 3$ fm with large probability.\nNeutron-rich nuclei having small neutron separation energy may provide us\nopportunity to probe the spatial correlation since the neutron pairing and the\nspatial correlation persists also in an area of low-density neutron\ndistribution extending from the surface to far outside the nucleus.',
'Brian David Josephson (born 4 January 1940) is a British theoretical physicist and emeritus professor at the University of Cambridge. He shared the 1973 Nobel Prize in Physics with Leo Esaki and Ivar Giaever for his discovery of the Josephson effect, made in 1962 when he was a Ph.D. student at Cambridge.\nJosephson has spent his academic career as a member of the Theory of Condensed Matter Group in Cambridge\'s Cavendish Laboratory. He has been a Fellow of Trinity College, Cambridge, since 1962, and served as Professor of Physics from 1974 until 2007.\nIn the early 1970s, Josephson took up Transcendental Meditation and turned his attention to issues outside the boundaries of mainstream science. He set up the Mind–Matter Unification Project at Cavendish to explore the idea of intelligence in nature, the relationship between quantum mechanics and consciousness, and the synthesis of science and Eastern mysticism, broadly known as quantum mysticism. He has expressed support for topics such as parapsychology, water memory and cold fusion, which has made him a focus of criticism from fellow scientists.\n\n\n== Education ==\nBrian David Josephson was born on 4 January 1940 in Cardiff, Wales, to Jewish parents, Abraham Josephson and Mimi Weisbard. He attended Cardiff High School, where he credits some of the school masters for having helped him, particularly the physics master, Emrys Jones, who introduced him to theoretical physics. In 1957, he went up to Cambridge, where he initially read mathematics at Trinity College, Cambridge. After completing Maths Part II in two years, and finding it somewhat sterile, he decided to switch to physics.\nJosephson was known at Cambridge as a brilliant but shy student. Physicist John Waldram recalled overhearing Nicholas Kurti, an examiner from Oxford, discuss Josephson\'s exam results with David Shoenberg, Reader in Physics at Cambridge, and asking: "Who is this chap Josephson? He seems to be going through the theory like a knife through butter.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000, -0.0149, 0.1589],
# [-0.0149, 1.0000, 0.0733],
# [ 0.1589, 0.0733, 1.0000]])
sentence_0, sentence_1, and label| sentence_0 | sentence_1 | label | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| sentence_0 | sentence_1 | label |
|---|---|---|
current density definition |
h = 0, we see as expected a conventional diamagnetic Meissner effect. In- terestingly, even for a very small exchange field h/∆0 = 0.05 we observe that χ vs. T displays a re-entrant behavior. To understand the physical origin of this behavior, we first note that when the normal metal length satisfies L ≫ξS, the proximity-induced minigap is much smaller than the super- conducting gap ∆0. The minigap is determined by the Thou- less energy [29] εT = D/L2, so that longer samples have smaller minigaps. Now, in the presence of exchange fields h/∆0 ∼εT /∆0 = (ξS/L)2, the triplet proximity effect be- comes resonant and results in a zero-energy peak in the den- sity of states [30]. For smaller minigaps (larger L), only a small exchange field is needed to get sufficiently close to res- onance, which explains why a long normal metal can be influ- enced by a small h. As seen in the inset of Fig. 2 (a), a change in ξS/L will also give re-entrant behaviour as long as h is low- ered accordingly. Since εT is... |
0.0 |
polaron effect in superconductors |
High-temperature superconductivity (high-Tc or HTS) is superconductivity in materials with a critical temperature (the temperature below which the material behaves as a superconductor) above 77 K (−196.2 °C; −321.1 °F), the boiling point of liquid nitrogen. They are "high-temperature" only relative to previously known superconductors, which function only closer to absolute zero. The first high-temperature superconductor was discovered in 1986 by IBM researchers Georg Bednorz and K. Alex Müller. Although the critical temperature is around 35.1 K (−238.1 °C; −396.5 °F), this material was modified by Ching-Wu Chu to make the first high-temperature superconductor with critical temperature 93 K (−180.2 °C; −292.3 °F). Bednorz and Müller were awarded the Nobel Prize in Physics in 1987 "for their important break-through in the discovery of superconductivity in ceramic materials". Most high-Tc materials are type-II superconductors. |
1.0 |
why hbcco is a SC material |
High-temperature superconductivity (high-Tc or HTS) is superconductivity in materials with a critical temperature (the temperature below which the material behaves as a superconductor) above 77 K (−196.2 °C; −321.1 °F), the boiling point of liquid nitrogen. They are "high-temperature" only relative to previously known superconductors, which function only closer to absolute zero. The first high-temperature superconductor was discovered in 1986 by IBM researchers Georg Bednorz and K. Alex Müller. Although the critical temperature is around 35.1 K (−238.1 °C; −396.5 °F), this material was modified by Ching-Wu Chu to make the first high-temperature superconductor with critical temperature 93 K (−180.2 °C; −292.3 °F). Bednorz and Müller were awarded the Nobel Prize in Physics in 1987 "for their important break-through in the discovery of superconductivity in ceramic materials". Most high-Tc materials are type-II superconductors. |
1.0 |
CosineSimilarityLoss with these parameters:{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
per_device_train_batch_size: 16per_device_eval_batch_size: 16num_train_epochs: 4multi_dataset_batch_sampler: round_robinoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_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: 1num_train_epochs: 4max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_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: Falsebf16: Falsefp16: Falsefp16_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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_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: Trueuse_legacy_prediction_loop: Falsepush_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_inputs_for_metrics: Falseinclude_for_metrics: []eval_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: Noneinclude_tokens_per_second: Falseinclude_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: Trueprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss |
|---|---|---|
| 0.6944 | 500 | 0.1081 |
| 1.3889 | 1000 | 0.0745 |
| 2.0833 | 1500 | 0.0631 |
| 2.7778 | 2000 | 0.0485 |
| 3.4722 | 2500 | 0.0422 |
@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",
}
Base model
sentence-transformers/all-mpnet-base-v2