YT Comment Sentiment - Backend Side¶
Technology | Description |
---|---|
A Python library for building and training machine learning models. | |
A collaboration platform for machine learning, hosting data and MLflow models. | |
A platform to manage the ML lifecycle, including model tracking and deployment. | |
A modern web framework for building APIs with Python, known for its speed. | |
A Python library for data validation. Used to validate API data. | |
A testing framework for Python, used to test the FastAPI application. | |
An API to access and manage YouTube video data, including comments. | |
A cloud platform for hosting APIs, websites, and applications. |
What I followed to know?¶
Important
- As I am learning Python, Data Science and Machine Learning for more than 3 years. I don't have to look around to learn new things to build this. This part is kind of easy for me.
- But as I said earlier, the documentations and ChatGPT is most important resources you can onto.
- Need to get an API key from Google Developer Console to interact with YouTube Data API.
- Need to create an account on DagsHub to store/track MLFlow experiments and models.
- Created a DVC pipeline to run the MLFlow experiments seemlessly using
dvc repro
command. - After creating the FastAPI app, I've used
pytest
to test it and also setup apre-commit
for it. - Deployment on render.com.
What type of problems I have faced?¶
Render.com¶
-
As I have used
uv
to manage my project but render.com doesn't supportuv
out-of-the-box so I have usedpip
to useuv
for dependencies installation. -
Also, render.com only serve apps on port under
$PORT
env (which10000
most of the times) so make sure to explicitly provide while running app throughuvicorn
orfastapi-cli
CLI.
Docker¶
-
I am using
wordcloud
to create a plot in a FastAPI route. While building docker image FROMpython:3.11-slim
image, I am getting error becausewordcloud
package needsgcc
package to build wheels. So you need to explicitly installgcc
before installwordcloud
as python package. -
Also use multi-stage builds in
Dockerfile
to reduce the image size. Seeuv
docs.