Skip to content

Support gzipped (.jsonl.gz) input in pyserini.encode - #2626

Draft
yashs33244 wants to merge 1 commit into
castorini:masterfrom
yashs33244:feat/encode-jsonl-gz
Draft

Support gzipped (.jsonl.gz) input in pyserini.encode#2626
yashs33244 wants to merge 1 commit into
castorini:masterfrom
yashs33244:feat/encode-jsonl-gz

Conversation

@yashs33244

Copy link
Copy Markdown
Contributor

Closes #1908.

JsonlCollectionIterator only read plain-text files, so encoding a gzipped corpus meant decompressing it first, even though pyserini.index.lucene already accepts .jsonl.gz. This opens .gz inputs with gzip so pyserini.encode accepts them too (works for a single file and a directory of files). Plain .jsonl input is unchanged.

Added a test that reads a .jsonl.gz and asserts it matches the plain fixture.

Opening as a draft for review.

JsonlCollectionIterator only read plain-text files, so a gzipped corpus
had to be decompressed first even though pyserini.index.lucene already
accepts .jsonl.gz. Open .gz inputs with gzip so pyserini.encode accepts
them too. Adds a test that reads a .jsonl.gz identically to the plain file.

Closes castorini#1908.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for jsonl.gz input in pyserini.encode

1 participant