Giter VIP home page Giter VIP logo

scraper's Introduction

scraper

Scrape content from Orange forums. Made with scala-scraper.

Build Spark for Scala 2.11

Because it uses Scala 2.11, a version of Apache Spark supporting this version of Scala has to be built. To do this, first download Spark source code.

Then make pom.xml use Scala 2.11:

./dev/change-scala-version.sh 2.11

Build Spark with Maven:

./build/mvn -Pyarn -Phadoop-2.6 -Dhadoop.version=2.7.1 -Dscala-2.11 -DskipTests clean package

Machine learning on sentiment analysis

Use ml.ScrapeMessages as:

./bin/spark-submit --class ml.ScrapeMessages scraper-assembly.jar

Messages are then stored in $SPARK_DIR/ml/data in partitioned files: part-00000, part-00001, .... Merge them into a single text file to import it in Excel and save it as a csv file. This file alread exists in ml at the root of this directory.

Run ml.Train with the csv file to save a trained model:

./bin/spark-submit --class ml.Train scraper-assembly.jar <csv training file> <trained model save folder>

Run the scraper

Use sbt assembly to compile it and run:

./bin/spark-submit --class Scraper scraper-assembly.jar

Run the scraper on a Docker Swarm cluster

Deploy the Spark - Cassandra cluster with t3g7/deployer.

Then get Swarm nodes IPs with docker-machine ip swarm-node-{1,2,3} and replace "Swarm node 1 IP,Swarm node 2 IP,Swarm node 3 IP" with them as spark.cassandra.connection.host in Scraper.scala.

Copy the jar in t3g7/deployer/data and run it:

docker exec -it swarm-master/master /usr/local/spark/bin/spark-submit --class Scraper --master spark://master:7077 /usr/local/spark/data/scraper-assembly-$VERSION.jar

scraper's People

Contributors

bfovet avatar eftov avatar

Watchers

James Cloos avatar  avatar hhe avatar  avatar Anass Seddiki avatar Abderrahman Lahjouji 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.