Skip to content

Brajesh2022/video-finder-algorithm

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Video Inspiration Finder 🎯

An intelligent YouTube video recommendation system that learns your preferences to suggest coding videos you'll love. Built with machine learning and featuring a beautiful web dashboard.

Python License Contributions welcome

🌟 Features

  • πŸ” Smart YouTube Search: Automatically finds trending coding videos using configurable search queries
  • πŸ€– Machine Learning Recommendations: RandomForest model learns your preferences from ratings
  • πŸ“Š Beautiful Web Dashboard: YouTube-like interface with AI confidence scores
  • πŸ”’ Privacy First: All data stored locally in SQLite - no external tracking
  • ⚑ One-Command Setup: Get started with a single command
  • πŸ“± Responsive Design: Works perfectly on desktop and mobile
  • 🎯 Real-time Learning: Model updates instantly as you rate more videos

πŸš€ Quick Start

Option 1: Web Dashboard (Recommended)

git clone https://github.com/yourusername/video-idea-finder-algorithm.git
cd video-idea-finder-algorithm
./setup.sh
# Select option 1 for Dashboard

Option 2: Command Line Interface

./setup.sh
# Select option 2 for CLI mode

The setup script will:

  1. Create a Python virtual environment
  2. Install all dependencies
  3. Help you configure your YouTube API key
  4. Launch your preferred interface

πŸ“‹ Prerequisites

βš™οΈ Configuration

  1. Get YouTube API Key:

    • Visit Google Cloud Console
    • Create a project or select existing one
    • Enable YouTube Data API v3
    • Create credentials (API key)
  2. Set up environment:

    # Copy the example environment file
    cp .env.example .env
    
    # Edit .env and add your API key
    YOUTUBE_API_KEY=your_actual_api_key_here
  3. Add your search queries:

    • Edit src/youtube/search.py in the get_coding_search_queries() function
    • Add search terms relevant to your interests
    • Example: "python machine learning", "react tutorial", etc.

πŸ—οΈ Project Structure

video-idea-finder-algorithm/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ database/           # SQLite database operations
β”‚   β”‚   β”œβ”€β”€ manager.py      # Database setup and schema
β”‚   β”‚   β”œβ”€β”€ video_operations.py    # Video data CRUD
β”‚   β”‚   └── preference_operations.py # User ratings CRUD
β”‚   β”œβ”€β”€ youtube/            # YouTube API integration
β”‚   β”‚   β”œβ”€β”€ search.py       # Video search functionality
β”‚   β”‚   β”œβ”€β”€ details.py      # Video metadata retrieval
β”‚   β”‚   └── utils.py        # Helper functions
β”‚   β”œβ”€β”€ ml/                # Machine learning pipeline
β”‚   β”‚   β”œβ”€β”€ feature_extraction.py  # Video feature engineering
β”‚   β”‚   β”œβ”€β”€ model_training.py      # ML model management
β”‚   β”‚   └── predictions.py         # Recommendation engine
β”‚   └── rating/            # Interactive rating system
β”‚       β”œβ”€β”€ display.py      # Video information display
β”‚       β”œβ”€β”€ session.py      # Rating session management
β”‚       └── user_input.py   # User interaction handling
β”œβ”€β”€ templates/             # Web dashboard frontend
β”‚   └── dashboard.html     # Single-page application
β”œβ”€β”€ main.py               # CLI application entry point
β”œβ”€β”€ dashboard_api.py      # Web API server
β”œβ”€β”€ run_dashboard.py      # Dashboard launcher
β”œβ”€β”€ search_more_videos.py # Additional video search utility
β”œβ”€β”€ setup.sh             # Automated setup script
β”œβ”€β”€ .env.example         # Environment template
└── README.md           # This file

🧠 How the AI Works

Feature Engineering

The system extracts 11 key features from each video:

  • Content Features: Title length, description length, keyword presence
  • Engagement Metrics: View count, like ratio, engagement score
  • Semantic Analysis: Title sentiment, tutorial/beginner/AI keyword detection
  • Behavioral Patterns: Time constraints, challenge keywords

Machine Learning Pipeline

  1. Data Collection: YouTube API provides video metadata
  2. Feature Extraction: Convert raw video data into numerical features
  3. User Feedback: Collect like/dislike ratings with optional notes
  4. Model Training: RandomForest classifier with 100 trees
  5. Prediction: Generate confidence scores for new videos

Learning Process

  • Cold Start: Shows random videos until you have 10+ ratings
  • Warm Start: AI model activates and provides personalized recommendations
  • Continuous Learning: Model retrains after each new rating

πŸ–₯️ Available Commands

# Full interactive setup
./setup.sh

# CLI-only mode
python main.py

# Web dashboard
python run_dashboard.py

# Search for additional videos
python search_more_videos.py

# Start API server directly
python dashboard_api.py

🎨 Dashboard Features

  • YouTube-like Interface: Familiar grid layout with thumbnails
  • AI Confidence Scores: See how confident the AI is about each recommendation
  • Real-time Feedback: Rate videos with instant visual feedback
  • Model Status: Track learning progress and training status
  • Liked Videos: Review your previously liked videos
  • Responsive Design: Perfect on any screen size

πŸ”§ Customization

Search Queries

Edit the search queries in src/youtube/search.py:

def get_coding_search_queries() -> List[str]:
    return [
        "python machine learning tutorial",
        "javascript react project",
        "web development 2024",
        # Add your own search terms
    ]

ML Model Parameters

Modify model settings in src/ml/model_training.py:

model = RandomForestClassifier(
    n_estimators=100,        # Number of trees
    max_depth=10,           # Tree depth
    min_samples_split=5,    # Minimum samples for split
    random_state=42
)

🀝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and test thoroughly
  4. Commit your changes: git commit -m 'Add amazing feature'
  5. Push to the branch: git push origin feature/amazing-feature
  6. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/yourusername/video-idea-finder-algorithm.git

# Create development environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run tests (if available)
python -m pytest

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • YouTube Data API v3 for video data
  • scikit-learn for machine learning capabilities
  • Flask for the web framework
  • SQLite for local data storage

πŸ“š Learn More

This project demonstrates several key concepts:

  • API Integration: YouTube Data API v3 usage
  • Machine Learning: Feature engineering and model training
  • Web Development: Flask API and responsive frontend
  • Database Design: SQLite schema and operations
  • DevOps: Environment management and deployment

Perfect for learning about ML-powered recommendation systems!

πŸ› Troubleshooting

Common Issues

API Key Issues:

  • Ensure your YouTube API key is valid and has quota remaining
  • Check that YouTube Data API v3 is enabled in Google Cloud Console

Database Issues:

  • Delete video_inspiration.db to reset the database
  • Run ./setup.sh again to reinitialize

Import Errors:

  • Activate the virtual environment: source venv/bin/activate
  • Reinstall dependencies: pip install -r requirements.txt

Port Conflicts:

  • Dashboard runs on port 5001 by default
  • Change the port in dashboard_api.py if needed

Need Help?

  • πŸ“§ Open an issue on GitHub
  • πŸ’¬ Check existing issues for solutions
  • πŸ” Review the troubleshooting section above

⭐ Found this helpful? Give it a star! ⭐

Built with ❀️ for the coding community

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 55.9%
  • HTML 38.3%
  • Shell 5.8%