This is a writing interface intended to imitate the predictive text function on smartphones. It is not a bot! A user has to be involved.
cd ~/Desktop
or wherever you would like to download the project (cd
means "Change Directory" and ~/Desktop
is a shortcut to your desktop) git clone https://github.com/jbrew/pt-voicebox.git
to download the projectcd pt-voicebox
to go into the project directorysudo easy_install pip
(this will prompt you for your password)pip install --user -r requirements.txt
to download the project dependenciesbin/voicebox
and follow the onscreen instructionscd ~/Desktop/pt-voicebox
or wherever you downloaded the projecttexts
folder within voicebox (pt-voicebox/texts
)cd ~/Desktop/pt-voicebox
or wherever you downloaded the projectnosetests tests
The classes are structured as follows:
The approach to generating word lists is Markov-esque but is not strictly a Markov process, which would need to be stochastic. Here, the user has the final decision.
At each step of the sentence, the script uses the n most recent words to determine a list of the m most likely words to come next. The Markov determination of this list is a weighted combination of several lists, with higher weights given to lists of words that followed larger n-grams that constitute the immediate context.
For instance, when n=2 and the most recent two words in the sentence are "my big", the following lists factor into supplying the list of m words:
A similar pattern holds for higher values of n, with larger n-grams emphasized ver smaller n-grams, and closer n-grams emphasized over more distant ones.