mo-mittal's picture
Upload README.md
fb44eb6 verified
|
raw
history blame
No virus
3.68 kB

Reddit Political Discourse Dataset

Data Source

Pushshift Archive: Pushshift is a social media data collection, analysis, and archiving platform that has collected Reddit data since 2015, offering real-time updates as well as historical data dating back to Reddit's inception.

Dataset Description

This dataset is a curated collection of posts from 9 prominent US politics-oriented subreddits known for their wide range of political views. The selected subreddits include: r/politics, r/democrats, r/Conservative, r/The_Donald (now banned), r/SandersForPresident, r/JoeBiden, r/LateStageCapitalism, and r/socialism.

Data Collection

The dataset comprises the top posts from the selected subreddits for each year starting from 2014. The raw data files from Pushshift were processed to enhance manageability and accessibility.

Dataset Structure

Each row in the dataset represents a single post and includes the following columns:

  • Author
  • Created UTC
  • Domain
  • Title
  • Selftext
  • Subreddit
  • Score
  • Number of Comments
  • Ups
  • Downs
  • Permalink
  • Is Self
  • URL
  • Subreddit Subscribers
  • Upvote Ratio
  • Is Original Content
  • Media
  • Selftext HTML
  • Author Flair Text
  • Link Flair Text
  • Image Text (generated feature, explained below)

URL Content Processing

The dataset includes a URL attribute, which can point to an image or an external article. The content from these URLs is processed to extract textual information, which enriches the dataset with additional context for each post. Here's an overview of how the URLs are handled:

  1. Image URLs: For URLs that point to images (identified by their file extension), the image is downloaded to a local directory. Each image is then validated to ensure it is properly formatted and not corrupt. If valid, optical character recognition (OCR) is performed on the image using pytesseract, converting any text in the image into a string.

  2. Article URLs: For URLs presumed to point to articles (not ending in typical image file extensions), a heuristic is applied to extract meaningful text directly from the URL itself. This involves parsing the URL's path, extracting segments, and replacing common URL encodings (such as hyphens and underscores) with spaces to form a readable string.

  3. Text Inclusion: The extracted text, whether from images or article URLs, is then associated with the corresponding post entry in the dataset. This provides an expanded dataset where users can analyze not only the metadata of the Reddit post but also content referenced by external links.

This process is designed to handle a wide range of content types and to be robust against common issues such as download errors or invalid image files. It enhances the dataset by providing a more comprehensive view of the post's content and the discourse it is a part of.

Impact

The political discourse on Reddit provides a rich landscape for research. This dataset not only contains textual content but also images (linked via the 'url' attribute) and sometimes links to external articles, offering a diverse mix of content that can help analyze and understand the propagation of political discourse.

Limitations

The dataset is a subset of top posts and does not represent the entirety of posts within the selected subreddits. Comments can potentially be harvested using the 'permalink' attribute and OAuth procedures, which may be included in future updates. Some images and articles have not been processed due to authentication issues with Imgur and other cases where content has been removed or banned.

License

Citation

Changelog

Contact Information