Introduction
- This is my final project for the Data Science Capstone.
- It predicts the next word using a Shiny app.
- Built using basic pattern-matching and NLP logic.
Data & Preprocessing
- Manually created a set of sample phrases and rules.
- Lowercased and trimmed input.
- Pattern matching used to find likely next word.
Algorithm
- Used grepl() to match common phrases.
- If a known phrase is found, return a next word.
- Else, return “the” as a default.
- Fast and lightweight logic.
Shiny App
- User enters a phrase in a textbox.
- Clicks “Predict” → app shows next word.
- Open the app here
Conclusion
- Simple and fast app using R and Shiny.
- Future work: real n-gram models, larger datasets.
- Clean UI, good user experience.