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

This class illustrates how to write a FeatureExtractor implementation. More...

#include <example-feature-extractor.H>

Inheritance diagram for reranker::ExampleFeatureExtractor:
reranker::FeatureExtractor reranker::FactoryConstructible

Public Member Functions

 ExampleFeatureExtractor ()
 Constructs an instance, emitting that fact to cout. More...
 
virtual ~ExampleFeatureExtractor ()
 Destroys this instance. More...
 
virtual void RegisterInitializers (Initializers &initializers)
 
virtual void Init (const Environment *env, const string &arg)
 Initializes this instance with the specified argument string. More...
 
virtual void Extract (Candidate &candidate, FeatureVector< int, double > &features)
 Extracts “compiled” features. More...
 
virtual void ExtractSymbolic (Candidate &candidate, FeatureVector< string, double > &symbolic_features)
 Extracts symbolic (or string) features. 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...
 
virtual void Extract (CandidateSet &candidate_set)
 Extracts features for all the candidates in the specified CandidateSet. More...
 
- Public Member Functions inherited from reranker::FactoryConstructible
virtual ~FactoryConstructible ()
 

Detailed Description

This class illustrates how to write a FeatureExtractor implementation.

Implementation advice:
Most implementations are likely only to have to worry about implementing the ExtractSymbolic method, implementing the Extract method to do nothing.

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

Constructor & Destructor Documentation

reranker::ExampleFeatureExtractor::ExampleFeatureExtractor ( )
inline

Constructs an instance, emitting that fact to cout.

Definition at line 62 of file example-feature-extractor.H.

virtual reranker::ExampleFeatureExtractor::~ExampleFeatureExtractor ( )
inlinevirtual

Destroys this instance.

Definition at line 66 of file example-feature-extractor.H.

Member Function Documentation

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

Extracts “compiled” features.

Implementation advice:
Most implementations of the FeatureExtractor interface will likely implement either this method or the ExtractSymbolic method, but not both. In fact, most implementations will likely only implement the ExtractSymbolic method.
Parameters
[in]candidatethe candidate for which to extract features
[out]featuresthe features extracted for the specified candidate

Implements reranker::FeatureExtractor.

Definition at line 109 of file example-feature-extractor.H.

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

Extracts symbolic (or string) features.

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

Implements reranker::FeatureExtractor.

Definition at line 120 of file example-feature-extractor.H.

virtual void reranker::ExampleFeatureExtractor::Init ( const Environment env,
const string &  arg 
)
inlinevirtual

Initializes this instance with the specified argument string.

This method is guaranteed to be invoked by a Factory just after construction.

Parameters
envthe environment used by the Factory when this object was constructed
argthe argument string with which to initialize this instance
See Also
Factory::Create(const string&,string&,string&,bool&,bool&)

Reimplemented from reranker::FactoryConstructible.

Definition at line 83 of file example-feature-extractor.H.

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

Reimplemented from reranker::FactoryConstructible.

Definition at line 68 of file example-feature-extractor.H.


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