Skip to content

Using Sparse Vectors #38

Pinned Answered by neon-sunset
twchase asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @twchase,

I haven't had a use for sparse-dense vectors yet but since this library matches the official API surface almost 1:1, you can pretty much follow the official example in https://www.pinecone.io/learn/hybrid-search-intro/ (although I sympathize with the fact that syntax and dynamic typing of Python does not help with understanding the exact behavior).

When .Upsert'ing a vector, its sparse values are represented by an optional SparseValues property with corresponding Indices and Values arrays.

If a tokenizer of your choice produces a pair of int and float sequences represented by IEnumerable/List/T[], then you can try passing them to a new vector with

var vec = new Vector
{
    Id =

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by twchase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants