class_docstr: Scenario for single document text summarization.
  Currently supports the following datasets:
  1. XSum (https://arxiv.org/pdf/1808.08745.pdf)
  2. CNN/DailyMail non-anonymized (https://arxiv.org/pdf/1704.04368.pdf)
  
  Task prompt structure
  
      Summarize the given document.
      Document: {tok_1 ... tok_n}
      Summary: {tok_1 ... tok_m}
  
  Example from XSum dataset
  
      Document: {Part of the Broad Road was closed to traffic on Sunday at about 18:00 GMT.
                 The three adults and three children have been taken to Altnagelvin Hospital
                 with non life-threatening injuries. The Fire Service, Northern Ireland Ambulance Service
                 and police attended the crash. The Broad Road has since been reopened.}
      Summary: {Three adults and three children have been taken to hospital following a crash involving
                a tractor and a campervan in Limavady, County Londonderry}
class_docstr_tok: ["Scenario","for","single","document","text","summarization",".","Currently","supports","the","following","datasets",":","1",".","XSum","(","https",":","\/\/arxiv.org\/pdf\/1808.08745.pdf",")","2",".","CNN\/DailyMail","non-anonymized","(","https",":","\/\/arxiv.org\/pdf\/1704.04368.pdf",")","Task","prompt","structure","Summarize","the","given","document",".","Document",":","{","tok_1","...","tok_n","}","Summary",":","{","tok_1","...","tok_m","}","Example","from","XSum","dataset","Document",":","{","Part","of","the","Broad","Road","was","closed","to","traffic","on","Sunday","at","about","18:00","GMT",".","The","three","adults","and","three","children","have","been","taken","to","Altnagelvin","Hospital","with","non","life-threatening","injuries",".","The","Fire","Service",",","Northern","Ireland","Ambulance","Service","and","police","attended","the","crash",".","The","Broad","Road","has","since","been","reopened",".","}","Summary",":","{","Three","adults","and","three","children","have","been","taken","to","hospital","following","a","crash","involving","a","tractor","and","a","campervan","in","Limavady",",","County","Londonderry","}"]
code: def get_instances(self) -> List[Instance]:
      dataset, article_key, summary_key = self._load_dataset(
          self.dataset_name
      )
  
      splits = {
          "train": TRAIN_SPLIT,
          "validation": VALID_SPLIT,
          "test": TEST_SPLIT,
      }
  
      instances: List[Instance] = []
  
      for split_name, split in splits.items():
          for example in dataset[split_name]:
              article: str = self._clean_and_truncate(
                  example[article_key], self.doc_max_length
              )
              summary: str = self._clean_and_truncate(
                  example[summary_key]
              )
  
              if split_name == "train":
                  art_len = len(article.split())
                  if (
                      self.sampling_max_length
                      and art_len > self.sampling_max_length
                  ):
                      continue
                  if (
                      self.sampling_min_length
                      and art_len < self.sampling_min_length
                  ):
                      continue
                  if self.dataset_name == "xsum":
                      if self._xsum_filter(article, summary):
                          continue
  
              instances.append(
                  Instance(
                      input=Input(text=article),
                      references=[
                          Reference(
                              Output(text=summary), tags=[CORRECT_TAG]
                          )
                      ],
                      split=split,
                  )
              )
  
      return instances
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/scenarios/summarization_scenario.py
imports: import os
  import pickle
  from typing import List, Optional
  from helm.common.general import ensure_file_downloaded, ensure_directory_exists
  from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
label_desc: Use image node_id 6 for calling the SummarizationScenario obj's underlying member method code with example usage: obj.get_instances() and returns: instances