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::RankFeatureExtractor Class Reference

Encodes the baseline rank as a boolean feature. More...

#include <rank-feature-extractor.H>

Inheritance diagram for reranker::RankFeatureExtractor:
reranker::FeatureExtractor reranker::FactoryConstructible

Public Member Functions

 RankFeatureExtractor ()
 Constructs an instance. More...
 
virtual ~RankFeatureExtractor ()
 Destroys this instance. More...
 
virtual void RegisterInitializers (Initializers &initializers)
 
virtual void Extract (Candidate &candidate, FeatureVector< int, double > &features)
 Extracts features for the specified candidate, where each feature is represented by an int for its unique identifier. More...
 
virtual void ExtractSymbolic (Candidate &candidate, FeatureVector< string, double > &symbolic_features)
 Extracts symbolic (or string) features. More...
 
virtual void Extract (CandidateSet &candidate_set)
 Override the default Extract method so that it caches the score of the top-scoring hypothesis of the baseline system. More...
 
- Public Member Functions inherited from reranker::FeatureExtractor
 FeatureExtractor ()
 Constructs an empty feature vector. More...
 
virtual ~FeatureExtractor ()
 Destroys this vector. More...
 
virtual void Reset ()
 Indicates to this instance that iteration over candidate sets on which features are being extracted has been reset. More...
 
- Public Member Functions inherited from reranker::FactoryConstructible
virtual ~FactoryConstructible ()
 
virtual void Init (const Environment *env, const string &arg)
 

Detailed Description

Encodes the baseline rank as a boolean feature.

Definition at line 51 of file rank-feature-extractor.H.

Constructor & Destructor Documentation

reranker::RankFeatureExtractor::RankFeatureExtractor ( )
inline

Constructs an instance.

Definition at line 54 of file rank-feature-extractor.H.

virtual reranker::RankFeatureExtractor::~RankFeatureExtractor ( )
inlinevirtual

Destroys this instance.

Definition at line 57 of file rank-feature-extractor.H.

Member Function Documentation

virtual void reranker::RankFeatureExtractor::Extract ( Candidate candidate,
FeatureVector< int, double > &  features 
)
inlinevirtual

Extracts features for the specified candidate, where each feature is represented by an int for its unique identifier.

Implementation advice:
Please play nice with others! For efficiency, the feature vector you are modifying is the actual feature vector inside the specified Candidate. Please use FeatureVector::IncrementWeight wherever possible; only use FeatureVector::SetWeight if you truly want to blow away any existing weight for a feature.
Parameters
[in]candidatethe candidate for which to extract features
[out]featuresthe features extracted for the specified candidate

Implements reranker::FeatureExtractor.

Definition at line 64 of file rank-feature-extractor.H.

virtual void reranker::RankFeatureExtractor::Extract ( CandidateSet candidate_set)
inlinevirtual

Override the default Extract method so that it caches the score of the top-scoring hypothesis of the baseline system.

Reimplemented from reranker::FeatureExtractor.

Definition at line 101 of file rank-feature-extractor.H.

virtual void reranker::RankFeatureExtractor::ExtractSymbolic ( Candidate candidate,
FeatureVector< string, double > &  symbolic_features 
)
inlinevirtual

Extracts symbolic (or string) features.

These will be automatically compiled when training.

Parameters
[in]candidatethe candidate for which to extract features
[out]symbolic_featuresthe features extracted for the specified candidate

Implements reranker::FeatureExtractor.

Definition at line 73 of file rank-feature-extractor.H.

virtual void reranker::RankFeatureExtractor::RegisterInitializers ( Initializers initializers)
inlinevirtual

Reimplemented from reranker::FactoryConstructible.

Definition at line 59 of file rank-feature-extractor.H.


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