https://github.com/chfoo/tellnext
Next word prediction using Markov chain and trigram model.
https://github.com/chfoo/tellnext
Last synced: 9 months ago
JSON representation
Next word prediction using Markov chain and trigram model.
- Host: GitHub
- URL: https://github.com/chfoo/tellnext
- Owner: chfoo
- License: gpl-3.0
- Archived: true
- Created: 2014-12-09T01:59:49.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-16T01:03:45.000Z (over 8 years ago)
- Last Synced: 2025-03-24T20:14:51.937Z (11 months ago)
- Language: Python
- Size: 24.4 KB
- Stars: 17
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
tellnext
========
Next word prediction using a Markov chain and trigram model.
TellNext is a toy library and tool for predicting the next word in a sentence. It is a form of autocomplete, as seen in iOS and Android text input, where a list of candidate words is available for selection after entry of a word.
It currently only works with English words.
Quick Start
===========
Requires Python 3 (or PyPy 3 during training).
Dependencies::
pip3 install -r requirements.txt
Train your language model::
pypy3 -m tellnext --database MODEL.db train CORPUS.TXT
Train using Twitter Tweets::
pypy3 -m tellnext --database MODEL.db train-twitter \
archiveteam-twitter-spritzer-2012-03/
archiveteam-twitter-spritzer-2013-08/
Get a list of predictions::
python3 -m tellnext --database MODEL.db next dragons are
Generate some sentences::
python3 -m tellnext --database MODEL.db generate --lines 10
Credits
=======
Copyright 2014 Christopher Foo. License GPL 3.