How vsancnaj/hybrid-recommendation-system works
Main Components
• Data Layer:
• Raw Data Repository (“data/” directory containing CSV files like product_info.csv and various reviews datasets).
• Processed Data/Metadata (“metadata/” directory, e.g., products.csv and hybrid_similarity.pkl).
• Model and Processing:
• Jupyter Notebook (model.ipynb) used for training and evaluating the recommendation models and generating precomputed similarity metrics.
• The hybrid recommendation engine that integrates both item-based collaborative filtering and content-based filtering.
• Service Layer:
• Flask API (api.py): Exposes recommendation endpoints (e.g. http://127.0.0.1:5000/recommend) that process user requests and return tailored recommendations.
• Streamlit Web App (app.py): Provides a user-friendly interface enabling users to select products and view recommendations.
• Environment/Infrastructure:
• Virtual Environment (skincare/ directory) and dependency management via requirements.txt.
Relationships and Interactions
• Data Flow:
• The raw data in the “data/” directory is processed (likely in model.ipynb) to produce a clean dataset and a similarity matrix stored in the “metadata/” directory.
• The recommendation model takes these processed inputs to compute hybrid recommendations.
• Cross-Component Communication:
• The Flask API, using the processed model outputs (from “metadata/”), provides endpoints that return recommendations upon HTTP requests.
• The Streamlit application acts as a client to the API, allowing users to interact with the system.
Architectural Patterns and Design Principles
• Separation of Concerns: Different components are clearly divided by functionality (data ingestion/processing, model training, API service, front-end interface).
• Modularity: By having separate modules (Flask for API and Streamlit for UI), the system supports independent improvement, troubleshooting, or scaling.
• Hybrid Recommendation Logic: Emphasizes the integration of collaborative filtering and content-based methods, which could be annotated as part of the model component.
Relevant Technologies & Frameworks
• Python-based development (indicated by .py files and Jupyter Notebook).
• Flask for building RESTful API services.
• Streamlit for a rapid web-based interface.
• Data processing libraries (likely pandas, possibly scikit-learn or NLP libraries for handling text features) as mentioned in the README.
Detailing the Essential Architectural Elements
• Individual modules and their interactions. For instance:
• That the Flask API is the middleware that bridges the data/model outputs with user interactions, and that the Streamlit web app is built on top of this API.
• Two-pronged approach of recommendations (item-based vs. content-based) by adding side notes or sub-components under the “Recommendation Model”.