How asphyxiaovo/anime-recommendation-api works
This repository provides an anime recommendation API backed by a content-based recommender, plus an offline training and evaluation workflow. API clients request health, anime details, or similar titles; the API delegates to the recommender, which loads a saved bundle or builds one from the catalog, then ranks items by cosine similarity. Offline, training settings drive catalog loading, TF-IDF bundle creation, similarity evaluation, and artifact logging. The excerpts establish these calls and configuration references; some artifact and dataset connections are inferred from explicit paths, while unsampled internals are not expanded.
Main entry points: train_content_based.py Training Workflow · recommender.py Anime Recommender · main.py API Routes · pipeline.py Feature Pipeline
Components 12
Recommendation API
- API Routes
app/main.py - Response Schemas
app/schemas.py - Runtime Settings
app/core/config.py
Recommendation Runtime
- Anime Recommender
app/services/recommender.py
Model Training
- Feature Pipeline
training/pipeline.py - Training Workflow
training/train_content_based.py - Similarity Evaluation
training/evaluate.py
Data and Tracking
- Anime Catalog
data/external/anime_catalog.csv - Model Bundle
models/production - Training Config
experiments/configs/content_based.yaml
Other components
- API Client
- MLflow Tracking
Connections 14
- API Client → API Routes: requests
- API Routes → Anime Recommender: dispatches
app/main.py - API Routes → Runtime Settings: reads defaults
app/main.py - API Routes → Response Schemas: returns typed
app/main.py - Anime Recommender → Runtime Settings: reads paths
app/services/recommender.py - Anime Recommender → Feature Pipeline: builds fallback
app/services/recommender.py - Anime Recommender → Model Bundle: loads artifact
app/services/recommender.py - Anime Recommender → Anime Catalog: loads fallback data
app/services/recommender.py - Feature Pipeline → Anime Catalog: reads CSV
training/pipeline.py - Training Workflow → Training Config: loads settings
training/train_content_based.py - Training Workflow → Feature Pipeline: builds and saves
training/train_content_based.py - Training Workflow → Similarity Evaluation: evaluates bundle
training/train_content_based.py - Training Workflow → MLflow Tracking: logs run
training/train_content_based.py - Training Workflow → Model Bundle: writes artifact
training/train_content_based.py