nlp.py 文件源码

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

项目:turingtweets 作者: jjfeore 项目源码 文件源码
def gen_tweet():
    """Read the redis, and build a fake tweet from that."""
    host_url = os.environ.get('REDIS_URL')
    chains = redis.from_url(host_url)
    markov_chains = chains.get('markov_tweets')
    markov_chains = pickle.loads(markov_chains)
    the_tweet = None

    while not the_tweet:
        the_tweet = markov_chains.make_short_sentence(140, 70)
    return the_tweet
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号