def match_sents(sents_a, sents_b):
  """Finds best matching between two lists of sentences."""
  scores = score_matrix(sents_a, sents_b)
  best_score = -float("inf")
  best_seq = None
  for i in range(len(sents_a)):
    seq, score = _recursion(scores[i:,], 0)
    if score > best_score:
      best_seq = [None] * i + seq
      best_score = score
  return best_seq, best_score
Finds best matching between two lists of sentences.
language/fruit/rendering_utils.py