Cambridge SMT System
lmert.main.cpp
Go to the documentation of this file.
1
#include <
main.custom_assert.hpp
>
2
#include <
main.logger.hpp
>
3
#include <
main.lmert.hpp
>
4
5
int
main
(
int
argc,
const
char
* argv[] ) {
6
using namespace
ucam::util
;
7
using namespace
ucam::fsttools
;
8
using namespace
ucam::lmert
;
9
using namespace
HifstConstants
;
10
initLogger
( argc, argv );
11
FORCELINFO
( argv[0] <<
" starts!"
);
12
RegistryPO
rg ( argc, argv );
13
FORCELINFO
( rg.
dump
(
"CONFIG parameters:\n====================="
,
"====================="
) );
14
std::string extTok(rg.
exists
(
kLmertExternalTokenizer
) ? rg.
getString
(
kLmertExternalTokenizer
) :
""
);
15
std::string wMap(rg.
exists
(
kLmertWMap
) ? rg.
getString
(
kLmertWMap
) :
""
);
16
std::string refFiles;
17
bool
intRefs;
18
if
(rg.
exists
(
kLmertWordRefs
)) {
19
refFiles = rg.
getString
(
kLmertWordRefs
);
20
intRefs =
false
;
21
}
22
if
(rg.
exists
(
kLmertIntRefs
)) {
23
refFiles = rg.
getString
(
kLmertIntRefs
);
24
intRefs =
true
;
25
}
26
unsigned
int
bleuCacheSize = rg.
get
<
int
>(
kLmertBleuCacheSize
);
27
BleuScorer
bleuScorer(refFiles, extTok, bleuCacheSize, intRefs, wMap);
28
TuneSet< TupleArc32 >
tuneSet(rg);
29
PARAMS32
lambda = ParseParamString<float>(rg.
getString
(
kLmertInitialParams
));
30
RandomLineSearch< TupleArc32 >
rls(rg, tuneSet, bleuScorer, lambda);
31
LINFO
(bleuScorer.CacheStats());
32
FORCELINFO
(argv[0] <<
" finished!"
);
33
}
ucam::fsttools::BleuScorer
Definition:
bleu.hpp:165
HifstConstants::kLmertWordRefs
std::string const kLmertWordRefs
Definition:
constants-lmert.hpp:9
main.lmert.hpp
ucam::util::RegistryPO
Definition:
registrypo.hpp:95
ucam::lmert::RandomLineSearch
Definition:
randomlinesearch.hpp:16
LINFO
#define LINFO(msg)
Definition:
logger.boost_log.hpp:78
main
int main(int argc, const char *argv[])
Definition:
lmert.main.cpp:5
ucam::util::RegistryPO::get
T get(const std::string &key) const
Returns parsed value associated to key.
Definition:
registrypo.hpp:194
ucam::util::initLogger
void initLogger(int argc, const char *argv[])
Inits logger, parses param options checking for –logger.verbose.
Definition:
logger.boost_log.hpp:55
FORCELINFO
#define FORCELINFO(msg)
Definition:
logger.boost_log.hpp:79
ucam::util
Definition:
main.applylm.hpp:25
ucam::fsttools::TuneSet
Definition:
tuneset.hpp:14
HifstConstants
Definition:
constants-fsttools.hpp:4
HifstConstants::kLmertWMap
std::string const kLmertWMap
Definition:
constants-lmert.hpp:17
main.logger.hpp
Static variables for logger. Include only once from main file.
ucam::fsttools::PARAMS32
std::vector< float > PARAMS32
Definition:
bleu.hpp:18
ucam::util::RegistryPO::getString
std::string getString(const std::string &key) const
Performs get<string> and checks whether the real value is to be loaded from file (–param=file://.....)
Definition:
registrypo.hpp:205
ucam::util::RegistryPO::exists
bool exists(const std::string &key) const
Determines whether a program option (key) has been defined by the user.
Definition:
registrypo.hpp:235
HifstConstants::kLmertIntRefs
std::string const kLmertIntRefs
Definition:
constants-lmert.hpp:10
ucam::util::RegistryPO::dump
std::string dump(const std::string &decorator_start="", const std::string &decorator_end="")
Dumps all configuration parameters into a string with a reasonably pretty format. ...
Definition:
registrypo.hpp:108
HifstConstants::kLmertInitialParams
std::string const kLmertInitialParams
Definition:
constants-lmert.hpp:8
ucam::lmert
Definition:
lineoptimize.hpp:9
ucam::fsttools
Definition:
bleu.hpp:15
HifstConstants::kLmertBleuCacheSize
std::string const kLmertBleuCacheSize
Definition:
constants-lmert.hpp:18
HifstConstants::kLmertExternalTokenizer
std::string const kLmertExternalTokenizer
Definition:
constants-lmert.hpp:16
main.custom_assert.hpp
Static variable for custom_assert. Include only once from main file.
ucam-smt
cpp
lmert
lmert.main.cpp
Generated on Wed May 25 2016 10:26:01 for Cambridge SMT System by
1.8.11