Giter Site home page Giter Site logo

tspannhw / twitter-stream-ml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from giorgioinf/twitter-stream-ml

0.0 2.0 0.0 30.07 MB

Machine Learning over Twitter's stream. Using Apache Spark, Web Server and Lightning Graph server.

License: GNU General Public License v3.0

Scala 56.19% Shell 0.80% HTML 9.34% JavaScript 33.67%

twitter-stream-ml's Introduction

twitter-stream-ml

Machine Learning over Twitter's stream. Using Apache Spark, Web Server and Lightning Graph server. Running example

Twitter Stream ML - Preview

1. Building

This project are using sbt, scala and java.

$ sbt assembly

2. Pre-execution

2.1. Lightning Graph Server

First of all, the application depends on Lightning Graph Server.

The default server is http://public.lightning-viz.org, but you can Deploy or Install on your machine

2.2. Web Server

Second, the spark job (twtml-spark) depends on web server (twtml-web).

Deploy or run by command-line:

$ sbt web/run
or
$ scala web/target/scala-2.11/twtml-web*.jar

3. Command-line

It's possible to execute the spark job (twtml-spark) by command-line, without change configuration files.

First of all, there are 3 ways to execute the application:

  1. sbt
$ sbt "spark/run --master <master>"
  1. standalone jar
$ scala -extdirs "$SPARK_HOME/lib" spark/target/scala-2.10/twtml-spark*.jar --master <master>
  1. spark-submit
$ spark-submit --master <master> spark/target/scala-2.10/twtml-spark*.jar

Without master parameter, the default is local[2].

3.1. Help command

$ <command> --help
OR
$ <command> -h

4. Configuration

Just only spark job needs a configuration. It's also configurable by command-line. You can see de command options running:

4.1. Twitter access tokens

$ <command> --consumerKey xxxxxxxxxxxxxxxxxxxxxxxxx \
--consumerSecret xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
--accessToken xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
--accessTokenSecret xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

4.2. Servers

$ <command> --lightning http://localhost:3000 \
--twtweb http://localhost:8888

4.3. File configuration

If you prefer, you can use configuration file to save the same options available by command-line. It's necessary to create a <application.conf> file. You can also copy from <reference.conf>.

$ cp spark/src/main/resources/reference.conf \
/spark/src/main/resources/application.conf

Now, just change de application.conf

spark/src/main/resources/application.conf

...
lightning="http://localhost:3000"
twtweb="hhttp://localhost:8888"
consumerKey="xxxxxxxxxxxxxxxxxxxxxxxxx"
consumerSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
accessToken="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
accessTokenSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
...

Dependencies

Lightning is a data-visualization server providing API-based access to reproducible, web-based, interactive visualizations.

sbt is an open source build tool for Scala and Java projects, similar to Java's Maven or Ant.

Apache Spark - 1.6.1

Apache Spark is an open-source cluster computing framework originally developed in the AMPLab at UC Berkeley. In contrast to Hadoop's two-stage disk-based MapReduce paradigm, Spark's in-memory primitives provide performance up to 100 times faster for certain applications. By allowing user programs to load data into a cluster's memory and query it repeatedly, Spark is well suited to machine learning algorithms.

Apache Hadoop is an open-source software framework written in Java for distributed storage and distributed processing of very large data sets on computer clusters built from commodity hardware. All the modules in Hadoop are designed with a fundamental assumption that hardware failures are commonplace and thus should be automatically handled in software by the framework.

Scala - 2.11.8

Scala is an object-functional programming language for general software applications. Scala has full support for functional programming and a very strong static type system. This allows programs written in Scala to be very concise and thus smaller in size than other general-purpose programming languages. Many of Scala's design decisions were inspired by criticism of the shortcomings of Java.

Java Open JDK - Standard Edition - 1.7+

A general-purpose computer programming language designed to produce programs that will run on any computer system.

Guides

twitter-stream-ml's People

Contributors

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