本文整理匯總了Python中API.API.gettop方法的典型用法代碼示例。如果您正苦於以下問題:Python API.gettop方法的具體用法?Python API.gettop怎麽用?Python API.gettop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類API.API
的用法示例。
在下文中一共展示了API.gettop方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: API
# 需要導入模塊: from API import API [as 別名]
# 或者: from API.API import gettop [as 別名]
#list religious sources
sources['5'] = ['news_va_en', 'Buddhism_Now', 'HinduismToday', 'Pearlsofprophet', 'YourJudaism', 'HuffPostRelig', 'RNS']
#list entertainment sources
sources['6'] = ['MTV', 'Rock Music', 'TheGRAMMYs', 'TheAcademy', 'bbcentertain', 'EntMagazine', 'EW', 'mashentertain', 'CBSShowbiz']
#job and careers sources
sources['7'] = ['GuardianCareers', 'CareerBuilder', 'LinkedIn', 'indeed', 'TweetMyJobs', 'USNewsCareers', 'UCSBcareer', 'BI_Careers']
#weather sources
sources['8'] = ['weatherchannel', 'bbcweather','wunderground', 'weathernetwork', 'capitalweather', 'CNNweather']
#random/other sources
sources['9'] = ['Seldomaniac', 'Callamasta', 'jwharris', 'don_brown', 'lou1derful', 'ChrisPawelski']
api = API(sources)
api.gettweets()
api.cleantweets()
api.tokenizetweets()
api.writetofile()
top = api.gettop()
api.getfeatures()
print top
print api.train()