vectorisers.base.VectoriserBase

vectorisers.base.VectoriserBase()

Abstract base class for all vectorisers.

Defines the common interface that all vectoriser implementations must follow. Subclasses must implement the transform method to convert text into numerical embeddings.

Methods

Name Description
transform Transforms input text(s) into embeddings.

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.