wlin12/JNN

Sentence score from lstm language model

Closed this issue · 1 comments

Is it possible to pass a single sentence to the language model and get perplexity or any other score? How do I use trained language model?

Thanks.

Yes, if you run the language model (LSTMLanguageModel.java) it will score all sentences in the dev and test sets individually every n iterations (set by validation_interval).

If you do not want to train just set iterations to 0 and it will simply score the sentences with the model in output_dir. More specifically, the model.gz file in the directory in specified in output_dir is loaded before doing anything (either keep training from that point or score validation and test sentences).

Cheers,
Wang Ling