Cambridge SMT System
|
Language model loader task, loads a language model wrapping it in a class to provide. More...
#include <task.loadlm.hpp>
Public Member Functions | |
LoadLanguageModelTask (const ucam::util::RegistryPO &rg, const std::string &lmload=HifstConstants::kLmLoad, const std::string &lmscale=HifstConstants::kLmFeatureweights, const std::string &lmwp=HifstConstants::kLmWordPenalty, const std::string &wordmapkey=HifstConstants::kLmWordmap, bool forceone=false) | |
Public constructor. If the user wants to load several language models (e.g. –lm.load=lm1,lm2,lm3,lm4 and –lm.scale=0.25,0.25,0.25 ), the second and following instances of LoadLanguageModelTask will be created using the private constructor (see below), which has an index to the actual language model that must be loaded. For the public constructor, the index is set to 0. More... | |
bool | run (Data &d) |
Method inherited from TaskInterface. Loads the language model and stores in lm data structure. More... | |
bool | close () |
Free language model resources. Returns true if ok, false if otherwise. More... | |
~LoadLanguageModelTask () | |
Destructor. More... | |
Public Member Functions inherited from ucam::util::TaskInterface< Data > | |
TaskInterface () | |
Constructor. More... | |
virtual | ~TaskInterface () |
bool | chainrun (Data &d) |
Implements chain of responsability. Calls run method and, if there is another task, call its run method too. More... | |
bool | operator() (Data &d) |
TaskInterface & | appendTask (TaskInterface *t) |
Appends a task class. If there is no task, append here, otherwise delegate in next task. More... | |
TaskInterface & | operator() (TaskInterface *t) |
TaskInterface * | getTask () |
Return appended task. More... | |
TaskInterface * | next () |
Language model loader task, loads a language model wrapping it in a class to provide.
Definition at line 144 of file task.loadlm.hpp.
|
inline |
Public constructor. If the user wants to load several language models (e.g. –lm.load=lm1,lm2,lm3,lm4 and –lm.scale=0.25,0.25,0.25 ), the second and following instances of LoadLanguageModelTask will be created using the private constructor (see below), which has an index to the actual language model that must be loaded. For the public constructor, the index is set to 0.
rg | ucam::util::RegistryPO object, containing user parameters. |
lmload | key word to access the registry object for language models |
lmscale | key word to access the registry object for language model scales. |
forceone | To force the loading of only one language model (i.e. lm1 with scale 0.25). |
Definition at line 183 of file task.loadlm.hpp.
|
inline |
Destructor.
Definition at line 274 of file task.loadlm.hpp.
|
inline |
Free language model resources. Returns true if ok, false if otherwise.
Definition at line 262 of file task.loadlm.hpp.
|
inlinevirtual |
Method inherited from TaskInterface. Loads the language model and stores in lm data structure.
&d | data structure in which the null filter is to be stored. |
Implements ucam::util::TaskInterface< Data >.
Definition at line 226 of file task.loadlm.hpp.