MCPcopy Create free account

hub / github.com/huggingface/sentence-transformers / functions

Functions404 in github.com/huggingface/sentence-transformers

↓ 51 callersMethodfit
Train the model with the given training objective Each training objective is sampled in turn for one batch. We sample only as
sentence_transformers/SentenceTransformer.py:564
↓ 45 callersMethodencode
Computes sentence embeddings :param sentences: the sentences to embed :param batch_size: the batch size used for the computa
sentence_transformers/SentenceTransformer.py:110
↓ 34 callersMethodget_word_embedding_dimension
(self)
sentence_transformers/models/CNN.py:49
↓ 33 callersMethodfrom_input_examples
(cls, examples: List[InputExample], **kwargs)
sentence_transformers/evaluation/TripletEvaluator.py:62
↓ 13 callersMethodevaluate
Evaluate the model :param evaluator: the evaluator :param output_path: the evaluator can write the r
sentence_transformers/SentenceTransformer.py:746
↓ 12 callersMethodpredict
Performs predicts with the CrossEncoder on the given sentence pairs. :param sentences: A list of sentence pairs [[Sent1, Sent2], [Se
sentence_transformers/cross_encoder/CrossEncoder.py:231
↓ 11 callersMethodload
(input_path)
sentence_transformers/models/BoW.py:81
↓ 10 callersMethodsave
(self, output_path)
sentence_transformers/models/BoW.py:76
↓ 9 callersMethodget_sentence_embedding_dimension
(self)
sentence_transformers/models/BoW.py:56
↓ 9 callersMethodpretrained_model_score
(self, model_name, expected_score)
tests/test_pretrained_stsb.py:13
↓ 7 callersMethod_first_module
Returns the first module of this sequential embedder
sentence_transformers/SentenceTransformer.py:330
↓ 7 callersMethoddevice
Get torch.device from module, assuming that the whole module has one device.
sentence_transformers/SentenceTransformer.py:858
↓ 4 callersFunctionfullname
Gives a full name (package_name.class_name) for a class / object in Python. Will be used to load the correct classes from JSON files
sentence_transformers/util.py:298
↓ 4 callersFunctionimport_from_string
Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import failed.
sentence_transformers/util.py:310
↓ 4 callersFunctionr
(n)
docs/_static/js/custom.js:23
↓ 4 callersFunctions
(e,t,o)
docs/_static/js/custom.js:23
↓ 4 callersMethodsave
Saves all elements for this seq. sentence embedder into different sub-folders :param path: Path on disc :param model_name: Op
sentence_transformers/SentenceTransformer.py:338
↓ 4 callersMethodsave_pretrained
Same function as save
sentence_transformers/cross_encoder/CrossEncoder.py:318
↓ 4 callersMethodtokenizer
Property to get the tokenizer that is used by this model
sentence_transformers/SentenceTransformer.py:876
↓ 3 callersFunctionbatch_to_device
send a pytorch batch to a device (CPU/GPU)
sentence_transformers/util.py:287
↓ 3 callersMethodfind_best_acc_and_threshold
(scores, labels, high_score_more_similar: bool)
sentence_transformers/evaluation/BinaryClassificationEvaluator.py:156
↓ 3 callersMethodfind_best_f1_and_threshold
(scores, labels, high_score_more_similar: bool)
sentence_transformers/evaluation/BinaryClassificationEvaluator.py:183
↓ 3 callersMethodfrom_text_file
(embeddings_file_path: str, update_embeddings: bool = False, item_separator: str = " ", tokenizer=WhitespaceTo
sentence_transformers/models/WordEmbeddings.py:86
↓ 3 callersMethodget_sentence_embedding_dimension
(self)
sentence_transformers/SentenceTransformer.py:323
↓ 3 callersMethodget_word_embedding_dimension
(self)
sentence_transformers/models/Transformer.py:81
↓ 2 callersFunctionF
(e,t)
docs/_static/js/custom.js:23
↓ 2 callersMethod_get_scheduler
Returns the correct learning rate scheduler. Available scheduler: constantlr, warmupconstant, warmuplinear, warmupcosine, warmupcosinewithhar
sentence_transformers/SentenceTransformer.py:839
↓ 2 callersFunction_power_method
(transition_matrix, increase_power=True)
examples/applications/text-summarization/LexRank.py:42
↓ 2 callersMethodadd_dataset
(self, parallel_sentences: List[List[str]], weight: int = 100, max_sentences: int = None, max_sentence_length:
sentence_transformers/datasets/ParallelSentencesDataset.py:77
↓ 2 callersFunctionb
(e)
docs/_static/js/custom.js:23
↓ 2 callersFunctionconnected_nodes
(matrix)
examples/applications/text-summarization/LexRank.py:62
↓ 2 callersFunctioncos_sim
Computes the cosine similarity cos_sim(a[i], b[j]) for all i and j. :return: Matrix with res[i][j] = cos_sim(a[i], b[j])
sentence_transformers/util.py:23
↓ 2 callersFunctioncreate_markov_matrix
(weights_matrix)
examples/applications/text-summarization/LexRank.py:74
↓ 2 callersMethodencode_multi_process
This method allows to run encode() on multiple GPUs. The sentences are chunked into smaller packages and sent to individual processes
sentence_transformers/SentenceTransformer.py:252
↓ 2 callersMethodevaluate_stsb_test
(self, model, expected_score)
tests/test_train_stsb.py:56
↓ 2 callersMethodevaluate_stsb_test
(self, model, expected_score)
tests/test_cross_encoder.py:40
↓ 2 callersFunctionf
(e,t,o)
docs/_static/js/custom.js:23
↓ 2 callersMethodget_anchor_negative_triplet_mask
Return a 2D mask where mask[a, n] is True iff a and n have distinct labels. Args: labels: tf.int32 `Tensor` with shape [batch_size
sentence_transformers/losses/BatchHardTripletLoss.py:192
↓ 2 callersMethodget_anchor_positive_triplet_mask
Return a 2D mask where mask[a, p] is True iff a and p are distinct and have same label. Args: labels: tf.int32 `Tensor` with shape
sentence_transformers/losses/BatchHardTripletLoss.py:172
↓ 2 callersMethodget_config_dict
(self)
sentence_transformers/models/Transformer.py:117
↓ 2 callersMethodget_config_dict
(self)
sentence_transformers/models/BoW.py:73
↓ 2 callersMethodget_config_dict
(self)
sentence_transformers/models/Dense.py:44
↓ 2 callersMethodget_config_dict
(self)
sentence_transformers/models/Pooling.py:108
↓ 2 callersMethodget_labels
()
sentence_transformers/readers/NLIDataReader.py:40
↓ 2 callersFunctionh
(e,t,o)
docs/_static/js/custom.js:23
↓ 2 callersFunctionkNN
(x, y, k, use_ann_search=False, ann_num_clusters=32768, ann_num_cluster_probe=3)
examples/applications/parallel-sentence-mining/bitext_mining_utils.py:29
↓ 2 callersMethodload_data
Reads in a tab-seperated .txt/.csv/.tsv or .gz file. The different columns contain the different translations of the sentence in the first co
sentence_transformers/datasets/ParallelSentencesDataset.py:48
↓ 2 callersFunctionp
(e)
docs/_static/js/custom.js:23
↓ 2 callersMethodsave
Saves all model and tokenizer to path
sentence_transformers/cross_encoder/CrossEncoder.py:307
↓ 2 callersFunctionscore_candidates
(x, y, candidate_inds, fwd_mean, bwd_mean, margin)
examples/applications/parallel-sentence-mining/bitext_mining_utils.py:20
↓ 2 callersMethodstart_multi_process_pool
Starts multi process to process the encoding with several, independent processes. This method is recommended if you want to encode on
sentence_transformers/SentenceTransformer.py:205
↓ 2 callersMethodtokenize
Tokenizes the texts
sentence_transformers/SentenceTransformer.py:314
↓ 2 callersFunctionu
(e,t,o)
docs/_static/js/custom.js:23
↓ 2 callersFunctionx
(e,t,o)
docs/_static/js/custom.js:23
↓ 1 callersFunctionC
(e)
docs/_static/js/custom.js:23
↓ 1 callersMethod__init__
:param model: SentenceTransformer model
sentence_transformers/losses/ContrastiveTensionLoss.py:24
↓ 1 callersMethod__init__
(self, dataset_folder, s1_col_idx=0, s2_col_idx=1, score_col_idx=2, delimiter="\t", quoting=c
sentence_transformers/readers/STSDataReader.py:12
↓ 1 callersMethod__len__
(self)
sentence_transformers/datasets/NoDuplicatesDataLoader.py:43
↓ 1 callersMethod__len__
(self)
examples/training/paraphrases/MultiDatasetDataLoader.py:88
↓ 1 callersMethod_create_model_card
Create an automatic model and stores it in path
sentence_transformers/SentenceTransformer.py:383
↓ 1 callersMethod_eval_during_training
Runs evaluation during the training
sentence_transformers/SentenceTransformer.py:759
↓ 1 callersMethod_eval_during_training
Runs evaluation during the training
sentence_transformers/cross_encoder/CrossEncoder.py:296
↓ 1 callersMethod_last_module
Returns the last module of this sequential embedder
sentence_transformers/SentenceTransformer.py:334
↓ 1 callersMethod_load_auto_model
Creates a simple Transformer + Mean Pooling model and returns the modules
sentence_transformers/SentenceTransformer.py:792
↓ 1 callersMethod_load_model
Loads the transformer model
sentence_transformers/models/Transformer.py:44
↓ 1 callersMethod_load_sbert_model
Loads a full sentence-transformers model
sentence_transformers/SentenceTransformer.py:801
↓ 1 callersMethod_load_t5_model
Loads the encoder model from T5
sentence_transformers/models/Transformer.py:51
↓ 1 callersMethod_masked_maximum
(data, mask, dim=1)
sentence_transformers/losses/BatchSemiHardTripletLoss.py:105
↓ 1 callersMethod_masked_minimum
(data, mask, dim=1)
sentence_transformers/losses/BatchSemiHardTripletLoss.py:96
↓ 1 callersMethod_save_checkpoint
(self, checkpoint_path, checkpoint_save_total_limit, step)
sentence_transformers/SentenceTransformer.py:776
↓ 1 callersMethod_text_length
Help function to get the length for the input text. Text can be either a list of ints (which means a single text as input), or a tupl
sentence_transformers/SentenceTransformer.py:548
↓ 1 callersFunctionaddGithubButton
()
docs/_static/js/custom.js:1
↓ 1 callersFunctionadd_notice_log_level
Creates a new 'notice' logging level
sentence_transformers/LoggingHandler.py:25
↓ 1 callersFunctionadd_to_samples
(sent1, sent2, label)
examples/training/nli/training_nli_v2.py:59
↓ 1 callersMethodadd_transitive_closure
(graph)
sentence_transformers/evaluation/ParaphraseMiningEvaluator.py:144
↓ 1 callersMethodbatch_all_triplet_loss
Build the triplet loss over a batch of embeddings. We generate all the valid triplets and average the loss over the positive ones. Arg
sentence_transformers/losses/BatchAllTripletLoss.py:47
↓ 1 callersMethodbatch_hard_triplet_loss
Build the triplet loss over a batch of embeddings. For each anchor, we get the hardest positive and hardest negative to form a triplet.
sentence_transformers/losses/BatchHardTripletLoss.py:100
↓ 1 callersMethodbatch_hard_triplet_soft_margin_loss
Build the triplet loss over a batch of embeddings. For each anchor, we get the hardest positive and hardest negative to form a triplet.
sentence_transformers/losses/BatchHardSoftMarginTripletLoss.py:46
↓ 1 callersMethodbatch_semi_hard_triplet_loss
Build the triplet loss over a batch of embeddings. We generate all the valid triplets and average the loss over the positive ones. Arg
sentence_transformers/losses/BatchSemiHardTripletLoss.py:50
↓ 1 callersMethodcompute_dcg_at_k
(relevances, k)
sentence_transformers/evaluation/InformationRetrievalEvaluator.py:295
↓ 1 callersMethodcompute_metrices
(self, model)
sentence_transformers/evaluation/RerankingEvaluator.py:82
↓ 1 callersMethodcompute_metrices
(self, model, corpus_model = None, corpus_embeddings: Tensor = None)
sentence_transformers/evaluation/InformationRetrievalEvaluator.py:138
↓ 1 callersMethodcompute_metrices
(self, model)
sentence_transformers/evaluation/BinaryClassificationEvaluator.py:111
↓ 1 callersMethodcompute_metrices_batched
Computes the metrices in a batched way, by batching all queries and all documents together
sentence_transformers/evaluation/RerankingEvaluator.py:85
↓ 1 callersMethodcompute_metrices_individual
Embeds every (query, positive, negative) tuple individually. Is slower than the batched version, but saves memory as only the
sentence_transformers/evaluation/RerankingEvaluator.py:147
↓ 1 callersMethodcompute_metrics
(self, queries_result_list: List[object])
sentence_transformers/evaluation/InformationRetrievalEvaluator.py:189
↓ 1 callersFunctioncreate_markov_matrix_discrete
(weights_matrix, threshold)
examples/applications/text-summarization/LexRank.py:84
↓ 1 callersFunctiondegree_centrality_scores
( similarity_matrix, threshold=None, increase_power=True, )
examples/applications/text-summarization/LexRank.py:9
↓ 1 callersMethoddelete
(text, del_ratio=0.6)
sentence_transformers/datasets/DenoisingAutoEncoderDataset.py:32
↓ 1 callersFunctiondownload_corpora
(filepaths)
examples/training/multilingual/make_multilingual.py:68
↓ 1 callersFunctionfile_open
(filepath)
examples/applications/parallel-sentence-mining/bitext_mining_utils.py:50
↓ 1 callersMethodfit
Train the model with the given training objective Each training objective is sampled in turn for one batch. We sample only as
sentence_transformers/cross_encoder/CrossEncoder.py:103
↓ 1 callersMethodforward
(self, features: Dict[str, Tensor])
sentence_transformers/models/BoW.py:48
↓ 1 callersMethodgenerate_data
(self)
sentence_transformers/datasets/ParallelSentencesDataset.py:104
↓ 1 callersMethodget_config_dict
(self)
sentence_transformers/models/WordEmbeddings.py:70
↓ 1 callersMethodget_config_dict
(self)
sentence_transformers/models/WordWeights.py:65
↓ 1 callersMethodget_config_dict
(self)
sentence_transformers/models/CNN.py:61
↓ 1 callersMethodget_config_dict
(self)
sentence_transformers/models/WeightedLayerPooling.py:36
↓ 1 callersMethodget_config_dict
(self)
sentence_transformers/models/LSTM.py:50
↓ 1 callersFunctionget_duplicate_set
(ids_set)
examples/training/quora_duplicate_questions/create_splits.py:209
next →1–100 of 404, ranked by callers