allow mira compilation for Eva

This commit is contained in:
Hieu Hoang 2015-01-08 12:37:34 +00:00
parent 13ec6060b0
commit 782ac85674
5 changed files with 23 additions and 6 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 ;

View File

@ -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

View File

@ -613,6 +613,8 @@ public:
return m_continuePartialTranslation;
}
void ReLoadBleuScoreFeatureParameter(float weight);
Parameter* GetParameter() {
return m_parameter;
}