def get_winogrande(path: str) -> Iterator[WinogradExample]:
  """Fetches the Winogrande dataset from a storage bucket."""
  with tf.io.gfile.GFile(path, 'rb') as raw:
    with zipfile.ZipFile(raw) as zf:
      with zf.open('winogrande_1.1/dev.jsonl') as f:
        for line in f:
          example = json.loads(line)
          if len(example['sentence'].split('_')) != 2:
            raise ValueError(f'Invalid example {example}.')
          yield WinogradExample(
              source='winogrande',
              sentence=example['sentence'].replace('_', _OPTION),
              option1=example['option1'],
              option2=example['option2'],
              label=int(example['answer']) - 1,
              idx=example['qID'],
              group_key=example['qID'].split('-')[0],
              pronoun='_')
Fetches the Winogrande dataset from a storage bucket.
language/wino_dict/utils.py