A next-generation multimodal social media analytics platform for real-time insights and AI-powered analysis.
- Features
- Quick Start
- Installation Guide
- Configuration
- Usage
- Project Structure
- API Documentation
- Development Guide
- Testing & CI
- Troubleshooting
- Contributing
- License
- Acknowledgments
- Contact & Support
| Platform | Capabilities | Status |
|---|---|---|
| Posts, comments, metadata, subreddit analysis | β Active | |
| Tweets, user interactions, engagement metrics | β Active | |
| YouTube | Video content, comments, viewer statistics | β Active |
| Telegram | Channel messages, group analytics | π§ Planned |
| Posts, stories, engagement data | π§ Planned |
- Sentiment Analysis β multi-dimensional classification with confidence scores.
- Emotion Detection β joy, anger, sadness, fear, surprise.
- Trend Detection β real-time trend identification and short-term prediction.
- Entity Recognition β people, organizations, locations, products.
- Relationship Extraction β graph connections among entities.
- Anomaly Detection β statistical outlier and spike detection.
- Controversy Scoring β scale 0β1 to measure controversiality.
- RAG Chatbot β context-aware question answering over collected corpora.
- Vector Database β embeddings + FAISS for fast similarity search.
- Natural Language Queries β ask in plain English.
- Conversation Memory β maintain short-term chat history for context.
- Dynamic Dashboards β interactive, real-time charts.
- Sentiment Heatmaps β geographic and temporal visualization.
- Cross-Platform Comparison β side-by-side metrics across platforms.
- Export Options β PDF, CSV, JSON, PNG.
# Python 3.8+
python --version
# pip
pip --versiongit clone https://github.com/yourusername/multiverse-insights.git
cd multiverse-insights
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt# start streamlit UI
streamlit run streamlit_app.py
# then open http://localhost:8501git clone https://github.com/yourusername/multiverse-insights.git
cd multiverse-insights# Create virtual environment
python -m venv venv
# Activate (Linux/Mac)
source venv/bin/activate
# Activate (Windows)
venv\Scripts\activate# Install all required packages
pip install -r requirements.txt
# Verify installation
pip list# Create models directory
mkdir -p models
# Download Qwen model (example - change to actual model URL)
wget https://huggingface.co/unsloth/Qwen2.5-VL-7B-Instruct-GGUF/resolve/main/Qwen2.5-VL-7B-Instruct-Q5_K_M.gguf
# Verify model download
ls -la models/# Copy example configuration
cp config/config.example.json config/config.json
# Edit configuration file
nano config/config.json # or use your preferred editor| File | Purpose | Location |
|---|---|---|
twitter_cookies.json |
Twitter authentication | Project root |
youtube_cookies.json |
YouTube authentication | Project root |
config/config.json |
Application settings | config/ directory |
Security note: keep cookies and credentials out of version control. Use .gitignore and environment variables for secrets.
{
"models": {
"qwen_model_path": "models/Qwen2.5-7B-Instruct.Q5_K_M.gguf",
"embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
"max_tokens": 4096,
"temperature": 0.7
},
"vector_db": {
"path": "temp_vector_db",
"chunk_size": 1000,
"overlap": 200
},
"scraping": {
"max_results": 100,
"rate_limit": 60,
"timeout": 30
},
"ui": {
"theme": "dark",
"auto_refresh": false,
"cache_enabled": true
}
}- Log in to Twitter in your browser.
- Open Developer Tools (F12) β Application/Storage.
- Copy cookies as JSON and save as
twitter_cookies.json.
This section follows the Table of Contents order: Data Collection β Data Analysis β Chat Interface β Exporting & Examples.
- Choose platform β enter query β set date range β click Search.
- Results are shown for inspection; select Analyze to run the pipeline and visualize results.
graph TD
A[Select Platform] --> B[Enter Query]
B --> C[Set Date Range]
C --> D[Click Search]
D --> E[View Results]
E --> F{Choose Action}
F -->|Analyze| G[Analysis View]
F -->|Chat| H[Chat Interface]
- Navigate to Custom File Analysis tab.
- Upload JSON file (max 100MB).
- Select analysis type.
- Click Process and view results.
graph LR
A[Data Input] --> B[Preprocessing]
B --> C[Feature Extraction]
C --> D[Analysis Engine]
D --> E[Visualization]
E --> F[Export Results]
- Executive Summary β AI-generated overview.
- Sentiment Analysis β emotional breakdown per platform/time.
- Topic Modeling β identify key themes.
- Entity Extraction β named entity recognition with context.
- Anomaly Detection β detect spikes and outliers.
- Controversy Scoring β measure contentiousness of content.
| Query Type | Example | Expected Output |
|---|---|---|
| Topic Query | "What are the main topics?" | List of top topics + descriptions |
| Sentiment Query | "How do people feel about X?" | Sentiment breakdown with percentages |
| Entity Query | "Who are the key people mentioned?" | List of entities with context |
| Summary Query | "Summarize the findings" | Concise overview of insights |
- Natural language questions.
- Context awareness and limited short-term memory for conversation.
- Real-time responses based on processed data.
- History tracking / session export.
- Export charts & tables as PNG/CSV/JSON/PDF from every analysis view.
- Executive summaries available as downloadable PDF.
multiverse-insights/
βββ streamlit_app.py # Main Streamlit application
βββ ui_components.py # UI components and functions
βββ data_scrapers.py # Social media data collection
βββ utils1.py # Utility functions
βββ rag_chatbot.py # RAG-based chatbot
βββ requirements.txt # Python dependencies
βββ config/ # Configuration files
β βββ config.example.json # Example configuration
β βββ config.json # Active configuration
βββ models/ # Model files
β βββ Qwen2.5-7B-Instruct.Q5_K_M.gguf
βββ temp_vector_db/ # Temporary vector database
βββ docs/ # Documentation
βββ tests/ # Test files
βββ examples/ # Example data files & sample JSON
βββ README.md # This file
| Component | Primary Functions | Dependencies |
|---|---|---|
streamlit_app.py |
Main application logic, routing | All other modules |
ui_components.py |
UI rendering, interactive elements | streamlit, plotly |
data_scrapers.py |
Platform-specific data extraction | selenium, requests |
utils1.py |
Data processing, helper functions | pandas, numpy |
rag_chatbot.py |
RAG-based chatbot | transformers, faiss |
def scrape_reddit_data(query: str, subreddit: str = None, limit: int = 100) -> Tuple[str, str]:
"""
Scrape Reddit data for given query
Args:
query: Search query string
subreddit: Specific subreddit to search (optional)
limit: Maximum number of posts to retrieve
Returns:
Tuple of (filename, error_message)
"""def scrape_twitter_data(query: str, start_date: str = None, end_date: str = None) -> Tuple[str, str]:
"""
Scrape Twitter data for given query and date range
Args:
query: Search query string
start_date: Start date in YYYY-MM-DD format
end_date: End date in YYYY-MM-DD format
Returns:
Tuple of (filename, error_message)
"""def scrape_youtube_data(query: str, max_results: int = 10) -> Tuple[str, str]:
"""
Scrape YouTube data for given query
Args:
query: Search query string
max_results: Maximum number of videos to retrieve
Returns:
Tuple of (filename, error_message)
"""def analyze_sentiment(text: str) -> Dict[str, Any]:
"""
Analyze sentiment of given text
Returns:
Dictionary with sentiment scores and explanations
"""def extract_entities(text: str) -> List[Dict[str, str]]:
"""
Extract named entities from text
Returns:
List of dictionaries with entity information
"""Tip: Add explicit JSON schema documents to
docs/schema.mdfor each scraper and the output shape. This reduces ambiguous formats and speeds up onboarding.
# Clone repository
git clone https://github.com/yourusername/multiverse-insights.git
cd multiverse-insights
# Create development environment
python -m venv dev_env
source dev_env/bin/activate
# Install development dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install- Create a scraper module (e.g.
scraper_<platform>.py) and implementscrape_<platform>. - Update UI components to surface the platform in
ui_components.py. - Add a configuration entry under
config/config.example.json.
Example function stub:
def scrape_new_platform(query: str, **kwargs) -> Tuple[str, str]:
"""
Scrape data from new platform
Args:
query: Search query
**kwargs: Platform-specific parameters
Returns:
Tuple of (filename, error_message)
"""
# Implementation here
pass# Run tests
pytest
# Run specific tests
pytest tests/test_scrapers.py
# Coverage
pytest --cov=. --cov-report=html# Format code
black .
# Lint
flake8 .
# Type checks
mypy .lintβ runblack,flake8.testβ runpytestand coverage report.buildβ smoke test including model path check (no model downloads in CI unless cached).releaseβ optional: publish artifacts on release tags.
Add GH Actions badges to the top of the README after configuring the workflows.
| Issue | Solution |
|---|---|
ModuleNotFoundError |
Activate venv and re-run pip install -r requirements.txt |
| Permission denied | Use pip install --user or check permissions |
| Model download fails | Check network, disk space. Use a download mirror or proxy if needed |
| Chatbot not responding | Verify config.json model paths and vector DB location |
| Scraping errors | Refresh cookies, handle new site layouts, respect rate limits |
| Out-of-memory | Reduce chunk sizes, enable streaming, increase instance memory |
export DEBUG=true
streamlit run streamlit_app1.py --logger.level=debug- Use
st.cache_datafor repeated preprocessing andst.cache_resourcefor loaded models. - Tune
vector_db.chunk_sizeandoverlapfor memory/perf tradeoffs. - Consider lightweight embedding models for CPU-only deployments and GPU variants for production throughput.
graph TD
A[Fork Repository] --> B[Create Feature Branch]
B --> C[Write Code]
C --> D[Add Tests]
D --> E[Run Tests]
E --> F{Tests Pass?}
F -->|Yes| G[Commit Changes]
F -->|No| H[Fix Issues]
H --> E
G --> I[Push to Fork]
I --> J[Create Pull Request]
J --> K[Code Review]
K --> L[Merge to Main]
- Follow PEP8.
- Document all public functions with docstrings.
- Add tests for new scrapers and major logic.
- Keep secrets out of PRs.
- Use conventional commits.
- PR and Issue templates are located in
.github/.
This project is licensed under the MIT License. See the full license text below.
MIT License
Copyright (c) 2024 Multiverse Insights
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Core technologies:
- Streamlit β web UI
- Hugging Face β pre-trained models
- Sentence Transformers β text embeddings
- FAISS β vector similarity search
- Qwen β language model
Thanks to contributors and early testers.
- Documentation / Wiki: https://github.com/Prathameshsci369/Multiverse-Insights/wiki
- Issues: https://github.com/Prathameshsci369/Multiverse-Insights/issues
- Maintainer: Prathamesh Anand β prathameshsci963@gmail.com
