Download tools/mosesdecoder/phrase-extract/InternalStructFeature.h from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 1.7 kB
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/phrase-extract/InternalStructFeature.h
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/phrase-extract/InternalStructFeature.h
-
curl -L -o InternalStructFeature.h https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/phrase-extract/InternalStructFeature.h
1.7 kB
| namespace MosesTraining | |
| { | |
| class InternalStructFeature : public ScoreFeature | |
| { | |
| public: | |
| InternalStructFeature() : m_type(0) {}; | |
| /** Add the values for this feature function. */ | |
| void add(const ScoreFeatureContext& context, | |
| std::vector<float>& denseValues, | |
| std::map<std::string,float>& sparseValues) const; | |
| protected: | |
| /** Overridden in subclass */ | |
| virtual void add(const std::string *treeFragment, | |
| float count, | |
| std::vector<float>& denseValues, | |
| std::map<std::string,float>& sparseValues) const = 0; | |
| int m_type; | |
| }; | |
| class InternalStructFeatureDense : public InternalStructFeature | |
| { | |
| public: | |
| InternalStructFeatureDense() | |
| :InternalStructFeature() { | |
| m_type=1; | |
| } //std::cout<<"InternalStructFeatureDense: Construct "<<m_type<<"\n";} | |
| protected: | |
| virtual void add(const std::string *treeFragment, | |
| float count, | |
| std::vector<float>& denseValues, | |
| std::map<std::string,float>& sparseValues) const; | |
| }; | |
| class InternalStructFeatureSparse : public InternalStructFeature | |
| { | |
| public: | |
| InternalStructFeatureSparse() | |
| :InternalStructFeature() { | |
| m_type=2; | |
| }// std::cout<<"InternalStructFeatureSparse: Construct "<<m_type<<"\n";} | |
| protected: | |
| virtual void add(const std::string *treeFragment, | |
| float count, | |
| std::vector<float>& denseValues, | |
| std::map<std::string,float>& sparseValues) const; | |
| }; | |
| } | |