51 tokenizer_.Tokenize(line_, tokens_);
52 if (token_idx_ >= tokens_.size()) {
53 cerr <<
"FileBackedLossSetter: error: line " << line_number()
54 <<
" contains " << tokens_.size() <<
" tokens but loss is at token "
55 <<
"index " << token_idx_ << endl;
57 candidate.set_loss(atof(tokens_[token_idx_].c_str()));
A “feature extractor” that reads lines from a backing file, setting each candidate’s loss via its Can...
A class to represent a candidate in a set of candidates that constitutes a training instance for a re...
Provides the reranker::FileBackedLossSetter class.
A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type.