09/09/2024

Slide 1: Introduction

  • Title: Word Prediction App
  • Objective: To present an innovative app for predicting the next word based on user input.

Target Audience: Businesses and researchers looking for advanced text prediction solutions.

Slide 2: The Algorithm

  • Algorithm:
    • Utilizes a dictionary of common words, phrases, numbers, and salutations.
    • Employs an n-gram model to predict the next word.
    • Provides suggestions based on the input text.
  • Benefits:
    • Enhances user experience with fast and accurate predictions.
  • Easy integration with various applications and platforms.

    Slide 3: The Shiny App

  • Features:
    • User-friendly interface with a text input box.
    • Predicts the next word when the user clicks “Predict Next Word”.
    • Displays predictions based on an extensive dictionary.
  • Demo:
    • Live demo of the app.
  • Examples of word predictions in action.

    Slide 4: Technical Details

  • Technology:
    • Built with R and Shiny.
    • Utilizes the quanteda package for text processing and prediction.
  • Challenges:
    • Handling large dictionaries and ensuring quick responses.
  • Continuous updates to improve prediction accuracy.

    Slide 5: Next Steps

  • Development:
    • Add more words and phrases to enhance prediction accuracy.
    • Improve the app’s performance and scalability.
  • Implementation:
    • Explore potential markets and application areas.
    • Gather feedback for further enhancements.
  • Contact:
    • For more details or partnership opportunities, contact Dounia Nasir.
  • # Example R code to show in the presentation
    library(quanteda)
    ## Package version: 2.0.1
    ## Parallel computing: 2 of 32 threads used.
    ## See https://quanteda.io for tutorials and examples.
    ## 
    ## Attaching package: 'quanteda'
    ## The following object is masked from 'package:utils':
    ## 
    ##     View
    # Create a sample corpus
    corpus <- corpus(c("this is a test", "this is another example", "predict the next word"))
    
    # Create a document-feature matrix
    dfm <- dfm(tokens(corpus), ngrams = 2:3)
    ## Warning: ngrams argument is not used.
    # Convert dfm to a dataframe
    dfm_df <- convert(dfm, to = "data.frame")
    
    # Show the first few rows of the dataframe
    head(dfm_df)
    ##   document this is a test another example predict the next word
    ## 1    text1    1  1 1    1       0       0       0   0    0    0
    ## 2    text2    1  1 0    0       1       1       0   0    0    0
    ## 3    text3    0  0 0    0       0       0       1   1    1    1