Built with: Python, NumPy, Pandas, Seaborn, Matplotlib, Plotly, NLTK, scikit-learn, Pickle, Streamlit Tools: Jupyter Notebook, Spyder, Docker, Heroku Website: news-article-recommender.herokuapp.com
Goal: Recommend articles that best fit user preferences.
- Developed a web scraper using Cypress to retrieve story details from The New Yorker website.
- Fetches 90 news articles daily and appends new articles every other day.
- Automated web scraping with a CI/CD pipeline.
- Made pipeline OS-independent using Cypress Docker containerization.
- Employed TF-IDF and Word2Vec embeddings for article recommendations.
- Found Word2Vec performed better in capturing semantic similarity.
- Deployed the application on Heroku and Docker for ease of access.
A modern web application that recommends news articles based on a headline input using FastAPI and TF-IDF similarity, with a clean HTML/CSS/JavaScript frontend.
- Enter a news headline and get real-time article recommendations.
- Backend powered by FastAPI with efficient similarity computations using scikit-learn.
- Minimalistic frontend using plain HTML, CSS, and JavaScript for a responsive user experience.
- Fully containerized with Docker for portability and ease of deployment.
- Easily deployable locally or on cloud platforms like Google Cloud Run.
├── Backend/ # FastAPI backend API code
├── Frontend/ # HTML, CSS, and JavaScript frontend files
├── Pickle/ # Serialized data and TF-IDF model pickle files
├── Dockerfile # Docker configuration for containerizing the app
├── README.md # Project documentation (this file)
└── requirements.txt # Python dependencies (optional)
- Python 3.7 or higher
- Docker (for containerized deployment)
- (Optional) Google Cloud SDK for deployment to Cloud Run
-
Install required Python packages:
pip install fastapi uvicorn scikit-learn pandas numpy python-multipart
-
Start the FastAPI backend server:
uvicorn Backend.app:app --reload --port 8080
-
Open
Frontend/index.htmlin your browser to access the UI.
-
Build the Docker image:
docker build -t news-recommendation-app . -
Run the container locally:
docker run -p 8080:8080 news-recommendation-app
-
Open http://localhost:8080 in your browser.
-
Configure your GCP project and build the Docker image:
gcloud config set project YOUR_PROJECT_ID docker build -t gcr.io/YOUR_PROJECT_ID/news-recommendation-app . docker push gcr.io/YOUR_PROJECT_ID/news-recommendation-app
-
Deploy the container to Cloud Run:
gcloud run deploy news-recommendation-app \ --image gcr.io/YOUR_PROJECT_ID/news-recommendation-app \ --platform managed \ --region YOUR_REGION \ --allow-unauthenticated \ --port 8080 -
Access your deployed app via the URL provided by Cloud Run.
- FastAPI — Fast and modern web API framework
- scikit-learn / nltk — TF-IDF vectorization and cosine similarity calculations
- HTML / CSS / JavaScript — Frontend user interface
- Docker — Containerization for consistent environments
- Google Cloud Run — Serverless container hosting (optional cloud deployment)