MCPcopy Create free account

hub / github.com/huggingface/sentence-transformers / types & classes

Types & classes85 in github.com/huggingface/sentence-transformers

↓ 76 callersClassSentenceTransformer
Loads or create a SentenceTransformer model, that can be used to map sentences / text to embeddings. :param model_name_or_path: If it is a f
sentence_transformers/SentenceTransformer.py:33
↓ 53 callersClassInputExample
Structure for one input example with texts, the label and a unique id
sentence_transformers/readers/InputExample.py:4
↓ 53 callersClassLoggingHandler
sentence_transformers/LoggingHandler.py:4
↓ 14 callersClassCrossEncoder
sentence_transformers/cross_encoder/CrossEncoder.py:20
↓ 3 callersClassParallelSentencesDataset
This dataset reader can be used to read-in parallel sentences, i.e., it reads in a file with tab-seperated sentences with the same sentence i
sentence_transformers/datasets/ParallelSentencesDataset.py:12
↓ 3 callersClassWhitespaceTokenizer
Simple and fast white-space tokenizer. Splits sentence based on white spaces. Punctuation are stripped from tokens.
sentence_transformers/models/tokenizer/WhitespaceTokenizer.py:8
↓ 2 callersClassCERerankingEvaluator
This class evaluates a CrossEncoder model for the task of re-ranking. Given a query and a list of documents, it computes the score [query, d
sentence_transformers/cross_encoder/evaluation/CERerankingEvaluator.py:8
↓ 2 callersClassPooling
Performs pooling (max or mean) on the token embeddings. Using pooling, it generates from a variable sized sentence a fixed sized sentence embed
sentence_transformers/models/Pooling.py:9
↓ 2 callersClassSentencesDataset
DEPRECATED: This class is no longer used. Instead of wrapping your List of InputExamples in a SentencesDataset and then passing it to the Dat
sentence_transformers/datasets/SentencesDataset.py:7
↓ 2 callersClassTransformer
Huggingface AutoModel to generate token embeddings. Loads the correct class, e.g. BERT / RoBERTa etc. :param model_name_or_path: Huggingface
sentence_transformers/models/Transformer.py:8
↓ 2 callersClassWordEmbeddings
sentence_transformers/models/WordEmbeddings.py:16
↓ 1 callersClassAsym
sentence_transformers/models/Asym.py:10
↓ 1 callersClassBinaryClassificationEvaluator
Evaluate a model based on the similarity of the embeddings by calculating the accuracy of identifying similar and dissimilar sentences. T
sentence_transformers/evaluation/BinaryClassificationEvaluator.py:14
↓ 1 callersClassBoW
Implements a Bag-of-Words (BoW) model to derive sentence embeddings. A weighting can be added to allow the generation of tf-idf vectors. The outp
sentence_transformers/models/BoW.py:14
↓ 1 callersClassCLIPModel
sentence_transformers/models/CLIPModel.py:7
↓ 1 callersClassCNN
CNN-layer with multiple kernel-sizes over the word embeddings
sentence_transformers/models/CNN.py:14
↓ 1 callersClassDense
Feed-forward function with activiation function. This layer takes a fixed-sized sentence embedding and passes it through a feed-forward layer. C
sentence_transformers/models/Dense.py:11
↓ 1 callersClassDropout
Dropout layer. :param dropout: Sets a dropout value for dense layer.
sentence_transformers/models/Dropout.py:9
↓ 1 callersClassLSTM
Bidirectional LSTM running over word embeddings.
sentence_transformers/models/LSTM.py:9
↓ 1 callersClassLayerNorm
sentence_transformers/models/LayerNorm.py:9
↓ 1 callersClassMSMARCODataset
examples/training/ms_marco/train_bi-encoder_mnrl.py:196
↓ 1 callersClassMSMARCODataset
examples/training/ms_marco/train_bi-encoder_margin-mse.py:178
↓ 1 callersClassMultiDatasetDataLoader
examples/training/paraphrases/MultiDatasetDataLoader.py:5
↓ 1 callersClassNormalize
This layer normalizes embeddings to unit length
sentence_transformers/models/Normalize.py:6
↓ 1 callersClassPhraseTokenizer
Tokenizes the text with respect to existent phrases in the vocab. This tokenizers respects phrases that are in the vocab. Phrases are separated w
sentence_transformers/models/tokenizer/PhraseTokenizer.py:13
↓ 1 callersClassSTSBenchmarkDataReader
Reader especially for the STS benchmark dataset. There, the sentences are in column 5 and 6, the score is in column 4. Scores are normalized
sentence_transformers/readers/STSDataReader.py:46
↓ 1 callersClassSentenceLabelDataset
This dataset can be used for some specific Triplet Losses like BATCH_HARD_TRIPLET_LOSS which requires multiple examples with the same label i
sentence_transformers/datasets/SentenceLabelDataset.py:12
↓ 1 callersClassTokenizedSentencesDataset
examples/unsupervised_learning/MLM/train_mlm.py:65
↓ 1 callersClassWeightedLayerPooling
Token embeddings are weighted mean of their different hidden layer representations
sentence_transformers/models/WeightedLayerPooling.py:9
↓ 1 callersClassWordWeights
This model can weight word embeddings, for example, with idf-values.
sentence_transformers/models/WordWeights.py:12
ClassBatchAllTripletLoss
BatchAllTripletLoss takes a batch with (label, sentence) pairs and computes the loss for all possible, valid triplets, i.e., anchor and posit
sentence_transformers/losses/BatchAllTripletLoss.py:8
ClassBatchHardSoftMarginTripletLoss
BatchHardSoftMarginTripletLoss takes a batch with (label, sentence) pairs and computes the loss for all possible, valid triplets, i.e., ancho
sentence_transformers/losses/BatchHardSoftMarginTripletLoss.py:7
ClassBatchHardTripletLoss
BatchHardTripletLoss takes a batch with (label, sentence) pairs and computes the loss for all possible, valid triplets, i.e., anchor and posi
sentence_transformers/losses/BatchHardTripletLoss.py:57
ClassBatchHardTripletLossDistanceFunction
This class defines distance functions, that can be used with Batch[All/Hard/SemiHard]TripletLoss
sentence_transformers/losses/BatchHardTripletLoss.py:8
ClassBatchSemiHardTripletLoss
BatchSemiHardTripletLoss takes a batch with (label, sentence) pairs and computes the loss for all possible, valid triplets, i.e., anchor and
sentence_transformers/losses/BatchSemiHardTripletLoss.py:8
ClassCEBinaryAccuracyEvaluator
This evaluator can be used with the CrossEncoder class. It is designed for CrossEncoders with 1 outputs. It measure the accuracy of the
sentence_transformers/cross_encoder/evaluation/CEBinaryAccuracyEvaluator.py:11
ClassCEBinaryClassificationEvaluator
This evaluator can be used with the CrossEncoder class. Given sentence pairs and binary labels (0 and 1), it compute the average precision an
sentence_transformers/cross_encoder/evaluation/CEBinaryClassificationEvaluator.py:14
ClassCECorrelationEvaluator
This evaluator can be used with the CrossEncoder class. Given sentence pairs and continuous scores, it compute the pearson & spearman correla
sentence_transformers/cross_encoder/evaluation/CECorrelationEvaluator.py:11
ClassCESoftmaxAccuracyEvaluator
This evaluator can be used with the CrossEncoder class. It is designed for CrossEncoders with 2 or more outputs. It measure the accuracy
sentence_transformers/cross_encoder/evaluation/CESoftmaxAccuracyEvaluator.py:11
ClassComputeEmbeddingsTest
tests/test_compute_embeddings.py:10
ClassComputeEmbeddingsTest
tests/test_image_embeddings.py:11
ClassComputeMultiProcessTest
tests/test_multi_process.py:10
ClassContrastiveLoss
Contrastive loss. Expects as input two texts and a label of either 0 or 1. If the label == 1, then the distance between the two embeddings is
sentence_transformers/losses/ContrastiveLoss.py:17
ClassContrastiveTensionDataLoader
sentence_transformers/losses/ContrastiveTensionLoss.py:71
ClassContrastiveTensionLoss
This loss expects as input a batch consisting of multiple mini-batches of sentence pairs (a_1, p_1), (a_2, p_2)..., (a_{K+1}, p_{K+1})
sentence_transformers/losses/ContrastiveTensionLoss.py:12
ClassContrastiveTensionLossInBatchNegatives
sentence_transformers/losses/ContrastiveTensionLoss.py:44
ClassCosineSimilarityLoss
CosineSimilarityLoss expects, that the InputExamples consists of two texts and a float label. It computes the vectors u = model(input_text[0
sentence_transformers/losses/CosineSimilarityLoss.py:7
ClassCrossEncoderTest
tests/test_cross_encoder.py:17
ClassDenoisingAutoEncoderDataset
The DenoisingAutoEncoderDataset returns InputExamples in the format: texts=[noise_fn(sentence), sentence] It is used in combination with the
sentence_transformers/datasets/DenoisingAutoEncoderDataset.py:8
ClassDenoisingAutoEncoderLoss
This loss expects as input a batch consisting of damaged sentences and the corresponding original ones. The data generation process h
sentence_transformers/losses/DenoisingAutoEncoderLoss.py:10
ClassEmbeddingSimilarityEvaluator
Evaluate a model based on the similarity of the embeddings by calculating the Spearman and Pearson rank correlation in comparison to the gold
sentence_transformers/evaluation/EmbeddingSimilarityEvaluator.py:14
ClassEvaluatorTest
tests/test_evaluator.py:15
ClassGithubURLDomain
Resolve .py links to their respective Github URL
docs/conf.py:91
ClassInformationRetrievalEvaluator
This class evaluates an Information Retrieval (IR) setting. Given a set of queries and a large corpus set. It will retrieve for each query t
sentence_transformers/evaluation/InformationRetrievalEvaluator.py:15
ClassLabelAccuracyEvaluator
Evaluate a model based on its accuracy on a labeled dataset This requires a model with LossFunction.SOFTMAX The results are written in
sentence_transformers/evaluation/LabelAccuracyEvaluator.py:12
ClassLabelSentenceReader
Reads in a file that has at least two columns: a label and a sentence. This reader can for example be used with the BatchHardTripletLoss. Maps
sentence_transformers/readers/LabelSentenceReader.py:6
ClassMSEEvaluator
Computes the mean squared error (x100) between the computed sentence embedding and some target sentence embedding. The MSE is computed b
sentence_transformers/evaluation/MSEEvaluator.py:11
ClassMSEEvaluatorFromDataFrame
Computes the mean squared error (x100) between the computed sentence embedding and some target sentence embedding. :param dataframe:
sentence_transformers/evaluation/MSEEvaluatorFromDataFrame.py:15
ClassMSELoss
Computes the MSE loss between the computed sentence embedding and a target sentence embedding. This loss is used when extending sentence embe
sentence_transformers/losses/MSELoss.py:6
ClassMarginMSELoss
Compute the MSE loss between the |sim(Query, Pos) - sim(Query, Neg)| and |gold_sim(Q, Pos) - gold_sim(Query, Neg)|. By default, sim() is the
sentence_transformers/losses/MarginMSELoss.py:5
ClassMegaBatchMarginLoss
Loss function inspired from ParaNMT paper: https://www.aclweb.org/anthology/P18-1042/ Given a large batch (like 500 or more examples) of
sentence_transformers/losses/MegaBatchMarginLoss.py:7
ClassModelCardTemplate
sentence_transformers/model_card_templates.py:5
ClassMultipleNegativesRankingLoss
This loss expects as input a batch consisting of sentence pairs (a_1, p_1), (a_2, p_2)..., (a_n, p_n) where we assume that (a_i, p_i)
sentence_transformers/losses/MultipleNegativesRankingLoss.py:7
ClassMultipleNegativesSymmetricRankingLoss
This loss is an adaptation of MultipleNegativesRankingLoss. MultipleNegativesRankingLoss computes the following loss: For a given anc
sentence_transformers/losses/MultipleNegativesSymmetricRankingLoss.py:7
ClassNLIDataReader
Reads in the Stanford NLI dataset and the MultiGenre NLI dataset
sentence_transformers/readers/NLIDataReader.py:7
ClassNoDuplicatesDataLoader
sentence_transformers/datasets/NoDuplicatesDataLoader.py:4
ClassOnlineContrastiveLoss
Online Contrastive loss. Similar to ConstrativeLoss, but it selects hard positive (positives that are far apart) and hard negative pairs (neg
sentence_transformers/losses/OnlineContrastiveLoss.py:8
ClassPairedFilesReader
Reads in the a Pair Dataset, split in two files
sentence_transformers/readers/PairedFilesReader.py:7
ClassParaphraseMiningEvaluator
Given a large set of sentences, this evaluator performs paraphrase (duplicate) mining and identifies the pairs with the highest similarity. I
sentence_transformers/evaluation/ParaphraseMiningEvaluator.py:14
ClassPretrainedSTSbTest
tests/test_pretrained_stsb.py:11
ClassPretrainedSTSbTest
tests/test_train_stsb.py:16
ClassRerankingEvaluator
This class evaluates a SentenceTransformer model for the task of re-ranking. Given a query and a list of documents, it computes the score [q
sentence_transformers/evaluation/RerankingEvaluator.py:13
ClassSTSDataReader
Reads in the STS dataset. Each line contains two sentences (s1_col_idx, s2_col_idx) and one label (score_col_idx) Default values expects a t
sentence_transformers/readers/STSDataReader.py:6
ClassSentenceEvaluator
Base class for all evaluators Extend this class and implement __call__ for custom evaluators.
sentence_transformers/evaluation/SentenceEvaluator.py:1
ClassSequentialEvaluator
This evaluator allows that multiple sub-evaluators are passed. When the model is evaluated, the data is passed sequentially to all sub-evalua
sentence_transformers/evaluation/SequentialEvaluator.py:4
ClassSiameseDistanceMetric
The metric for the contrastive loss
sentence_transformers/losses/ContrastiveLoss.py:8
ClassSimilarityFunction
sentence_transformers/evaluation/SimilarityFunction.py:3
ClassSoftmaxLoss
This loss was used in our SBERT publication (https://arxiv.org/abs/1908.10084) to train the SentenceTransformer model on NLI data. It adds a
sentence_transformers/losses/SoftmaxLoss.py:10
ClassTranslationEvaluator
Given two sets of sentences in different languages, e.g. (en_1, en_2, en_3...) and (fr_1, fr_2, fr_3, ...), and assuming that fr_i is the tra
sentence_transformers/evaluation/TranslationEvaluator.py:14
ClassTripletDistanceMetric
The metric for the triplet loss
sentence_transformers/losses/TripletLoss.py:8
ClassTripletEvaluator
Evaluate a model based on a triplet: (sentence, positive_example, negative_example). Checks if distance(sentence, positive_example) < dis
sentence_transformers/evaluation/TripletEvaluator.py:13
ClassTripletLoss
This class implements triplet loss. Given a triplet of (anchor, positive, negative), the loss minimizes the distance between anchor and posit
sentence_transformers/losses/TripletLoss.py:16
ClassTripletReader
Reads in the a Triplet Dataset: Each line contains (at least) 3 columns, one anchor column (s1), one positive example (s2) and one negative e
sentence_transformers/readers/TripletReader.py:6
ClassUtilTest
tests/test_util.py:7
ClassWordTokenizer
sentence_transformers/models/tokenizer/WordTokenizer.py:7