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