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 reprocommand. - After creating the FastAPI app, I've used
pytestto test it and also setup apre-commitfor it. - Deployment on render.com.
What type of problems I have faced?¶
Render.com¶
-
As I have used
uvto manage my project but render.com doesn't supportuvout-of-the-box so I have usedpipto useuvfor dependencies installation. -
Also, render.com only serve apps on port under
$PORTenv (which10000most of the times) so make sure to explicitly provide while running app throughuvicornorfastapi-cliCLI.
Docker¶
-
I am using
wordcloudto create a plot in a FastAPI route. While building docker image FROMpython:3.11-slimimage, I am getting error becausewordcloudpackage needsgccpackage to build wheels. So you need to explicitly installgccbefore installwordcloudas python package. -
Also use multi-stage builds in
Dockerfileto reduce the image size. Seeuvdocs.