37 #ifndef RERANKER_MODEL_PROTO_READER_H_
38 #define RERANKER_MODEL_PROTO_READER_H_
41 #include "../proto/model.pb.h"
47 using confusion_learning::FeatureVecMessage;
48 using confusion_learning::ModelMessage;
67 virtual void Read(
const ModelMessage &model_message,
Model *model)
const = 0;
78 bool skip_key =
false,
79 const string& separator =
"\t")
const = 0;
86 #define REGISTER_NAMED_MODEL_PROTO_READER(TYPE,NAME) \
87 REGISTER_NAMED(TYPE,NAME,ModelProtoReader)
93 #define REGISTER_MODEL_PROTO_READER(TYPE) \
94 REGISTER_NAMED_MODEL_PROTO_READER(TYPE,TYPE)
Model is an interface for reranking models.
ModelProtoReader()
Constructs a new instance that can de-serialize Model instances from ModelMessage protocol buffer mes...
virtual void Read(const ModelMessage &model_message, Model *model) const =0
De-serializes a Model instance from a ModelMessage.
A class to de-serialize a Model instance from a ModelMessage instance.
virtual ~ModelProtoReader()
Destroys this reader.
An interface to make it easier to implement Factory-constructible types by implementing both required...
Provides a generic dynamic object factory.
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.
Reranker model interface.