def _generate_ngram_table(self, output_dir, labels, results):
        """Returns an HTML table containing data on each n-gram in
        `results`."""
        html = []
        grouped = results.groupby(constants.NGRAM_FIELDNAME)
        row_template = self._generate_ngram_row_template(labels)
        for name, group in grouped:
            html.append(self._render_ngram_row(name, group, row_template,
                                               labels))
        return '\n'.join(html)
Returns an HTML table containing data on each n-gram in
        `results`.