mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 21:42:19 +03:00
allow mira compilation for Eva
This commit is contained in:
parent
13ec6060b0
commit
782ac85674
6
Jamroot
6
Jamroot
@ -173,8 +173,8 @@ project : requirements
|
||||
;
|
||||
|
||||
#Add directories here if you want their incidental targets too (i.e. tests).
|
||||
build-projects lm util phrase-extract phrase-extract/syntax-common search moses moses/LM mert moses-cmd scripts regression-testing ;
|
||||
# mira
|
||||
build-projects lm util phrase-extract phrase-extract/syntax-common search moses moses/LM mert moses-cmd scripts regression-testing ;
|
||||
# contrib/mira
|
||||
|
||||
if [ option.get "with-mm" : : "yes" ]
|
||||
{
|
||||
@ -229,7 +229,7 @@ phrase-extract//extract-mixed-syntax
|
||||
phrase-extract//score-stsg
|
||||
phrase-extract//filter-rule-table
|
||||
biconcor
|
||||
#mira//mira
|
||||
#contrib/mira//mira
|
||||
contrib/server//mosesserver
|
||||
mm
|
||||
rephraser
|
||||
|
@ -280,7 +280,7 @@ void MosesDecoder::initialize(StaticData& staticData, const std::string& source,
|
||||
|
||||
// set weight of BleuScoreFeature
|
||||
//cerr << "Reload Bleu feature weight: " << bleuObjectiveWeight*bleuScoreWeight << " (" << bleuObjectiveWeight << "*" << bleuScoreWeight << ")" << endl;
|
||||
//staticData.ReLoadBleuScoreFeatureParameter(bleuObjectiveWeight*bleuScoreWeight);
|
||||
staticData.ReLoadBleuScoreFeatureParameter(bleuObjectiveWeight*bleuScoreWeight);
|
||||
|
||||
m_bleuScoreFeature->SetCurrSourceLength((*m_sentence).GetSize());
|
||||
if (chartDecoding)
|
||||
|
@ -1,8 +1,8 @@
|
||||
lib mira_lib :
|
||||
[ glob *.cpp : *Test.cpp Main.cpp ]
|
||||
../mert//mert_lib ../moses//moses ../OnDiskPt//OnDiskPt ..//boost_program_options ;
|
||||
../../mert//mert_lib ../../moses//moses ../../OnDiskPt//OnDiskPt ../..//boost_program_options ;
|
||||
|
||||
exe mira : Main.cpp mira_lib ../mert//mert_lib ../moses//moses ../OnDiskPt//OnDiskPt ..//boost_program_options ..//boost_filesystem ;
|
||||
exe mira : Main.cpp mira_lib ../../mert//mert_lib ../../moses//moses ../../OnDiskPt//OnDiskPt ../..//boost_program_options ../..//boost_filesystem ;
|
||||
|
||||
alias programs : mira ;
|
||||
|
||||
|
@ -803,6 +803,21 @@ void StaticData::LoadDecodeGraphsNew(const std::vector<std::string> &mappingVect
|
||||
|
||||
}
|
||||
|
||||
void StaticData::ReLoadBleuScoreFeatureParameter(float weight)
|
||||
{
|
||||
//loop over ScoreProducers to update weights of BleuScoreFeature
|
||||
const std::vector<FeatureFunction*> &producers = FeatureFunction::GetFeatureFunctions();
|
||||
for(size_t i=0; i<producers.size(); ++i) {
|
||||
FeatureFunction *ff = producers[i];
|
||||
std::string ffName = ff->GetScoreProducerDescription();
|
||||
|
||||
if (ffName == "BleuScoreFeature") {
|
||||
SetWeight(ff, weight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ScoreComponentCollection StaticData::GetAllWeightsScoreComponentCollection() const {}
|
||||
// in ScoreComponentCollection.h
|
||||
|
||||
|
@ -613,6 +613,8 @@ public:
|
||||
return m_continuePartialTranslation;
|
||||
}
|
||||
|
||||
void ReLoadBleuScoreFeatureParameter(float weight);
|
||||
|
||||
Parameter* GetParameter() {
|
||||
return m_parameter;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user