Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for jsonl.gz input in pyserini.encode #1908

Open
ftvalentini opened this issue Jun 4, 2024 · 0 comments
Open

Support for jsonl.gz input in pyserini.encode #1908

ftvalentini opened this issue Jun 4, 2024 · 0 comments

Comments

@ftvalentini
Copy link

Would be nice to add support for reading jsonl.gz files when encoding a corpus with a dense encoder with python -m pyserini.encode, in:

with open(filename) as f:

Maybe with:

#...
open_handle = gzip.open if filename.endswith(".gz") else open
with open_handle(filename) as f: 
#...

In this way both pyserini.index.lucene and pyserini.encode accept jsonl.gz files as input.

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

No branches or pull requests

1 participant