SentenceTransformer based on Shuu12121/CodeSearch-ModernBERT-Snake
This is a
sentence-transformers
model finetuned from
Shuu12121/CodeSearch-ModernBERT-Snake
. It maps sentences & paragraphs to a 512-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
'Reject Message.\n\n :param int/long delivery_tag: Server-assigned delivery tag\n :param bool requeue: Re-queue the message\n\n :raises AMQPInvalidArgument: Invalid Parameters\n :raises AMQPChannelError: Raises if the channel encountered an error.\n :raises AMQPConnectionError: Raises if the connection\n encountered an error.\n\n :return:',
"def reject(self, delivery_tag=0, requeue=True):\n \n if not compatibility.is_integer(delivery_tag):\n raise AMQPInvalidArgument('delivery_tag should be an integer')\n elif not isinstance(requeue, bool):\n raise AMQPInvalidArgument('requeue should be a boolean')\n reject_frame = specification.Basic.Reject(delivery_tag=delivery_tag,\n requeue=requeue)\n self._channel.write_frame(reject_frame)",
'def num_columns(self):\n \n if self.term.is_a_tty:\n return self.term.width // self.hint_width\n return 1',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 512]# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Approximate statistics based on the first 1000 samples:
sentence_0
sentence_1
label
type
string
string
float
details
min: 5 tokens
mean: 97.05 tokens
max: 2706 tokens
min: 27 tokens
mean: 159.11 tokens
max: 889 tokens
min: 1.0
mean: 1.0
max: 1.0
Samples:
sentence_0
sentence_1
label
Set the text for this element.
Arguments:
text (str): The text
cls (str): The class of the text, defaults to
current
(leave this unless you know what you are doing). There may be only one text content element of each class associated with the element.
def settext(self, text, cls='current'):
self.replace(TextContent, value=text, cls=cls)
1.0
Associate a document with this element.
Arguments:
doc (:class:
Document
): A document
Each element must be associated with a FoLiA document.
def setdocument(self, doc):
assert isinstance(doc, Document)
if not self.doc:
self.doc = doc
if self.id:
if self.id in doc:
raise DuplicateIDError(self.id)
else:
self.doc.index[id] = self
for e in self: #recursive for all children
if isinstance(e,AbstractElement): e.setdocument(doc)
1.0
Tests whether a new element of this class can be added to the parent.
This method is mostly for internal use.
This will use the
OCCURRENCES
property, but may be overidden by subclasses for more customised behaviour.
Parameters:
parent (:class:
AbstractElement
): The element that is being added to
set (str or None): The set
raiseexceptions (bool): Raise an exception if the element can't be added?
if not parent.
class
.accepts(Class, raiseexceptions, parent):
return False
if Class.OCCURRENCES > 0:
#check if the parent doesn't have too many already
count = parent.count(Class,None,True,[True, AbstractStructureElement]) #never descend into embedded structure annotatioton
if count >= Class.OCCURRENCES:
if raiseexceptions:
if parent.id:
extra = ' (id=' + parent.id + ')'
else:
extra = ''
raise DuplicateAnnotationError("Unable to add another object of type " + Class.
name
+ " to " + parent.
class
.
name
+ " " + extra + ". There are already " + str(count) + " instances of this class, which is the maximum.")
else:
return False
if Class.OCCURRENCES_PER_SET > 0 and set and Class.R...
@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}
}
Runs of Shuu12121 CodeSearch-ModernBERT-Snake-1.0 on huggingface.co
8
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About CodeSearch-ModernBERT-Snake-1.0 huggingface.co Model
More CodeSearch-ModernBERT-Snake-1.0 license Visit here:
CodeSearch-ModernBERT-Snake-1.0 huggingface.co is an AI model on huggingface.co that provides CodeSearch-ModernBERT-Snake-1.0's model effect (), which can be used instantly with this Shuu12121 CodeSearch-ModernBERT-Snake-1.0 model. huggingface.co supports a free trial of the CodeSearch-ModernBERT-Snake-1.0 model, and also provides paid use of the CodeSearch-ModernBERT-Snake-1.0. Support call CodeSearch-ModernBERT-Snake-1.0 model through api, including Node.js, Python, http.
CodeSearch-ModernBERT-Snake-1.0 huggingface.co is an online trial and call api platform, which integrates CodeSearch-ModernBERT-Snake-1.0's modeling effects, including api services, and provides a free online trial of CodeSearch-ModernBERT-Snake-1.0, you can try CodeSearch-ModernBERT-Snake-1.0 online for free by clicking the link below.
Shuu12121 CodeSearch-ModernBERT-Snake-1.0 online free url in huggingface.co:
CodeSearch-ModernBERT-Snake-1.0 is an open source model from GitHub that offers a free installation service, and any user can find CodeSearch-ModernBERT-Snake-1.0 on GitHub to install. At the same time, huggingface.co provides the effect of CodeSearch-ModernBERT-Snake-1.0 install, users can directly use CodeSearch-ModernBERT-Snake-1.0 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
CodeSearch-ModernBERT-Snake-1.0 install url in huggingface.co: