- class sts_select.gensim.FastTextModel(model_path=None)¶
- Parameters:
model_path – Path to a saved model. If None, a new model will be created.
- encode(sentences, batch_size=1, show_progress_bar=False)¶
Prepares sentence bpairs for the model and returns the embeddings.
- Parameters:
sentences – List of sentences to encode.
- fit(train_objectives=None, epochs=None, warmup_steps=None)¶
Fits the model to the given sentence pair/similarity dataset.
- Parameters:
train_objectives – List of tuples. Each tuple contains a dataloader and a loss function.
epochs – Number of epochs to train the model.
warmup_steps – Number of warmup steps.
- save(path)¶
Saves the model to the specified path.
- Parameters:
path – Path to save the model to.
- class sts_select.gensim.SkipgramModel(model_path=None)¶
- Parameters:
model_path – Path to a saved model. If None, a new model will be created.
- encode(sentences, batch_size=1, show_progress_bar=False)¶
Prepares sentence bpairs for the model and returns the embeddings.
- Parameters:
sentences – List of sentences to encode.
- fit(train_objectives=None, epochs=None, warmup_steps=None, worker_count=-1)¶
Fits the model to the given sentence pair/similarity dataset.
- Parameters:
train_objectives – List of tuples. Each tuple contains a dataloader and a loss function.
epochs – Number of epochs to train the model.
warmup_steps – Number of warmup steps.
- save(path)¶
Saves the model to the specified path.
- Parameters:
path – Path to save the model to.