Moses::RDLM Class Reference

#include <RDLM.h>

Inheritance diagram for Moses::RDLM:

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

Collaboration graph
[legend]

List of all members.

Classes

class  UnbinarizedChildren

Public Member Functions

 RDLM (const std::string &line)
 ~RDLM ()
virtual const FFStateEmptyHypothesisState (const InputType &input) const
 return the state associated with the empty hypothesis for a given sentence
void Score (InternalTree *root, const TreePointerMap &back_pointers, boost::array< float, 4 > &score, size_t &boundary_hash, rdlm::ThreadLocal &thread_objects, int num_virtual=0, int rescoring_levels=0) const
bool GetHead (InternalTree *root, const TreePointerMap &back_pointers, std::pair< int, int > &IDs) const
void GetChildHeadsAndLabels (InternalTree *root, const TreePointerMap &back_pointers, int reached_end, rdlm::ThreadLocal &thread_objects) const
void GetIDs (const Word &head, const Word &preterminal, std::pair< int, int > &IDs) const
int Factor2ID (const Factor *const factor, int model_type) const
void ScoreFile (std::string &path)
void PrintInfo (std::vector< int > &ngram, nplm::neuralTM *lm) const
TreePointerMap AssociateLeafNTs (InternalTree *root, const std::vector< TreePointer > &previous) const
bool IsUseable (const FactorMask &mask) const
void SetParameter (const std::string &key, const std::string &value)
FFStateEvaluateWhenApplied (const Hypothesis &cur_hypo, const FFState *prev_state, ScoreComponentCollection *accumulator) const
 This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.
FFStateEvaluateWhenApplied (const ChartHypothesis &, int, ScoreComponentCollection *accumulator) const
void Load (AllOptions::ptr const &opts)
 override to load model files


Detailed Description

Definition at line 85 of file RDLM.h.


Constructor & Destructor Documentation

Moses::RDLM::RDLM ( const std::string &  line  )  [inline]

Definition at line 153 of file RDLM.h.

References Moses::Word::CreateFromString(), Moses::Output, and Moses::FeatureFunction::ReadParameters().

Here is the call graph for this function:

Moses::RDLM::~RDLM (  ) 

Definition at line 36 of file RDLM.cpp.


Member Function Documentation

RDLM::TreePointerMap Moses::RDLM::AssociateLeafNTs ( InternalTree root,
const std::vector< TreePointer > &  previous 
) const

Definition at line 732 of file RDLM.cpp.

Referenced by EvaluateWhenApplied().

Here is the caller graph for this function:

virtual const FFState* Moses::RDLM::EmptyHypothesisState ( const InputType input  )  const [inline, virtual]

return the state associated with the empty hypothesis for a given sentence

Implements Moses::StatefulFeatureFunction.

Definition at line 180 of file RDLM.h.

FFState * Moses::RDLM::EvaluateWhenApplied ( const ChartHypothesis cur_hypo,
int  featureID,
ScoreComponentCollection accumulator 
) const [virtual]

FFState* Moses::RDLM::EvaluateWhenApplied ( const Hypothesis cur_hypo,
const FFState prev_state,
ScoreComponentCollection accumulator 
) const [inline, virtual]

This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.

Implements Moses::StatefulFeatureFunction.

Definition at line 200 of file RDLM.h.

References UTIL_THROW.

int Moses::RDLM::Factor2ID ( const Factor *const   factor,
int  model_type 
) const

Definition at line 662 of file RDLM.cpp.

References StringPiece::as_string(), Moses::Factor::GetId(), Moses::Factor::GetString(), and NULL.

Referenced by GetChildHeadsAndLabels(), GetIDs(), and Score().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::RDLM::GetChildHeadsAndLabels ( InternalTree root,
const TreePointerMap &  back_pointers,
int  reached_end,
rdlm::ThreadLocal thread_objects 
) const

bool Moses::RDLM::GetHead ( InternalTree root,
const TreePointerMap &  back_pointers,
std::pair< int, int > &  IDs 
) const

Definition at line 543 of file RDLM.cpp.

References Moses::InternalTree::GetChildren(), GetIDs(), Moses::InternalTree::GetLabel(), Moses::InternalTree::GetLength(), and Moses::Word::GetString().

Referenced by GetChildHeadsAndLabels(), and Score().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::RDLM::GetIDs ( const Word head,
const Word preterminal,
std::pair< int, int > &  IDs 
) const

Definition at line 645 of file RDLM.cpp.

References Factor2ID().

Referenced by GetHead().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::RDLM::IsUseable ( const FactorMask mask  )  const [inline, virtual]

Implements Moses::FeatureFunction.

Definition at line 194 of file RDLM.h.

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

override to load model files

Reimplemented from Moses::FeatureFunction.

Definition at line 42 of file RDLM.cpp.

References Moses::Word::GetString(), Moses::StaticData::GetTreeStructure(), Moses::StaticData::InstanceNonConst(), NULL, ScoreFile(), Moses::StaticData::SetTreeStructure(), and UTIL_THROW_IF2.

Here is the call graph for this function:

void Moses::RDLM::PrintInfo ( std::vector< int > &  ngram,
nplm::neuralTM *  lm 
) const

Definition at line 718 of file RDLM.cpp.

void Moses::RDLM::Score ( InternalTree root,
const TreePointerMap &  back_pointers,
boost::array< float, 4 > &  score,
size_t &  boundary_hash,
rdlm::ThreadLocal thread_objects,
int  num_virtual = 0,
int  rescoring_levels = 0 
) const

void Moses::RDLM::ScoreFile ( std::string &  path  ) 

Definition at line 750 of file RDLM.cpp.

References Moses::rdlm::ThreadLocal::ancestor_heads, Moses::rdlm::ThreadLocal::ancestor_labels, and Score().

Referenced by Load().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from Moses::FeatureFunction.

Definition at line 782 of file RDLM.cpp.

References Moses::FeatureFunction::GetScoreProducerDescription(), Moses::FeatureFunction::m_tuneable, Moses::Scan< bool >(), and UTIL_THROW.

Here is the call graph for this function:


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

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