Examples of FeatureTemplateBasedFF


Examples of joshua.discriminative.feature_related.feature_function.FeatureTemplateBasedFF

   
    //================ discriminative reranking model
    HashMap<String, Double> modelTbl =  new HashMap<String, Double>();     
    DiscriminativeSupport.loadModel(modelFile, modelTbl, rulesStringToIDTable);     
   
    return new FeatureTemplateBasedFF(featID, weight, modelTbl, featTemplates, restrictedFeatureSet);
  }
View Full Code Here

Examples of joshua.discriminative.feature_related.feature_function.FeatureTemplateBasedFF

    ((EdgeTblBasedBaselineFF)featFunctions.get(0)).collectTransitionLogPs(hg);
   
    //=== step-2: model extraction based on the definition of Q
    for(Map.Entry<VariationalNgramApproximator, FeatureTemplateBasedFF> entry : approximatorMap.entrySet()){
      VariationalNgramApproximator approximator = entry.getKey();
      FeatureTemplateBasedFF featureFunction = entry.getValue();
      HashMap<String, Double> model = approximator.estimateModel(hg, pInsideOutside);
      featureFunction.setModel(model);     
    }
   
    //clean up
    pInsideOutside.clearState();
   
View Full Code Here

Examples of joshua.discriminative.feature_related.feature_function.FeatureTemplateBasedFF

            System.out.println("varatioanl_ngram_order is greater than baseline_lm_order; must be wrong");
            System.exit(1);
          }
          double weight = new Double(fds[2].trim());         
          FeatureTemplate ft = new NgramFT(symbolTbl, true , ngramStateID, baselineLMOrder, vlmOrder, vlmOrder);
          FeatureTemplateBasedFF ff =  new FeatureTemplateBasedFF(ngramStateID+1+featFunctions.size(), weight, ft);
         
          VariationalNgramApproximator rmodel = new VariationalNgramApproximator(symbolTbl, ft, 1.0, vlmOrder);
          featFunctions.add(ff);
          approximatorMap.put(rmodel, ff);         
          logger.info( String.format("vlm feature with weight: " + weight))
View Full Code Here

Examples of joshua.discriminative.feature_related.feature_function.FeatureTemplateBasedFF

      insideOutsider.runInsideOutside(testHG, 0, 1, insideOutsideScalingFactor);//ADD_MODE=0=sum; LOG_SEMIRING=1;
     
      //### step-2: model extraction based on the definition of Q
      for(Map.Entry<VariationalNgramApproximator, FeatureTemplateBasedFF> entry : approximatorMap.entrySet()){
        VariationalNgramApproximator approximator = entry.getKey();
        FeatureTemplateBasedFF featureFunction = entry.getValue();
        HashMap<String, Double> model = approximator.estimateModel(testHG, insideOutsider);
        featureFunction.setModel(model);     
      }
     
 
      //###############semiring parsing
      parserEntropyP.insideEstimationOverHG(testHG);
View Full Code Here

Examples of joshua.discriminative.feature_related.feature_function.FeatureTemplateBasedFF

    int featID = 999;
    double weight = 1.0;
    HashSet<String> restrictedFeatureSet = null;
    HashMap<String, Double> modelTbl = obtainModelTable(this.featureStringToIntegerMap, this.lastWeightVector);
    //System.out.println("modelTable: " + modelTbl);
    FeatureFunction ff = new FeatureTemplateBasedFF(featID, weight, modelTbl, this.featTemplates, restrictedFeatureSet);

    //==== reranker
    List<FeatureFunction> features =  new ArrayList<FeatureFunction>();
    features.add(ff);
    HGRanker reranker = new HGRanker(features)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.