【问题标题】:How to filter twitter with blank between characters?如何用字符之间的空白过滤推特?
【发布时间】:2016-10-09 14:14:50
【问题描述】:

基于 twitter 流 apitrack 和 tweepy,我想过滤 twitter 帖子包含 "A B" 代码如下:

twitter_stream.filter(track=['A B'])

但结果出乎意料:

A New Project Featuring ASAP Rocky Vince Staples Lil B
In a contract, A & B agree to do various

但我想匹配如下:

A B want to .... 
...xx A B xx...

有人有这些经历吗?

【问题讨论】:

标签: python nlp web-crawler tweepy twitter-streaming-api


【解决方案1】:

将空间编码为“%20”。

twitter_stream.filter(track=['A%20B'])

【讨论】:

    猜你喜欢
    • 2011-04-23
    • 2011-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-23
    • 2021-07-22
    • 1970-01-01
    相关资源
    最近更新 更多