Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
|
An abstract base class/interface for all feature extractors. More...
#include <feature-extractor.H>
Public Member Functions | |
FeatureExtractor () | |
Constructs an empty feature vector. More... | |
virtual | ~FeatureExtractor () |
Destroys this vector. More... | |
virtual void | Extract (Candidate &candidate, FeatureVector< int, double > &features)=0 |
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)=0 |
Extracts symbolic features for the specified candidate, where each feature is represented by a string for its unique identifier. 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 | RegisterInitializers (Initializers &initializers) |
virtual void | Init (const Environment *env, const string &arg) |
An abstract base class/interface for all feature extractors.
Concrete subclasses need to register themselves with the FeatureExtractor Factory via the REGISTER_FEATURE_EXTRACTOR(MyDerivedClassName) macro.
Example:
Definition at line 86 of file feature-extractor.H.
|
inline |
Constructs an empty feature vector.
Definition at line 89 of file feature-extractor.H.
|
inlinevirtual |
Destroys this vector.
Definition at line 91 of file feature-extractor.H.
|
pure virtual |
Extracts features for the specified candidate, where each feature is represented by an int for its unique identifier.
[in] | candidate | the candidate for which to extract features |
[out] | features | the features extracted for the specified candidate |
Implemented in reranker::ExampleFeatureExtractor, reranker::NgramFeatureExtractor, reranker::AbstractFileBackedFeatureExtractor, reranker::FileBackedNgramFeatureExtractor, reranker::FileBackedLossSetter, reranker::BasicFileBackedFeatureExtractor, and reranker::RankFeatureExtractor.
|
inlinevirtual |
Extracts features for all the candidates in the specified CandidateSet.
The default implementation here uses the concrete implementations of the Extract(Candidate&,FeatureVector<int,double>&) and ExtractSymbolic methods.
candidate_set | the set of candidates for which to extract features. |
Reimplemented in reranker::AbstractFileBackedFeatureExtractor, and reranker::RankFeatureExtractor.
Definition at line 139 of file feature-extractor.H.
|
pure virtual |
Extracts symbolic features for the specified candidate, where each feature is represented by a string for its unique identifier.
[in] | candidate | the candidate for which to extract features |
[out] | symbolic_features | the features extracted for the specified candidate |
Implemented in reranker::ExampleFeatureExtractor, reranker::NgramFeatureExtractor, reranker::FileBackedNgramFeatureExtractor, reranker::AbstractFileBackedFeatureExtractor, reranker::FileBackedLossSetter, reranker::BasicFileBackedFeatureExtractor, and reranker::RankFeatureExtractor.
|
inlinevirtual |
Indicates to this instance that iteration over candidate sets on which features are being extracted has been reset.
Concrete subclasses should override this method (which by default does nothing) if they need to do something special at the beginning of each iteration.
Reimplemented in reranker::AbstractFileBackedFeatureExtractor.
Definition at line 128 of file feature-extractor.H.