我想調用在IBM沃森平臺的自然語言分類服務deleteClassifier()方法分類,操作完成,但不會刪除分類器。這裏是我的代碼和輸出: 代碼: NaturalLanguageClassifier service = new NaturalLanguageClassifier();
service.setUsernameAndPassword("xxxxxxx", "yyyyyyy");
我現在通過使用nltk來學習naivebayes分類器。 在文檔(http://www.nltk.org/book/ch06.html)1.3文檔分類中,有一個特徵集示例。 featuresets = [(document_features(d), c) for (d,c) in documents]
train_set, test_set = featuresets[100:], featur
def word_feats(words):
return dict([(word, True) for word in words])
for tweet in negTweets:
words = re.findall(r"[\w']+|[.,!?;]", tweet) #splits the tweet into words
negwords = [(wor