Coder Social home page Coder Social logo

eslamalaaeddin / sentimentanalyzer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12.98 MB

Simple sentiment analyzer that classifies tweets as either positive or negative.

Python 100.00%
conditional-probability confusion-matrix logistic-regression naive-bayes sentiment-analysis support-vector-machines word-frequency-count

sentimentanalyzer's Introduction

SentimentAnalyzer

Simple sentiment analyzer that classifies tweets as either positive or negative.

Pipeline

Data Aquistion

From nltk.twitter_samples

Splitting

We have 10000 tweets, 5000 are Positive(+) and 5000 are Negative(-)
We will split to be 80% for training and 20% testing

Text Cleaning

for each tweet
	1- Remove stock market tickers
	2- Remove old retweet text "RT"
	3- Remove hyperlinks
	4- Remove hashtags 

PreProcessing(Ordered)

	1- Tokenization
	2- Remove stop words
	3- Remove punctuations
	4- Stemming

Output: list of processed words for each tweet.

Building Frequency Table for each list of words (word, class[+|-]): count

Exracting Features From Tweets

for each processed tweet
	tweet = (1, count of positive words, count of negative words)

Building X and Y (Real Dataset) X: tweet 1 (1, 10, 13) tweet 2 (1, 5, 11) tweet 3 (1, 9, 18) tweet 4 (1, 24, 13) ... and so on
Y: 1 (positive tweet) or 0 (negative tweet)

Modeling

Logisitic Regression
SVM 
Naive Bayes

Evaluation

Precision
Recall
F1 Score

sentimentanalyzer's People

Contributors

eslamalaaeddin avatar

Watchers

 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.