def get_winograd() -> Iterator[WinogradExample]:
  """Fetches the Winograd dataset from TFDS."""
  for example in tfds.load('wsc273', split='test'):
    sentence = example['text'].numpy().decode()
    pronoun = example['pronoun_text'].numpy().decode()
    start = example['pronoun_start'].numpy()
    end = example['pronoun_end'].numpy()
    if sentence[start:end] != pronoun:
      raise ValueError(f'Invalid example {example}.')
    yield WinogradExample(
        source='winograd',
        sentence=sentence[:start] + _OPTION + sentence[end:],
        option1=example['option1'].numpy().decode(),
        option2=example['option2'].numpy().decode(),
        idx=example['idx'].numpy(),
        label=example['label'].numpy(),
        group_key='',
        pronoun=example['pronoun_text'].numpy().decode())
Fetches the Winograd dataset from TFDS.
language/wino_dict/utils.py