Skip to content

Instantly share code, notes, and snippets.

@pakjiddat

pakjiddat/ui.R

Created May 31, 2021
Embed
What would you like to do?
Shiny app for predicting words - UI code
#
# This is the user-interface definition the word-predictor 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(shiny)
# Define UI for application
shinyUI(fluidPage(
# Application title
titlePanel("Word Predictor"),
# Horizontal rule
hr(),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
# The input field
textInput("ngram", "Enter a n-gram:")
),
# Show a plot of the possible predicted words
mainPanel(
# The predicted word
uiOutput("next_word"),
# The predicted word probability
uiOutput("word_prob"),
# Horizontal rule
hr(),
# The bar plot of possible next words
plotOutput("next_word_plot")
)
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment