kpu / kenlm

KenLM: Faster and Smaller Language Model Queries
http://kheafield.com/code/kenlm/
Other
2.5k stars 513 forks source link

Log Probability of Unigram word #286

Closed Michael95-m closed 4 years ago

Michael95-m commented 4 years ago

I have a question of how to get the log probability of uni gram word? I've found that using the python interface, I can only train uni gram language model but can't use with kenlm.Model() (got errors). So, instead of using the unigram language model, I trained tri gram language model and I just used model.score() function for uni gram word to get log probability of that word . My question is that Is it OK to use that way ??