Skip to content

Commit 16f34db

Browse files
committed
update
1 parent c3b1a41 commit 16f34db

File tree

5 files changed

+163
-31
lines changed

5 files changed

+163
-31
lines changed

NHANES_dash.py

+30-30
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
# clientid = config.reddit_reddit_clientid
3030
# clientsecret = config.reddit_clientsecret
3131

32-
username = st.secrets["reddit_username"]
33-
password = st.secrets["reddit_password"]
34-
clientid = st.secrets["reddit_clientid"]
35-
clientsecret = st.secrets["reddit_clientsecret"]
32+
# username = st.secrets["reddit_username"]
33+
# password = st.secrets["reddit_password"]
34+
# clientid = st.secrets["reddit_clientid"]
35+
# clientsecret = st.secrets["reddit_clientsecret"]
3636

3737
#################Twitter_AUTH##########################
3838
# API_Key = config.twitter_API_Key
@@ -41,11 +41,11 @@
4141
# Access_Token = config.twitter_Access_Token
4242
# Access_Token_Secret = config.twitter_Access_Token_Secret
4343

44-
API_Key = st.secrets["twitter_API_Key"]
45-
API_Key_Secret = st.secrets["twitter_API_Key_Secret"]
46-
Bearer_Token = st.secrets["twitter_Bearer_Token"]
47-
Access_Token = st.secrets["twitter_Access_Token"]
48-
Access_Token_Secret = st.secrets["twitter_Access_Token_Secret"]
44+
# API_Key = st.secrets["twitter_API_Key"]
45+
# API_Key_Secret = st.secrets["twitter_API_Key_Secret"]
46+
# Bearer_Token = st.secrets["twitter_Bearer_Token"]
47+
# Access_Token = st.secrets["twitter_Access_Token"]
48+
# Access_Token_Secret = st.secrets["twitter_Access_Token_Secret"]
4949

5050
###################Database_AUTH#########################
5151
# host= config.host
@@ -54,29 +54,29 @@
5454
# port = config.port
5555
# database = config.database
5656

57-
host= st.secrets["host"]
58-
user= st.secrets["user"]
59-
db_password= st.secrets["password"]
60-
port = st.secrets["port"]
61-
database = st.secrets["database"]
57+
# host= st.secrets["host"]
58+
# user= st.secrets["user"]
59+
# db_password= st.secrets["password"]
60+
# port = st.secrets["port"]
61+
# database = st.secrets["database"]
6262

6363
################################################################################################################
6464

65-
#Twitter API Authentication
66-
consumerKey = API_Key
67-
consumerSecret = API_Key_Secret
68-
accessToken = Access_Token
69-
accessTokenSecret = Access_Token_Secret
70-
auth = tweepy.OAuthHandler(consumerKey, consumerSecret)
71-
auth.set_access_token(accessToken, accessTokenSecret)
72-
api = tweepy.API(auth,wait_on_rate_limit=True)
73-
74-
#Reddit API Authentication
75-
reddit = praw.Reddit(client_id=clientid,
76-
client_secret=clientsecret,
77-
password=password,
78-
user_agent='Reddit search data extractor by /u/' + username + '',
79-
username=username)
65+
# #Twitter API Authentication
66+
# consumerKey = API_Key
67+
# consumerSecret = API_Key_Secret
68+
# accessToken = Access_Token
69+
# accessTokenSecret = Access_Token_Secret
70+
# auth = tweepy.OAuthHandler(consumerKey, consumerSecret)
71+
# auth.set_access_token(accessToken, accessTokenSecret)
72+
# api = tweepy.API(auth,wait_on_rate_limit=True)
73+
74+
# #Reddit API Authentication
75+
# reddit = praw.Reddit(client_id=clientid,
76+
# client_secret=clientsecret,
77+
# password=password,
78+
# user_agent='Reddit search data extractor by /u/' + username + '',
79+
# username=username)
8080

8181
################################################################################################################
8282
import pickle as pkle
@@ -116,7 +116,7 @@
116116
with col2:
117117
st.markdown(" <h1 style='text-align: center;'> NHANES, Health Disparities Data Visualization Tool</h1>", unsafe_allow_html=True)
118118
st.markdown("<p style='text-align: center;'><i><b>Transformative Research to Address Health Disparities and Advance Health Equity at Minority Serving Institutions</b></i></p>", unsafe_allow_html=True)
119-
st.markdown("<center><img src='https://github.com/kkrusere/NHANES-Data-Visualization-Dashboard-on-Health-Disparities-and-Inequities/blob/main/assets/health_disparities.jpg?raw=true' width=600/></center>", unsafe_allow_html=True)
119+
st.markdown("<center><img src='https://github.com/kkrusere/NHANES-EDA-on-Health-Disparities/blob/main/assets/nhanes_health_disparities.png?raw=true' width=600/></center>", unsafe_allow_html=True)
120120

121121
with col3:
122122
st.write("")

Rnext.p

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
�K.
1+
�K.

commennext.p

0 Bytes
Binary file not shown.

next.p

0 Bytes
Binary file not shown.

