suntxy / wordhammer

Chinese text auto-completion by N-Gram

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chinese text auto-completion

Word Hammer is an implementation of N-Gram model for auto completion.

Usage

from hammer import WordHammer

text = "今天天气真好"
hm = WordHammer()

# train
hm.loadCorpus(corpus=text)

# prediction
hm.doPrediction(sen="今天天气")

# save model
hm.save()

# load model
hm.load()

About

Chinese text auto-completion by N-Gram


Languages

Language:Python 100.0%