QuackIR
QuackIR is a toolkit for reproducible information retrieval research with relational database management systems. Sparse retrieval is available with DuckDB, SQLite, and PostgreSQL. Dense and hybrid retrieval are available with DuckDB and PostgreSQL. Analysis with the porter tokenizer is provided via wrapping Pyserini's Lucene analyzer.
Installation
Clone Repository
git clone https://github.com/castorini/quackir.git --recurse-submodules
Install Dependencies
conda create -n quackir python=3.10
conda activate quackir
conda install -c conda-forge postgresql pgvector openjdk=21 maven -y
pip install -r requirements.txt
Initialize PostgreSQL
initdb -D mydb
pg_ctl -D mydb -l logfile start &
createdb quackir
psql quackir
create user postgres superuser;
create extension vector;
\q
Quick Start
To create a sparse index with DuckDB:
from quackir.index import DuckDBIndexer
from quackir import IndexType
table_name = "corpus"
index_type = IndexType.SPARSE
indexer = DuckDBIndexer()
indexer.init_table(table_name, index_type)
indexer.load_table(table_name, corpus_file)
indexer.fts_index(table_name)
indexer.close()
To perform sparse retrieval:
from quackir.search import DuckDBSearcher
from quackir import SearchType
table_name = "corpus"
query = "what is a lobster roll"
search_type = SearchType.SPARSE
searcher = DuckDBSearcher()
results = searcher.search(
search_type, query_string=query, table_names=[table_name]
)
print(results)
searcher.close()
For using commands, see the documentation.
Reproduce
For step-by-step reproduction of BEIR experiments, see these docs.
To reproduce all BEIR experiments, run the following command and find the results in logs:
bash ./scripts/beir/run.sh
Metadata
Release files for quackir 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quackir-0.0.1.tar.gz | 22.3 kB | Without provenance | Details for quackir-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quackir-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for quackir-0.0.1-py3-none-any.whl |
Total release size: 61.7 kB
Release files / quackir-0.0.1.tar.gz
| Download URL | quackir-0.0.1.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f0d787fb9acc5984526c87a3b8e044867821a359dde70e0bbb829c75c6b2670
|
|
BLAKE2b-256 checksum How to use checksums |
a9507640e3f33f17baca284aafe177adcecf1fc9fc3b8edee9599682104910c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / quackir-0.0.1-py3-none-any.whl
| Download URL | quackir-0.0.1-py3-none-any.whl |
|---|---|
| Size | 39.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad9ee212e053eff1fb8f14148bcaca7a9c519d617eba780e4b8b76a0c58ca07a
|
|
BLAKE2b-256 checksum How to use checksums |
6868e72b8a56108107387051964bfd233d9afedbd66dc90dedd4faa126f27da3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for quackir 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.