primeqa.mrc.processors.postprocessors.extractive.ExtractivePostProcessor#

class primeqa.mrc.processors.postprocessors.extractive.ExtractivePostProcessor(*args, n_best_size: int, scorer_type=SupportedSpanScorers.WEIGHTED_SUM_TARGET_TYPE_AND_SCORE_DIFF, output_confidence_feature: bool = False, confidence_model_path: Optional[str] = None, **kwargs)#

Bases: primeqa.mrc.processors.postprocessors.abstract.AbstractPostProcessor

Post processor for extractive QA (use with ExtractiveQAHead).

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.

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

Convert examples into references for use with metrics.

process(examples: datasets.arrow_dataset.Dataset, features: datasets.arrow_dataset.Dataset, predictions: Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray])#

Convert data and model predictions into MRC answers.

process_references_and_predictions(examples, features, predictions) primeqa.mrc.data_models.eval_prediction_with_processing.EvalPredictionWithProcessing#

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