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
docstr: Check whether the input data is legal
code: def check_data(self):
      r"""
      Check whether the input data is legal
  
      """
      self.id2loc = {}
      for i in range(len(self.ori_dataset)):
          if self.ori_dataset[i].sample_id not in self.id2loc:
              self.id2loc[self.ori_dataset[i].sample_id] = i
          else:
              raise ValueError(
                  "There are two origin samples have same id."
              )
          if not isinstance(
              self.ori_dataset[0], type(self.ori_dataset[i])
          ):
              raise ValueError(
                  "There are at least two type of "
                  "origin sample in the dataset."
              )
          try:
              for field in self.fields:
                  self.ori_dataset[i].get_value(field)
          except AttributeError:
              raise ValueError(
                  f"The {i} sample does not "
                  f"have the attribute {field}."
              )
  
      for i, trans_data in enumerate(self.trans_dataset):
          if trans_data.sample_id not in self.id2loc:
              raise ValueError(
                  "There is no origin sample " "can match trans sample"
              )
          if not isinstance(self.trans_dataset[0], type(trans_data)):
              raise ValueError(
                  "There are at least two type of "
                  "origin sample in the dataset."
              )
          try:
              for field in self.fields:
                  trans_data.get_value(field)
          except AttributeError:
              raise ValueError(
                  f"The {i} sample does not "
                  f"have the attribute {field}."
              )
  
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 3 for calling the Validator obj's underlying member method code with example usage: obj.check_data() without return types