twitter Streaming Classification: Location Estimationのプログラム変更について

44 views
Skip to first unread message

咲希

unread,
Sep 4, 2016, 9:44:53 PM9/4/16
to Jubatus
加藤です。
twitter Streaming Classification: Location Estimationのプログラム変更について

草津の観光客数の予測をしたいです。 
 
1.月別観光客数の情報収集:train.py 使って過去の投稿を情報収集 
2.特徴抽出:mecab を使用した投稿の特徴抽出 

下記のツイートのジオタグをどのように取得しましたか。
教えてもらえますか。

train_tweets():
    tokyo    = LocationFence("Tokyo",    138.946381, 35.523285, 139.953232, 35.906849)
    hokkaido = LocationFence("Hokkaido", 139.546509, 41.393294, 145.742798, 45.729191)
    kyusyu   = LocationFence("Kyusyu",   129.538879, 31.147006, 131.856995, 33.934245)

    locations = [tokyo, hokkaido, kyusyu]
    request_coordinates = []
    for l in locations:
        request_coordinates += l.get_coordinates()


変更したいところ

train_tweets():
    kusatsu    = LocationFence("kusatsu",    ?)

    locations = [kusatsu]
    request_coordinates = []
    for l in locations:
        request_coordinates += l.get_coordinates()

もし上記のプログラムを変更することで過去のツイートの情報収集できますか。

質問が多くてすいません。

お手数ですが、ご返事いただければ幸いです。

よろしくお願いいたします。

Kenichi Maehashi

unread,
Sep 6, 2016, 9:19:51 PM9/6/16
to jub...@googlegroups.com
加藤さま

Jubatus Team の前橋です。

> 下記のツイートのジオタグをどのように取得しましたか。

各都市の座標範囲(経度・緯度)は、Google Mapsや以下のサービス等で求めることができます。

http://user.numazu-ct.ac.jp/~tsato/webmap/sphere/coordinates/advanced.html

より正確な座標は以下のページなどで調べることもできます。

http://www.gsi.go.jp/KOKUJYOHO/center.htm

なお、このサンプルコードでは領域を単純な矩形として扱っていますので、コード流用時はご注意ください。

> もし上記のプログラムを変更することで過去のツイートの情報収集できますか。

Twitter APIでは、過去のパブリックタイムラインを取得することはできないようです。
参考: https://dev.twitter.com/rest/public

よろしくお願いいたします。

2016年9月5日 10:44 咲希 <chah...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "Jubatus" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jubatus+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Kenichi Maehashi @ Jubatus Team
Reply all
Reply to author
Forward
0 new messages