test.py

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
2+
from streamlit_option_menu import option_menu
3+
import streamlit as st
4+
import plotly.express as px
5+
from plotly.subplots import make_subplots
6+
import plotly.graph_objects as go
7+
8+
import matplotlib.pyplot as plt
9+
from wordcloud import WordCloud
10+
11+
import json
12+
from bs4 import BeautifulSoup
13+
import pandas as pd
14+
import datetime
15+
import random
16+
# Import date class from datetime module
17+
from datetime import date
18+
19+
import datetime
20+
#import config
21+
22+
import pickle as pkle
23+
import os.path
24+
25+
from streamlit_server_state import server_state, server_state_lock
26+
27+
import requests
28+
import streamlit.components.v1 as components
29+
30+
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
31+
32+
33+
st.set_page_config(page_title="YouTube_comment_Analysis_Dash_App", page_icon="", layout="wide")
34+
35+
36+
with st.sidebar:
37+
choose = option_menu("Dash Menu", ["About the Project", "Video Summery Stats", "Topic Search", "Sentiment Analysis", "WordCloud"],
38+
icons=['','', '','', ''],
39+
menu_icon="youtube", default_index=0,
40+
styles={
41+
"container": {"padding": "5!important", "background-color": "#fafafa"},
42+
"icon": {"color": "black", "font-size": "25px"},
43+
"nav-link": {"font-size": "16px", "text-align": "left", "margin":"0px", "--hover-color": "#eee"},
44+
"nav-link-selected": {"background-color": "#636EFA"},
45+
}
46+
)
47+
48+
49+
if choose == "About the Project":
50+
#Add the cover image for the cover page. Used a little trick to center the image
51+
col1, col2, col3 = st.columns((.1,1,.1))
52+
53+
with col1:
54+
st.write("")
55+
56+
with col2:
57+
st.markdown(" <h1 style='text-align: center;'>YouTube Comment Analyser</h1>", unsafe_allow_html=True)
58+
st.markdown("<p style='text-align: center;'><i><b> YouTube-comments-Analyzer is a tool to analyze audience sentiment, "
59+
"perspective, topics, and engagement of YouTube video comments. It collects and preprocesses comments, performs "
60+
"sentiment analysis and topic modeling, and visualizes findings through an interactive dashboard. Beneficial for "
61+
"content creators, marketers, and researchers. </b></i></p>", unsafe_allow_html=True)
62+
st.markdown("<center><img src='https://github.com/kkrusere/Market-Basket-Analysis-on-the-Online-Retail-Data/blob/main/Assets/comments_analyzer.jpg?raw=1' width=300/></center>", unsafe_allow_html=True)
63+
64+
with col3:
65+
st.write("")
66+
67+
col1, col2 = st.columns( [0.8, 0.2])
68+
with col1: # To display the header text using css style
69+
st.markdown("#### **About the Project:**")
70+
71+
st.markdown("""
72+
73+
##### **Abstract**
74+
75+
76+
""")
77+
78+
st.markdown("##### ***Project Contributors:***")
79+
st.markdown("Kuzi Rusere")
80+
81+
82+
elif choose == "Video Summery Stats":
83+
col1, col2 = st.columns( [0.8, 0.2])
84+
with col1: # To display the header text using css style
85+
st.markdown(""" <style> .font {
86+
font-size:35px ; font-family: 'Cooper Black'; color: black;}
87+
</style> """, unsafe_allow_html=True)
88+
st.markdown('<p class="font">Video Summery Stats</p>', unsafe_allow_html=True)
89+
keywords = ["Sentiment-Analysis"] # this is going to be our keyword
90+
91+
92+
93+
st.markdown("---")
94+
######################################################################
95+
96+
97+
#######################################################*******************************************************####################################################################
98+
99+
elif choose == "Topic Search":
100+
#Add a file uploader to allow users to upload their project plan file
101+
st.markdown(""" <style> .font {
102+
font-size:35px ; font-family: 'Cooper Black'; color: black;}
103+
</style> """, unsafe_allow_html=True)
104+
st.markdown('<p class="font">Topic Search</p>', unsafe_allow_html=True)
105+
#creating a list of the survey cycles that we are going to be collecting the data
106+
107+
108+
st.markdown("---")
109+
######################################################################
110+
111+
############################################################*******************************************########################################################
112+
113+
elif choose == "Sentiment Analysis":
114+
st.markdown(""" <style> .font {
115+
font-size:35px ; font-family: 'Cooper Black'; color: black;}
116+
</style> """, unsafe_allow_html=True)
117+
st.markdown('<p class="font">Sentiment Analysis</p>', unsafe_allow_html=True)
118+
119+
st.markdown("---")
120+
######################################################################
121+
122+
#######################################################*******************************************###############################################################
123+
124+
125+
elif choose == "WordCloud":
126+
st.markdown(""" <style> .font {
127+
font-size:35px ; font-family: 'Cooper Black'; color: black;}
128+
</style> """, unsafe_allow_html=True)
129+
st.markdown('<p class="font">WordCloud</p>', unsafe_allow_html=True)
130+
131+
st.markdown("---")
132+
######################################################################

0 commit comments

Comments
 (0)