35 #ifndef RERANKER_FILE_BACKED_LOSS_SETTER_H_
36 #define RERANKER_FILE_BACKED_LOSS_SETTER_H_
64 initializers.
Add(
"token_idx", (
int *)&token_idx_);
94 vector<string> tokens_;
void Add(const string &name, T *member, bool required=false)
virtual void Extract(Candidate &candidate, FeatureVector< int, double > &features)
Sets the loss for the specified candidate based on what was read from the last line in the stream bac...
virtual void Init(const Environment *env, const string &arg)
Initializes this instance.
A “feature extractor” that reads lines from a backing file, setting each candidate’s loss via its Can...
virtual void RegisterInitializers(Initializers &initializers)
Registers the initializers for the filename_ and token_idx_ members.
An interface for an environment in which variables of various types are mapped to their values...
A class to represent a candidate in a set of candidates that constitutes a training instance for a re...
virtual ~FileBackedLossSetter()
Destroys this instance.
virtual void ExtractSymbolic(Candidate &candidate, FeatureVector< string, double > &symbolic_features)
Overridden to do nothing.
FileBackedLossSetter()
Constructs a new instance.
A container for all the member initializers for a particular Factory-constructible instance...