mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
Merge branch 'GHKMStruct' of github.com:moses-smt/mosesdecoder into GHKMStruct
This commit is contained in:
commit
643fa18805
7
GHKM_sparse_weights
Normal file
7
GHKM_sparse_weights
Normal file
@ -0,0 +1,7 @@
|
||||
InternalStructFeature_NTVBZ 0.1
|
||||
InternalStructFeature_NTVBD 0.1
|
||||
InternalStructFeature_NTVBP 0.1
|
||||
InternalStructFeature_NTPP 0.1
|
||||
InternalStructFeature_NTSBAR 0.1
|
||||
|
||||
|
@ -11,7 +11,7 @@ InternalStructFeature::InternalStructFeature()
|
||||
}
|
||||
|
||||
bool InternalStructFeature::equals(const PhraseAlignment& lhs, const PhraseAlignment& rhs) const{
|
||||
cout<<"InternalStructFeature: Equals\n";
|
||||
//cout<<"InternalStructFeature: Equals\n";
|
||||
//don't know what it's used for and what we should compare
|
||||
//-> if the dense score is the same
|
||||
//-> if the sparse feature is set
|
||||
@ -19,7 +19,13 @@ bool InternalStructFeature::equals(const PhraseAlignment& lhs, const PhraseAlign
|
||||
/** Return true if the two phrase pairs are equal from the point of this feature. Assume
|
||||
that they already compare true according to PhraseAlignment.equals()
|
||||
**/
|
||||
return true;
|
||||
|
||||
/* if(lhs.ghkmParse==rhs.ghkmParse)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
*/
|
||||
//return true;
|
||||
}
|
||||
|
||||
void InternalStructFeature::add(const ScoreFeatureContext& context,
|
||||
@ -52,9 +58,15 @@ void InternalStructFeatureSparse::add(std::string *internalStruct,
|
||||
std::map<std::string,float>& sparseValues) const{
|
||||
//cout<<"Sparse: "<<*internalStruct<<endl;
|
||||
if(internalStruct->find("VBZ")!=std::string::npos)
|
||||
sparseValues["NT_VBZ"] = 1;
|
||||
sparseValues["NTVBZ"] = 1;
|
||||
if(internalStruct->find("VBD")!=std::string::npos)
|
||||
sparseValues["NT_VBD"] = 1;
|
||||
sparseValues["NTVBD"] = 1;
|
||||
if(internalStruct->find("VBP")!=std::string::npos)
|
||||
sparseValues["NTVBP"] = 1;
|
||||
if(internalStruct->find("PP")!=std::string::npos)
|
||||
sparseValues["NTPP"] = 1;
|
||||
if(internalStruct->find("SBAR")!=std::string::npos)
|
||||
sparseValues["NTSBAR"] = 1;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user