Skip to content

zweatshirt and SquatchOut1. Takes file of subreddit posts/urls and scrubs the comments out of the html, then analyzes the sentiments of the comments (pos., neutral, neg.) and graphs the sentiments per post.

Notifications You must be signed in to change notification settings

zweatshirt/reddit_sentiment_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 

Repository files navigation

Reddit Comments Sentiment Analysis

Authors: Alex Wernex and Zachery Linscott

This is a program to download the HTML pages of multiple URLs pointing to Reddit posts.

How it works:

  1. Each URL is read from a file that the user of the program provides a path to.
  2. The raw HTML of each URL is then put into separate files.
  3. From there the HTML is "scrubbed" to extract the comments from the subreddit.
  4. The cleaned comments are stored in files unique to each post.
  5. The comments files are scanned and sentiment analysis is performed on each comment.
  6. Once the sentiments are gathered, they are also put into their own files, unique for each Reddit post.
  7. Each sentiment file is then put into its own bar graph.
    • The user can visually see the num of pos., neg., and neutral comments.
  8. These graphs appear and are stored in a folder as well.

How to Use

  1. Ensure you are in the correct directory.

  2. Make sure to download the environment from requirements.yaml to make sure you have the appropriate libraries.

    • If you don't, no biggie, the program will just take a little longer, to install the dependencies during runtime.
  3. Run in the terminal using python passing the file of urls you wish to gather comments from as an argument, e.g.: python run.py yourfilepath/yourfilename

  4. Finally when you are finished viewing the graphs, exit out of all of the windows to end the program. Don't worry, all of the graphs will still be in the plots folder as pictures.

About

zweatshirt and SquatchOut1. Takes file of subreddit posts/urls and scrubs the comments out of the html, then analyzes the sentiments of the comments (pos., neutral, neg.) and graphs the sentiments per post.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages