mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 13:23:25 +03:00
delete mention of Distortion score producer and its weight in static data
This commit is contained in:
parent
2835ea63e0
commit
e091990565
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.162355801">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.162355801" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
@ -74,7 +76,6 @@
|
||||
<listOptionValue builtIn="false" value="boost_system-mt"/>
|
||||
<listOptionValue builtIn="false" value="boost_thread-mt"/>
|
||||
<listOptionValue builtIn="false" value="boost_filesystem-mt"/>
|
||||
<listOptionValue builtIn="false" value="rt"/>
|
||||
</option>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.128214028" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.461114338">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.461114338" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
@ -72,7 +74,6 @@
|
||||
<listOptionValue builtIn="false" value="boost_thread-mt"/>
|
||||
<listOptionValue builtIn="false" value="lm"/>
|
||||
<listOptionValue builtIn="false" value="util"/>
|
||||
<listOptionValue builtIn="false" value="rt"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.userobjs.1542590830" name="Other objects" superClass="gnu.cpp.link.option.userobjs" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc}/../../boost/lib64/libboost_system-mt.a""/>
|
||||
@ -160,8 +161,13 @@
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="1">
|
||||
<resource resourceType="PROJECT" workspacePath="/moses-cmd"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/moses-cmd"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/moses-cmd"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
|
@ -62,7 +62,6 @@ public:
|
||||
CHECK(m_transOptRange != NULL);
|
||||
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
const float weightDistortion = staticData.GetWeightDistortion();
|
||||
|
||||
const float distortionScoreA = DistortionScoreProducer::CalculateDistortionScore(
|
||||
*hypoA,
|
||||
@ -77,8 +76,22 @@ public:
|
||||
hypoB->GetWordsBitmap().GetFirstGapPos()
|
||||
);
|
||||
|
||||
const float scoreA = hypoA->GetScore() + distortionScoreA * weightDistortion;
|
||||
const float scoreB = hypoB->GetScore() + distortionScoreB * weightDistortion;
|
||||
|
||||
float totalWeightDistortion = 0;
|
||||
const std::vector<FeatureFunction*> &ffs = FeatureFunction::GetFeatureFunctions();
|
||||
std::vector<FeatureFunction*>::const_iterator iter;
|
||||
for (iter = ffs.begin(); iter != ffs.end(); ++iter) {
|
||||
const FeatureFunction *ff = *iter;
|
||||
|
||||
const DistortionScoreProducer *model = dynamic_cast<const DistortionScoreProducer*>(ff);
|
||||
if (model) {
|
||||
float weight =staticData.GetAllWeights().GetScoreForProducer(model);
|
||||
totalWeightDistortion += weight;
|
||||
}
|
||||
}
|
||||
const float scoreA = hypoA->GetScore() + distortionScoreA * totalWeightDistortion;
|
||||
const float scoreB = hypoB->GetScore() + distortionScoreB * totalWeightDistortion;
|
||||
|
||||
|
||||
if (scoreA > scoreB) {
|
||||
return true;
|
||||
|
@ -480,7 +480,16 @@ void OutputWordGraph(std::ostream &outputWordGraphStream, const Hypothesis *hypo
|
||||
// re-ordering
|
||||
outputWordGraphStream << "\tr=";
|
||||
|
||||
outputWordGraphStream << hypo->GetScoreBreakdown().GetScoreForProducer(StaticData::Instance().GetDistortionProducer());
|
||||
const std::vector<FeatureFunction*> &ffs = FeatureFunction::GetFeatureFunctions();
|
||||
std::vector<FeatureFunction*>::const_iterator iter;
|
||||
for (iter = ffs.begin(); iter != ffs.end(); ++iter) {
|
||||
const FeatureFunction *ff = *iter;
|
||||
|
||||
const DistortionScoreProducer *model = dynamic_cast<const DistortionScoreProducer*>(ff);
|
||||
if (model) {
|
||||
outputWordGraphStream << hypo->GetScoreBreakdown().GetScoreForProducer(model);
|
||||
}
|
||||
}
|
||||
|
||||
// lexicalised re-ordering
|
||||
/*
|
||||
|
@ -634,7 +634,6 @@ bool StaticData::LoadData(Parameter *parameter)
|
||||
DistortionScoreProducer *model = new DistortionScoreProducer(line);
|
||||
const vector<float> &weights = m_parameter->GetWeights(feature, featureIndex);
|
||||
SetWeights(model, weights);
|
||||
m_distortionScoreProducer = model;
|
||||
}
|
||||
else if (feature == "WordPenalty") {
|
||||
WordPenaltyProducer *model = new WordPenaltyProducer(line);
|
||||
@ -1104,11 +1103,6 @@ float StaticData::GetWeightUnknownWordPenalty() const {
|
||||
return GetWeight(m_unknownWordPenaltyProducer);
|
||||
}
|
||||
|
||||
float StaticData::GetWeightDistortion() const {
|
||||
CHECK(m_distortionScoreProducer);
|
||||
return StaticData::Instance().GetWeight(m_distortionScoreProducer);
|
||||
}
|
||||
|
||||
void StaticData::ConfigDictionaries() {
|
||||
for (vector<DecodeGraph*>::const_iterator i = m_decodeGraphs.begin();
|
||||
i != m_decodeGraphs.end(); ++i) {
|
||||
@ -1148,7 +1142,6 @@ void StaticData::CollectFeatureFunctions()
|
||||
std::vector<FeatureFunction*>::const_iterator iter;
|
||||
for (iter = ffs.begin(); iter != ffs.end(); ++iter) {
|
||||
const FeatureFunction *ff = *iter;
|
||||
cerr << ff->GetScoreProducerDescription() << endl;
|
||||
|
||||
const LanguageModel *lm = dynamic_cast<const LanguageModel*>(ff);
|
||||
if (lm) {
|
||||
|
@ -55,7 +55,6 @@ class GlobalLexicalModelUnlimited;
|
||||
class PhraseDictionaryFeature;
|
||||
class SparsePhraseDictionaryFeature;
|
||||
class GenerationDictionary;
|
||||
class DistortionScoreProducer;
|
||||
class DecodeStep;
|
||||
class UnknownWordPenaltyProducer;
|
||||
class MetaScoreProducer;
|
||||
@ -136,7 +135,6 @@ protected:
|
||||
|
||||
mutable size_t m_verboseLevel;
|
||||
WordPenaltyProducer* m_wpProducer;
|
||||
DistortionScoreProducer* m_distortionScoreProducer;
|
||||
UnknownWordPenaltyProducer *m_unknownWordPenaltyProducer;
|
||||
|
||||
MetaFeatureProducer *m_metaFeatureProducer;
|
||||
@ -441,10 +439,6 @@ public:
|
||||
const UnknownWordPenaltyProducer *GetUnknownWordPenaltyProducer() const
|
||||
{ return m_unknownWordPenaltyProducer; }
|
||||
|
||||
DistortionScoreProducer* GetDistortionProducer() const {
|
||||
assert(m_distortionScoreProducer);
|
||||
return m_distortionScoreProducer;
|
||||
}
|
||||
MetaFeatureProducer* GetMetaFeatureProducer() const {
|
||||
return m_metaFeatureProducer;
|
||||
}
|
||||
@ -677,7 +671,6 @@ public:
|
||||
|
||||
float GetWeightWordPenalty() const;
|
||||
float GetWeightUnknownWordPenalty() const;
|
||||
float GetWeightDistortion() const;
|
||||
|
||||
const std::vector<PhraseDictionaryFeature*>& GetPhraseDictionaries() const
|
||||
{ return m_phraseDictionary;}
|
||||
|
Loading…
Reference in New Issue
Block a user