【发布时间】:2011-01-10 21:17:50
【问题描述】:
我想知道是否有人可以通过代码 sn-p 帮助我,该代码演示了如何使用特征频率方法而不是特征存在来训练朴素贝叶斯分类器。
我认为下面第 6 章中所示的 link text 是指使用 Feature Presence (FP) 创建功能集 -
def document_features(document):
document_words = set(document)
features = {}
for word in word_features:
features['contains(%s)' % word] = (word in document_words)
return features
请指教
【问题讨论】:
标签: python nlp nltk stanford-nlp