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))
find_long_reply.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录