memory-resident LMs for ngram?

Andreas Stolcke stolcke at speech.sri.com
Tue Sep 11 14:12:16 PDT 2007


In message <3E6206DB-6143-4320-8EDE-87F48C790426 at gmail.com>you wrote:
> Is there an easy way to make ngram load an LM into memory and become  
> a server of perlexity scores for sentences?

It should be easy using the existing functionality.

Write a wrapper script (shell, perl, whatever) that 

- invokes
		ngram -lm LM ... -ppl -  -debug 2 
- reads input sentences from some defined place and writes them to the 
	std input of ngram (above)
- reads the std output of ngram and reformats it into whatever format is 
	suitable

Using this approach, ngram is invoked only once and the LM is read only once.
It will terminated after its std input is closed or sees end-of-file.

Andreas 




More information about the SRILM-User mailing list