added -report-all-factors-in-n-best

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@2909 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
bojar 2010-02-18 10:54:33 +00:00
parent 7ebfb57818
commit cce14523ab
4 changed files with 11 additions and 1 deletions

View File

@ -304,6 +304,7 @@ void OutputNBest(std::ostream& out, const Moses::TrellisPathList &nBestList, con
{
const StaticData &staticData = StaticData::Instance();
bool labeledOutput = staticData.IsLabeledNBestList();
bool reportAllFactors = staticData.GetReportAllFactorsNBest();
bool includeAlignment = staticData.NBestIncludesAlignment();
bool includeWordAlignment = staticData.PrintAlignmentInfoInNbest();
@ -318,7 +319,7 @@ void OutputNBest(std::ostream& out, const Moses::TrellisPathList &nBestList, con
for (int currEdge = (int)edges.size() - 1 ; currEdge >= 0 ; currEdge--)
{
const Hypothesis &edge = *edges[currEdge];
OutputSurface(out, edge.GetCurrTargetPhrase(), outputFactorOrder, false); // false for not reporting all factors
OutputSurface(out, edge.GetCurrTargetPhrase(), outputFactorOrder, reportAllFactors);
}
out << " |||";

View File

@ -62,6 +62,7 @@ Parameter::Parameter()
AddParam("output-factors", "list of factors in the output");
AddParam("phrase-drop-allowed", "da", "if present, allow dropping of source words"); //da = drop any (word); see -du for comparison
AddParam("report-all-factors", "report all factors in output, not just first");
AddParam("report-all-factors-in-n-best", "Report all factors in n-best-lists. Default is false");
AddParam("report-segmentation", "t", "report phrase segmentation in the output");
AddParam("stack", "s", "maximum stack size for histogram pruning");
AddParam("stack-diversity", "sd", "minimum number of hypothesis of each coverage in stack (default 0)");

View File

@ -209,6 +209,9 @@ bool StaticData::LoadData(Parameter *parameter)
// print all factors of output translations
SetBooleanParameter( &m_reportAllFactors, "report-all-factors", false );
// print all factors of output translations
SetBooleanParameter( &m_reportAllFactorsNBest, "report-all-factors-in-n-best", false );
//
if (m_inputType == SentenceInput)
{

View File

@ -126,6 +126,7 @@ protected:
UnknownWordPenaltyProducer *m_unknownWordPenaltyProducer;
bool m_reportSegmentation;
bool m_reportAllFactors;
bool m_reportAllFactorsNBest;
bool m_isDetailedTranslationReportingEnabled;
bool m_onlyDistinctNBest;
bool m_computeLMBackoffStats;
@ -389,6 +390,10 @@ public:
{
return m_reportAllFactors;
}
bool GetReportAllFactorsNBest() const
{
return m_reportAllFactorsNBest;
}
bool IsDetailedTranslationReportingEnabled() const
{
return m_isDetailedTranslationReportingEnabled;