Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
reranker::ModelProtoReader Class Referenceabstract

A class to de-serialize a Model instance from a ModelMessage instance. More...

#include <model-proto-reader.H>

Inheritance diagram for reranker::ModelProtoReader:
reranker::FactoryConstructible reranker::PerceptronModelProtoReader

Public Member Functions

 ModelProtoReader ()
 Constructs a new instance that can de-serialize Model instances from ModelMessage protocol buffer messages. More...
 
virtual ~ModelProtoReader ()
 Destroys this reader. More...
 
virtual void Read (const ModelMessage &model_message, Model *model) const =0
 De-serializes a Model instance from a ModelMessage. More...
 
virtual void ReadFeatures (istream &is, Model *model, bool skip_key=false, const string &separator="\t") const =0
 De-serializes FeatureMessage instances from the specified input stream. More...
 
- Public Member Functions inherited from reranker::FactoryConstructible
virtual ~FactoryConstructible ()
 
virtual void RegisterInitializers (Initializers &initializers)
 
virtual void Init (const Environment *env, const string &arg)
 

Detailed Description

A class to de-serialize a Model instance from a ModelMessage instance.

Definition at line 53 of file model-proto-reader.H.

Constructor & Destructor Documentation

reranker::ModelProtoReader::ModelProtoReader ( )
inline

Constructs a new instance that can de-serialize Model instances from ModelMessage protocol buffer messages.

Definition at line 57 of file model-proto-reader.H.

virtual reranker::ModelProtoReader::~ModelProtoReader ( )
inlinevirtual

Destroys this reader.

Definition at line 59 of file model-proto-reader.H.

Member Function Documentation

virtual void reranker::ModelProtoReader::Read ( const ModelMessage &  model_message,
Model model 
) const
pure virtual

De-serializes a Model instance from a ModelMessage.

Parameters
[in]model_messagethe ModelMessage from which to de-serialize a Model instance
[out]modelthe Model to be de-serialized from the specified ModelMessage

Implemented in reranker::PerceptronModelProtoReader.

virtual void reranker::ModelProtoReader::ReadFeatures ( istream &  is,
Model model,
bool  skip_key = false,
const string &  separator = "\t" 
) const
pure virtual

De-serializes FeatureMessage instances from the specified input stream.

Parameters
[in]isinput stream from which to read data
[in,out]modelmodel to add features to
[in]skip_keyassumes there is a key before the separator
[in]separatorthe string separator to use

Implemented in reranker::PerceptronModelProtoReader.


The documentation for this class was generated from the following file: