<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate(self, output_dir, work, ngrams, labels, minus_ngrams):
 """Generates HTML reports for each witness to `work`, showing its text with the n-grams in `ngrams` highlighted. Any n-grams in `minus_ngrams` have any highlighting of them (or subsets of them) removed. :param output_dir: directory to write report to :type output_dir: `str` :param work: name of work to highlight :type work: `str` :param ngrams: groups of n-grams to highlight :type ngrams: `list` of `list` of `str` :param labels: labels for the groups of n-grams :type labels: `list` of `str` :param minus_ngrams: n-grams to remove highlighting from :type minus_ngrams: `list` of `str` :rtype: `str` """

        template = self._get_template()
        colours = generate_colours(len(ngrams))
        for siglum in self._corpus.get_sigla(work):
            ngram_data = zip(labels, ngrams)
            content = self._generate_base(work, siglum)
            for ngrams_group in ngrams:
                content = self._highlight(content, ngrams_group, True)
            content = self._highlight(content, minus_ngrams, False)
            self._ngrams_count = 1
            content = self._format_content(content)
            report_name = '{}-{}.html'.format(work, siglum)
            self._write(work, siglum, content, output_dir, report_name,
                        template, ngram_data=ngram_data,
                        minus_ngrams=minus_ngrams, colours=colours)