find_long_reply.py 文件源码

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

项目:tensorflow_seq2seq_chatbot 作者: higepon 项目源码 文件源码
def main():
    with tf.Session() as sess:
        listener = QueueListener(sess)
        stream = Stream(listener.auth, listener)
        stream.filter(languages=["ja"],
                      track=['?', '?', '?', '?', '???', '??', '??', '?', 'http', 'www', 'co', '@', '#', '?', '?', '?',
                             '.', '!', ',', ':', '?', '?', ')', '...', '??'])
        try:
            while True:
                try:
                    stream.sample()
                except KeyboardInterrupt:
                    print('KEYBOARD INTERRUPT')
                    return
                except (socket.error, http.client.HTTPException):
                    global tcpip_delay
                    print('TCP/IP Error: Restarting after %.2f seconds.' % tcpip_delay)
                    time.sleep(min(tcpip_delay, MAX_TCPIP_TIMEOUT))
                    tcpip_delay += 0.25
        finally:
            stream.disconnect()
            print('Exit successful, corpus dumped in %s' % (listener.dumpfile))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号