predict.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:Text-Classifier 作者: daniellaah 项目源码 文件源码
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]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号