code: def read_wsc(dir_path):
      df_dict = dict()
      tokenizer = WhitespaceTokenizer()
      meta_data = dict()
      meta_data["noun"] = {
          "type": "entity",
          "attrs": {"parent": "text"},
      }
      meta_data["pronoun"] = {
          "type": "entity",
          "attrs": {"parent": "text"},
      }
      for fold in ["train", "val", "test"]:
          jsonl_path = os.path.join(dir_path, "{}.jsonl".format(fold))
          df = read_jsonl_superglue(jsonl_path)
          samples = []
          for i in range(len(df)):
              text = df.loc[i, "text"]
              if fold != "test":
                  label = df.loc[i, "label"]
              target = df.loc[i, "target"]
              span1_index = target["span1_index"]
              span2_index = target["span2_index"]
              span1_text = target["span1_text"]
              span2_text = target["span2_text"]
              # Build entity
              # list of entities
              # 'entities': {'start': 0, 'end': 100}
              tokens, offsets = tokenizer.encode_with_offsets(text, str)
              pos_start1 = offsets[span1_index][0]
              pos_end1 = pos_start1 + len(span1_text)
              pos_start2 = offsets[span2_index][0]
              pos_end2 = pos_start2 + len(span2_text)
              if fold == "test":
                  samples.append(
                      {
                          "text": text,
                          "noun": {
                              "start": pos_start1,
                              "end": pos_end1,
                          },
                          "pronoun": {
                              "start": pos_start2,
                              "end": pos_end2,
                          },
                      }
                  )
              else:
                  samples.append(
                      {
                          "text": text,
                          "noun": {
                              "start": pos_start1,
                              "end": pos_end1,
                          },
                          "pronoun": {
                              "start": pos_start2,
                              "end": pos_end2,
                          },
                          "label": label,
                      }
                  )
          df = pd.DataFrame(samples)
          df_dict[fold] = df
      return df_dict, meta_data
  
imports: import os
  import shutil
  import argparse
  import zipfile
  import json
  import pandas
  import pyarrow
  import pyarrow.json
  from gluonnlp.utils.misc import download, load_checksum_stats
  from gluonnlp.base import get_data_home_dir
  from gluonnlp.data.tokenizers import WhitespaceTokenizer
label_desc: Use image node_id 19 for calling a global function with example usage: read_wsc(dir_path) and returns: df_dict,  meta_data