| #pragma once |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| #include <string> |
| #include <vector> |
|
|
| namespace MosesTraining |
| { |
| enum REO_MODEL_TYPE {REO_MSD, REO_MSLR, REO_MONO}; |
| enum REO_POS {LEFT, RIGHT, DLEFT, DRIGHT, UNKNOWN}; |
|
|
|
|
| class PhraseExtractionOptions |
| { |
|
|
| public: |
| int maxPhraseLength; |
| int minPhraseLength; |
| std::string separator; |
|
|
| private: |
| bool allModelsOutputFlag; |
| bool wordModel; |
| REO_MODEL_TYPE wordType; |
| bool phraseModel; |
| REO_MODEL_TYPE phraseType; |
| bool hierModel; |
| REO_MODEL_TYPE hierType; |
| bool orientationFlag; |
| bool translationFlag; |
| bool includeSentenceIdFlag; |
| bool onlyOutputSpanInfo; |
| bool gzOutput; |
| std::string instanceWeightsFile; |
| bool targetConstituentConstrainedFlag; |
| bool targetConstituentBoundariesFlag; |
| bool flexScoreFlag; |
| bool singleWordHeuristicFlag; |
|
|
| public: |
| std::vector<std::string> placeholders; |
| bool debug; |
|
|
| PhraseExtractionOptions(const int initmaxPhraseLength): |
| maxPhraseLength(initmaxPhraseLength), |
| minPhraseLength(3), |
| separator("|||"), |
| allModelsOutputFlag(false), |
| wordModel(false), |
| wordType(REO_MSD), |
| phraseModel(false), |
| phraseType(REO_MSD), |
| hierModel(false), |
| hierType(REO_MSD), |
| orientationFlag(false), |
| translationFlag(true), |
| includeSentenceIdFlag(false), |
| onlyOutputSpanInfo(false), |
| gzOutput(false), |
| targetConstituentConstrainedFlag(false), |
| targetConstituentBoundariesFlag(false), |
| flexScoreFlag(false), |
| singleWordHeuristicFlag(false), |
| debug(false) { |
| } |
|
|
| |
| void initAllModelsOutputFlag(const bool initallModelsOutputFlag) { |
| allModelsOutputFlag=initallModelsOutputFlag; |
| } |
| void initWordModel(const bool initwordModel) { |
| wordModel=initwordModel; |
| } |
| void initWordType(REO_MODEL_TYPE initwordType ) { |
| wordType=initwordType; |
| } |
| void initPhraseModel(const bool initphraseModel ) { |
| phraseModel=initphraseModel; |
| } |
| void initPhraseType(REO_MODEL_TYPE initphraseType) { |
| phraseType=initphraseType; |
| } |
| void initHierModel(const bool inithierModel) { |
| hierModel=inithierModel; |
| } |
| void initHierType(REO_MODEL_TYPE inithierType) { |
| hierType=inithierType; |
| } |
| void initOrientationFlag(const bool initorientationFlag) { |
| orientationFlag=initorientationFlag; |
| } |
| void initTranslationFlag(const bool inittranslationFlag) { |
| translationFlag=inittranslationFlag; |
| } |
| void initIncludeSentenceIdFlag(const bool initincludeSentenceIdFlag) { |
| includeSentenceIdFlag=initincludeSentenceIdFlag; |
| } |
| void initOnlyOutputSpanInfo(const bool initonlyOutputSpanInfo) { |
| onlyOutputSpanInfo= initonlyOutputSpanInfo; |
| } |
| void initGzOutput (const bool initgzOutput) { |
| gzOutput= initgzOutput; |
| } |
| void initInstanceWeightsFile(const char* initInstanceWeightsFile) { |
| instanceWeightsFile = std::string(initInstanceWeightsFile); |
| } |
| void initTargetConstituentConstrainedFlag(const bool initTargetConstituentConstrainedFlag) { |
| targetConstituentConstrainedFlag = initTargetConstituentConstrainedFlag; |
| } |
| void initTargetConstituentBoundariesFlag(const bool initTargetConstituentBoundariesFlag) { |
| targetConstituentBoundariesFlag = initTargetConstituentBoundariesFlag; |
| } |
| void initFlexScoreFlag(const bool initflexScoreFlag) { |
| flexScoreFlag=initflexScoreFlag; |
| } |
| void initSingleWordHeuristicFlag(const bool initSingleWordHeuristicFlag) { |
| singleWordHeuristicFlag = initSingleWordHeuristicFlag; |
| } |
|
|
| |
| bool isAllModelsOutputFlag() const { |
| return allModelsOutputFlag; |
| } |
| bool isWordModel() const { |
| return wordModel; |
| } |
| REO_MODEL_TYPE isWordType() const { |
| return wordType; |
| } |
| bool isPhraseModel() const { |
| return phraseModel; |
| } |
| REO_MODEL_TYPE isPhraseType() const { |
| return phraseType; |
| } |
| bool isHierModel() const { |
| return hierModel; |
| } |
| REO_MODEL_TYPE isHierType() const { |
| return hierType; |
| } |
| bool isOrientationFlag() const { |
| return orientationFlag; |
| } |
| bool isTranslationFlag() const { |
| return translationFlag; |
| } |
| bool isIncludeSentenceIdFlag() const { |
| return includeSentenceIdFlag; |
| } |
| bool isOnlyOutputSpanInfo() const { |
| return onlyOutputSpanInfo; |
| } |
| bool isGzOutput () const { |
| return gzOutput; |
| } |
| std::string getInstanceWeightsFile() const { |
| return instanceWeightsFile; |
| } |
| bool isTargetConstituentConstrainedFlag() const { |
| return targetConstituentConstrainedFlag; |
| } |
| bool isTargetConstituentBoundariesFlag() const { |
| return targetConstituentBoundariesFlag; |
| } |
| bool isFlexScoreFlag() const { |
| return flexScoreFlag; |
| } |
| bool isSingleWordHeuristicFlag() const { |
| return singleWordHeuristicFlag; |
| } |
| }; |
|
|
| } |
|
|
|
|