Skip to content

awni/py-arpa-lm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

py-arpa-lm

Python API for reading and querying ARPA format language model.

Usage :

lm = LM("test.arpa")

# Score a sentence
lm.score("HELLO WORLD")

# Get integer word id
wId = lm.get_word_id("HELLO")

# Get the bigram probability of two words
lm.get_bg(lm.get_word_id("HELLO"),lm.get_word_id("WORLD"))

# Get the trigram probability of three words
lm.get_tg(lm.start,lm.get_word_id("HELLO"),lm.end)

About

Python API for reading and querying ARPA formatted language models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages