sporse 0.2.0

Sparse vector index for learned sparse retrieval (SPLADE, LADE)
Documentation
  • Coverage
  • 93.75%
    15 out of 16 items documented1 out of 15 items with examples
  • Size
  • Source code size: 32.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.11 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 44s Average build duration of successful builds.
  • all releases: 58s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • arclabs561/sporse
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • arclabs561

sporse

Sparse vector index for learned sparse retrieval.

Indexes sparse vectors (SPLADE, LADE) using an inverted index with Block-Max WAND traversal for exact top-k inner product search.

Usage

use sporse::{SparseVec, SporseIndex};

let mut index = SporseIndex::new();

index.insert(0, &SparseVec::new(vec![(0, 1.0), (3, 2.5), (7, 0.8)]));
index.insert(1, &SparseVec::new(vec![(1, 3.0), (3, 1.0)]));
index.insert(2, &SparseVec::new(vec![(0, 0.5), (7, 2.0)]));

index.build();

let query = SparseVec::new(vec![(0, 1.0), (3, 1.0)]);
let results = index.search(&query, 2);
// [(0, 3.5), (1, 1.0)] -- doc 0 scores highest

Features

  • serde -- Serialize/Deserialize for SparseVec