Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Media AI Sentiment Analysis

This repository contains Python files for generating synthetic social media post data and analyzing the dataset.

Features

  • Data Generation: Generate synthetic data to perform analysis on.
  • Data Analysis:
    • Generate summary of the data.
    • Plot data in many different ways.
    • Analyze how data visualization can be misleading when focused on one subset of the data.
  • Prediction using Linear Regression
    • Use sklearn's Linear Regression to predict future sentiments on historical data.

Setup Instructions

1. Install the required libraries. You can install the necessary libraries by running the following command:

pip install -r requirements.txt

2. Generate the dataset The dataset can be generated by running the generate.py file. A generated dataset "posts.db" comes included with 10000 observations.

  • database_size Number of observations in the generated database.
  • percent_twitternegative Percentage of posts to generate with "Negative" sentiment on "Twitter" platform.
  • percent_instanegative Percentage of posts to generate with "Negative" sentiment on "Instagram" platform.
  • percent_facebooknegative Percentage of posts to generate with "Negative" sentiment on "Facebook" platform.
  • start_year Starting year for dataset.
  • end_year Ending year for dataset.
  • pos_increase How intense the number of positive posts increases per year. Higher = bigger increase. Number between 0 and 1, can be negative as well.

3. Generate data summary To gain a general overview of the data, run the summary() function in main.py. This will create a .txt file called "summary.txt" which contains general information about the data. A summary.txt file comes already included on the generated dataset.

4. Generate plots To better understand the generated data, run the plot_data() function in main.py.

5. Run predictions using Linear Regression with sklearn To see how social media sentiments might change in the future based on historical data, run the predict_future() function in main.py.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages