code: def __init__(
      self,
      data_root: str,
      task: str = "",
      models: List[str] = (),
      page_sz: int = 10,
      page_no: int = 1,
      query: str = "",
      sorting: int = 0,
      sorting_metric: str = "",
  ):
      if not op.isdir(data_root):
          raise NotADirectoryError(
              f"{data_root} is not a valid data root."
          )
      self.data_root = data_root
      self.task = task
      self.dir_path = op.join(data_root, task)
      self.models = models
      self.page_sz = page_sz
      self.page_no = page_no
      self.all_metrics_and_names = [
          list(e) for e in get_scorer_ids_and_names()
      ]
  
      self.cfg = VizSeqTaskConfigManager(self.dir_path)
      self.metrics = self.cfg.metrics
      if len(self.cfg.task_name) == 0:
          self.cfg.set_task_name(task)
      self.task_name = self.cfg.task_name
      self.description = self.cfg.description
      self.tokenization = self.cfg.tokenization
  
      self.all_tokenization = [e.name for e in VizSeqTokenization]
      self.query = query
      self.sorting = sorting
      self.sorting_metric = sorting_metric
      set_g_cred_path(VizSeqGlobalConfigManager().g_cred_path)
      src = _get_src(self.dir_path)
      self.src_has_text = src.has_text
      self.enum_src_names_and_types = self.get_enum(
          zip(src.names, [t.name for t in src.data_types])
      )
      ref = _get_ref(self.dir_path)
      self.enum_ref_names = self.get_enum(ref.names)
  
imports: from typing import List, Tuple, Iterable
  import math
  import os
  import os.path
  from glob import glob
  import json
  from vizseq._data import VizSeqTaskConfigManager, VizSeqGlobalConfigManager, VizSeqStats, set_g_cred_path, VizSeqTableExporter, VizSeqNGrams, VizSeqTokenization
  from vizseq.scorers import get_scorer_name, get_scorer_ids_and_names
  from .data_view import VizSeqDataPageView, VizSeqPageData
  from .mem_cached_data_getters import _get_src, _get_ref, _get_tag, _get_hypo, _get_scores
label_desc: Use image node_id 1 to create a new VizSeqWebView object from inherited base classes: object with example: obj = VizSeqWebView(data_root, task, models, page_sz, page_no, query, sorting, sorting_metric)