Giter VIP home page Giter VIP logo

sentiment-analysis-storm's Introduction

Simple Sentiment Analysis using Apache Storm

A very simple project that simulates how to execute sentiment analysis using Apache Storm 0.10.x.

Random sentences are emitted by a dummy Spout. Then words of each sentence are splitted (by space) and stemmed based on a dummy collection (could be replaced with a real DB) of words. New sentence is emitted again without the "useless" word and processed by PositiveBolt, where a positive score is calculated and emitted. New sentence is processed again by NegativeBolt and a negative score is calculated and emitted, additional to positive score. ScoreBolt compares 2 previous scores and decides if this sentence is positive or negative. Then final result, original and modified sentences, are persisted to HBase (by HBaseBatchBolt) and logged (by LoggingBolt) too.

Storm external module Flux is used to define and deploy topology in Storm.

Application has been tested with Apache HBase 1.1.2 and Cloudera 5.4.x/5.5.x

Usage

Prerequisites

  • Download HBase 1.1.x.
  • Extract tgz
  • Run single node of HBase
    • $> cd bin
    • $> ./start-hbase.sh
  • Create required table
    • $> hbase shell
    • hbase(main):001:0> create 'SentimentAnalysisStorm', 'cf'

Build

mvn clean package -DskipTests

Running in local mode

Using Flux:

  • storm jar target/sentiment-analysis-storm-0.0.1-SNAPSHOT.jar org.apache.storm.flux.Flux --local src/test/resources/flux/topology.yaml -s 10000

Running in cluster mode

Using Flux:

  • storm jar target/sentiment-analysis-storm-0.0.1-SNAPSHOT.jar org.apache.storm.flux.Flux --remote src/test/resources/flux/topology.yaml --c nimbus.host=localhost

sentiment-analysis-storm's People

Contributors

qiozas avatar

Watchers

 avatar  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.