diff options
author | Chris Dyer <redpony@gmail.com> | 2010-01-27 12:34:28 +0000 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2010-01-27 12:34:28 +0000 |
commit | ee4383b3bc67e2d8ce113fce716050dc2e1b8572 (patch) | |
tree | aa4b9fbc1f6e397352a54ae98f70b26a8f91040d /decoder/ff_wordalign.h | |
parent | 9e7d60da4421074d279a91cb6e4e67438add4645 (diff) |
add binary model2-like features
Diffstat (limited to 'decoder/ff_wordalign.h')
-rw-r--r-- | decoder/ff_wordalign.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/decoder/ff_wordalign.h b/decoder/ff_wordalign.h index aea4c950..582e8c9f 100644 --- a/decoder/ff_wordalign.h +++ b/decoder/ff_wordalign.h @@ -4,6 +4,8 @@ #include "ff.h" #include "array2d.h" +#include <boost/multi_array.hpp> + class RelativeSentencePosition : public FeatureFunction { public: RelativeSentencePosition(const std::string& param); @@ -20,6 +22,20 @@ class RelativeSentencePosition : public FeatureFunction { std::string template_; }; +class Model2BinaryFeatures : public FeatureFunction { + public: + Model2BinaryFeatures(const std::string& param); + protected: + virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta, + const Hypergraph::Edge& edge, + const std::vector<const void*>& ant_contexts, + SparseVector<double>* features, + SparseVector<double>* estimated_features, + void* out_context) const; + private: + boost::multi_array<int, 3> fids_; +}; + class MarkovJump : public FeatureFunction { public: MarkovJump(const std::string& param); |