46 using namespace reranker;
49 main(
int argc,
char **argv) {
51 shared_ptr<FeatureExtractor> example_feature_extractor1 =
52 factory.
CreateOrDie(
"ExampleFeatureExtractor(arg(\"my_feats:\"))",
"");
54 shared_ptr<FeatureExtractor> example_feature_extractor2 =
55 factory.
CreateOrDie(
"ExampleFeatureExtractor(b(true), "
56 "arg(\"your_feats:\"))",
"");
58 shared_ptr<FeatureExtractor> example_feature_extractor3 =
59 factory.
CreateOrDie(
"ExampleFeatureExtractor(arg(\"whose_feats:\"), "
60 "strvec({\"foo\", \"bar\", \"baz\"}))",
"");
62 shared_ptr<FeatureExtractor> example_feature_extractor4 =
63 factory.
CreateOrDie(
"ExampleFeatureExtractor(b(true))",
"");
67 shared_ptr<Candidate> c1(
new Candidate(0, 0.1, 0.7, 5,
68 "This is a silly string."));
70 shared_ptr<Candidate> c2(
new Candidate(1, 0.2, 0.8, 5,
71 "This is a sillier string."));
74 example_feature_extractor1->Extract(candidate_set);
75 example_feature_extractor2->Extract(candidate_set);
76 example_feature_extractor3->Extract(candidate_set);
78 cout << candidate_set << endl;
Provides the reranker::Candidate class for representing a candidate hypothesis from an initial model...
void set_reference_string(const string &reference_string)
void AddCandidate(shared_ptr< Candidate > candidate)
Factory for dynamically created instance of the specified type.
A class to hold a set of candidates, either for training or test.
shared_ptr< T > CreateOrDie(StreamTokenizer &st, Environment *env=NULL)
Dynamically creates an object, whose type and initialization are contained in a specification string...
A class to represent a candidate in a set of candidates that constitutes a training instance for a re...
Class to hold a single training instance for a reranker, which is a set of examples, typically the n-best output of some input process, posibly including a gold-standard feature vector.