class_docstr: Data preprocessor.
      
code: def __getitem__(self, idx):
      idx, start, end = self.lst[idx]
      dialog = self.raw[idx][start:end]
      source, target = dialog[:-1], dialog[-1]
  
      spks, utts = list(
          zip(
              *[
                  (speaker, WordPunctTokenizer().tokenize(uttr))
                  for speaker, uttr, _ in source
              ]
          )
      )
  
      spks = list(spks)
  
      while len(spks) < 10:
          spks.append(0)
  
      source = "|||".join([" ".join(uttr) for uttr in utts])
      target_test = " ".join(WordPunctTokenizer().tokenize(target[1]))
  
      return spks, source, target_test, target[0]
  
file_path: texar/examples/hierarchical_dialog/sw_loader.py
imports: import os
  import json
  from json_lines import reader
  from nltk.tokenize import WordPunctTokenizer
  from sklearn.feature_extraction.text import TfidfVectorizer
  import texar.tf
  from config_data import data_root
label_desc: Use image node_id 3 for calling the Dataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: spks,  source,  target_test,  target