def predict_with_content(classifier, news_content, feature_words):
word_list = jieba.lcut(news_content)
x = np.array([1 if word in word_list else 0 for word in feature_words]).reshape(1, -1)
return classifier.predict(x)[0]
评论列表
文章目录