paddlenlp/metrics/rouge.py
def _get_ngrams(self, words):
        """Calculates word n-grams for multiple sentences.
        """
        ngram_set = set()
        max_index_ngram_start = len(words) - self.n
        for i in range(max_index_ngram_start + 1):
            ngram_set.add(tuple(words[i:i + self.n]))
        return ngram_set
Calculates word n-grams for multiple sentences.
        
Calculates word n-grams for multiple sentences.
Calculates word n - grams for multiple sentences .
def _get_ngrams(self, words):
        ngram_set = set()
        max_index_ngram_start = len(words) - self.n
        for i in range(max_index_ngram_start + 1):
            ngram_set.add(tuple(words[i:i + self.n]))
        return ngram_set
def _get_ngrams ( self , words ) : ngram_set = set ( ) max_index_ngram_start = len ( words ) - self . n for i in range ( max_index_ngram_start + 1 ) : ngram_set . add ( tuple ( words [ i : i + self . n ] ) ) return ngram_set
Calculates word n-grams for multiple sentences.
Calculates word n - grams for multiple sentences .
"""Calculates word n-grams for multiple sentences.
        """
self
words