mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 13:23:25 +03:00
update confusion network to query InputFeature for paramters, rather than StaticData
This commit is contained in:
parent
fc7e4f4550
commit
cc0f00049e
@ -10,6 +10,7 @@
|
|||||||
#include "StaticData.h"
|
#include "StaticData.h"
|
||||||
#include "Sentence.h"
|
#include "Sentence.h"
|
||||||
#include "UserMessage.h"
|
#include "UserMessage.h"
|
||||||
|
#include "moses/FF/InputFeature.h"
|
||||||
|
|
||||||
namespace Moses
|
namespace Moses
|
||||||
{
|
{
|
||||||
@ -118,8 +119,14 @@ bool ConfusionNet::ReadFormat0(std::istream& in,
|
|||||||
const std::vector<FactorType>& factorOrder)
|
const std::vector<FactorType>& factorOrder)
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
size_t numInputScores = StaticData::Instance().GetNumInputScores();
|
|
||||||
size_t numRealWordCount = StaticData::Instance().GetNumRealWordsInInput();
|
const StaticData &staticData = StaticData::Instance();
|
||||||
|
const InputFeature *inputFeature = staticData.GetInputFeature();
|
||||||
|
size_t numInputScores = inputFeature->GetNumInputScores();
|
||||||
|
size_t numRealWordCount = inputFeature->GetNumRealWordsInInput();
|
||||||
|
//size_t numInputScores = staticData.GetNumInputScores();
|
||||||
|
//size_t numRealWordCount = staticData.GetNumRealWordsInInput();
|
||||||
|
|
||||||
size_t totalCount = numInputScores + numRealWordCount;
|
size_t totalCount = numInputScores + numRealWordCount;
|
||||||
bool addRealWordCount = (numRealWordCount > 0);
|
bool addRealWordCount = (numRealWordCount > 0);
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ bool Parameter::LoadParam(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save("/tmp/new.ini");
|
Save("/tmp/moses.ini.new");
|
||||||
|
|
||||||
// check if parameters make sense
|
// check if parameters make sense
|
||||||
return Validate() && noErrorFlag;
|
return Validate() && noErrorFlag;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "PCNTools.h"
|
#include "PCNTools.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "FloydWarshall.h"
|
#include "FloydWarshall.h"
|
||||||
|
#include "moses/FF/InputFeature.h"
|
||||||
|
|
||||||
namespace Moses
|
namespace Moses
|
||||||
{
|
{
|
||||||
@ -33,10 +34,15 @@ void WordLattice::Print(std::ostream& out) const
|
|||||||
|
|
||||||
int WordLattice::InitializeFromPCNDataType(const PCN::CN& cn, const std::vector<FactorType>& factorOrder, const std::string& debug_line)
|
int WordLattice::InitializeFromPCNDataType(const PCN::CN& cn, const std::vector<FactorType>& factorOrder, const std::string& debug_line)
|
||||||
{
|
{
|
||||||
size_t maxSizePhrase = StaticData::Instance().GetMaxPhraseLength();
|
const StaticData &staticData = StaticData::Instance();
|
||||||
|
const InputFeature *inputFeature = staticData.GetInputFeature();
|
||||||
|
//size_t numInputScores = inputFeature->GetNumInputScores();
|
||||||
|
//size_t numRealWordCount = inputFeature->GetNumRealWordsInInput();
|
||||||
size_t numInputScores = StaticData::Instance().GetNumInputScores();
|
size_t numInputScores = StaticData::Instance().GetNumInputScores();
|
||||||
size_t numRealWordCount = StaticData::Instance().GetNumRealWordsInInput();
|
size_t numRealWordCount = StaticData::Instance().GetNumRealWordsInInput();
|
||||||
|
|
||||||
|
size_t maxSizePhrase = StaticData::Instance().GetMaxPhraseLength();
|
||||||
|
|
||||||
bool addRealWordCount = (numRealWordCount > 0);
|
bool addRealWordCount = (numRealWordCount > 0);
|
||||||
|
|
||||||
//when we have one more weight than params, we add a word count feature
|
//when we have one more weight than params, we add a word count feature
|
||||||
|
Loading…
Reference in New Issue
Block a user