Note
Run word_game_NLP.ipynb to play, you can play manually or let it play with the test.txt dataset
Build AI/ML model to guess a hidden word, inspired by this game
- Hidden word is given by user or randomly picked from test.txt dataset. Eg: "apple"
- The word is masked with underscores ("_ _ _ _ _")
- AI bot will try to pridict that hidden word by guess a letter per attempt.
- If the guess letter is correct, the system will return an update state on the hidden word. Eg: Guessed "p" -> "_ p p _ _"
- There is a limit of 6 attempts, each wrong guess will decrease the attempt by 1.
- Game ends when the word is fully revealed or the attempts remains reaches 0.
Model_1 is n-grams model from scratch without NLTK package, it is train on lowcase English words from nltk.corpus.words.words() dictionary. I find that a combination of 1 to 6-grams models is effective, although the number of n-gram models can be increased with the expense of computational cost. Model_1 Structure:
Work in progresss, thinking LSTM, NLP, Transformer.... I will finish it when I have some free time!