mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
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:
parent
7ebfb57818
commit
cce14523ab
@ -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 << " |||";
|
||||
|
||||
|
@ -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)");
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user