mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-19 15:17:10 +03:00
fixed sparse feature output
This commit is contained in:
parent
bf5c32df6c
commit
5f37a545b1
@ -11,7 +11,7 @@ void InternalStructStatelessFF::Evaluate(const Phrase &source
|
||||
, ScoreComponentCollection &estimatedFutureScore) const
|
||||
{
|
||||
// cerr << "MARIA!!!" << endl;
|
||||
// scoreBreakdown.PlusEquals(this, 1);
|
||||
scoreBreakdown.PlusEquals(this, 0);
|
||||
|
||||
}
|
||||
|
||||
@ -20,11 +20,12 @@ void InternalStructStatelessFF::Evaluate(const InputType &input
|
||||
, ScoreComponentCollection &scoreBreakdown) const
|
||||
{
|
||||
|
||||
//cerr << "HHHHH" << scoreBreakdown << endl;
|
||||
FactorList f_mask;
|
||||
cerr << "HHHHH" << scoreBreakdown << endl;
|
||||
scoreBreakdown.PlusEquals(this, 66);
|
||||
/* FactorList f_mask;
|
||||
f_mask.push_back(0);
|
||||
//if(inputPath.GetPhrase().GetStringRep(f_mask).)
|
||||
int score =0;
|
||||
int score =50;
|
||||
for(size_t i=0;i<inputPath.GetPhrase().GetSize();i++){
|
||||
if(inputPath.GetPhrase(). GetFactor(i,0)->GetString().as_string()=="ist"){
|
||||
//cout<<inputPath.GetPhrase().GetStringRep(f_mask);
|
||||
@ -32,6 +33,8 @@ void InternalStructStatelessFF::Evaluate(const InputType &input
|
||||
}
|
||||
}
|
||||
scoreBreakdown.PlusEquals(this, score);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -711,12 +711,13 @@ void outputPhrasePair(const PhraseAlignmentCollection &phrasePair, float totalCo
|
||||
|
||||
//MARIA
|
||||
//sparse features
|
||||
if(extraSparse.size()>0)
|
||||
phraseTableFile << " ||| ";
|
||||
for (map<string,float>::const_iterator i = extraSparse.begin();
|
||||
i != extraSparse.end(); ++i) {
|
||||
phraseTableFile << " " << i->first << " " << i->second;
|
||||
}
|
||||
phraseTableFile << " ||| ";
|
||||
for (map<string,float>::const_iterator i = extraSparse.begin();
|
||||
i != extraSparse.end(); ++i) {
|
||||
phraseTableFile << " " << i->first << " " << i->second;
|
||||
}
|
||||
// if(extraSparse.size()==0) //leave empty slot for 6th position; 7th is the extra information -> TreeFragments maybe
|
||||
// phraseTableFile << " ";
|
||||
|
||||
// tree fragments
|
||||
if (treeFragmentsFlag && !inverseFlag) {
|
||||
|
Loading…
Reference in New Issue
Block a user