sgnlp.models.span_extraction.utils.get_examples

get_examples(examples_to_process: List[Dict[str, torch.Tensor]], is_training: bool = True)List[transformers.data.processors.squad.SquadExample][source]

Converts list of dict of train data to list of SquadExample

Parameters
  • examples_to_process (List[Dict]) – list of train data

  • is_training (bool, optional) – option to set is_training. Defaults to True.

Raises

TypeError – examples_to_process should be a list of examples.

Returns

list of SquadExample

Return type

List[SquadExample]