Actually, I do know it at construction time. For instance I specify a 
string "scores=mdis" in the ini, every character in the value 
corresponds to one type of score, so I have 4 feature scores. Setting 
again "num-features=4" is redundant now (I guess I can still do that, 
but I don't like it). I see the number of scores is set in the low-level 
function ParseLine in the FeatureFunction class, should I override 
ParseLine in the inherited class then?

W dniu 14.06.2014 20:11, Hieu Hoang pisze:
> the number of scores must be set in the feature function constructor, 
> there's no functionality to change it once its set
>
> You might be better off using sparse features if you don't know how 
> many scores you have at construction time
>
>
> On 14/06/14 09:17, Marcin Junczys-Dowmunt wrote:
>> Hi,
>> what's the trick for defining a feature function with a variable number
>> of scores based on custom parameters in the ini-file?
>> Just setting m_numScoreComponents = 2 in SetParameter(...) doesn't work.
>> It seems the number of features is registered somewhere on object
>> creation as I get the followiing message:
>>
>> Exception: moses/ScoreComponentCollection.cpp:242 in void
>> Moses::ScoreComponentCollection::Assign(const Moses::FeatureFunction*,
>> const std::vector<float>&) threw util::Exception'.
>> Feature function EditOps0 specified 1 dense scores or weights. Actually
>> has 2
>>
>> Thanks,
>> Marcin
>>
>>
>> _______________________________________________
>> Moses-support mailing list
>> [email protected]
>> http://mailman.mit.edu/mailman/listinfo/moses-support
>>
>

_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to