Package joshua.decoder.hypergraph

Examples of joshua.decoder.hypergraph.HyperEdge


  private static HyperEdge clone_deduction(HyperEdge inEdge){
    ArrayList<HGNode> l_ant_items = null;
    if (null != inEdge.getAntNodes()) {
      l_ant_items = new ArrayList<HGNode>(inEdge.getAntNodes());//l_ant_items will be changed in get_1best_tree_item
    }
    HyperEdge res = new HyperEdge(inEdge.getRule(), inEdge.bestDerivationLogP, inEdge.getTransitionLogP(false), l_ant_items, null);
    return res;
  }
View Full Code Here


      return tbl_processed_items.get(it);
    else{
      boolean should_filter = true;//default: filter out
     
      ArrayList<HyperEdge> l_survive_deductions= new   ArrayList<HyperEdge>();
      HyperEdge best_survive_deduction = null;
     
      //### recursive call on each deduction, and update l_deductions and best_deduction
      for(HyperEdge dt : it.hyperedges){
        HyperEdge new_edge = filter_deduction(dt);//deduction-specifc operation
        if(new_edge!=null){//survive
          should_filter = false;//the item survives as long as at least one hyperedge survives
          l_survive_deductions.add(new_edge);
          if(best_survive_deduction ==null || best_survive_deduction.bestDerivationLogP>new_edge.bestDerivationLogP)
            best_survive_deduction = new_edge;
View Full Code Here

            l_ant_items.add(new_node);
          }
        }
      }
     
      HyperEdge new_edge = null;
      if(should_filter==false){
        new_edge = new HyperEdge(dt.getRule(), bestLogP, dt.getTransitionLogP(false), l_ant_items, null);
      }
      //System.out.println("hyperEdge filter="+res);
      return new_edge;
    }
  }
View Full Code Here

 

  @Override
  protected HyperEdge createNewHyperEdge(HyperEdge originalEdge, List<HGNode> antVirtualItems, DPStateOracle dps) {
    return new HyperEdge(originalEdge.getRule(), dps.bestDerivationLogP, null, antVirtualItems, originalEdge.getSourcePath());
  }
View Full Code Here

  protected HyperEdge createNewHyperEdge(HyperEdge originalEdge, List<HGNode> antVirtualItems, DPStateOracle dps) {
    /**compared wit the original edge, two changes:
     * (1) change the list of ant nodes
     * (2) change the transition logProb to BLEU from Model logProb
     * */
    return new HyperEdge(originalEdge.getRule(), dps.bestDerivationLogP, null, antVirtualItems, originalEdge.getSourcePath());
  }
View Full Code Here

  }
 
  private void handleOneCombination(HGNode originalParentHGNode, HyperEdge originalEdge, ArrayList<HGNode> antRefinedNodes, HashMap<String, RefinedNode> refinedNodeSigs){
   
    DPS dps = computeState(originalParentHGNode, originalEdge,  antRefinedNodes);
    HyperEdge tEdge = createNewHyperEdge(originalEdge, antRefinedNodes, dps);
    addHyperedge(originalParentHGNode, refinedNodeSigs, tEdge, dps);
  }
View Full Code Here

TOP

Related Classes of joshua.decoder.hypergraph.HyperEdge

Copyright © 2018 www.massapicom. 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.