2011-08-13 05:39:35 +04:00
|
|
|
#ifndef moses_TargetWordInsertionFeature_h
|
|
|
|
#define moses_TargetWordInsertionFeature_h
|
|
|
|
|
|
|
|
#include <string>
|
2013-05-27 03:33:01 +04:00
|
|
|
#include <boost/unordered_set.hpp>
|
2011-08-13 05:39:35 +04:00
|
|
|
|
2013-05-24 22:11:15 +04:00
|
|
|
#include "StatelessFeatureFunction.h"
|
2013-05-24 21:02:49 +04:00
|
|
|
#include "moses/FactorCollection.h"
|
|
|
|
#include "moses/AlignmentInfo.h"
|
2011-08-13 05:39:35 +04:00
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
|
|
|
/** Sets the features for length of source phrase, target phrase, both.
|
|
|
|
*/
|
2013-05-29 21:16:15 +04:00
|
|
|
class TargetWordInsertionFeature : public StatelessFeatureFunction
|
|
|
|
{
|
2011-08-13 05:39:35 +04:00
|
|
|
private:
|
2013-05-27 03:33:01 +04:00
|
|
|
boost::unordered_set<std::string> m_vocab;
|
2011-08-13 05:39:35 +04:00
|
|
|
FactorType m_factorType;
|
|
|
|
bool m_unrestricted;
|
2013-06-09 23:09:21 +04:00
|
|
|
std::string m_filename;
|
2011-08-13 05:39:35 +04:00
|
|
|
|
|
|
|
public:
|
2013-01-02 18:48:19 +04:00
|
|
|
TargetWordInsertionFeature(const std::string &line);
|
2013-05-29 21:16:15 +04:00
|
|
|
|
2013-05-30 15:41:08 +04:00
|
|
|
bool IsUseable(const FactorMask &mask) const;
|
|
|
|
|
2013-06-09 23:09:21 +04:00
|
|
|
void Load();
|
2012-04-09 23:47:51 +04:00
|
|
|
|
2013-05-28 13:51:28 +04:00
|
|
|
virtual void Evaluate(const Phrase &source
|
2013-05-29 21:16:15 +04:00
|
|
|
, const TargetPhrase &targetPhrase
|
|
|
|
, ScoreComponentCollection &scoreBreakdown
|
|
|
|
, ScoreComponentCollection &estimatedFutureScore) const;
|
2013-08-30 18:49:00 +04:00
|
|
|
void Evaluate(const InputType &input
|
|
|
|
, const InputPath &inputPath
|
|
|
|
, ScoreComponentCollection &scoreBreakdown) const
|
|
|
|
{}
|
|
|
|
void Evaluate(const Hypothesis& hypo,
|
|
|
|
ScoreComponentCollection* accumulator) const
|
|
|
|
{}
|
|
|
|
void EvaluateChart(const ChartHypothesis &hypo,
|
|
|
|
ScoreComponentCollection* accumulator) const
|
|
|
|
{}
|
2013-05-02 15:15:26 +04:00
|
|
|
|
2013-05-28 13:51:28 +04:00
|
|
|
void ComputeFeatures(const Phrase &source,
|
2013-05-29 21:16:15 +04:00
|
|
|
const TargetPhrase& targetPhrase,
|
|
|
|
ScoreComponentCollection* accumulator,
|
|
|
|
const AlignmentInfo &alignmentInfo) const;
|
2013-06-20 16:25:02 +04:00
|
|
|
void SetParameter(const std::string& key, const std::string& value);
|
2012-04-09 23:47:51 +04:00
|
|
|
|
2011-08-13 05:39:35 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // moses_TargetWordInsertionFeature_h
|