docstr: Creates a DataPairCorpus for the SuperGlue Recognizing Textual Entailment (RTE) data.
  
  See https://super.gluebenchmark.com/tasks
  Additionaly to the Corpus we have a eval_dataset containing the test file of the SuperGlue data.
  This file contains unlabeled test data to evaluate models on the SuperGlue RTE task.
docstr_tok: ["Creates","a","DataPairCorpus","for","the","SuperGlue","Recognizing","Textual","Entailment","(","RTE",")","data",".","See","https",":","\/\/super.gluebenchmark.com\/tasks","Additionaly","to","the","Corpus","we","have","a","eval_dataset","containing","the","test","file","of","the","SuperGlue","data",".","This","file","contains","unlabeled","test","data","to","evaluate","models","on","the","SuperGlue","RTE","task","."]
code: def __init__(
      self,
      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 DataPairCorpus for the SuperGlue Recognizing Textual Entailment (RTE) data.
  
      See https://super.gluebenchmark.com/tasks
      Additionaly to the Corpus we have a eval_dataset containing the test file of the SuperGlue data.
      This file contains unlabeled test data to evaluate models on the SuperGlue RTE task.
      """
      base_path = (
          flair.cache_root / "datasets"
          if not base_path
          else Path(base_path)
      )
  
      dataset_name = "superglue"
  
      data_folder = base_path / dataset_name
  
      data_file = data_folder / "RTE/train.tsv"
  
      # if data 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/superglue/data/v2/RTE.zip",
              Path("datasets") / dataset_name,
          )
  
          unpack_file(
              zipped_data_path, data_folder, mode="zip", keep=False
          )
  
          # the downloaded files have json format, we transform them to tsv
          rte_jsonl_to_tsv(data_folder / "RTE/train.jsonl", remove=True)
          rte_jsonl_to_tsv(
              data_folder / "RTE/test.jsonl", remove=True, label=False
          )
          rte_jsonl_to_tsv(data_folder / "RTE/val.jsonl", remove=True)
  
          os.rename(
              str(data_folder / "RTE/val.tsv"),
              str(data_folder / "RTE/dev.tsv"),
          )
          os.rename(
              str(data_folder / "RTE/test.tsv"),
              str(data_folder / "RTE/eval_dataset.tsv"),
          )
  
      super().__init__(
          data_folder / "RTE",
          columns=[0, 1, 2],
          use_tokenizer=use_tokenizer,
          max_tokens_per_doc=max_tokens_per_doc,
          max_chars_per_doc=max_chars_per_doc,
          in_memory=in_memory,
          label_type="textual_entailment",
          sample_missing_splits=sample_missing_splits,
      )
  
      self.eval_dataset = DataPairDataset(
          data_folder / "RTE/eval_dataset.tsv",
          label_type="textual_entailment",
          columns=[0, 1, 2],
          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=False,
          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 SUPERGLUE_RTE object from inherited base classes: DataPairCorpus with example: obj = SUPERGLUE_RTE(base_path, max_tokens_per_doc, max_chars_per_doc, use_tokenizer, in_memory, sample_missing_splits)