autofaiss.external.quantize.score_index

autofaiss.external.quantize.score_index(index_path, embeddings, save_on_disk=True, output_index_info_path='infos.json', current_memory_available='32G', verbose=20)[source]

Compute metrics on a given index, use cached ground truth for fast scoring the next times.

Parameters:
  • index_path (Union[str, faiss.Index]) – Path to .index file. Or in memory index

  • embeddings (Union[str, np.ndarray]) – Path containing all preprocessed vectors and cached files. Can also be an in memory array.

  • save_on_disk (bool) – Whether to save on disk

  • output_index_info_path (str) – Path to index infos .json

  • current_memory_available (str) – Memory available on the current machine, having more memory is a boost because it reduces the swipe between RAM and disk.

  • verbose (int) – set verbosity of outputs via logging level, default is logging.INFO

Returns:

metric_infos – Metric infos of the index.

Return type:

Optional[Dict[str, Union[str, float, int]]]