Tweepy - 是否可以流式传输确切的短语? [英] Tweepy - is it possible to stream exact phrases?

查看:27
本文介绍了Tweepy - 是否可以流式传输确切的短语?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TheStreamer.filter(languages=["en"], track=['Bruno Mars is lovely'])

有没有办法让它跟踪一个确切的短语,而不是相关的短语?例如,

Is there a way to get this to track an exact phrase, rather than relevant phrases? For instance,

'Bruno Mars 真是个可爱的人'

'Bruno Mars really is a lovely man'

可能是我不想要的结果.

would probably be a result, which I don't want.

推荐答案

根据 track

不支持短语的精确匹配(相当于大多数搜索引擎中的引用短语).

Exact matching of phrases (equivalent to quoted phrases in most search engines) is not supported.

因此,简单的答案是否定的,您无法使用此技术阻止匹配所有单词以任何顺序并带有任何标点符号的推文.事后,您将不得不过滤掉与您的标准不符的结果.

So the simple answer is no, you cannot prevent matching tweets in which all words are present in any order and with any punctuation with this technique. You're going to have to filter out results that don't match your criteria after the fact.

这篇关于Tweepy - 是否可以流式传输确切的短语?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