37 #ifndef RERANKER_MODEL_MERGE_REDUCER_H_
38 #define RERANKER_MODEL_MERGE_REDUCER_H
40 #include "../proto/dataio.h"
41 #include "../proto/model.pb.h"
45 using confusion_learning::FeatureMessage;
46 using confusion_learning::ModelMessage;
54 virtual int Reduce(
const string& key,
const string& value) = 0;
55 virtual int Flush(
void) = 0;
68 virtual int Reduce(
const string& feat_id,
const string& value);
69 virtual int Flush(
void);
73 FeatureMessage cur_message_;
75 ConfusionProtoIO messageio_;
89 : new_model_message_(true) {
91 virtual int Reduce(
const string& key,
const string& value);
92 virtual int Flush(
void);
97 bool new_model_message_;
98 ConfusionProtoIO messageio_;
99 ModelMessage model_message_;
111 virtual int Reduce(
const string& key,
const string& value);
virtual int Reduce(const string &key, const string &value)
FeatureReducer(bool uniform_mix, double mix_denominator)
A reducer class which processes FeatureMessage proto buffers.
virtual int Reduce(const string &feat_id, const string &value)
virtual int Reduce(const string &key, const string &value)=0
Abstract base-class for a streaming reducer.
A reducer class which processes SymbolMessage messages and returns a set of unique them into a single...
A reducer class which processes ModelMessage protocol messages and merges them into a single message...
virtual int Flush(void)=0
static const char * kModelMessageFeatureName
virtual int Reduce(const string &key, const string &value)