ZGen  0.2.0
a linearization system for natural language.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pipe.h
Go to the documentation of this file.
1 #ifndef __ZGEN_BESTFIRST_PIPE_H__
2 #define __ZGEN_BESTFIRST_PIPE_H__
3 
4 #include "types/instance.h"
6 #include "bestfirst/option.h"
11 
12 namespace ZGen {
13 
14 namespace BestFirst {
15 
16 class Pipe {
17 public:
18  Pipe(const Option& opts);
19 
20  ~Pipe();
21 
25  void realize();
26 
30  void save_model();
31 
32 private:
33  bool prepare_data();
34 
36  void build_output(const Span* span, dependency_t& output);
37 
38 private:
40  const Option& opts;
42  Model* model;
44  Knowledge::PostagConstrain * constrain;
46  SpanAllocator* allocator;
48  SpanFactory* factory;
50  Learner* learner;
51 
52  SpanSet gold_spans; /*< The gold spans. */
53  SpanMaxHeap agenda; /*< The open table in best-first search. */
54  SpanKMaxHeap chart; /*< The span chart for storing spans.*/
55  SpanSet chart_mask;
56 
57  std::vector<dependency_t> dataset;
58  std::vector<dependency_t> referset;
59 };
60 
61 } // end for namespace BestFirst
62 
63 } // end for namespace ZGen
64 
65 #endif // end for __ZGEN_BESTFIRST_PIPE_H__
Definition: learner.h:13
boost::unordered_set< Span *, SpanPtrHash, SpanPtrEqual > SpanSet
Definition: span_types.h:12
~Pipe()
Definition: pipe.cc:46
Definition: instance.h:18
Definition: postag_constrain.h:14
boost::heap::priority_queue< Span *, boost::heap::compare< SpanPtrLess > > SpanMaxHeap
Definition: span_types.h:14
Definition: option.h:10
Definition: pipe.h:16
void save_model()
Definition: pipe.cc:145
Definition: model.h:12
Pipe(const Option &opts)
Definition: pipe.cc:18
Definition: span_allocator.h:27
Definition: span_types.h:18
Definition: span.h:13
Definition: span_factory.h:15
void realize()
Definition: pipe.cc:54