Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
|
A class to construct a PerceptronModel from a ModelMessage
instance.
More...
#include <perceptron-model-proto-reader.H>
Public Member Functions | |
PerceptronModelProtoReader () | |
Constructs a new instance that can serialize Model instances to ModelMessage protocol buffer messages. More... | |
virtual | ~PerceptronModelProtoReader () |
Destroys this reader. More... | |
virtual void | RegisterInitializers (Initializers &initializers) |
Registers the smart_copy_ data member with the name "smart_copy". More... | |
virtual void | Read (const ModelMessage &model_message, Model *model) const |
De-serializes a PerceptronModel instance from a ModelMessage. More... | |
virtual void | ReadFeatures (istream &is, Model *model, bool skip_key, const string &separator) const |
De-serializes Features from an instance. More... | |
Public Member Functions inherited from reranker::ModelProtoReader | |
ModelProtoReader () | |
Constructs a new instance that can de-serialize Model instances from ModelMessage protocol buffer messages. More... | |
virtual | ~ModelProtoReader () |
Destroys this reader. More... | |
Public Member Functions inherited from reranker::FactoryConstructible | |
virtual | ~FactoryConstructible () |
virtual void | Init (const Environment *env, const string &arg) |
A class to construct a PerceptronModel from a ModelMessage
instance.
TODO(dbikel): Need some kind of a factory for model readers, so the proper ModelProtoReader gets instantiated given a particular Model subclass.
Definition at line 57 of file perceptron-model-proto-reader.H.
|
inline |
Constructs a new instance that can serialize Model instances to ModelMessage protocol buffer messages.
Definition at line 61 of file perceptron-model-proto-reader.H.
|
inlinevirtual |
Destroys this reader.
Definition at line 63 of file perceptron-model-proto-reader.H.
|
virtual |
De-serializes a PerceptronModel instance from a ModelMessage.
[in] | model_message | the ModelMessage from which to de-serialize a PerceptronModel instance |
[out] | model | the PerceptronModel to be de-serialized from the specified ModelMessage |
Implements reranker::ModelProtoReader.
Definition at line 54 of file perceptron-model-proto-reader.C.
|
virtual |
De-serializes Features from an instance.
[in] | is | input stream from which to read data |
[in,out] | model | model to add features to |
[in] | skip_key | assumes there is a key before the separator |
[in] | separator | the string separator to use |
Implements reranker::ModelProtoReader.
Definition at line 98 of file perceptron-model-proto-reader.C.
|
inlinevirtual |
Registers the smart_copy_ data member with the name "smart_copy".
“Smart copying” is when only one of the parameter vectors of a model is present in a message, and so this reader automatically copies the non-empty vector’s contents to the empty vector
Reimplemented from reranker::FactoryConstructible.
Definition at line 71 of file perceptron-model-proto-reader.H.