class_docstr: Unified interface for all CommonSense scenarios.
  
  - The "HellaSwag" benchmark from this paper:
    https://arxiv.org/pdf/1905.07830.pdf
  
  - The "OpenBookQA" benchmark from this paper:
    https://aclanthology.org/D18-1260.pdf
  
  - The "CommonSenseQA" benchmark from this paper:
    https://arxiv.org/pdf/1811.00937.pdf
  
  - The "PIQA" benchmark from this paper:
    https://arxiv.org/pdf/1911.11641.pdf
  
  - The "SIQA" benchmark from this paper:
    https://arxiv.org/pdf/1904.09728.pdf
class_docstr_tok: ["Unified","interface","for","all","CommonSense","scenarios",".","-","The","``","HellaSwag","''","benchmark","from","this","paper",":","https",":","\/\/arxiv.org\/pdf\/1905.07830.pdf","-","The","``","OpenBookQA","''","benchmark","from","this","paper",":","https",":","\/\/aclanthology.org\/D18-1260.pdf","-","The","``","CommonSenseQA","''","benchmark","from","this","paper",":","https",":","\/\/arxiv.org\/pdf\/1811.00937.pdf","-","The","``","PIQA","''","benchmark","from","this","paper",":","https",":","\/\/arxiv.org\/pdf\/1911.11641.pdf","-","The","``","SIQA","''","benchmark","from","this","paper",":","https",":","\/\/arxiv.org\/pdf\/1904.09728.pdf"]
code: def load_dataset(self) -> List[List[str]]:
      data_path = os.path.join(self.output_path, "data", self.dataset)
  
      if self.dataset == "hellaswag":
          split_to_file = {
              split: os.path.join(data_path, f"hellaswag_{split}.jsonl")
              for split in ["train", "val"]
          }  # Ignore HellaSwag test set because no label information
          item_process_func = self.process_hellaswag_item
      elif self.dataset == "openbookqa":
          split_to_file = {
              split: os.path.join(
                  data_path,
                  "OpenBookQA-V1-Sep2018",
                  "Data",
                  "Main",
                  f"{split}.jsonl",
              )
              for split in ["train", "test"]
          }
          item_process_func = self.process_openbookqa_item
      elif self.dataset == "commonsenseqa":
          split_to_file = {
              split: os.path.join(
                  data_path, f"commonsenseqa_{split}.jsonl"
              )
              for split in ["train", "val"]
          }  # Ignore CommonSenseQA test set because no label information
          item_process_func = self.process_commonsenseqa_item
      elif self.dataset == "piqa":
          split_to_file = {
              split: os.path.join(data_path, f"piqa_{split}.jsonl")
              for split in ["train", "val"]
          }  # Ignore PIQA test set because no label information
          item_process_func = self.process_piqa_item
      elif self.dataset == "siqa":
          split_to_file = {
              split: os.path.join(data_path, f"siqa_{split}.jsonl")
              for split in ["train", "val"]
          }  # SIQA has no available test set
          item_process_func = self.process_siqa_item
      else:
          raise ValueError(f"Unknown dataset: {self.dataset}")
  
      data = []
      for split in split_to_file:
          file_path = split_to_file[split]
          if not os.path.exists(file_path):
              raise FileNotFoundError(f"File not found: {file_path}")
  
          hlog(f"Reading {file_path}")
          with open(file_path) as f:
              for line in f:
                  item = json.loads(line)
                  question, answers, correct_answer = item_process_func(
                      item
                  )
                  data.append(
                      [question, answers, correct_answer, split]
                  )
      return data
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/scenarios/commonsense_scenario.py
imports: import json
  import os
  from typing import List
  from helm.common.general import ensure_file_downloaded, ensure_directory_exists
  from helm.common.hierarchical_logger import hlog
  from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
label_desc: Use image node_id 8 for calling the CommonSenseScenario obj's underlying member method code with example usage: obj.load_dataset() and returns: data