Moses::PhraseDictionaryMultiModel Class Reference

#include <PhraseDictionaryMultiModel.h>

Inheritance diagram for Moses::PhraseDictionaryMultiModel:

Inheritance graph
[legend]
Collaboration diagram for Moses::PhraseDictionaryMultiModel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PhraseDictionaryMultiModel (const std::string &line)
 PhraseDictionaryMultiModel (int type, const std::string &line)
 ~PhraseDictionaryMultiModel ()
void Load (AllOptions::ptr const &opts)
 override to load model files
virtual void CollectSufficientStatistics (const Phrase &src, std::map< std::string, multiModelStats * > *allStats) const
virtual
TargetPhraseCollection::shared_ptr 
CreateTargetPhraseCollectionLinearInterpolation (const Phrase &src, std::map< std::string, multiModelStats * > *allStats, std::vector< std::vector< float > > &multimodelweights) const
std::vector< std::vector< float > > getWeights (size_t numWeights, bool normalize) const
std::vector< float > normalizeWeights (std::vector< float > &weights) const
void CacheForCleanup (TargetPhraseCollection::shared_ptr tpc)
void CleanUpAfterSentenceProcessing (const InputType &source)
virtual void CleanUpComponentModels (const InputType &source)
virtual
TargetPhraseCollection::shared_ptr 
GetTargetPhraseCollectionLEGACY (const Phrase &src) const
 find list of translations that can translates src. Only for phrase input
virtual void InitializeForInput (ttasksptr const &ttask)
 Create entry for translation of source to targetPhrase.
ChartRuleLookupManagerCreateRuleLookupManager (const ChartParser &, const ChartCellCollectionBase &, std::size_t)
 Create a sentence-specific manager for SCFG rule lookup.
void SetParameter (const std::string &key, const std::string &value)
const std::vector< float > * GetTemporaryMultiModelWeightsVector () const
void SetTemporaryMultiModelWeightsVector (std::vector< float > weights)

Protected Types

typedef std::vector
< TargetPhraseCollection::shared_ptr
PhraseCache
typedef PhraseCache SentenceCache

Protected Member Functions

PhraseCacheGetPhraseCache ()

Protected Attributes

std::string m_mode
std::vector< std::string > m_pdStr
std::vector< PhraseDictionary * > m_pd
size_t m_numModels
std::vector< float > m_multimodelweights
SentenceCache m_sentenceCache
std::vector< float > m_multimodelweights_tmp


Detailed Description

Implementation of a virtual phrase table constructed from multiple component phrase tables.

Definition at line 63 of file PhraseDictionaryMultiModel.h.


Member Typedef Documentation

Definition at line 135 of file PhraseDictionaryMultiModel.h.

Definition at line 140 of file PhraseDictionaryMultiModel.h.


Constructor & Destructor Documentation

Moses::PhraseDictionaryMultiModel::PhraseDictionaryMultiModel ( const std::string &  line  ) 

Moses::PhraseDictionaryMultiModel::PhraseDictionaryMultiModel ( int  type,
const std::string &  line 
)

Definition at line 51 of file PhraseDictionaryMultiModel.cpp.

References m_multimodelweights, m_pdStr, and UTIL_THROW_IF2.

Moses::PhraseDictionaryMultiModel::~PhraseDictionaryMultiModel (  ) 

Definition at line 79 of file PhraseDictionaryMultiModel.cpp.


Member Function Documentation

void Moses::PhraseDictionaryMultiModel::CacheForCleanup ( TargetPhraseCollection::shared_ptr  tpc  ) 

Definition at line 284 of file PhraseDictionaryMultiModel.cpp.

References GetPhraseCache().

Referenced by Moses::PhraseDictionaryMultiModelCounts::GetTargetPhraseCollectionLEGACY(), and GetTargetPhraseCollectionLEGACY().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryMultiModel::CleanUpAfterSentenceProcessing ( const InputType source  )  [virtual]

Reimplemented from Moses::PhraseDictionary.

Definition at line 292 of file PhraseDictionaryMultiModel.cpp.

References CleanUpComponentModels(), GetPhraseCache(), and SetTemporaryMultiModelWeightsVector().

Here is the call graph for this function:

void Moses::PhraseDictionaryMultiModel::CleanUpComponentModels ( const InputType source  )  [virtual]

Definition at line 312 of file PhraseDictionaryMultiModel.cpp.

References m_numModels, and m_pd.

Referenced by CleanUpAfterSentenceProcessing().

Here is the caller graph for this function:

void Moses::PhraseDictionaryMultiModel::CollectSufficientStatistics ( const Phrase src,
std::map< std::string, multiModelStats * > *  allStats 
) const [virtual]

