Code Monkey home page Code Monkey logo

depression-and-anxiety-detection-on-social-media's Introduction

Depression-and-Anxiety-Detection-on-Social-Media

Depression and Anxiety Detection using NLP on Social Media Messages .

Abstract

This project dives into the working of Natural Language Processing for Sentiment Analysis applying concepts of Data Sciences and Machine Learning. The project explores in detail the process of sentiment analysis right from tagging and labelling data and classifying sentiments manually to creating a ML Model to automate this prediction.

Depression and Anxiety are alarmingly becoming common in today's mordern stressful world. It leads to adverse effects and consequences both for the person themselves and all their loved ones. Early prediction especially using text messages on social media platform will help people seek help and prevent adverse consequence.

About The Project

The project can be divided into 5 step process:

  • Step 1: Gathering Data
  • Step 2: Cleaning Data
  • Step 3: Data Analysis
  • Step 4: Model
  • Step 5: Testing and Analysing Model

Step 1: Gathering Data

The databases used are:

Labelling the data and analysising sentiments: The csv file contains manual labeling of sentiment words and manual analysis of sentiment. This has been recorded along with a sentiment analyser's output. [https://github.com/AnushaNathRoy/Depression-and-Anxiety-Prediction-on-Social-Media/blob/main/SentimentAnalysisData.csv]

Analysis and observations on sentiment analysis: This manual labelling gave a lot of insights on the drawbacks of automation of sentiment analysis and scopes for improvement. [https://github.com/AnushaNathRoy/Depression-and-Anxiety-Prediction-on-Social-Media/blob/main/SentimentAnalysis.pdf]

Step 2: Cleaning Data

Cleaning the given data for better prediction is an important step. The cleaning process used various tools and libraries to clean data by:

  • Removing stop words
  • Lemmatization (Coverting to Root Words)
  • Removing non-word charecters, single charecter, spaces , URLs, etc.

Step 3: Data Analysis

Data analysis of the cleaned data involved creating wordclouds. There are 3 wordclouds created for better data visualisation:

  • WordCloud on Depression Sentiments
  • WordCloud on Depressive + Negative Tweets
  • WordCloud on Positive Tweets

Step 4: Model

Key Steps:

  • Splitting data into train and test sets
  • Vectorizing input to input into model
  • Model Chosen: LogisticRegression

Step 5: Testing and Analysing Model

The observation made in this step can be summarised below:

          precision    recall  f1-score   support

      -1       0.93      0.70      0.80       430
       0       0.78      0.75      0.76    160202
       4       0.76      0.79      0.78    161431

accuracy                           0.77    322063
macro avg       0.82      0.75     0.78    322063
weighted avg     0.77      0.77    0.77    322063

The model accuracy is 0.7708491816818449.

Local Installation:

Download the databases and put them in the same directory as this project and Run Jupyter Notebook on this directory.

depression-and-anxiety-detection-on-social-media's People

Contributors

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