from abc import ABC, abstractmethod
from typing import List, Union, Any
from swarmauri.core.vectors.IVector import IVector
[docs]
class IVectorize(ABC):
"""
Interface for converting text to vectors.
Implementations of this interface transform input text into numerical
vectors that can be used in machine learning models, similarity calculations,
and other vector-based operations.
"""
[docs]
@abstractmethod
def fit(self, data: Union[str, Any]) -> None:
pass
[docs]
@abstractmethod
def infer_vector(self, data: Union[str, Any], *args, **kwargs) -> IVector:
pass