gnes.indexer.chunk.helper module

class gnes.indexer.chunk.helper.DictKeyIndexer(*args, **kwargs)[source]

Bases: gnes.indexer.base.BaseChunkIndexerHelper

add(keys: List[Tuple[int, int]], weights: List[float], *args, **kwargs) → int[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

query(keys: List[int], *args, **kwargs) → List[Tuple[int, int, float]][source]
train(*args, **kwargs)

Train the model, need to be overrided

class gnes.indexer.chunk.helper.ListKeyIndexer(*args, **kwargs)[source]

Bases: gnes.indexer.base.BaseChunkIndexerHelper

add(keys: List[Tuple[int, int]], weights: List[float], *args, **kwargs) → int[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

query(keys: List[int], *args, **kwargs) → List[Tuple[int, int, float]][source]
train(*args, **kwargs)

Train the model, need to be overrided

class gnes.indexer.chunk.helper.ListNumpyKeyIndexer(*args, **kwargs)[source]

Bases: gnes.indexer.chunk.helper.ListKeyIndexer

add(*args, **kwargs) → int[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

query(keys: List[int], *args, **kwargs) → List[Tuple[int, int, float]][source]
train(*args, **kwargs)

Train the model, need to be overrided

class gnes.indexer.chunk.helper.NumpyKeyIndexer(buffer_size: int = 10000, col_size: int = 3, *args, **kwargs)[source]

Bases: gnes.indexer.base.BaseChunkIndexerHelper

add(keys: List[Tuple[int, int]], weights: List[float], *args, **kwargs) → int[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

capacity
query(keys: List[int], *args, **kwargs) → List[Tuple[int, int, float]][source]
train(*args, **kwargs)

Train the model, need to be overrided