-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
118 lines (113 loc) · 3.76 KB
/
ui.R
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
source("dependencies.r")
ui <- fluidPage(
# setup shiny alerts
useShinyalert(),
# Application title
titlePanel("Twitter Sentiment Analysis"),
tabsetPanel(
tabPanel("SYUZNET Approach",
fluidPage(
# Inputs(s) panel
fluidRow(
# Enter a hashtag that interests you.
column(
width = 4,
offset = 4,
textInput(
inputId = "hashtag",
label = "Enter any hashtag to analyze",
value = "corona"
)
),
# Select sample size
column(
width = 4,
offset = 4,
sliderInput(
inputId = "sampleSize",
label = "Sample Size",
value = 100,
min = 100,
max = 1000
)
)
),
# Output tab panel
tabsetPanel(
# Output(s)
tabPanel("Word Cloud",
wordcloud2Output(outputId = "wordcloud")),
tabPanel(
"Word Frequency Table",
dataTableOutput(outputId = "frequencyTable")
),
tabPanel("Tweets",
dataTableOutput(outputId = "tweets")),
tabPanel(
"Sentiment Analysis",
plotOutput(outputId = "sentimentAnalysisPlot")
)
)
)),
# ML Approach TAB
tabPanel("ML Approach",
fluidPage(
fluidRow(
column (
offset = 0,
width = 4,
checkboxInput(
label = "USE CACHED MODEL",
inputId = "useCache",
value = TRUE
)
),
column(
offset = 0,
width = 4,
div("Note: Retraining requires 2 Hour")
),
column(
width = 4,
offset = 4,
textInput(
inputId = "hashtagML",
label = "Enter any hashtag to analyze",
value = "corona"
)
),
# Select sample size
column(
width = 4,
offset = 8,
sliderInput(
inputId = "sampleSizeML",
label = "Sample Size",
value = 100,
min = 100,
max = 1000
)
)
),
# Output tab panel
tabsetPanel(
tabPanel(
"Sentiment Analysis SVM",
plotOutput(outputId = "mlSentimentPlotSVM")
),
tabPanel(
"Sentiment Analysis KNN",
plotOutput(outputId = "mlSentimentPlotKNN")
),
tabPanel("SVM Model Graph",
plotOutput(outputId = "svmPlot")),
tabPanel("KNN Model Graph",
plotOutput(outputId = "knnPlot")),
tabPanel("SVM Confusion matrix",
plotOutput(outputId = "svmCMPlot")),
tabPanel("KNN Confusion matrix",
plotOutput(outputId = "knnCMPlot"))
)
))
)
)