GithubHelp home page GithubHelp logo

faisalmehmood2007 / airline_sentiment_analysis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abdullahtarek/airline_sentiment_analysis

0.0 0.0 0.0 1.65 MB

This repository performs sentiment analysis on tweets of an airline company

Python 18.94% Jupyter Notebook 81.06%

airline_sentiment_analysis's Introduction

Airline_sentiment_analysis

This repository performs sentiment analysis on tweets of an airline company by using RNNs. The idea is to know how a user is feeling based on his tweet.

Requirements

  • tensorfow
  • numpy
  • pandas
  • scikit-learn

You can install all the requirements with the bellow command
pip install -r requirements.txt

Download pretrained word embedding

Before doing anything you should first download the pretrained word_embeding from GloVe by running the following commands

  • clone the repository
  • cd airline_sentiment_analysis
  • run-- > python Download_word_embedding.py

Run inference

  • clone the repository
  • cd airline_sentiment_analysis 1- Run Through terminal
  • open inference.py edit the text variable
  • got to terminal and run --> python inference.py
  • This will tell you the sentiment of the sentence 2- Run Through jupyter notebook
  • open inference.ipynb
  • edit text variable
  • Run the cells to get the sentiment

Run training and evaluation

  • clone the repository
  • cd airline_sentiment_analysis
  • open Train_and_evaluate.ipynb
  • edit Dataset path and word embeding path if neccessary. (you won't have to edit anything if you kept folders as is)
  • Run the cells

pipeline

1- explore the dataset:

  • Envistage the dataset and knew that the data is skewed( more the 50% of the data is one negative and the rest is either nuetral or positive). The steps of the evistagation can be found in this notbook explore_dataset.ipynb

2- word2vec:

  • Used a pretrained word embedding to converts words into vectors that represent each word

3- Model:

  • Built a model consisting of three layers of GRUs followed by on dense layer

4- Training:

  • Because the data skewed I implemented and used the Stratsified batch.

Accuracy, percision,recall , f1_score and a confusion matrix are all found in this notebook Train_and_evaluate.ipynb after training.

airline_sentiment_analysis's People

Contributors

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