How joelreji/blogcommentsprediction works
Main Components
• Data Collection & Ingestion:
• BlogScraping.ipynb: Uses the PRAW API for scraping Reddit data.
• refreshtoken.py: A utility module to manage authentication (refresh token) so that the Reddit API interaction can be maintained reliably.
• Data Preparation & Feature Engineering:
• bagofWords_Reddit.ipynb: Responsible for generating 200 bag-of-words features using the data from RedditData.csv (and possibly the supplemented reddit_data_with_bow.xlsx).
• Modeling and Evaluation:
• blog_test_data.ipynb: Used to build initial models using original blog test data.
• RedditModeling.ipynb: Performs base and final modeling using the features; reddit-final.csv is mainly consumed here.
• Data Sources:
• CSV and Excel files (RedditData.csv, reddit-final.csv, reddit_data_with_bow.xlsx) provide the raw and processed datasets.
• Data set reference: The UCI BlogFeedback dataset mentioned in the README is the external source of the original data utilized in this project.
Relationships and Interactions
• Data flow starts with the external data source (UCI BlogFeedback) and live data extracted via the Reddit API.
• The authentication utility (refreshtoken.py) facilitates secure data scraping.
• BlogScraping.ipynb collects data from Reddit and outputs scraped features that might later be enriched or combined.
• The output data from the scraping process (e.g., RedditData.csv) is then processed for feature engineering in bagofWords_Reddit.ipynb.
• The newly engineered features (bag-of-words) along with the raw features support the downstream modeling work in blog_test_data.ipynb and RedditModeling.ipynb.
• The final refined dataset (reddit-final.csv) is used to train, validate, and compare models.
Architectural Patterns and Technologies
• Pipeline Pattern: The project follows a sequential data science pipeline from data ingestion to feature engineering and finally to modeling.
• Modularity: Different notebooks clearly separate concerns (e.g., data scraping vs. feature extraction vs. modeling).
• Technologies: Python (Jupyter Notebooks) for interactive computing, the PRAW API for Reddit data scraping, and common machine learning libraries likely utilized in these notebooks (even though not explicitly listed, expect libraries such as pandas, scikit-learn, etc.).
• Reusability: The refreshtoken.py module is an example of modular code designed to be reusable for API authentication.