(self)
Compute term frequency for reference data.
        This will be used to compute idf (inverse document frequency later)
        The term frequency is stored in the object
        :return: None
Compute term frequency for reference data.
        This will be used to compute idf (inverse document frequency later)
        The term frequency is stored in the object
        :return: None
Compute term frequency for reference data . This will be used to compute idf ( inverse document frequency later ) The term frequency is stored in the object : return : None
def compute_doc_freq(self):
        '''
        Compute term frequency for reference data.
        This will be used to compute idf (inverse document frequency later)
        The term frequency is stored in the object
        :return: None
        '''
        for refs in self.crefs:
            # refs, k ref captions of one image
            for ngram in set([ngram for ref in refs for (ngram,count) in ref.items()]):
                self.document_frequency[ngram] += 1
def compute_doc_freq ( self ) : for refs in self . crefs : # refs, k ref captions of one image for ngram in set ( [ ngram for ref in refs for ( ngram , count ) in ref . items ( ) ] ) : self . document_frequency [ ngram ] += 1