Closed michaelhutt closed 9 years ago
The currently supported wrapper for NPLM is in moses/LM/NeuralLMWrapper.cpp . I don't know if lm/wrappers/nplm.cc is used for anything, but if you want to compile it, use Kenneth's fork of NPLM (https://github.com/kpu/nplm) and compile moses with the option '--with-nplm-0.1'.
'--with-nplm-0.1` was taken out with the latest commit (https://github.com/moses-smt/mosesdecoder/commit/8b323abbca16619bfbaf32d5f9b2dcaf63457d53).
Rico, is NPLM threadsafe for parallel lookup_ngram against the same instance of neuralLM? If so, a lot of that wrapper can be thrown out.
when each thread has its own instance of neuralNetwork() (or neuralLM/neuralTM), lookups are thread-safe, even if the instances share the same model(); just don't do anything that modifies the model in parallel, like calling neuralNetwork.premultiply().
The nplm wrapper at
lm/wrappers/nplm.cc
is not compatible with the NPLM at https://github.com/rsennrich/nplm, which is the suggested NPLM (from http://www.statmt.org/moses/?n=FactoredTraining.BuildingLanguageModel#ntoc1). The NPLM from @rsennrich has incorporated changes from the upstream 0.3 version, which changed the nplm::neuralLM constructor's signature - it no longer takes a string.