mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
option to get unpruned search graph for chart decoder
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4228 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
0ab0df5aac
commit
7927439ce5
@ -190,7 +190,6 @@ void ChartCell::GetSearchGraph(long translationId, std::ostream &outputSearchGra
|
||||
const ChartHypothesisCollection &coll = iterOutside->second;
|
||||
coll.GetSearchGraph(translationId, outputSearchGraphStream, reachable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream &out, const ChartCell &cell)
|
||||
|
@ -259,7 +259,8 @@ void ChartHypothesisCollection::GetSearchGraph(long translationId, std::ostream
|
||||
HCType::const_iterator iter;
|
||||
for (iter = m_hypos.begin() ; iter != m_hypos.end() ; ++iter) {
|
||||
ChartHypothesis &mainHypo = **iter;
|
||||
if (reachable.find(mainHypo.GetId()) != reachable.end()) {
|
||||
if (StaticData::Instance().GetUnprunedSearchGraph() ||
|
||||
reachable.find(mainHypo.GetId()) != reachable.end()) {
|
||||
outputSearchGraphStream << translationId << " " << mainHypo << endl;
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ void ChartRuleLookupManagerOnDisk::GetChartRuleCollection(
|
||||
delete tpcollBerkeleyDb;
|
||||
m_cache[tpCollFilePos] = targetPhraseCollection;
|
||||
} else {
|
||||
// jsut get out of cache
|
||||
// just get out of cache
|
||||
targetPhraseCollection = iterCache->second;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ size_t GenerationDictionary::GetNumScoreComponents() const
|
||||
|
||||
std::string GenerationDictionary::GetScoreProducerDescription(unsigned) const
|
||||
{
|
||||
return "Generation score, file=" + m_filePath;
|
||||
return "Generation score,file=" + m_filePath;
|
||||
}
|
||||
|
||||
std::string GenerationDictionary::GetScoreProducerWeightShortName(unsigned) const
|
||||
|
@ -120,6 +120,7 @@ Parameter::Parameter()
|
||||
AddParam("time-out", "seconds after which is interrupted (-1=no time-out, default is -1)");
|
||||
AddParam("output-search-graph", "osg", "Output connected hypotheses of search into specified filename");
|
||||
AddParam("output-search-graph-extended", "osgx", "Output connected hypotheses of search into specified filename, in extended format");
|
||||
AddParam("unpruned-search-graph", "usg", "When outputting chart search graph, do not exclude dead ends. Note: stack pruning may have eliminated some hypotheses");
|
||||
#ifdef HAVE_PROTOBUF
|
||||
AddParam("output-search-graph-pb", "pb", "Write phrase lattice to protocol buffer objects in the specified path.");
|
||||
#endif
|
||||
|
@ -210,6 +210,7 @@ bool StaticData::LoadData(Parameter *parameter)
|
||||
} else
|
||||
m_outputSearchGraphPB = false;
|
||||
#endif
|
||||
SetBooleanParameter( &m_unprunedSearchGraph, "unpruned-search-graph", true );
|
||||
|
||||
// include feature names in the n-best list
|
||||
SetBooleanParameter( &m_labeledNBestList, "labeled-n-best-list", true );
|
||||
|
@ -193,6 +193,7 @@ protected:
|
||||
#ifdef HAVE_PROTOBUF
|
||||
bool m_outputSearchGraphPB; //! whether to output search graph as a protobuf
|
||||
#endif
|
||||
bool m_unprunedSearchGraph; //! do not exclude dead ends (chart decoder only)
|
||||
|
||||
size_t m_cubePruningPopLimit;
|
||||
size_t m_cubePruningDiversity;
|
||||
@ -539,6 +540,9 @@ public:
|
||||
return m_outputSearchGraphPB;
|
||||
}
|
||||
#endif
|
||||
bool GetUnprunedSearchGraph() const {
|
||||
return m_unprunedSearchGraph;
|
||||
}
|
||||
|
||||
XmlInputType GetXmlInputType() const {
|
||||
return m_xmlInputType;
|
||||
|
Loading…
Reference in New Issue
Block a user