primeqa.mrc.processors.postprocessors.squad.SQUADPostProcessor#
- class primeqa.mrc.processors.postprocessors.squad.SQUADPostProcessor(*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.extractive.ExtractivePostProcessor
Post processor for extractive QA (use with ExtractiveQAHead).
Methods
Convert examples into references for use with metrics.
prepare_predictions_for_squad
Convert data and model predictions into MRC answers.
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.