小编Cit*_*lla的帖子

Twitter4j:在主题标签中搜索关键字

我正在使用Twitter4j开发应用程序.我正在尝试使用某个标签导入推文(例如:天气)然后,我想通过搜索关键字对推文进行分类.

例如:导入的一些推文可能是

- OMG, I hate this rain #weather
- This sunshine makes me feel so happy #weather
- Such strange #weather! One moment it rains, the next the sun shines. Confusing!
- Rain makes me sad #weather
- I love the sunshine! #weather
Run Code Online (Sandbox Code Playgroud)

然后,我想将这些推文归类为:

- hate, Confusing, sad,... are negative 
- happy, love,... are positive
Run Code Online (Sandbox Code Playgroud)

PositiveTweets将是:

- This sunshine makes me feel so happy #weather
- I love the sunshine! #weather
Run Code Online (Sandbox Code Playgroud)

NegativeTweets将是:

- OMG, I hate this rain #weather …
Run Code Online (Sandbox Code Playgroud)

java twitter filter twitter4j hashtag

3
推荐指数
1
解决办法
4119
查看次数

标签 统计

filter ×1

hashtag ×1

java ×1

twitter ×1

twitter4j ×1