Skip to content

Sentiment analysis for depression based on Twitter posts ๐Ÿ“Š [finished]

Notifications You must be signed in to change notification settings

weronikazak/depression-tweets

Repository files navigation

Depression Tweets Analysis ๐Ÿ“Š

Depression is a common illness worldwide, with more than 264 million people affected. Depression is different from usual mood fluctuations and short-lived emotional responses to challenges in everyday life. Especially when long-lasting and with moderate or severe intensity, depression may become a serious health condition. It can cause the affected person to suffer greatly and function poorly at work, at school and in the family. At its worst, depression can lead to suicide. Close to 800 000 people die due to suicide every year. Suicide is the second leading cause of death in 15-29-year-olds.
-- WHO

Sentiment analysis for depression based on Twitter posts. The aim of this project is to analyze linguistic markers in social media posts and creating a model that can give an invidual insight into user's mental mealth.

Big shoutout to twintproject for their handy tweets scraping tool - Twint.

Models

Tensorflow

To detect whether the post contains anxious linguistic markers, using the Tensorflow library I builded a CNN of a simple architecture with a summary shown below.

In the end the model had accuracy of 96.98% and the loss of 0.14%.

Sklearn

An approach to try different classifiers available in Sklearn library, such as:

  • KNeighborsRegressor(K-nn)
  • Lasso
  • Ridge
  • ElasticNet
  • GradientBoostingRegressor
  • RandomForestRegressor
  • ExtraTreesRegressor


From left to right: R^2 score, Mean Squared Error, Mean Absolute Error

The RandomForestClassifier turnt out to be the best among them with final score of 99.19% accuracy, so even better than neural network.

About

Sentiment analysis for depression based on Twitter posts ๐Ÿ“Š [finished]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published