Retriever

This module contains the Retriever class.

Classes

class chemdatawriter.retriever.Retriever(papers)

Retriever class for processing and retrieving relevant sections.

__init__(papers)

Initialize the Retriever.

Parameters:

papers (list) – List of papers to process.

_write_to_cache(cache_path)

Writes papers to cache for processing.

Parameters:

cache_path (str) – Path to write papers.

_load_docs_from_cache(cache_path)

Loads documents from cache and processes them for retrieval.

Parameters:

cache_path (str) – Path to load papers.

retrieve(query, cache_path, chapter_size)

Retrieve relevant sections based on the query.

Parameters:
  • query (str) – Search query for retrieval.

  • cache_path (str) – Path to cache.

  • chapter_size (int) – Number of sections to retrieve.

Returns:

List of indices of relevant sections.

Return type:

list