Skip to content

nemat-al/Social-Media-Monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social-Media-Monitoring

Social Media Monitoring /Twitter/ in python language.


Index

  1. About the project
  2. Requirements
  3. Social Media Monitoring Steps
  4. Data Processing
  5. Sentiment Analysis with RNN

About the project

The main goal of this project is to scrape data from Twitter for a specific brand or product and try to classify the tweets sentimatically as negative or positive tweets.


Requirements

Here is a list of some of the used libraries:

  1. d2l: for building the sentiment analysis model.
  2. demoji: for replacing the emojis in tweets with their description.
  3. snscrape: a library to scrap tweets.
  4. Nltk: for natural language processing.

Social Media Monitoring Steps

In the following figure we can see the main steps of the project: First of all we should select a string to search for, then we need to scrape Twitter for posts containing that string. After that, the data will be cleaned, analyzed and presented in a way to show what sentiments are included in the tweets.

alt text


Data Processing

After scrapping data from Twitter. The following preprocessing pipeline will be apllied :

  1. Cleaning signs:
  • Replacing emojis with their description.
  • Data collected the web and specially from social media platform contain links and signs like (#) and (@)., we remove those signs.
  • It is important to delete the links, since no sentiments can be discovered from the link text.
  • Deleting punctuation marks and any non-Asci chars.
  1. NLP cleaning:
  • We keep only English texts.
  • Remove all the occurrences of the word that we have searched for.
  • The names will be kept and other tokens will be transformed to their lemmas. The Data processing pipeline is shown in the following figure:

image


Sentiment Analysis with RNN

The idea is to represent each token using the pretrained GloVe model, and feed these token representations into a multilayer bidirectional RNN to obtain the text sequence representation, which will be transformed into sentiment analysis outputs.

The sentiment analysis model is inspired from: https://d2l.ai/chapter_natural-language-processing-applications/sentiment-analysis-rnn.html

Releases

No releases published

Packages

No packages published