Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphikoehn <pkoehn@inf.ed.ac.uk>2013-10-13 09:59:05 +0400
committerphikoehn <pkoehn@inf.ed.ac.uk>2013-10-13 09:59:05 +0400
commit8e23a3f2c1a7b08d20f350e2a1dd4e41f2a0bb1b (patch)
tree77c6f381b47676597c404325947e6d7edf2f78e7 /moses-cmd
parent793686ea147b6a9eb7bbad2eff0e03695cab4ea0 (diff)
more enriched trace
Diffstat (limited to 'moses-cmd')
-rw-r--r--moses-cmd/IOWrapper.cpp15
-rw-r--r--moses-cmd/IOWrapper.h1
-rw-r--r--moses-cmd/Main.cpp3
3 files changed, 14 insertions, 5 deletions
diff --git a/moses-cmd/IOWrapper.cpp b/moses-cmd/IOWrapper.cpp
index ac85271d7..650b0c4aa 100644
--- a/moses-cmd/IOWrapper.cpp
+++ b/moses-cmd/IOWrapper.cpp
@@ -262,17 +262,23 @@ void OutputSurface(std::ostream &out, const Hypothesis &edge, const std::vector<
}
}
- // trace option "-t" / "-tt"
+ // trace ("report segmentation") option "-t" / "-tt"
if (reportSegmentation > 0 && phrase.GetSize() > 0) {
const WordsRange &sourceRange = edge.GetCurrSourceWordsRange();
const int sourceStart = sourceRange.GetStartPos();
const int sourceEnd = sourceRange.GetEndPos();
- out << "|" << sourceStart << "-" << sourceEnd;
- // enriched "-tt"
+ out << "|" << sourceStart << "-" << sourceEnd; // enriched "-tt"
if (reportSegmentation == 2) {
- out << ",0, ";
+ out << ",wa=";
const AlignmentInfo &ai = edge.GetCurrTargetPhrase().GetAlignTerm();
OutputAlignment(out, ai, 0, 0);
+ out << ",total=";
+ out << edge.GetTotalScore()-edge.GetPrevHypo()->GetTotalScore();
+ out << ",";
+ ScoreComponentCollection scoreBreakdown(edge.GetScoreBreakdown());
+ scoreBreakdown.MinusEquals(edge.GetPrevHypo()->GetScoreBreakdown());
+ out << scoreBreakdown;
+
}
out << "| ";
}
@@ -443,7 +449,6 @@ void OutputNBest(std::ostream& out
, char reportSegmentation)
{
const StaticData &staticData = StaticData::Instance();
- bool labeledOutput = staticData.IsLabeledNBestList();
bool reportAllFactors = staticData.GetReportAllFactorsNBest();
bool includeSegmentation = staticData.NBestIncludesSegmentation();
bool includeWordAlignment = staticData.PrintAlignmentInfoInNbest();
diff --git a/moses-cmd/IOWrapper.h b/moses-cmd/IOWrapper.h
index 7c6bdd119..901e89dc2 100644
--- a/moses-cmd/IOWrapper.h
+++ b/moses-cmd/IOWrapper.h
@@ -133,6 +133,7 @@ public:
IOWrapper *GetIOWrapper(const Moses::StaticData &staticData);
bool ReadInput(IOWrapper &ioWrapper, Moses::InputTypeEnum inputType, Moses::InputType*& source);
+void OutputLanguageModelOrder(std::ostream &out, const Moses::Hypothesis *hypo, Moses::Manager &manager);
void OutputBestSurface(std::ostream &out, const Moses::Hypothesis *hypo, const std::vector<Moses::FactorType> &outputFactorOrder, char reportSegmentation, bool reportAllFactors);
void OutputLatticeMBRNBest(std::ostream& out, const std::vector<LatticeMBRSolution>& solutions,long translationId);
void OutputBestHypo(const std::vector<Moses::Word>& mbrBestHypo, long /*translationId*/,
diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp
index 2d8a214d7..b3695a06f 100644
--- a/moses-cmd/Main.cpp
+++ b/moses-cmd/Main.cpp
@@ -291,6 +291,9 @@ public:
out << m_source->GetTranslationId() << " ";
}
+ if (staticData.GetReportSegmentation() == 2) {
+ manager.GetOutputLanguageModelOrder(out, bestHypo);
+ }
OutputBestSurface(
out,
bestHypo,