本文整理汇总了Python中nltk.probability.ConditionalFreqDist.tabulate方法的典型用法代码示例。如果您正苦于以下问题:Python ConditionalFreqDist.tabulate方法的具体用法?Python ConditionalFreqDist.tabulate怎么用?Python ConditionalFreqDist.tabulate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nltk.probability.ConditionalFreqDist
的用法示例。
在下文中一共展示了ConditionalFreqDist.tabulate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set
# 需要导入模块: from nltk.probability import ConditionalFreqDist [as 别名]
# 或者: from nltk.probability.ConditionalFreqDist import tabulate [as 别名]
from nltk.corpus import brown
from nltk.probability import ConditionalFreqDist
genres = ['news', 'romance']
days = set("Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split())
cfd = ConditionalFreqDist(
(genre,word)
for genre in genres
for word in brown.words(categories=genre)
if word in days
)
cfd.tabulate()