summaryrefslogtreecommitdiff
path: root/decoder/ff_soft_syn.h
diff options
context:
space:
mode:
authorWu, Ke <wuke@cs.umd.edu>2014-11-01 14:48:17 -0400
committerWu, Ke <wuke@cs.umd.edu>2014-11-01 14:48:17 -0400
commit4444b842ef12f31e3aede13950b553f9a5bcb2d6 (patch)
treec68a65174fad0d15f9a238e86e056560d6badaca /decoder/ff_soft_syn.h
parente09c8fc558a5138b7e67b8f8fc898f7d4003e0b9 (diff)
Junhui's implementation of soft syntax constraint features
Diffstat (limited to 'decoder/ff_soft_syn.h')
-rw-r--r--decoder/ff_soft_syn.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/decoder/ff_soft_syn.h b/decoder/ff_soft_syn.h
new file mode 100644
index 00000000..21618bc0
--- /dev/null
+++ b/decoder/ff_soft_syn.h
@@ -0,0 +1,90 @@
+/*
+ * ff_soft_syn.h
+ *
+ */
+
+#ifndef FF_SOFT_SYN_H_
+#define FF_SOFT_SYN_H_
+
+#include "ff_factory.h"
+#include "ff.h"
+
+struct SoftSynFeatureImpl;
+
+class SoftSynFeature : public FeatureFunction {
+ public:
+ SoftSynFeature(std::string param);
+ ~SoftSynFeature();
+ static std::string usage(bool param, bool verbose);
+
+ protected:
+ virtual void PrepareForInput(const SentenceMetadata& smeta);
+
+ 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* out_context) const;
+
+ private:
+ SoftSynFeatureImpl* pimpl_;
+};
+
+struct SoftSynFeatureFactory : public FactoryBase<FeatureFunction> {
+ FP Create(std::string param) const;
+ std::string usage(bool params, bool verbose) const;
+};
+
+struct SoftKBestSynFeatureImpl;
+
+class SoftKBestSynFeature : public FeatureFunction {
+ public:
+ SoftKBestSynFeature(std::string param);
+ ~SoftKBestSynFeature();
+ static std::string usage(bool param, bool verbose);
+
+ protected:
+ virtual void PrepareForInput(const SentenceMetadata& smeta);
+
+ 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* out_context) const;
+
+ private:
+ SoftKBestSynFeatureImpl* pimpl_;
+};
+
+struct SoftKBestSynFeatureFactory : public FactoryBase<FeatureFunction> {
+ FP Create(std::string param) const;
+ std::string usage(bool params, bool verbose) const;
+};
+
+struct SoftForestSynFeatureImpl;
+
+class SoftForestSynFeature : public FeatureFunction {
+ public:
+ SoftForestSynFeature(std::string param);
+ ~SoftForestSynFeature();
+ static std::string usage(bool param, bool verbose);
+
+ protected:
+ virtual void PrepareForInput(const SentenceMetadata& smeta);
+
+ 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* out_context) const;
+
+ private:
+ SoftForestSynFeatureImpl* pimpl_;
+};
+
+struct SoftForestSynFeatureFactory : public FactoryBase<FeatureFunction> {
+ FP Create(std::string param) const;
+ std::string usage(bool params, bool verbose) const;
+};
+
+#endif /* FF_SOFT_SYN_H_ */