docstr: Creates a Winograd Schema Challenge Corpus formated as Natural Language Inference task (WNLI).
  
  The task is to predict if the sentence with the pronoun substituted is entailed by the original sentence.
  Additionaly to the Corpus we have a eval_dataset containing the test file of the Glue data.
  This file contains unlabeled test data to evaluate models on the Glue WNLI task.
docstr_tok: ["Creates","a","Winograd","Schema","Challenge","Corpus","formated","as","Natural","Language","Inference","task","(","WNLI",")",".","The","task","is","to","predict","if","the","sentence","with","the","pronoun","substituted","is","entailed","by","the","original","sentence",".","Additionaly","to","the","Corpus","we","have","a","eval_dataset","containing","the","test","file","of","the","Glue","data",".","This","file","contains","unlabeled","test","data","to","evaluate","models","on","the","Glue","WNLI","task","."]
code: def __init__(
      self,
      label_type="entailment",
      base_path: Optional[Union[str, Path]] = None,
      max_tokens_per_doc=-1,
      max_chars_per_doc=-1,
      use_tokenizer=True,
      in_memory: bool = True,
      sample_missing_splits: bool = True,
  ) -> None:
      """Creates a Winograd Schema Challenge Corpus formated as Natural Language Inference task (WNLI).
  
      The task is to predict if the sentence with the pronoun substituted is entailed by the original sentence.
      Additionaly to the Corpus we have a eval_dataset containing the test file of the Glue data.
      This file contains unlabeled test data to evaluate models on the Glue WNLI task.
      """
      base_path = (
          flair.cache_root / "datasets"
          if not base_path
          else Path(base_path)
      )
  
      dataset_name = "glue"
  
      data_folder = base_path / dataset_name
  
      data_file = data_folder / "WNLI/train.tsv"
  
      # if data is not downloaded yet, download it
      if not data_file.is_file():
          # get the zip file
          zipped_data_path = cached_path(
              "https://dl.fbaipublicfiles.com/glue/data/WNLI.zip",
              Path("datasets") / dataset_name,
          )
  
          unpack_file(
              zipped_data_path, data_folder, mode="zip", keep=False
          )
  
          # rename test file to eval_dataset, since it has no labels
          os.rename(
              str(data_folder / "WNLI/test.tsv"),
              str(data_folder / "WNLI/eval_dataset.tsv"),
          )
  
      super().__init__(
          data_folder / "WNLI",
          label_type=label_type,
          columns=[1, 2, 3],
          skip_first_line=True,
          use_tokenizer=use_tokenizer,
          max_tokens_per_doc=max_tokens_per_doc,
          max_chars_per_doc=max_chars_per_doc,
          in_memory=in_memory,
          sample_missing_splits=sample_missing_splits,
      )
  
      self.eval_dataset = DataPairDataset(
          data_folder / "WNLI/eval_dataset.tsv",
          label_type=label_type,
          columns=[1, 2, 3],
          use_tokenizer=use_tokenizer,
          max_tokens_per_doc=max_tokens_per_doc,
          max_chars_per_doc=max_chars_per_doc,
          in_memory=in_memory,
          skip_first_line=True,
          label=False,
      )
  
imports: import logging
  import os
  from pathlib import Path
  from typing import List, Optional, Union
  import flair
  from flair.data import Corpus, DataPair, FlairDataset, Sentence, TextPair, _iter_dataset
  from flair.datasets.base import find_train_dev_test_files
  from flair.file_utils import cached_path, unpack_file, unzip_file
label_desc: Use image node_id 1 to create a new GLUE_WNLI object from inherited base classes: DataPairCorpus with example: obj = GLUE_WNLI(label_type, base_path, max_tokens_per_doc, max_chars_per_doc, use_tokenizer, in_memory, sample_missing_splits)