mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-01 16:33:16 +03:00
start show weights
This commit is contained in:
parent
33ec4cb7ab
commit
7eb759d1d9
@ -16,12 +16,15 @@ using namespace std;
|
||||
namespace Moses2
|
||||
{
|
||||
|
||||
FeatureFunction::FeatureFunction(size_t startInd, const std::string &line) :
|
||||
m_startInd(startInd), m_numScores(1), m_PhraseTableInd(NOT_FOUND)
|
||||
{
|
||||
ParseLine(line);
|
||||
cerr << GetName() << " " << m_startInd << "-" << (m_startInd + m_numScores - 1) << endl;
|
||||
}
|
||||
FeatureFunction::FeatureFunction(size_t startInd, const std::string &line)
|
||||
:m_startInd(startInd)
|
||||
,m_numScores(1)
|
||||
,m_PhraseTableInd(NOT_FOUND)
|
||||
,m_tuneable(true)
|
||||
{
|
||||
ParseLine(line);
|
||||
cerr << GetName() << " " << m_startInd << "-" << (m_startInd + m_numScores - 1) << endl;
|
||||
}
|
||||
|
||||
FeatureFunction::~FeatureFunction()
|
||||
{
|
||||
|
@ -73,6 +73,14 @@ public:
|
||||
return m_PhraseTableInd;
|
||||
}
|
||||
|
||||
//! if false, then this feature is not displayed in the n-best list.
|
||||
// use with care
|
||||
virtual bool IsTuneable() const
|
||||
{
|
||||
return m_tuneable;
|
||||
}
|
||||
|
||||
|
||||
// may have more factors than actually need, but not guaranteed.
|
||||
virtual void
|
||||
EvaluateInIsolation(MemPool &pool, const System &system, const Phrase<Moses2::Word> &source,
|
||||
|
@ -212,27 +212,13 @@ void FeatureFunctions::EvaluateWhenAppliedBatch(const Batch &batch) const
|
||||
|
||||
void FeatureFunctions::ShowWeights()
|
||||
{
|
||||
/*
|
||||
const vector<const StatelessFeatureFunction*>& slf = StatelessFeatureFunction::GetStatelessFeatureFunctions();
|
||||
const vector<const StatefulFeatureFunction*>& sff = StatefulFeatureFunction::GetStatefulFeatureFunctions();
|
||||
|
||||
for (size_t i = 0; i < sff.size(); ++i) {
|
||||
const StatefulFeatureFunction *ff = sff[i];
|
||||
BOOST_FOREACH(const FeatureFunction *ff, m_featureFunctions) {
|
||||
if (ff->IsTuneable()) {
|
||||
PrintFeatureWeight(ff);
|
||||
} else {
|
||||
cout << ff->GetScoreProducerDescription() << " UNTUNEABLE" << endl;
|
||||
cout << ff->GetName() << " UNTUNEABLE" << endl;
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < slf.size(); ++i) {
|
||||
const StatelessFeatureFunction *ff = slf[i];
|
||||
if (ff->IsTuneable()) {
|
||||
PrintFeatureWeight(ff);
|
||||
} else {
|
||||
cout << ff->GetScoreProducerDescription() << " UNTUNEABLE" << endl;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user