Coder Social home page Coder Social logo

covid-19-tweets-text-classification's Introduction

Covid-19-tweets-text-Classification

Covid 19 is a highly contagious disease caused by a virus known as SARS-CoV-2. The task of this project is to build a model for Text Classification task based on sentiments from Twitter data about Covid19. The dataset used contains 4 attributes, one of them being the sentiment associated with the tweets.The final model with the best performance for this multiclass classification task is Bidirectional LSTM with dense layers with a test accuracy of 80%. The model summary is as follows-

Screenshot (63)

Understanding the dataset

  • First 10 rows
  • Last 10 rows
  • Information about data
  • Number of missing values in data
  • Number of duplicate values in data
  • Number of unique values in columns
  • Count of unique values for the column Sentiment
  • Places of missing values in data

Analyzing relationships

  • Barplot for the top 20 places with most tweets
  • Percentage distribution of tweets from top 20 locations
  • Countplot for different classes
  • Countplot for tweets on different dates
  • Countplot for different classes of tweets on different days

Feature Engineering

  • Merging five classes into three prominent classes
  • Removing all links,mentions and special characters
  • Removing stop words
  • Generating wordcloud to see the most frequent words for each class
  • Lemmatizing the data
  • Tokenizing the text
  • Replacing each word with its corresponding integer value from the word_index and padding it to make the data equal in length
  • One hot encoding the classes
  • Getting embeddings from GloVe model for our data

Modelling

  • Bidirectional LSTM

Vizualising results

Accuracy: 0.8001579778830964

          precision    recall  f1-score   support

Negative       0.83      0.79      0.81      1633
 Neutral       0.77      0.71      0.74       619
Positive       0.78      0.85      0.82      1546

micro avg 0.80 0.80 0.80 3798 macro avg 0.79 0.78 0.79 3798 weighted avg 0.80 0.80 0.80 3798 samples avg 0.80 0.80 0.80 3798

image

covid-19-tweets-text-classification's People

Contributors

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