Skip to main content

QuackIR

LICENSE

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)

Source distribution for quackir 0.0.1
File Size Uploaded
quackir-0.0.1.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quackir 0.0.1
File Interpreter ABI Platform
quackir-0.0.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page