Search SRILM-USER Archives

Match: Format: Sort by:
Search:

Re: memory-resident LMs for ngram?

From: Andreas Stolcke <stolcke at ADDRESS HIDDEN>
Date: Tue, 11 Sep 2007 14:12:16 PDT

In message <3E6206DB-6143-4320-8EDE-87F48C790426 at ADDRESS HIDDEN>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

Click here to go to the SRILM home page.