Sentence Transformer

opensearch_py_ml.ml_models.SentenceTransformerModel.__init__(self, model_id: str = 'sentence-transformers/msmarco-distilbert-base-tas-b', folder_path: str | None = None, overwrite: bool = False) None

Initiate a sentence transformer model class object. The model id will be used to download pretrained model from the hugging-face and served as the default name for model files, and the folder_path will be the default location to store files generated in the following functions

Parameters:
  • model_id (string) – Optional, the huggingface mode id to download sentence transformer model, default model id: ‘sentence-transformers/msmarco-distilbert-base-tas-b’

  • folder_path (string) – Optional, the path of the folder to save output files, such as queries, pre-trained model, after-trained custom model and configuration files. if None, default as “/model_files/” under the current work directory

  • overwrite (bool) – Optional, choose to overwrite the folder at folder path. Default as false. When training different sentence transformer models, it’s recommended to give designated folder path every time. Users can choose to overwrite = True to overwrite previous runs

Returns:

no return value expected

Return type:

None