Abstract class for Summarizers.
Module base
BaseSummarizer
class BaseSummarizer(BaseComponent)
Abstract class for Summarizer
BaseSummarizer.predict
@abstractmethod
def predict(documents: List[Document]) -> List[Document]
Abstract method for creating a summary.
Arguments:
documents
: Related documents (e.g. coming from a retriever) that the answer shall be conditioned on.
Returns:
List of Documents, where Document.meta["summary"] contains the summarization
BaseSummarizer.run
def run(documents: List[Document])
Arguments:
documents
: Related documents (e.g. coming from a retriever) that the answer shall be conditioned on.
BaseSummarizer.run_batch
def run_batch(documents: Union[List[Document], List[List[Document]]],
batch_size: Optional[int] = None)
Arguments:
documents
: List of related documents.batch_size
: Number of Documents to process at a time.