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

Extracts n-gram features for candidate hypotheses on the fly. More...

#include <ngram-feature-extractor.H>

Inheritance diagram for reranker::NgramFeatureExtractor:
reranker::FeatureExtractor reranker::FactoryConstructible

Public Member Functions

 NgramFeatureExtractor ()
 Constructs an instance. More...
 
virtual ~NgramFeatureExtractor ()
 Destroys this instance. More...
 
virtual void RegisterInitializers (Initializers &initializers)
 Registers two variables that may be initialized when this object is constructed via Factory::CreateOrDie. More...
 
virtual void Extract (Candidate &candidate, FeatureVector< int, double > &features)
 Does nothing. More...
 
virtual void ExtractSymbolic (Candidate &candidate, FeatureVector< string, double > &symbolic_features)
 Extracts n-gram features according to the n-gram order specified via the Init method. 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 ()
 
virtual void Init (const Environment *env, const string &arg)
 

Detailed Description

Extracts n-gram features for candidate hypotheses on the fly.

Definition at line 67 of file ngram-feature-extractor.H.

Constructor & Destructor Documentation

reranker::NgramFeatureExtractor::NgramFeatureExtractor ( )
inline

Constructs an instance.

Definition at line 70 of file ngram-feature-extractor.H.

virtual reranker::NgramFeatureExtractor::~NgramFeatureExtractor ( )
inlinevirtual

Destroys this instance.

Definition at line 72 of file ngram-feature-extractor.H.

Member Function Documentation

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

Does nothing.

Implements reranker::FeatureExtractor.

Definition at line 108 of file ngram-feature-extractor.H.

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

Extracts n-gram features according to the n-gram order specified via the Init method.

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

Implements reranker::FeatureExtractor.

Definition at line 75 of file ngram-feature-extractor.C.

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

Registers two variables that may be initialized when this object is constructed via Factory::CreateOrDie.

Variable name Type Required Description Default value
n int Yes The n-gram order for this feature extractor to extract. n/a
prefix string No A prefix string to be prepended to each feature name produced. n + "g_ng" where n is the string representation of the n-gram order

Reimplemented from reranker::FactoryConstructible.

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


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