Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrusere committed Apr 4, 2024
1 parent c3b1a41 commit 16f34db
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 31 deletions.
60 changes: 30 additions & 30 deletions NHANES_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
# clientid = config.reddit_reddit_clientid
# clientsecret = config.reddit_clientsecret

username = st.secrets["reddit_username"]
password = st.secrets["reddit_password"]
clientid = st.secrets["reddit_clientid"]
clientsecret = st.secrets["reddit_clientsecret"]
# username = st.secrets["reddit_username"]
# password = st.secrets["reddit_password"]
# clientid = st.secrets["reddit_clientid"]
# clientsecret = st.secrets["reddit_clientsecret"]

#################Twitter_AUTH##########################
# API_Key = config.twitter_API_Key
Expand All @@ -41,11 +41,11 @@
# Access_Token = config.twitter_Access_Token
# Access_Token_Secret = config.twitter_Access_Token_Secret

API_Key = st.secrets["twitter_API_Key"]
API_Key_Secret = st.secrets["twitter_API_Key_Secret"]
Bearer_Token = st.secrets["twitter_Bearer_Token"]
Access_Token = st.secrets["twitter_Access_Token"]
Access_Token_Secret = st.secrets["twitter_Access_Token_Secret"]
# API_Key = st.secrets["twitter_API_Key"]
# API_Key_Secret = st.secrets["twitter_API_Key_Secret"]
# Bearer_Token = st.secrets["twitter_Bearer_Token"]
# Access_Token = st.secrets["twitter_Access_Token"]
# Access_Token_Secret = st.secrets["twitter_Access_Token_Secret"]

###################Database_AUTH#########################
# host= config.host
Expand All @@ -54,29 +54,29 @@
# port = config.port
# database = config.database

host= st.secrets["host"]
user= st.secrets["user"]
db_password= st.secrets["password"]
port = st.secrets["port"]
database = st.secrets["database"]
# host= st.secrets["host"]
# user= st.secrets["user"]
# db_password= st.secrets["password"]
# port = st.secrets["port"]
# database = st.secrets["database"]

################################################################################################################

#Twitter API Authentication
consumerKey = API_Key
consumerSecret = API_Key_Secret
accessToken = Access_Token
accessTokenSecret = Access_Token_Secret
auth = tweepy.OAuthHandler(consumerKey, consumerSecret)
auth.set_access_token(accessToken, accessTokenSecret)
api = tweepy.API(auth,wait_on_rate_limit=True)

#Reddit API Authentication
reddit = praw.Reddit(client_id=clientid,
client_secret=clientsecret,
password=password,
user_agent='Reddit search data extractor by /u/' + username + '',
username=username)
# #Twitter API Authentication
# consumerKey = API_Key
# consumerSecret = API_Key_Secret
# accessToken = Access_Token
# accessTokenSecret = Access_Token_Secret
# auth = tweepy.OAuthHandler(consumerKey, consumerSecret)
# auth.set_access_token(accessToken, accessTokenSecret)
# api = tweepy.API(auth,wait_on_rate_limit=True)

# #Reddit API Authentication
# reddit = praw.Reddit(client_id=clientid,
# client_secret=clientsecret,
# password=password,
# user_agent='Reddit search data extractor by /u/' + username + '',
# username=username)

################################################################################################################
import pickle as pkle
Expand Down Expand Up @@ -116,7 +116,7 @@
with col2:
st.markdown(" <h1 style='text-align: center;'> NHANES, Health Disparities Data Visualization Tool</h1>", unsafe_allow_html=True)
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)
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)
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)

with col3:
st.write("")
Expand Down
2 changes: 1 addition & 1 deletion Rnext.p
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�K.
�K.
Binary file modified commennext.p
Binary file not shown.
Binary file modified next.p
Binary file not shown.
132 changes: 132 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@

from streamlit_option_menu import option_menu
import streamlit as st
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go

import matplotlib.pyplot as plt
from wordcloud import WordCloud

import json
from bs4 import BeautifulSoup
import pandas as pd
import datetime
import random
# Import date class from datetime module
from datetime import date

import datetime
#import config

import pickle as pkle
import os.path

from streamlit_server_state import server_state, server_state_lock

import requests
import streamlit.components.v1 as components

from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer


st.set_page_config(page_title="YouTube_comment_Analysis_Dash_App", page_icon="", layout="wide")


with st.sidebar:
choose = option_menu("Dash Menu", ["About the Project", "Video Summery Stats", "Topic Search", "Sentiment Analysis", "WordCloud"],
icons=['','', '','', ''],
menu_icon="youtube", default_index=0,
styles={
"container": {"padding": "5!important", "background-color": "#fafafa"},
"icon": {"color": "black", "font-size": "25px"},
"nav-link": {"font-size": "16px", "text-align": "left", "margin":"0px", "--hover-color": "#eee"},
"nav-link-selected": {"background-color": "#636EFA"},
}
)


if choose == "About the Project":
#Add the cover image for the cover page. Used a little trick to center the image
col1, col2, col3 = st.columns((.1,1,.1))

with col1:
st.write("")

with col2:
st.markdown(" <h1 style='text-align: center;'>YouTube Comment Analyser</h1>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center;'><i><b> YouTube-comments-Analyzer is a tool to analyze audience sentiment, "
"perspective, topics, and engagement of YouTube video comments. It collects and preprocesses comments, performs "
"sentiment analysis and topic modeling, and visualizes findings through an interactive dashboard. Beneficial for "
"content creators, marketers, and researchers. </b></i></p>", unsafe_allow_html=True)
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)

with col3:
st.write("")

col1, col2 = st.columns( [0.8, 0.2])
with col1: # To display the header text using css style
st.markdown("#### **About the Project:**")

st.markdown("""
##### **Abstract**
""")

st.markdown("##### ***Project Contributors:***")
st.markdown("Kuzi Rusere")


elif choose == "Video Summery Stats":
col1, col2 = st.columns( [0.8, 0.2])
with col1: # To display the header text using css style
st.markdown(""" <style> .font {
font-size:35px ; font-family: 'Cooper Black'; color: black;}
</style> """, unsafe_allow_html=True)
st.markdown('<p class="font">Video Summery Stats</p>', unsafe_allow_html=True)
keywords = ["Sentiment-Analysis"] # this is going to be our keyword



st.markdown("---")
######################################################################


#######################################################*******************************************************####################################################################

elif choose == "Topic Search":
#Add a file uploader to allow users to upload their project plan file
st.markdown(""" <style> .font {
font-size:35px ; font-family: 'Cooper Black'; color: black;}
</style> """, unsafe_allow_html=True)
st.markdown('<p class="font">Topic Search</p>', unsafe_allow_html=True)
#creating a list of the survey cycles that we are going to be collecting the data


st.markdown("---")
######################################################################

############################################################*******************************************########################################################

elif choose == "Sentiment Analysis":
st.markdown(""" <style> .font {
font-size:35px ; font-family: 'Cooper Black'; color: black;}
</style> """, unsafe_allow_html=True)
st.markdown('<p class="font">Sentiment Analysis</p>', unsafe_allow_html=True)

st.markdown("---")
######################################################################

#######################################################*******************************************###############################################################


elif choose == "WordCloud":
st.markdown(""" <style> .font {
font-size:35px ; font-family: 'Cooper Black'; color: black;}
</style> """, unsafe_allow_html=True)
st.markdown('<p class="font">WordCloud</p>', unsafe_allow_html=True)

st.markdown("---")
######################################################################

0 comments on commit 16f34db

Please sign in to comment.