def doc_importance(self): for i in self.doc_split: sig_word = [] tokens = Kkma().morphs(i) for j in tokens: if j in self.word: sig_word.append(tokens.index(j)) length = max(sig_word) - min(sig_word) + 1 self.importance.append(len(sig_word) * len(sig_word) / length)