DocumentationAPI Reference📓 Tutorials🧑‍🍳 Cookbook🤝 Integrations💜 Discord🎨 Studio (Waitlist)
API Reference

Abstract class for Readers.

Module base

BaseReader

class BaseReader(BaseComponent)

BaseReader.run

def run(query: str,
        documents: List[Document],
        top_k: Optional[int] = None,
        labels: Optional[MultiLabel] = None,
        add_isolated_node_eval: bool = False)

Arguments:

  • query: Query string.
  • documents: List of Documents in which Reader looks for answers.
  • top_k: The maximum number of answers to return.
  • labels: Labels to be used for evaluation.
  • add_isolated_node_eval: If True, the reader will be evaluated in isolation (i.e. without a retriever).

BaseReader.run_batch

def run_batch(queries: List[str],
              documents: Union[List[Document], List[List[Document]]],
              top_k: Optional[int] = None,
              batch_size: Optional[int] = None,
              labels: Optional[List[MultiLabel]] = None,
              add_isolated_node_eval: bool = False)

Arguments:

  • queries: List of query strings.
  • documents: List of lists of Document in which Reader looks for answers.
  • top_k: The maximum number of answers to return.
  • labels: Labels to be used for evaluation.
  • add_isolated_node_eval: If True, the reader will be evaluated in isolation (i.e. without a retriever).

BaseReader.timing

def timing(fn, attr_name)

Wrapper method used to time functions.