gnes.indexer.chunk.numpy module

class gnes.indexer.chunk.numpy.NumpyIndexer(is_binary: bool = False, *args, **kwargs)[source]

Bases: gnes.indexer.base.BaseChunkIndexer

An exhaustive search indexer using numpy The distance is computed as L1 distance normalized by the number of dimension

add(keys: List[Tuple[int, Any]], vectors: numpy.ndarray, weights: List[float], *args, **kwargs)[source]

adding new chunks and their vector representations :param keys: list of (doc_id, offset) tuple :param vectors: vector representations :param weights: weight of the chunks

train(*args, **kwargs)

Train the model, need to be overrided