Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions | Variables
piped-model-evaluator.C File Reference

An executable that loads one or more development test files into memory and then continuously reads filenames from stdin, loading the Model instance from each file and evaluating on the development test data, printing the loss to stdout. More...

#include <iostream>
#include <fstream>
#include <string>
#include <memory>
#include <unistd.h>
#include "candidate-set-iterator.H"
#include "candidate-set-reader.H"
#include "model.H"
#include "model-reader.H"

Go to the source code of this file.

Macros

#define DEBUG   0
 
#define PROG_NAME   "piped-model-evaluator"
 
#define DEFAULT_MAX_EXAMPLES   -1
 
#define DEFAULT_MAX_CANDIDATES   -1
 
#define DEFAULT_REPORTING_INTERVAL   1000
 
#define DEFAULT_USE_WEIGHTED_LOSS   true
 
#define XSTR(arg)   STR(arg)
 Expands the string value of the specified argument using the STR macro. More...
 
#define STR(arg)   #arg
 “Returns” the string value of the specified argument. More...
 

Functions

void usage ()
 
bool check_for_required_arg (int argc, int i, string err_msg)
 
int main (int argc, char **argv)
 

Variables

const char * usage_msg []
 

Detailed Description

An executable that loads one or more development test files into memory and then continuously reads filenames from stdin, loading the Model instance from each file and evaluating on the development test data, printing the loss to stdout.

Definition in file piped-model-evaluator.C.

Macro Definition Documentation

#define DEBUG   0

Definition at line 49 of file piped-model-evaluator.C.

#define DEFAULT_MAX_CANDIDATES   -1

Definition at line 54 of file piped-model-evaluator.C.

#define DEFAULT_MAX_EXAMPLES   -1

Definition at line 53 of file piped-model-evaluator.C.

#define DEFAULT_REPORTING_INTERVAL   1000

Definition at line 55 of file piped-model-evaluator.C.

#define DEFAULT_USE_WEIGHTED_LOSS   true

Definition at line 56 of file piped-model-evaluator.C.

#define PROG_NAME   "piped-model-evaluator"

Definition at line 51 of file piped-model-evaluator.C.

#define STR (   arg)    #arg

“Returns” the string value of the specified argument.

Definition at line 63 of file piped-model-evaluator.C.

#define XSTR (   arg)    STR(arg)

Expands the string value of the specified argument using the STR macro.

Definition at line 61 of file piped-model-evaluator.C.

Function Documentation

bool check_for_required_arg ( int  argc,
int  i,
string  err_msg 
)

Definition at line 108 of file piped-model-evaluator.C.

int main ( int  argc,
char **  argv 
)

Definition at line 119 of file piped-model-evaluator.C.

void usage ( )

Definition at line 100 of file piped-model-evaluator.C.

Variable Documentation

const char* usage_msg[]
Initial value:
= {
"Usage:\n",
"piped-model-evaluator" " -d|--devtest <devtest input file>+\n",
"\t[--dev-config <devtest feature extractor config file>]\n",
"\t[--model-files <file with model filenames>\n",
"\t[-u] [--no-base64]\n",
"\t[--max-examples <max num examples>]\n",
"\t[--max-candidates <max num candidates>]\n",
"\t[-r <reporting interval>] [ --use-weighted-loss[=][true|false] ]\n",
"where\n",
"\t<devtest input file> is the name of a stream of serialized\n",
"\t\tCandidateSet instances, or \"-\" for input from standard input\n",
"\t\t(required unless training in mapper mode)\n",
"\t--model-files specifies the name of a file from which to read model\n",
"\t\tmodel filenames (use this option for debugging; defaults to stdin)\n",
"\t-u specifies that the input files are uncompressed\n",
"\t--no-base64 specifies not to use base64 encoding/decoding\n",
"\t--max-examples specifies the maximum number of examples to read from\n",
"\t\tany input file (defaults to " "-1" ")\n",
"\t--max-candidates specifies the maximum number of candidates to read\n",
"\t\tfor any candidate set (defaults to " "-1" ")\n",
"\t-r specifies the interval at which the CandidateSetReader reports how\n",
"\t\tmany candidate sets it has read (defaults to "
"1000" ")\n",
"\t--use-weighted-loss specifies whether to weight losses on devtest\n",
"\t\texamples by the number of tokens in the reference, where, e.g.,\n",
"\t\tweighted loss is appropriate for computing WER, but not BLEU\n",
"\t\t(defaults to " "true" ")\n"
}

Definition at line 68 of file piped-model-evaluator.C.