Spaces:
Sleeping
Sleeping
Download pages/1_Data_Overview.py from Srikanth0804/Sentiment_Analysis: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/Srikanth0804/Sentiment_Analysis/resolve/main/pages/1_Data_Overview.py
- Command line
-
hf download hf://spaces/Srikanth0804/Sentiment_Analysis/pages/1_Data_Overview.py
-
curl -L -o 1_Data_Overview.py https://huggingface.co/spaces/Srikanth0804/Sentiment_Analysis/resolve/main/pages/1_Data_Overview.py
1.1 kB
| import streamlit as st | |
| st.title("π Data Collection & Preprocessing") | |
| st.markdown(""" | |
| ### π **YouTube Comment Extraction** | |
| β Used **YouTube Data API v3** via the **requests** library and **API Key** authentication | |
| πΉ Extracted comments from 150+ video IDs across balanced sentiment categories: | |
| π’ **Positive:** "heartwarming reunion", "feel good moments" | |
| π΄ **Negative:** "controversial incident", "bad customer experience" | |
| βͺ **Neutral:** "tech reviews", "travel vlogs" | |
| π Gathered over **15,000** top-level comments using pagination (nextPageToken) | |
| πΎ Data saved into a **JSON** format with keys: **video_id** and **comment** | |
| --- | |
| ### π§Ή **Text Preprocessing Steps** | |
| β Removed HTML tags, emojis, special characters, and links | |
| π‘ Converted text to lowercase | |
| π§½ Removed stopwords and non-alphabetic tokens | |
| π§ Applied **tokenization** | |
| The cleaned text was used to train our **sentiment classifier** in the next step. | |
| --- | |
| """) | |
| if st.button("Next"): | |
| st.switch_page("pages/2_Model_Training.py") | |
| if st.button("Go to Home"): | |
| st.switch_page("app.py") |