SPLADE (Sparse Lexical and Expansion) generates contextualized tokens and weights from a query, enabling semantic search through sparse lexical representations rather than dense embeddings alone. section 7.4.3
Unlike an SKG expansion, SPLADE-style output may contain language-model tokens such as “las”, “##ag”, and “na##”, not necessarily terms directly present in the document index. Documents therefore need matching SPLADE tokens generated and indexed before query-time matching works. section 7.4.3
Listing 7.14 Expanding queries with SPLADE++
from spladerunner import Expander
expander = Expander('Splade_PP_en_v1', 128) #1
queries = ["kimchi", "bbq", "korean bbq",
"lasagna", "karaoke", "drive through"]
for query in queries:
sparse_vec = expander.expand(query, #2
outformat="lucene")[0] #3
print(sparse_vec)
A Python listing expands queries including “kimchi”, “korean bbq”, “lasagna”, and “drive through” with Splade_PP_en_v1 and returns Lucene-formatted sparse output. section 7.4.3
