mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 15:48:05 +03:00
re-apply changes unrelated to setting reference translations
This commit is contained in:
parent
b263f14f63
commit
eebfd61e48
@ -70,14 +70,14 @@ namespace Mira {
|
||||
: m_manager(NULL) {
|
||||
// force initialisation of the phrase dictionary (TODO: why?)
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
m_sentence = new Sentence(Input);
|
||||
/*m_sentence = new Sentence(Input);
|
||||
stringstream in("Initialising decoder..\n");
|
||||
const std::vector<FactorType> &inputFactorOrder = staticData.GetInputFactorOrder();
|
||||
m_sentence->Read(in,inputFactorOrder);
|
||||
m_sentence->Read(in,inputFactorOrder);*/
|
||||
|
||||
const TranslationSystem& system = staticData.GetTranslationSystem(TranslationSystem::DEFAULT);
|
||||
m_manager = new Manager(*m_sentence, staticData.GetSearchAlgorithm(), &system);
|
||||
m_manager->ProcessSentence();
|
||||
/*m_manager = new Manager(*m_sentence, staticData.GetSearchAlgorithm(), &system);
|
||||
m_manager->ProcessSentence();*/
|
||||
|
||||
// Add the bleu feature
|
||||
m_bleuScoreFeature = new BleuScoreFeature(scaleByInputLength, historySmoothing);
|
||||
|
@ -83,6 +83,7 @@ void BleuScoreFeature::PrintHistory(std::ostream& out) const {
|
||||
|
||||
void BleuScoreFeature::LoadReferences(const std::vector< std::vector< std::string > >& refs)
|
||||
{
|
||||
cerr << "BleuScoreFeature: loading reference sentences.. " << endl;
|
||||
m_refs.clear();
|
||||
FactorCollection& fc = FactorCollection::Instance();
|
||||
for (size_t file_id = 0; file_id < refs.size(); file_id++) {
|
||||
|
@ -1298,7 +1298,7 @@ bool StaticData::LoadDecodeGraphs()
|
||||
|
||||
bool StaticData::LoadReferences()
|
||||
{
|
||||
vector<string> bleuWeightStr = m_parameter->GetParam("weight-b");
|
||||
vector<string> bleuWeightStr = m_parameter->GetParam("weight-bl");
|
||||
vector<string> referenceFiles = m_parameter->GetParam("references");
|
||||
if ((!referenceFiles.size() && bleuWeightStr.size()) || (referenceFiles.size() && !bleuWeightStr.size())) {
|
||||
UserMessage::Add("You cannot use the bleu feature without references, and vice-versa");
|
||||
@ -1338,7 +1338,6 @@ bool StaticData::LoadReferences()
|
||||
}
|
||||
//Set the references in the bleu feature
|
||||
m_bleuScoreFeature->LoadReferences(references);
|
||||
m_bleuScoreFeature->SetCurrentReference(0); //TODO: Temporary, for testing
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user