本文整理匯總了Python中Data.load_data方法的典型用法代碼示例。如果您正苦於以下問題:Python Data.load_data方法的具體用法?Python Data.load_data怎麽用?Python Data.load_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Data
的用法示例。
在下文中一共展示了Data.load_data方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: lda_function
# 需要導入模塊: import Data [as 別名]
# 或者: from Data import load_data [as 別名]
from gensim import models
from operator import itemgetter
import csv
import numpy as np
from collections import Counter
import nltk.corpus
import Data
import stack_plot
import bars
from toolbox_02450 import clusterval
import piechart
from matplotlib import pyplot as plt
import time
# load complete papers information and abstracts seperately
papers, abstracts = Data.load_data()
# load the transformed documents
dictionary, corpus_tfidf, corpus = Data.prepare_data()
def lda_function(number_of_topics):
"""
Apply LDA model to the data.
Return the first six terms of the topics as a list of strings,
the years of publication for the papers of each topic, and the LDA model.
"""
lda = models.LdaModel(corpus=corpus_tfidf, id2word=dictionary,
num_topics=number_of_topics, iterations=100)
topics = []