ZGen
0.2.0
a linearization system for natural language.
Main Page
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
bestfirst
pipe
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
"
5
#include "
knowledge/postag_constrain.h
"
6
#include "
bestfirst/option.h
"
7
#include "
bestfirst/learning/learner.h
"
8
#include "
bestfirst/search/span_types.h
"
9
#include "
bestfirst/search/span_allocator.h
"
10
#include "
bestfirst/search/span_factory.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__
span_types.h
learner.h
ZGen::BestFirst::Learner
Definition:
learner.h:13
ZGen::BestFirst::SpanSet
boost::unordered_set< Span *, SpanPtrHash, SpanPtrEqual > SpanSet
Definition:
span_types.h:12
ZGen::BestFirst::Pipe::~Pipe
~Pipe()
Definition:
pipe.cc:46
ZGen::DependencyParse
Definition:
instance.h:18
ZGen::Knowledge::PostagConstrain
Definition:
postag_constrain.h:14
ZGen::BestFirst::SpanMaxHeap
boost::heap::priority_queue< Span *, boost::heap::compare< SpanPtrLess > > SpanMaxHeap
Definition:
span_types.h:14
ZGen::BestFirst::Option
Definition:
option.h:10
span_allocator.h
ZGen::BestFirst::Pipe
Definition:
pipe.h:16
instance.h
option.h
ZGen::BestFirst::Pipe::save_model
void save_model()
Definition:
pipe.cc:145
ZGen::BestFirst::Model
Definition:
model.h:12
postag_constrain.h
ZGen::BestFirst::Pipe::Pipe
Pipe(const Option &opts)
Definition:
pipe.cc:18
ZGen::BestFirst::SpanAllocator
Definition:
span_allocator.h:27
ZGen::BestFirst::SpanKMaxHeap
Definition:
span_types.h:18
ZGen::BestFirst::Span
Definition:
span.h:13
ZGen::BestFirst::SpanFactory
Definition:
span_factory.h:15
ZGen::BestFirst::Pipe::realize
void realize()
Definition:
pipe.cc:54
span_factory.h
Generated by
1.8.6