8000 [Feature Request] Batch Encoding of Queries · Issue #2270 · castorini/pyserini · GitHub
[go: up one dir, main page]

Skip to content

[Feature Request] Batch Encoding of Queries #2270

Open

Description

@kaushikacharya

In https://github.com/castorini/pyserini/blob/master/pyserini/encode/_auto.py
though AutoDocumentEncoder allows batch encoding, but AutoQueryEncoder encodes one query at a time.

This forces FaissSearcher # batch_search function to encode one query at a time

q_embs = [_enc(q) for q in queries]

def _enc(q):
    if isinstance(q, dict):
        return self.query_encoder.encode(**q)
    assert isinstance(q, str)
    return self.query_encoder.encode(q)
q_embs = [_enc(q) for q in queries]

Allowing batch encoding for queries would improve performance of batch_search

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0