converse.py 文件源码

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

项目:Tzara---A-Personal-Assistant 作者: Suman7495 项目源码 文件源码
def Markov_generate_unigram(seed):
    seed = ''.join(seed)
    counter = 1
    next_word_list = []
    for i in data:
        if seed == i:
            next_word_list.append(data[counter])
        counter += 1
    if len(next_word_list) == 0:
        return nltk.bigrams(["you", "are"])
    cfdist = nltk.FreqDist(next_word_list)
    next_word = cfdist.max()
    return nltk.bigrams([seed, next_word])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号