def _compute_raw_sari_score(original, pred, references, tokenizer):
  """Compute SARI score.

    The score is introduced in the following paper to measure
    sentence similarity.

    Optimizing Statistical Machine Translation for Text
    Simplification Wei Xu, Courtney Napoles, Ellie Pavlick, Quanze Chen and
    Chris Callison-Burch In Transactions of the Association for Computational
    Linguistics (TACL) 2016
    http://cs.jhu.edu/~napoles/res/tacl2016-optimizing.pdf
    This basically compares the overlap between the original sentence,
    reference sentences, and the predicted sentence.

    This score only considers unigrams, and compute raw true positive,
    false positive, and false negative counts instead of computing
    precision, recall, f1 per example.

  Args:
    original: the original sentence.
    pred: predicted sentence.
    references: a list of reference sentences.
    tokenizer: Word tokenizer to use.

  Returns:
    SARIScore.
    It has three sub components: add, keep, and deletion scores.
  """
  # first tokenize.
  if not references:
    raise ValueError('Annotation cannot be empty.')
  # Tokenize.
  tokenized_original = tokenizer(original)
  tokenized_prediction = tokenizer(pred)
  tokenized_references = [tokenizer(annot) for annot in references]
  # Create vocab.
  vocab = set(tokenized_prediction + tokenized_original)
  for tokenized_reference in tokenized_references:
    vocab.update(tokenized_reference)
  vocab_dict = {v: i for i, v in enumerate(vocab)}
  # Map to id.
  source_ids = np.array([vocab_dict[t] for t in tokenized_original])
  pred_ids = np.array([vocab_dict[t] for t in tokenized_prediction])
  reference_ids_list = []
  for reference in tokenized_references:
    reference_ids_list.append(np.array([vocab_dict[t] for t in reference]))
  # Compute the score.
  (add_tp, add_fp, add_fn, del_tp, del_fp, del_fn) = (
      _get_raw_sari_score(source_ids, pred_ids, reference_ids_list))
  return RawSARIScore(add_tp, add_fp, add_fn, del_tp, del_fp, del_fn)
Compute SARI score.

    The score is introduced in the following paper to measure
    sentence similarity.

    Optimizing Statistical Machine Translation for Text
    Simplification Wei Xu, Courtney Napoles, Ellie Pavlick, Quanze Chen and
    Chris Callison-Burch In Transactions of the Association for Computational
    Linguistics (TACL) 2016
    http://cs.jhu.edu/~napoles/res/tacl2016-optimizing.pdf
    This basically compares the overlap between the original sentence,
    reference sentences, and the predicted sentence.

    This score only considers unigrams, and compute raw true positive,
    false positive, and false negative counts instead of computing
    precision, recall, f1 per example.

  Args:
    original: the original sentence.
    pred: predicted sentence.
    references: a list of reference sentences.
    tokenizer: Word tokenizer to use.

  Returns:
    SARIScore.
    It has three sub components: add, keep, and deletion scores.
  
language/decontext/eval_util.py