-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSegParser.h
59 lines (47 loc) · 1.19 KB
/
SegParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* SegParser.h
*
* Created on: Mar 19, 2014
* Author: yuanz
*/
#ifndef SEGPARSER_H_
#define SEGPARSER_H_
#include <boost/multi_array.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>
#include "DependencyPipe.h"
#include "decoder/DevelopmentThread.h"
#include "Parameters.h"
#include "Options.h"
#include "decoder/DependencyDecoder.h"
namespace segparser {
using namespace std;
using namespace boost;
class Parameters;
class DependencyDecoder;
class DevelopmentThread;
class SegParser {
public:
SegParser(DependencyPipe* pipe, Options* options);
virtual ~SegParser();
void train(vector<inst_ptr>& il);
void trainingIter(vector<inst_ptr>& goldList, vector<inst_ptr>& predList, int iter);
void checkDevStatus(int iter);
void outputWeight(ofstream& fout, int type, Parameters* params);
void outputWeight(string fStr);
void loadModel(string file);
void saveModel(string file, Parameters* params);
void closeDecoder();
void evaluatePruning();
DependencyPipe* pipe;
DependencyDecoder* decoder;
Parameters* parameters;
Parameters* devParams;
DevelopmentThread* dt;
Options* options;
SegParser* pruner;
private:
int devTimes;
};
} /* namespace segparser */
#endif /* SEGPARSER_H_ */