Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
reranker::FeatureVectorWriter< FV > Class Template Reference

A class to serialize FeatureVector instances to FeatureVecMessage instances. More...

#include <feature-vector-writer.H>

Public Member Functions

void SerializeFeature (const typename FV::key_type &uid, const typename FV::mapped_type &value, FeatureMessage_FeatureType feature_type, FeatureMessage *feature_message, Symbols *symbols=NULL) const
 Serializes a single feature-value pair to a FeatureMessage. More...
 
void Write (const FV &features, FeatureMessage_FeatureType feature_type, FeatureVecMessage *fv_message, Symbols *symbols=NULL) const
 Serializes the specified feature vector to the specified FeatureVecMessage protocol buffer message. More...
 

Detailed Description

template<typename FV>
class reranker::FeatureVectorWriter< FV >

A class to serialize FeatureVector instances to FeatureVecMessage instances.

Template Parameters
thetype of FeatureVector to write

Definition at line 60 of file feature-vector-writer.H.

Member Function Documentation

template<typename FV>
void reranker::FeatureVectorWriter< FV >::SerializeFeature ( const typename FV::key_type &  uid,
const typename FV::mapped_type &  value,
FeatureMessage_FeatureType  feature_type,
FeatureMessage *  feature_message,
Symbols symbols = NULL 
) const
inline

Serializes a single feature-value pair to a FeatureMessage.

Parameters
[in]uidthe uid of this feature-value pair
[in]valuethe value of this feature-value pair
[in]feature_typethe type of features contained in the specified feature vector to be serialized (specified in model.proto)
[out]feature_messagethe FeatureMessage instance to fill in
[in]symbolsa pointer to an optional Symbols instance to be used when determining the symbol of a feature’s uid

Definition at line 75 of file feature-vector-writer.H.

template<typename FV>
void reranker::FeatureVectorWriter< FV >::Write ( const FV &  features,
FeatureMessage_FeatureType  feature_type,
FeatureVecMessage *  fv_message,
Symbols symbols = NULL 
) const
inline

Serializes the specified feature vector to the specified FeatureVecMessage protocol buffer message.

Parameters
[in]featuresthe feature vector to serialize
[in]feature_typethe type of features contained in the specified feature vector to be serialized (specified in model.proto)
[out]fv_messagethe FeatureVecMessage instance to fill in with the serialized version of the specified feature vector
[in]symbolsa pointer to an optional Symbols instance to be used when determining the symbol of a feature’s uid

Definition at line 104 of file feature-vector-writer.H.


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