-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
132 lines (113 loc) · 3.47 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#11810105_Isha Rukhaya
#11810058_Nitin Agarwal
#11810013_Ajay Chopra
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shinyWidgets)
library(shiny)
library(udpipe)
library(igraph)
library(ggraph)
library(ggplot2)
library(stringr)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
tags$style(
HTML(
"
.tabs-above > .nav > li[class=active] > a {
background-color: #000;
color: #FFF;
}"
)
),
# Application title
titlePanel("NLP using UDPipe"),
#Sidebar with 3 input options : Upload file and model file and checkbox choice for xpos tagging
sidebarLayout(
sidebarPanel(
helpText(
"Lets start text analysis by uploading a text file and specify Language"
),
## Language selection radio button
awesomeRadio(
inputId = "lang",
label = "Please select Language of Text ",
choices = c("en", "other"),
selected = ("en"),
inline = TRUE,
status = "warning"
),
### Upload utilities
fileInput("file", "Upload text file(only .txt file)"),
fileInput("modelfile", "Upload model file for other than English language"),
## Checkbbox input for pos tag filtering
awesomeCheckboxGroup(
inputId = "xposchoice",
label = "Choose Xpos tags: It will filter over Annotation and Cooccurence graph only",
choices = c("JJ", "NN", "NNP", "RB", "VB"),
selected = list("JJ", "NN", "NNP")
)
),
# Main Panel
mainPanel(
setBackgroundImage(src = "https://png.pngtree.com/thumb_back/fw800/back_pic/03/59/27/6957a41f6e761b3.jpg"),
tabsetPanel(
type = "tabs",
tabPanel(
title = "Introduction",
h4(
'This App displays step by step process of doing NLP using udpipe model.UDPipe provides the standard NLP functionalities of tagging, parsing and dependency evaluations - all within R'
),
br(),
h4(p("Follow tabs sequence from left to Right")),
h4(
p(
"Please upload Text file and Model File from the left panel and see the file content in this tab
and then click the next tab."
),
div("This app doesn't require model to be uploaded for English .", style =
"color:blue")
),
br(),
uiOutput("text")
)
,
tabPanel("Annotated text", dataTableOutput("anntext"))
,
tabPanel("Nouns extraction", dataTableOutput("phrasextractnoun")),
tabPanel("Verbs extraction", dataTableOutput("phrasextractverb"))
,
tabPanel(
title = "Collocations",
h4(
"Collocations are Sequence of words or terms that co-occur more often than would be expected by chance."
),
dataTableOutput("collocations")
)
,
tabPanel(
"Cooccurrences of Noun and Adjectives",
dataTableOutput("cooccurrences_noun_adj")
)
,
tabPanel(
"Cooccurrences at the file level",
dataTableOutput("gen_cooccur")
)
,
tabPanel(
"Skipgram based Co-occurrences",
dataTableOutput("cooccur_skips_ngrams")
)
,
tabPanel("Cooccurence graph", plotOutput("plot1"))
)
)
)
))