Lite weight wrapper for the independent implementation of SPLADE++ models for search & retrieval pipelines. Models and Library created by Prithivi Da, For PRs and Collaboration checkout the readme.
35
stars
8
commits
Python
primary language
Aug 24, 2024
updated
Title is dedicated to the Original Blade Runners - Harrison Ford and the Author Philip K. Dick of "Do Androids Dream of Electric Sheep?"
A Ultra-lite & Super-fast Python wrapper for the independent implementation of SPLADE++ models for your search & retrieval pipelines. Based on the papers Naver's From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective and Google's SparseEmbed
pip install spladerunner
# One-time only init
from spladerunner import Expander
expander = Expander('Splade_PP_en_v1', 128) #pass model, max_seq_len
# Sample passage expansion
sparse_rep = expander.expand("The Manhattan Project and its atomic bomb helped bring an end to World War II. Its legacy of peaceful uses of atomic energy continues to have an impact on history and science.")
# For solr or elastic or vanilla lucene stores.
sparse_rep = expander.expand("The Manhattan Project and its atomic bomb helped bring an end to World War II. Its legacy of peaceful uses of atomic energy continues to have an impact on history and science.", outformat="lucene")
print(sparse_rep)
(Feel free to skip to 3 If you are expert in sparse and dense representations)
Pros
β
Efficient and Cheap.
β
No need to fine-tune models.
β
οΈ Interpretable.
β
οΈ Exact Term Matches.
Cons
β Vocabulary mismatch (Need to remember exact terms)
Pros
β
Search how humans innately think.
β
When finetuned beats sparse by long way.
β
Easily works with Multiple modals.
Cons
β Suffers token amnesia (misses term matching),
β Resource intensive (both index & retreival),
β Famously hard to interpret.
β Needs fine-tuning for OOD data.
2a. What the Models learn?
prithivida/Splade_PP_en_v1 (default model)4a. πΈ Where and How can you use?
4b. How (and what) to contribute?
Wacky Weights in Learned Sparse Representations and the Revenge of Score-at-a-Time Query Evaluation
Query2doc: Query Expansion with Large Language Models note: don't mistake this for docT5query, this is a recent work
Thanks to Nils Reimers for
Props to Naver folks, the original authors of the paper for such a robust research.
8 commits
Python
100.0%
Lite weight wrapper for the independent implementation of SPLADE++ models for search & retrieval pipelines. Models and Library created by Prithivi Da, For PRs and Collaboration checkout the readme.
35
stars
8
commits
Python
primary language
Aug 24, 2024
updated
Title is dedicated to the Original Blade Runners - Harrison Ford and the Author Philip K. Dick of "Do Androids Dream of Electric Sheep?"
A Ultra-lite & Super-fast Python wrapper for the independent implementation of SPLADE++ models for your search & retrieval pipelines. Based on the papers Naver's From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective and Google's SparseEmbed
pip install spladerunner
# One-time only init
from spladerunner import Expander
expander = Expander('Splade_PP_en_v1', 128) #pass model, max_seq_len
# Sample passage expansion
sparse_rep = expander.expand("The Manhattan Project and its atomic bomb helped bring an end to World War II. Its legacy of peaceful uses of atomic energy continues to have an impact on history and science.")
# For solr or elastic or vanilla lucene stores.
sparse_rep = expander.expand("The Manhattan Project and its atomic bomb helped bring an end to World War II. Its legacy of peaceful uses of atomic energy continues to have an impact on history and science.", outformat="lucene")
print(sparse_rep)
(Feel free to skip to 3 If you are expert in sparse and dense representations)
Pros
β
Efficient and Cheap.
β
No need to fine-tune models.
β
οΈ Interpretable.
β
οΈ Exact Term Matches.
Cons
β Vocabulary mismatch (Need to remember exact terms)
Pros
β
Search how humans innately think.
β
When finetuned beats sparse by long way.
β
Easily works with Multiple modals.
Cons
β Suffers token amnesia (misses term matching),
β Resource intensive (both index & retreival),
β Famously hard to interpret.
β Needs fine-tuning for OOD data.
2a. What the Models learn?
prithivida/Splade_PP_en_v1 (default model)4a. πΈ Where and How can you use?
4b. How (and what) to contribute?
Wacky Weights in Learned Sparse Representations and the Revenge of Score-at-a-Time Query Evaluation
Query2doc: Query Expansion with Large Language Models note: don't mistake this for docT5query, this is a recent work
Thanks to Nils Reimers for
Props to Naver folks, the original authors of the paper for such a robust research.
8 commits
Python
100.0%