-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
79 lines (70 loc) · 1.87 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
source("WordInputModules.R")
library(shinyjs)
ui <- fixedPage(
useShinyjs(),
titlePanel("Word Embedding Explorer"),
mainPanel(
tabsetPanel(
tabPanel(
"Single Word Query",
wordInputUI('word_query'),
value = 'word_query'
),
tabPanel(
"Query by Analogy",
fixedRow(
br(), br(),
fixedRow(
column(wordInputUI("analogy_a"), width = 2),
column(br(), "is to", width = 1),
column(wordInputUI("analogy_b"), width = 2)
),
fixedRow(
column('', width = 1),
column(strong("As"), width = 10)
),
fixedRow(
column(wordInputUI("analogy_c"), width = 2),
column(br(), "is to?", width = 1)
)
),
value = 'word_analogy'
),
tabPanel(
"Word Formula",
tagList(
textInput("word_formula", "Word Formula:", "rec - affordable"),
strong("Usage:"), em("use +/- between words. Ensure spaces between terms.")
),
value = 'word_formula'
),
tabPanel(
"Query Builder",
wordInputUI('builder_pos_terms'),
wordInputUI('builder_neg_terms'),
value = 'word_query_builder'
),
tabPanel(
"Query by Text",
textInput("text_query", "Query Text:", "What can I do for fun?"),
value = 'query_by_text'
),
id = "query_type"
),
br(), hr(), br(),
h3("Query Result:"),
fluidRow(
column(h4("Most Similar Terms:"), tableOutput('query_result'), width = 6),
column(
hidden(
span(
id = "different_terms",
h4("Most Different Terms:"),
tableOutput('furthest_result')
)
),
actionLink("show_different", "Show/Hide Most Different Terms"),
width = 6)
)
)
)