Users land on the main interface and choose to start a new analysis.
User selects the platform: Reddit, Instagram, or Twitter/X.
User inputs a public profile ID for analysis.
Optional login for storing analysis history.
Simple registration form for account creation.
Visual trends over time for abnormality and negative sentiment.
Each scraped post includes sentiment scores and abnormality probability.
Full analysis summary showing verdict, average sentiment, abnormality %, and graphs.
List of all previous analyses with quick metrics and PDF download links.
Professional PDF generated summarizing the analysis with charts.
MindSpace is a full‑stack web application that analyzes public social media posts for abnormality (risk) indicators and sentiment. It uses a dual‑engine approach (custom Naïve Bayes abnormality model + NLTK VADER sentiment scores) to produce interactive charts, per‑post breakdowns, and downloadable PDF reports. Registered users can save and revisit analysis history.
Platform & Scraping
• Reddit, Instagram, Twitter/X scraping (public posts)
• Platform selector modal for quick analysis
Analysis & ML
• Custom Naïve Bayes abnormality model (model_nb.pkl)
• VADER sentiment (neg/pos/neu)
• Per‑post probability + sentiment tags
UI & Reports
• Interactive time series & bar charts
• Per‑post cards with sentiment chips
• Downloadable, printable PDF reports
• Light + Dark UI themes
User & History
• Registration & login
• Saved analyses with thumbnails and PDF links
• Timestamps and platform metadata
Frontend: HTML, Bootstrap, JS (charts via Chart.js / Matplotlib for PDFs)
Backend: Python (Flask)
ML: scikit‑learn (Naïve Bayes), NLTK VADER
DB: PostgreSQL / SQLite
PDF: Matplotlib + ReportLab
Scraping: AsyncPRAW, Apify, Playwright (where applicable)
git clone https://github.com/SanjayMarathi/MindSpace.git
cd MindSpace
python -m venv venv
# activate venv
source venv/bin/activate # mac/linux
# or .\venv\Scripts\activate # windows
pip install -r requirements.txt
python app.py # or `flask run` depending on entrypointEnvironment: create a .env with keys for any third‑party scraping services and DB connection string.
- Open the app in a browser.
- Click Start New Analysis → choose platform → enter a public username/profile URL.
- Wait for scraping and model processing — results page shows charts, per‑post cards and a PDF export button.
- Register / log in to save the analysis to your history.
Example analysis URL:
http://127.0.0.1:5000/analyze?platform=reddit&user=example_user
MindSpace/
├── app.py
├── requirements.txt
├── models/
│ └── model_nb.pkl
├── static/
├── templates/
│ ├── index.html
│ ├── results.html
│ ├── history.html
│ └── report_pdf.html
├── scrapers/
│ ├── reddit_scraper.py
│ ├── instagram_scraper.py
│ └── twitter_scraper.py
└── utils/
├── pdf_utils.py
└── viz_utils.py
- Keep screenshots in
outputs/for README rendering on GitHub. - Place ML model files in
models/and load them from the analysis pipeline. - When deploying, ensure Matplotlib fonts are available to avoid PDF rendering issues.
- Respect platform scraping policies and rate limits — use official APIs where required.
Sanjay Marathi
GitHub: https://github.com/SanjayMarathi









