def _ngram_counts(sequence, order):
  """Returns count of all ngrams of given order in sequence."""
  if len(sequence) < order:
    return collections.Counter()
  return collections.Counter(_ngrams(sequence, order))
Returns count of all ngrams of given order in sequence.
language/table_text_eval/table_text_eval.py