from sentence_transformers import SparseEncoder
# Download from the 🤗 Hub
model = SparseEncoder("yosefw/SPLADE-BERT-Tiny-distil-v5")
# Run inference
queries = [
"lists of narcotic medications",
]
documents = [
'The following list of narcotics is just a sample of some of the names you may hear either in a medical setting or on the streets: 1 Heroin. 2 Opium. 3 Oxycontin. Oxycodone. 4 Hydrocodone. Hydromorphone. 5 Fentanyl. Buprenorphine. 6 Levorphanol. 7 Codeine. Lorcet. 8 Lortab. 9 Norco. 10 Oncet. Procet. 11 Vicodin. Xodol. Zydone.',
'When used in a legal context in the U.S., a narcotic drug is simply one that is totally prohibited, or one that is used in violation of governmental regulation, such as heroin or cannabis. In the medical community, the term is more precisely defined and generally does not carry the same negative connotations.',
'Tomb is a vault for the dead (an enclosed grave). Raider means someone who attacks the enemy or steals. The term applies to grave robbers. Or treasure hunters. It is also the name of a popular multi platform video game(Tomb Raider). Which features a main character who is a explorer/treasure hunter(Lara Croft).',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 30522] [3, 30522]# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[14.6490, 16.3028, 1.8537]])
Approximate statistics based on the first 1000 samples:
query
positive
negative
label
type
string
string
string
list
details
min: 4 tokens
mean: 8.98 tokens
max: 40 tokens
min: 20 tokens
mean: 80.67 tokens
max: 298 tokens
min: 17 tokens
mean: 76.49 tokens
max: 238 tokens
size: 1 elements
Samples:
query
positive
negative
label
what was the congressional reconstruction act?
On Mar. 2, 1867, Congress enacted the Reconstruction Act, which, supplemented later by three related acts, divided the South (except Tennessee) into five military districts in which the authority of the army commander was supreme.y Aug., 1868, six states (Arkansas, North Carolina, South Carolina, Louisiana, Alabama, and Florida) had been readmitted to the Union, having ratified the Fourteenth Amendment as required by the first Reconstruction Act.
Reconstruction Acts of 1867-1868. Johnson s vetoes of these measures were overridden by Congress, repeating a familiar pattern. Nearly two years following the end of the Civil War, Congress finally forged a complete plan for reconstruction.Three measures were passed in 1867 as well as additional legislation the following year.early two years following the end of the Civil War, Congress finally forged a complete plan for reconstruction. Three measures were passed in 1867 as well as additional legislation the following year.
[0.25]
what are two similarities of atm and debit cards
Similarities of ATM Card and Debit Card ATM card and debit card are made of plastic and both have the same appearance. Both are issued by the bank and provide the facility like balance inquiry, withdrawal of money or make payment online and much more.
Debit cards offer the convenience of a credit but work in a different way. Debit cards draw money directly from your checking account when you make the purchase. They do this by placing a hold on the amount of the purchase.
@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",
}
SpladeLoss
@misc{formal2022distillationhardnegativesampling,
title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and Stéphane Clinchant},
year={2022},
eprint={2205.04733},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2205.04733},
}
SparseMarginMSELoss
@misc{hofstätter2021improving,
title={Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation},
author={Sebastian Hofstätter and Sophia Althammer and Michael Schröder and Mete Sertkan and Allan Hanbury},
year={2021},
eprint={2010.02666},
archivePrefix={arXiv},
primaryClass={cs.IR}
}
FlopsLoss
@article{paria2020minimizing,
title={Minimizing flops to learn efficient sparse representations},
author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
journal={arXiv preprint arXiv:2004.05665},
year={2020}
}
Runs of yosefw SPLADE-BERT-Tiny-distil-v5 on huggingface.co
17
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About SPLADE-BERT-Tiny-distil-v5 huggingface.co Model
More SPLADE-BERT-Tiny-distil-v5 license Visit here:
SPLADE-BERT-Tiny-distil-v5 huggingface.co is an AI model on huggingface.co that provides SPLADE-BERT-Tiny-distil-v5's model effect (), which can be used instantly with this yosefw SPLADE-BERT-Tiny-distil-v5 model. huggingface.co supports a free trial of the SPLADE-BERT-Tiny-distil-v5 model, and also provides paid use of the SPLADE-BERT-Tiny-distil-v5. Support call SPLADE-BERT-Tiny-distil-v5 model through api, including Node.js, Python, http.
SPLADE-BERT-Tiny-distil-v5 huggingface.co is an online trial and call api platform, which integrates SPLADE-BERT-Tiny-distil-v5's modeling effects, including api services, and provides a free online trial of SPLADE-BERT-Tiny-distil-v5, you can try SPLADE-BERT-Tiny-distil-v5 online for free by clicking the link below.
yosefw SPLADE-BERT-Tiny-distil-v5 online free url in huggingface.co:
SPLADE-BERT-Tiny-distil-v5 is an open source model from GitHub that offers a free installation service, and any user can find SPLADE-BERT-Tiny-distil-v5 on GitHub to install. At the same time, huggingface.co provides the effect of SPLADE-BERT-Tiny-distil-v5 install, users can directly use SPLADE-BERT-Tiny-distil-v5 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
SPLADE-BERT-Tiny-distil-v5 install url in huggingface.co: