This task consists of creating a Sentence Embedding. That is, a vector of sentence representations which can be used for a downstream task.
TextEmbedder implementation is adapted from https://github.com/UKPLab/sentence-transformers/blob/master/sentence_transformers/models/Transformer.py
Let’s look at an example of generating sentence embeddings.
We start by using few custom sentences as input.
Next, we load a trained model from
And generate sentence embeddings.
Here’s the full example: