Text embeddings and data splitting
TL;DR

If you are training the document-embedding model, then split the data before you convert the text into embeddings.

If you are using a pre-trained document-embedding model, then it won't matter and it is pre-processing step that it doesn't matter when you execute it.

Pipeline when training your own document-embedding model


Split your text data into train/validate/test sets.
Use your train set to train the document-embedding model.
Use your trained document-embedding model to convert train and validation sets to train your other model (e.g. classification model).
Test your final model by using your trained document-embedding model to convert the test set and test the trained final (classification) model.