Git Product home page Git Product logo

anuragkr29 / tweetanalysis Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5 KB

Work with a set of Tweets about US airlines and examine their sentiment polarity.The aim is to learn to classify Tweets as either “positive”, “neutral”, or “negative” by using two classifiers and pipelines for pre-processing and model building.

License: MIT License

Scala 100.00%
scala spark machine-learning-pipelines rdd dataframe tweets tokenizer stopwords-removal sentiment-analysis

tweetanalysis's Introduction

TweetAnalysis

Work with a set of Tweets about US airlines and examine their sentiment polarity.The aim is to learn to classify Tweets as either “positive”, “neutral”, or “negative” by using two classifiers and pipelines for pre-processing and model building.

Below are the steps of the project:

  1. Loading: First step is to define an input argument that defines the path from which to load the dataset. After that, you will need to remove rows where the text field is null.
  2. Pre-Processing: You will start by creating a pre-processing pipeline with the following stages: • Tokenizer: Transform the text column by breaking down the sentence into words • Stop Word Remover: Remove stop-words from the words column Hint: Use the import org.apache.spark.ml.feature.StopWordsRemover class. • Term Hashing: Convert words to term-frequency vectors Hint: Use the import org.apache.spark.ml.feature.HashingTF class • Label Conversion: The label is a string e.g. “Positive”, which you need to convert to numeric format Hint: Use the import org.apache.spark.ml.feature.StringIndexer class Remember that you need to create a pipeline of the above steps and then transform the raw input dataset to a pre-processed dataset.
  3. Model Creation - You will need to create two classification models that you can select from the MLlib classification library. You will have to create a ParameterGridBuilder for parameter tuning and then use the CrossValidator object for finding the best model. An example of this can be seen here: https://spark.apache.org/docs/2.2.0/api/scala/index.html#org. apache.spark.ml.tuning.CrossValidator
  4. Model Testing & Evaluation: Next, you will create a random sample of the dataset and apply your model on it and output classification evaluation metrics, such as accuracy, etc. You can see details of multi-class evaluation metrics at https://spark.apache.org/docs/2.2.0/ mllib-evaluation-metrics.html.
  5. Output: Finally, you have to write the output the classification metrics to a file whose location is specified by the second argument to the class.

tweetanalysis's People

Contributors

anuragkr29 avatar

Watchers

 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.