1
다음과 같이 tf-idf를 계산합니다.tf-idf (Gensim)를 사용하여 코퍼스에서 가장 중요한 단어 얻기
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))
그러나, 지금은 가장 높은 idf
값이 단어를 사용하여 내 신체에서 가장 3 중요한 단어를 식별합니다. 어떻게하는지 알려주세요. 다음과 같이