class_docstr: An abstract class that computes the semantic similarity score between
      original text and adversarial texts
  
  :param ~textflint.input.dataset origin_dataset:
          the dataset of origin sample
  :param ~textflint.input.dataset trans_dataset:
      the dataset of translate sample
  :param str|list fields: the name of the origin field need compare.
  :param bool need_tokens: if we need tokenize the sentence
code: def __init__(
      self, origin_dataset, trans_dataset, fields, need_tokens=False
  ):
      assert isinstance(
          origin_dataset, Dataset
      ), f"Input must be a {Dataset}"
      assert isinstance(
          trans_dataset, Dataset
      ), f"Input must be a {Dataset}"
      assert len(origin_dataset) and len(
          trans_dataset
      ), f"origin_dataset and trans_dataset can not be empty."
      assert isinstance(
          origin_dataset[0], type(trans_dataset[0])
      ), f"The type of origin sample and trans sample must be same."
  
      self.ori_dataset = origin_dataset
      self.trans_dataset = trans_dataset
      self.id2loc = None
      self._score = None
      self.fields = fields if isinstance(fields, list) else [fields]
      self.check_data()
      self.need_tokens = need_tokens
  
file_path: textflint/textflint/generation/validator/validator.py
imports: import numpy
  from abc import ABC, abstractmethod
  from ...input.dataset.dataset import *
label_desc: Use image node_id 1 to create a new Validator object from inherited base classes: ABC with example: obj = Validator(origin_dataset, trans_dataset, fields, need_tokens)