':key: ä¿å­æš¡åçtwordsæ°æ®,èŠçšå°phiçæ°æ®'

def save_twords(self, file_name):

    self.calculate_phi()
    out_num = (self.V if (self.twords_num > self.V) else self.twords_num)
    with open(file_name, 'w', encoding='utf-8') as f_twords:
        for k in range(self.K):
            words_list = sorted([(w, self.phi[(k, w)]) for w in range(self.V)], key=(lambda x: x[1]), reverse=True)
            f_twords.write(('Topic    %dth:\n' % k))
            f_twords.writelines([(' DCTB %s    %f\n' % (self.local_bi.get_value(w), p)) for (w, p) in words_list[:out_num]])
    return