ChartRuleLookupManager * Moses::PhraseDictionaryMultiModel::CreateRuleLookupManager ( const ChartParser ,
const ChartCellCollectionBase ,
std::size_t   
) [virtual]

Create a sentence-specific manager for SCFG rule lookup.

Implements Moses::PhraseDictionary.

Definition at line 274 of file PhraseDictionaryMultiModel.cpp.

References UTIL_THROW.

TargetPhraseCollection::shared_ptr Moses::PhraseDictionaryMultiModel::CreateTargetPhraseCollectionLinearInterpolation ( const Phrase src,
std::map< std::string, multiModelStats * > *  allStats,
std::vector< std::vector< float > > &  multimodelweights 
) const [virtual]

PhraseCache& Moses::PhraseDictionaryMultiModel::GetPhraseCache (  )  [inline, protected]

Definition at line 144 of file PhraseDictionaryMultiModel.h.

References get_id(), and m_sentenceCache.

Referenced by CacheForCleanup(), and CleanUpAfterSentenceProcessing().

Here is the call graph for this function:

Here is the caller graph for this function:

TargetPhraseCollection::shared_ptr Moses::PhraseDictionaryMultiModel::GetTargetPhraseCollectionLEGACY ( const Phrase src  )  const [virtual]

find list of translations that can translates src. Only for phrase input

Reimplemented from Moses::PhraseDictionary.

Reimplemented in Moses::PhraseDictionaryMultiModelCounts.

Definition at line 99 of file PhraseDictionaryMultiModel.cpp.

References CacheForCleanup(), CollectSufficientStatistics(), CreateTargetPhraseCollectionLinearInterpolation(), getWeights(), Moses::FeatureFunction::m_numScoreComponents, Moses::PhraseDictionary::m_tableLimit, and Moses::RemoveAllInMap().

Here is the call graph for this function:

const std::vector< float > * Moses::PhraseDictionaryMultiModel::GetTemporaryMultiModelWeightsVector (  )  const

Definition at line 321 of file PhraseDictionaryMultiModel.cpp.

References get_id(), m_multimodelweights_tmp, and NULL.

Referenced by getWeights().

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::vector< float > > Moses::PhraseDictionaryMultiModel::getWeights ( size_t  numWeights,
bool  normalize 
) const

virtual void Moses::PhraseDictionaryMultiModel::InitializeForInput ( ttasksptr const &  ttask  )  [inline, virtual]

Create entry for translation of source to targetPhrase.

Reimplemented from Moses::PhraseDictionary.

Reimplemented in Moses::PhraseDictionaryMultiModelCounts.

Definition at line 110 of file PhraseDictionaryMultiModel.h.

void Moses::PhraseDictionaryMultiModel::Load ( AllOptions::ptr const &  opts  )  [virtual]

override to load model files

Reimplemented from Moses::FeatureFunction.

Reimplemented in Moses::PhraseDictionaryMultiModelCounts.

Definition at line 82 of file PhraseDictionaryMultiModel.cpp.

References Moses::FindPhraseDictionary(), m_numModels, Moses::FeatureFunction::m_options, m_pd, m_pdStr, NULL, Moses::PhraseDictionary::SetFeaturesToApply(), and UTIL_THROW_IF2.

Here is the call graph for this function:

std::vector< float > Moses::PhraseDictionaryMultiModel::normalizeWeights ( std::vector< float > &  weights  )  const

Definition at line 261 of file PhraseDictionaryMultiModel.cpp.

References m_numModels.

Referenced by getWeights().

Here is the caller graph for this function:

void Moses::PhraseDictionaryMultiModel::SetParameter ( const std::string &  key,
const std::string &  value 
) [virtual]

Reimplemented from Moses::PhraseDictionary.

Reimplemented in Moses::PhraseDictionaryMultiModelCounts.

Definition at line 64 of file PhraseDictionaryMultiModel.cpp.

References m_mode, m_multimodelweights, m_numModels, m_pdStr, and Moses::Tokenize().

Here is the call graph for this function:

void Moses::PhraseDictionaryMultiModel::SetTemporaryMultiModelWeightsVector ( std::vector< float >  weights  ) 

Definition at line 337 of file PhraseDictionaryMultiModel.cpp.

References get_id(), and m_multimodelweights_tmp.

Referenced by CleanUpAfterSentenceProcessing().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::vector<std::string> Moses::PhraseDictionaryMultiModel::m_pdStr [protected]

Definition at line 142 of file PhraseDictionaryMultiModel.h.

Referenced by GetPhraseCache().


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:33:51 2017 for Moses by  doxygen 1.5.9