-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
132 lines (92 loc) · 5.01 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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("---")
######################################################################