mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
- creates a virtual phrase table at decoding time based on a vector of component models and a combination algorithm - linear interpolation or instance weighting - two possible component model types supported so far: 0 (in-memory) or 12 (compact) - weights can be set in config, and overriden on a sentence-level through mosesserver API - online optimization (perplexity minimization) using dlib and xmlrpc-c call
57 lines
1.7 KiB
Plaintext
57 lines
1.7 KiB
Plaintext
max-factors = [ option.get "max-factors" : 4 : 4 ] ;
|
|
path-constant FACTOR-LOG : bin/factor.log ;
|
|
update-if-changed $(FACTOR-LOG) $(max-factors) ;
|
|
max-factors = <define>MAX_NUM_FACTORS=$(max-factors) <dependency>$(FACTOR-LOG) ;
|
|
|
|
with-dlib = [ option.get "with-dlib" ] ;
|
|
if $(with-dlib) {
|
|
dlib = <define>WITH_DLIB <include>$(with-dlib) ;
|
|
} else {
|
|
dlib = ;
|
|
}
|
|
|
|
alias headers : ../util//kenutil : : : $(max-factors) $(dlib) ;
|
|
|
|
alias ThreadPool : ThreadPool.cpp ;
|
|
|
|
if [ option.get "with-synlm" : no : yes ] = yes
|
|
{
|
|
lib m ;
|
|
obj SyntacticLanguageModel.o : SyntacticLanguageModel.cpp headers : <include>$(TOP)/synlm/hhmm/rvtl/include <include>$(TOP)/synlm/hhmm/wsjparse/include ;
|
|
alias synlm : SyntacticLanguageModel.o m : : : <define>HAVE_SYNLM ;
|
|
} else {
|
|
alias synlm ;
|
|
}
|
|
|
|
local have-clock = [ SHELL "bash -c \"g++ -dM -x c++ -E /dev/null -include time.h 2>/dev/null |grep CLOCK_MONOTONIC\"" : exit-status ] ;
|
|
if $(have-clock[2]) = 0 {
|
|
#required for clock_gettime. Threads already have rt.
|
|
lib rt : : <runtime-link>static:<link>static <runtime-link>shared:<link>shared ;
|
|
} else {
|
|
alias rt ;
|
|
}
|
|
|
|
lib moses :
|
|
[ glob
|
|
*.cpp
|
|
TranslationModel/*.cpp
|
|
TranslationModel/fuzzy-match/*.cpp
|
|
TranslationModel/DynSAInclude/*.cpp
|
|
TranslationModel/RuleTable/*.cpp
|
|
TranslationModel/Scope3Parser/*.cpp
|
|
TranslationModel/CYKPlusParser/*.cpp
|
|
: #exceptions
|
|
ThreadPool.cpp
|
|
SyntacticLanguageModel.cpp
|
|
*Test.cpp Mock*.cpp
|
|
]
|
|
headers LM//LM TranslationModel/CompactPT//CompactPT synlm ThreadPool rt
|
|
..//search ../util/double-conversion//double-conversion ..//z ../OnDiskPt//OnDiskPt ;
|
|
|
|
alias headers-to-install : [ glob-tree *.h ] ;
|
|
|
|
import testing ;
|
|
|
|
unit-test moses_test : [ glob *Test.cpp Mock*.cpp ] moses headers ..//z ../OnDiskPt//OnDiskPt ..//boost_unit_test_framework ;
|
|
|