ZGen  0.2.0
a linearization system for natural language.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ZGen::ShiftReduce::Model Class Reference

#include <model.h>

Public Member Functions

 Model (const option_t &opts)
 
floatval_t score (const StateItem &state, const Action &act, bool avg)
 
floatval_t score (const ScoreContext &ctx, const Action &act, bool avg)
 
void update (const StateItem &state, const Action &act, int timestamp, floatval_t scale)
 
void update (const ScoreContext &ctx, const Action &act, int timestamp, floatval_t scale)
 
void flush (int timestamp)
 
bool save (std::ostream &os)
 
bool load (std::istream &is)
 

Constructor & Destructor Documentation

ZGen::ShiftReduce::Model::Model ( const option_t opts)

Member Function Documentation

void ZGen::ShiftReduce::Model::flush ( int  timestamp)
bool ZGen::ShiftReduce::Model::load ( std::istream &  is)

Load the model fron input stream.

Parameters
[in]isThe input stream.
Returns
bool If successfully loaded, return true; otherwise return false.
bool ZGen::ShiftReduce::Model::save ( std::ostream &  os)

Save the model into the output stream.

Parameters
[out]osThe output stream.
Returns
bool If successfully saved, return true; otherwise return false.
floatval_t ZGen::ShiftReduce::Model::score ( const StateItem state,
const Action act,
bool  avg 
)

Get score for the state.

Parameters
[in]stateThe state
[in]actThe action
[in]avgThe average parameter.
Returns
floatval_t The score of applying the action act to the state.
floatval_t ZGen::ShiftReduce::Model::score ( const ScoreContext ctx,
const Action act,
bool  avg 
)

Get score for the state context.

Parameters
[in]ctxThe input state context.
[in]actThe action.
[in]avgThe average parameter.
Returns
floatval_t The score of applying the action act to the state context.
void ZGen::ShiftReduce::Model::update ( const StateItem state,
const Action act,
int  timestamp,
floatval_t  scale 
)

Update the model with the state.

Parameters
[in]stateThe input state.
[in]actThe action.
[in]timestampThe updated timestamp.
[in]scaleThe updated scale.
void ZGen::ShiftReduce::Model::update ( const ScoreContext ctx,
const Action act,
int  timestamp,
floatval_t  scale 
)

Update the model with the state context.

Parameters
[in]ctxThe input state context.
[in]actThe action.
[in]timestampThe updated timestamp.
[in]scaleThe updated scale.

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