blob: fd12a37c5879e434b84443f83d40e25df12e74ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef FFEXTERNAL_H_
#define FFEXTERNAL_H_
#include "ff.h"
// dynamically loaded feature function
class ExternalFeature : public FeatureFunction {
public:
ExternalFeature(const std::string& param);
~ExternalFeature();
virtual void PrepareForInput(const SentenceMetadata& smeta);
virtual void FinalTraversalFeatures(const void* context,
SparseVector<double>* features) const;
protected:
virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
const HG::Edge& edge,
const std::vector<const void*>& ant_contexts,
SparseVector<double>* features,
SparseVector<double>* estimated_features,
void* context) const;
private:
void* lib_handle;
FeatureFunction* ff_ext;
};
#endif
|