Я рассчитываю tf-idf следующим образом.
texts=['human interface computer',
'survey user computer system response time',
'eps user interface system',
'system human system eps',
'user response time']
dictionary = corpora.Dictionary(texts)
corpus = [dictionary.doc2bow(text) for text in texts]
tfidf = models.TfidfModel(corpus)
corpus_tfidf = tfidf[corpus]
analyzedDocument = namedtuple('AnalyzedDocument', 'word tfidf_score')
d=[]
for doc in corpus_tfidf:
for id, value in doc:
word = dictionary.get(id)
score = value
d.append(analyzedDocument(word, score))
Однако теперь я хочу определить 3 самых важных слова в моем корпусе, используя слова, которые имеют самые высокие значения idf
. Пожалуйста, дайте мне знать, как это сделать?