calculate_embeddings_for_text#
- calculate_embeddings_for_text(text: Series, model: str = 'miniLM', file_path: Optional[str] = 'embeddings.csv') DataFrame [source]#
Get default embeddings for the dataset.
- Parameters
- textpd.Series
The text to get embeddings for.
- modelstr, default ‘miniLM’
The type of embeddings to return. Can be either ‘miniLM’ or ‘open_ai’. For ‘open_ai’ option, the model used is ‘text-embedding-ada-002’ and requires to first set an open ai api key by using the command openai.api_key = YOUR_API_KEY
- file_pathOptional[str], default ‘embeddings.csv’
If given, the embeddings will be saved to the given file path.
- Returns
- pd.DataFrame
The embeddings for the dataset.