calculate_default_embeddings#
- calculate_default_embeddings(text: array, model: str = 'miniLM', file_path: Optional[str] = 'embeddings.npy') array [source]#
Get default embeddings for the dataset.
- Parameters
- textnp.array
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
- np.array
The embeddings for the dataset.