class: center, middle, inverse, title-slide .title[ # What’s the Next Word? ] .author[ ### Abril Susana ] .date[ ### March 7, 2025 ] --- # Welcome to "What's the Next Word?" - **Goal:** Predict the next word based on user input - **Collaboration:** Data Science Capstone Project with SwiftKey - **Technologies Used:** - **shiny**: To create the interactive app - **tm**, **text2vec**, **dplyr**: For text processing and data manipulation - **Data Source:** English text from HC Corpora (blogs, Twitter, and news) **How It Works:** The app provides predictions by analyzing the user input and suggesting the top three most likely next words. <img src="https://raw.githubusercontent.com/abrilsm114/data-science-capstone/main/app.gif" width="45%" style="display: block; margin: auto;" /> --- # The Prediction Algorithm - **Data Preparation:** - Cleaned 1 million lines of text (removing noise, punctuation, and stopwords). - Tokenized data to generate **n-grams** (up to 6-grams) and computed frequency distributions. - **Algorithm Used:** - The app uses a **back-off model** to predict the next word based on the user’s input. - **Maximum Likelihood Estimation** (MLE) is used for calculating n-gram probabilities. - The top 3 predictions are presented based on these probabilities, improving accuracy. --- # The Shiny App Interface & How It Works - **Functionality:** - **Real-Time Predictions:** As you type, the app predicts the next word. - **Interactive Feature:** Click any of the predicted words to auto-complete your sentence. - **Instant Feedback:** Predictions are updated instantly based on your input. --- # Try it Out & Learn More - **Live Demo:** Check out the app on [shinyapps.io](https://asusana.shinyapps.io/predict-next-word/) - **How to Use the App:** 1. Enter text in the input box. 2. See the top 3 predicted words appear below. 3. Click a word to add it to your input. <img src="https://raw.githubusercontent.com/abrilsm114/data-science-capstone/main/app.png" width="60%" style="display: block; margin: auto;" />