docarray.document.mixins.sugar module

class docarray.document.mixins.sugar.SingletonSugarMixin[source]

Bases: object

Provide sugary syntax for Document by inheriting methods from DocumentArray

match(darray: Union[DocumentArray, DocumentArrayMemmap], metric: Union[str, Callable[[ArrayType, ArrayType], np.ndarray]] = 'cosine', limit: Optional[Union[int, float]] = 20, normalization: Optional[Tuple[float, float]] = None, metric_name: Optional[str] = None, batch_size: Optional[int] = None, exclude_self: bool = False, only_id: bool = False, use_scipy: bool = False, num_worker: Optional[int] = 1) T[source]

# noqa: D102 # noqa: DAR101 :rtype: T :return: itself after modified

embed(embed_model: AnyDNN, device: str = 'cpu', batch_size: int = 256) T[source]

# noqa: D102 # noqa: DAR101 :rtype: T :return: itself after modified.