mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
compiles with bjam
This commit is contained in:
parent
08be3b6b4f
commit
53073726d6
7
Jamroot
7
Jamroot
@ -114,6 +114,13 @@ requirements += [ option.get "with-mm" : : <define>PT_UG ] ;
|
|||||||
requirements += [ option.get "with-mm" : : <define>MAX_NUM_FACTORS=4 ] ;
|
requirements += [ option.get "with-mm" : : <define>MAX_NUM_FACTORS=4 ] ;
|
||||||
requirements += [ option.get "unlabelled-source" : : <define>UNLABELLED_SOURCE ] ;
|
requirements += [ option.get "unlabelled-source" : : <define>UNLABELLED_SOURCE ] ;
|
||||||
|
|
||||||
|
if [ option.get "with-lbllm" ] {
|
||||||
|
external-lib boost_serialization ;
|
||||||
|
external-lib gomp ;
|
||||||
|
requirements += <library>boost_serialization ;
|
||||||
|
requirements += <library>gomp ;
|
||||||
|
}
|
||||||
|
|
||||||
if [ option.get "with-cmph" ] {
|
if [ option.get "with-cmph" ] {
|
||||||
requirements += <define>HAVE_CMPH ;
|
requirements += <define>HAVE_CMPH ;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,14 @@ if $(with-dlib) {
|
|||||||
dlib = ;
|
dlib = ;
|
||||||
}
|
}
|
||||||
|
|
||||||
alias headers : ../util//kenutil : : : $(max-factors) $(dlib) ;
|
with-lbllm = [ option.get "with-lbllm" ] ;
|
||||||
|
if $(with-lbllm) {
|
||||||
|
lbllm2 = <cxxflags>-std=c++0x <define>LM_LBL <include>$(with-lbllm)/src <include>$(with-lbllm)/3rdparty/eigen-3 ;
|
||||||
|
} else {
|
||||||
|
lbllm2 = ;
|
||||||
|
}
|
||||||
|
|
||||||
|
alias headers : ../util//kenutil : : : $(max-factors) $(dlib) $(lbllm2) ;
|
||||||
alias ThreadPool : ThreadPool.cpp ;
|
alias ThreadPool : ThreadPool.cpp ;
|
||||||
alias Util : Util.cpp Timer.cpp ;
|
alias Util : Util.cpp Timer.cpp ;
|
||||||
|
|
||||||
|
@ -93,13 +93,16 @@ if $(with-nplm) {
|
|||||||
#LBLLM
|
#LBLLM
|
||||||
local with-lbllm = [ option.get "with-lbllm" ] ;
|
local with-lbllm = [ option.get "with-lbllm" ] ;
|
||||||
if $(with-lbllm) {
|
if $(with-lbllm) {
|
||||||
lib lblLM : : <search>$(with-lbllm)/lib <search>$(with-lbllm)/lib64 ;
|
lib lbl : : <search>$(with-lbllm)/lib <search>$(with-lbllm)/lib64 ;
|
||||||
obj LBLLM.o : LBLLM.cpp lblLM ..//headers : <include>$(with-lbllm)/src <include>$(with-lbllm)/3rdparty/eigen-3 ;
|
obj LBLLM.o : LBLLM.cpp lbl ..//headers : <include>$(with-lbllm)/src <include>$(with-lbllm)/3rdparty/eigen-3 ;
|
||||||
alias lbllm : LBLLM.o lblLM : : : <cxxflags>-std=c++0x <linkflags>-std=c++0x <define>LM_LBL ;
|
obj LBLLM2.o : oxlm/LBLLM2.cpp lbl ..//headers : <include>$(with-lbllm)/src <include>$(with-lbllm)/3rdparty/eigen-3 ;
|
||||||
|
obj Mapper.o : oxlm/Mapper.cpp lbl ..//headers : <include>$(with-lbllm)/src <include>$(with-lbllm)/3rdparty/eigen-3 ;
|
||||||
|
alias lbllm : LBLLM.o LBLLM2.o Mapper.o lbl : : : <cxxflags>-std=c++0x <define>LM_LBL ;
|
||||||
dependencies += lbllm ;
|
dependencies += lbllm ;
|
||||||
lmmacros += LM_LBL ;
|
lmmacros += LM_LBL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#DALM
|
#DALM
|
||||||
local with-dalm = [ option.get "with-dalm" ] ;
|
local with-dalm = [ option.get "with-dalm" ] ;
|
||||||
if $(with-dalm) {
|
if $(with-dalm) {
|
||||||
|
@ -87,6 +87,17 @@ void LanguageModelSingleFactor::SetParameter(const std::string& key, const std::
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string LanguageModelSingleFactor::DebugContextFactor(const std::vector<const Word*> &contextFactor) const
|
||||||
|
{
|
||||||
|
std::string ret;
|
||||||
|
for (size_t i = 0; i < contextFactor.size(); ++i) {
|
||||||
|
const Word &word = *contextFactor[i];
|
||||||
|
ret += word.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,6 +67,8 @@ public:
|
|||||||
virtual LMResult GetValueForgotState(const std::vector<const Word*> &contextFactor, FFState &outState) const;
|
virtual LMResult GetValueForgotState(const std::vector<const Word*> &contextFactor, FFState &outState) const;
|
||||||
|
|
||||||
virtual LMResult GetValue(const std::vector<const Word*> &contextFactor, State* finalState = NULL) const = 0;
|
virtual LMResult GetValue(const std::vector<const Word*> &contextFactor, State* finalState = NULL) const = 0;
|
||||||
|
|
||||||
|
std::string DebugContextFactor(const std::vector<const Word*> &contextFactor) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,6 +68,11 @@ public:
|
|||||||
|
|
||||||
virtual LMResult GetValue(const std::vector<const Word*> &contextFactor, State* finalState = 0) const
|
virtual LMResult GetValue(const std::vector<const Word*> &contextFactor, State* finalState = 0) const
|
||||||
{
|
{
|
||||||
|
std::string str = DebugContextFactor(contextFactor);
|
||||||
|
if (str == "unterstützende ") {
|
||||||
|
std::cerr << str << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<int> ids;
|
std::vector<int> ids;
|
||||||
ids = mapper->convert(contextFactor);
|
ids = mapper->convert(contextFactor);
|
||||||
int word = ids.back();
|
int word = ids.back();
|
||||||
@ -77,6 +82,7 @@ public:
|
|||||||
|
|
||||||
double score;
|
double score;
|
||||||
score = model.predict(word, ids);
|
score = model.predict(word, ids);
|
||||||
|
std::cerr << "contextFactor=" << str << " " << score << std::endl;
|
||||||
|
|
||||||
LMResult ret;
|
LMResult ret;
|
||||||
ret.score = score;
|
ret.score = score;
|
||||||
|
Loading…
Reference in New Issue
Block a user