forked from HIT-SCIR/ltp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.h
66 lines (56 loc) · 2.26 KB
/
options.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
60
61
62
63
64
65
66
#ifndef __LTP_PARSERN_OPTIONS_H__
#define __LTP_PARSERN_OPTIONS_H__
#include <iostream>
namespace ltp {
namespace depparser {
struct SpecialOption {
static std::string UNKNOWN;
static std::string NIL;
static std::string ROOT;
};
struct BasicOption {
std::string model_file; //! The path to the model.
std::string root; //! The root.
};
struct AdaOption {
double ada_eps; //! Eps used in AdaGrad
double ada_alpha; //! Alpha used in AdaGrad
double lambda; //! TODO not known.
double dropout_probability; //! The probability for dropout.
};
struct NetworkOption {
int hidden_layer_size; //! Size for hidden layer.
int embedding_size; //! Size for embedding.
};
struct LearnOption:
public BasicOption,
public AdaOption,
public NetworkOption {
std::string reference_file; //! The path to the reference file.
std::string devel_file; //! The path to the devel file.
std::string embedding_file; //! The path to the embedding.
std::string cluster_file; //! The path to the cluster file, actived in use-cluster.
std::string oracle; //! The oracle type, can be [static, nondet, explore]
int word_cutoff; //! The frequency of rare word, word lower than that
//! will be cut off.
int max_iter; //! The maximum iteration.
double init_range; //!
int batch_size; //! The Size of batch.
int nr_precomputed; //! The number of precomputed features
int evaluation_stops; //!
int clear_gradient_per_iter; //! clear gradient each iteration.
bool save_intermediate; //! Save model whenever see an improved UAS.
bool fix_embeddings; //! Not tune the embedding when learning the parameters
bool use_distance; //! Specify to use distance feature.
bool use_valency; //! Specify to use valency feature.
bool use_cluster; //! Specify to use cluster feature.
};
struct TestOption:
public BasicOption {
std::string input_file; //! The path to the input file.
std::string output_file; //! The path to the output file.
bool evaluate;
};
} // namespace depparser
} // namespace ltp
#endif // end for __LTP_PARSERN_OPTIONS_H__