naivebayes.py 文件源码

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

项目:chatbot 作者: minggli 项目源码 文件源码
def classify(query,
             engine=engine,
             threshold=.85,
             limit=5):
    """spell out most probable diseases and respective percentages."""
    words = preprocess(' '.join(query))
    print('understanding {}...'.format(words))
    objects = engine.prob_classify(words)
    keys = list(objects.samples())

    samples = [tuple((key, objects.prob(key))) for key in keys]

    return feed_conversation(samples, limit, threshold)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号