primeqa.mrc.processors.postprocessors.abstract.AbstractPostProcessor#

class primeqa.mrc.processors.postprocessors.abstract.AbstractPostProcessor(k: int, max_answer_length: int, single_context_multiple_passages: bool = False, **kwargs)#

Bases: object

Base class for post processors.

Methods

prepare_examples_as_references

Convert examples into references for use with metrics.

process

Convert data and model predictions into MRC answers.

process_references_and_predictions

Convert data and model predictions into MRC answers and references for use in metrics.

abstract prepare_examples_as_references(examples: datasets.arrow_dataset.Dataset) List[Dict[str, Any]]#

Convert examples into references for use with metrics.

abstract process(examples: datasets.arrow_dataset.Dataset, features: datasets.arrow_dataset.Dataset, predictions: tuple)#

Convert data and model predictions into MRC answers.

abstract process_references_and_predictions(examples: datasets.arrow_dataset.Dataset, features: datasets.arrow_dataset.Dataset, predictions)#

Convert data and model predictions into MRC answers and references for use in metrics.