見出し画像

#TW-11 Twitterに自動翻訳を併記してみた (Easily read tweets written by languages which you don't understand)

(English follows)
いままでの記事ではTwitterのデータでも日本語で遊んでみたという話をしてきました。Twitterをうまく活用して文化理解をすすめたり、情報収集をしたり、マーケティング分析利用ができたりという可能性は見いだせてきました。さて、いままでは日本の話しをしていたのでそもそも軽く文化の理解はあるという状況でした。それがない国となると大きな壁が立ちはだかります。言語です。

シンガポールは東南アジアに位置し、英語を公用語として使用する珍しい国ですが、他の国はそれぞれの言語がありツイートももちろん該当言語でなされています。インドネシアの情報を例えば集めよう、誰かフォローしてみようとなっても、そもそもインドネシア語がわからないので、誰が何を話していて、誰をフォローすればよいのかも分かりませんでした。。。やはり弊社オフィスの中でも数少ない2ヶ国語しか話せない人という僕の欠点が(悲しい)。

Twitterには翻訳機能があるのですが、ツイート一つ一つ翻訳ボタン(?)を押さなければならず一覧性がないのです。ブラウザの翻訳機能もうまく機能したりしなかったり。データ分析の際にはインドネシア語の単語で検索を書けて、データを全部Google翻訳とかにかければなんとかなるのですが、タイムラインを追っかけていたいときには非常に不便な状態なのです。なので、、、自動翻訳Twitterビューワーを作ってみましたという話です。

すみません、すみません。見た目がダサいのとか許してください。まずは作ってみたかったのです。だらだらタイムラインを眺めて、ぼんやりツイートを理解する時間を作りたかったのです。そして今回は僕はWEBプログラミング(フロントエンド)を自分でやったことがあまりなかったので、それにチャレンジしながらやってみようということでブラウザで動くアプリです。

結果、上記の写真はインドネシア語の事例ですが、スピードは遅く、デザインはダサいですが、左にもとの言語、右の灰色に囲まれたところが翻訳された言語という形で縦に、フォローしている方のツイートを見ていけるものが完成しました。まだまだ見るだけの機能ですが、十分使えるものになりました。詳細は次回になると思いますが、今回のポイントは5つ。

  1. PythonでHTMLを吐き出すだけという原始的な仕組み

  2. Tweepyでデータ取得はものすごく簡単

  3. 取得したデータの解析がやはり一番手間がかかった

  4. 翻訳はGoogle translationを使用。遅いのでもうひと工夫必要

  5. 作るのにかかった時間は。。。約20時間?(勉強時間込み)

インドネシア専用アカウントを作ったので、しばらくこれでいろいろな人を見つけてはフォローし、インドネシアのツイートを満喫しようかと思っています。ちなみに、やはりというか翻訳は日本語にするより英語がおすすめです。英語のほうが、感覚的にですが精度が高いように感じられました。

So far, my posts about twitter were all about Japan and Japanese. After playing around with tweet data, I found out that tweet data has huge potential to understand culture/trend, collect information, get insight about consumers (If you use is correctly…). Since I'm Japanese, I have some basic understanding and language skill about Japan but now I would like to touch a bit to "Understanding other culture". Then to do it, there is a huge barrier, Language.

Singapore is unique country in south east Asia in a way that they use English as public language. But other countries normally have their own language and tweets are made in those. For example, when I think that I want to see tweet in Indonesia and want to follow Indonesians, I can not make it since I totally don't understand Bahasa Indonesia at all. I couldn't even tell who to follow. Well, I am one of the few people in my office who understand only 2 language… (Too bad).

Twitter has translation function but you have to press "translation" for every single tweets individually. Also browser provide translation function but it is unstable and doesn't work smoothly. For data analysis by search tweets by words, you may just put all data into translation and it would be enough for you. But if I want to just regularly see my timeline, it is too troublesome. OK, then I wanted to make convenient one for me by myself…

Well, I don't think I have a good sense of design but above is the one I made. I just wanted to see my tweets of accounts which I follow and it should be simple enough. This time, my topic is "Web" programming(frontend) which I have never tried myself before. So this works on browser.

in the end,,, above screen shot is the example from Bahasa to Japanese and it worked even though speed is slow and it is not beautifully designed. The left is the tweet in the original language and the right hi-lighted in gray is the translation. It is enough for the quick glance! I'll talk the details in the next post but points are below.

  1. Simply render Html by Python which is very primitive.

  2. Used Tweepy library to get tweet (very easy)

  3. Most time consuming part was again to analyze data which Tweepy provides

  4. Used Google translation but it must be improved a bit since the speed is slow.

  5. It took me around 20 hours including studying HTML/Python

Well, I made an account for following tweets in Indonesia. So I'll regularly read those and try to get idea on what type of analysis would be interesting to make. By the way, in terms of translation quality, Bahasa to English is much better that Bahasa to Japanese I assume. So I changed it to English now.

この記事が気に入ったらサポートをしてみませんか?