Code Monkey home page Code Monkey logo

social_test's Introduction

Twitter 感情分析サンプル

Google Cloud Platform の BigQuery, AppEngine, データポータル、Natural Language API を使ったソーシャル感情分析ダッシュボードのデモです。 Twitter API 経由で特定のハッシュタグを含むツイートを受け取ると Natural Language API 経由で感情分析した結果を BigQuery にストリーミングします。 詳細はこちらを参照ください。

事前準備

設定

  1. GCP コンソールで以下を有効にする

    • Cloud Natural Language API
    • BigQuery API
  2. git clone https://github.com/myoshimu/social_test.git

  3. npm install

  4. https://apps.twitter.com/ で Twitter API キーを発行し .env ファイルに記述します。

  5. Big Query にデータセットとテーブル作成

    • bq mk twitter
    • bq mk --schema HashTag:STRING,Tweet:STRING,SentimentScore:FLOAT,SentimentMagnitude:FLOAT,InsertDate:STRING -t twitter.twitter_stream
  6. .env ファイルの GCP プロジェクト ID を BigQuery のテーブルを含んでいるものに更新

  7. app.js のハッシュタグを変更

アプリケーション実行

VM もしくは AppEngine でそれぞれ以下のように起動してください。

VM で起動する場合

node app.js

App Engine で起動する場合

gcloud app deploy

social_test's People

Contributors

myoshimu avatar

Stargazers

ps0317ix avatar flik avatar  avatar Yosuke Onoue avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.