vectorisers.base.VectoriserBase.transform

vectorisers.base.VectoriserBase.transform(texts)

Transforms input text(s) into embeddings.

This abstract method must be implemented by any subclass of VectoriserBase. It converts input text in string or list form into a embedding in numpy array form.

Parameters

Name Type Description Default
texts str | list[str] A string or list of strings representing the input text(s) to be transformed. required

Returns

Name Type Description
np.ndarray numpy.ndarray: A numpy array containing the embeddings for the input text(s). Each row corresponds to the embedding of a single input text.