class_docstr: A constraint representing a maximum allowed perturbed words.
      We use the lcs div the long of the sentence as the score.
  
  :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: Calculate the score
  
  :param str transformed_text: transformed sentence
  :param str reference_text: origin sentence
  :return float: the score of two sentence
docstr_tok: ["Calculate","the","score",":","param","str","transformed_text",":","transformed","sentence",":","param","str","reference_text",":","origin","sentence",":","return","float",":","the","score","of","two","sentence"]
code: def validate(self, transformed_text, reference_text):
      r"""
      Calculate the score
  
      :param str transformed_text: transformed sentence
      :param str reference_text: origin sentence
      :return float: the score of two sentence
  
      """
      num_words_diff = self.get_lcs(reference_text, transformed_text)
  
      return num_words_diff / len(reference_text)
  
imports: import numpy
  from .validator import Validator
label_desc: Use image node_id 3 for calling the MaxWordsPerturbed obj's underlying member method code with example usage: obj.validate(transformed_text, reference_text) and returns: unknown