Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
candidate-set-proto-writer.H
Go to the documentation of this file.
1 // Copyright 2012, Google Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
13 // distribution.
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 // -----------------------------------------------------------------------------
30 //
31 //
36 
37 #ifndef RERANKER_CANDIDATE_SET_PROTO_WRITER_H_
38 #define RERANKER_CANDIDATE_SET_PROTO_WRITER_H_
39 
40 #include <unordered_map>
41 #include <vector>
42 
43 #include "../proto/data.pb.h"
44 #include "../proto/model.pb.h"
45 #include "candidate.H"
46 #include "candidate-set.H"
47 #include "feature-vector-writer.H"
48 
49 namespace reranker {
50 
51 using std::unordered_map;
52 
53 using confusion_learning::CandidateSetMessage;
54 using confusion_learning::CandidateMessage;
55 using confusion_learning::FeatureVecMessage;
56 using confusion_learning::FeatureMessage;
57 using confusion_learning::ScoreMessage;
58 
63  public:
69 
77  void Write(const CandidateSet &set,
78  CandidateSetMessage *candidate_set_message) const;
79  private:
82 };
83 
84 } // namespace reranker
85 
86 #endif
Provides the reranker::Candidate class for representing a candidate hypothesis from an initial model...
A class to serialize FeatureVector instances to FeatureVecMessage instances.
void Write(const CandidateSet &set, CandidateSetMessage *candidate_set_message) const
Serializes a CandidateSet instance to a CandidateSetMessage.
A class to construct a CandidateSetMessage from a CandidateSet instance.
virtual ~CandidateSetProtoWriter()
Destroys this writer.
A class to hold a set of candidates, either for training or test.
Definition: candidate-set.H:62
Serializer for reranker::FeatureVector instances to FeatureVecMessage instances.
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.
CandidateSetProtoWriter()
Constructs a new instance that can serialize CandidateSet instances to CandidateSetMessage protocol b...