|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| void | runInsideOutside (HyperGraph hg, int add_mode, int semiring, double scaling_factor_) |
| void | clearState () |
| double | getLogNormalizationConstant () |
| double | getEdgeUnormalizedPosteriorLogProb (HyperEdge dt, HGNode parent) |
| double | getEdgePosteriorProb (HyperEdge dt, HGNode parent) |
| double | getNodeUnnormalizedPosteriorLogProb (HGNode node) |
| double | getNodePosteriorProb (HGNode node) |
| void | sanityCheckHG (HyperGraph hg) |
Protected Member Functions | |
| abstract double | getHyperedgeLogProb (HyperEdge dt, HGNode parent_it) |
| double | getHyperedgeLogProb (HyperEdge dt, HGNode parent_it, double scaling_factor) |
Package Attributes | |
| int | ADD_MODE = 0 |
| int | LOG_SEMIRING = 1 |
| int | SEMIRING = LOG_SEMIRING |
| double | ZERO_IN_SEMIRING = Double.NEGATIVE_INFINITY |
| double | ONE_IN_SEMIRING = 0 |
| double | scaling_factor |
| double | normalizationConstant = ONE_IN_SEMIRING |
Private Member Functions | |
| void | sanity_check_item (HGNode it) |
| void | sanity_check_deduction (HyperEdge dt) |
| void | inside_estimation_hg (HyperGraph hg) |
| double | inside_estimation_item (HGNode it) |
| double | inside_estimation_deduction (HyperEdge dt, HGNode parent_item) |
| void | outside_estimation_hg (HyperGraph hg) |
| void | outside_estimation_item (HGNode cur_it, HGNode upper_item, HyperEdge parent_dt, double parent_deduct_prob) |
| void | outside_estimation_deduction (HyperEdge dt, HGNode parent_item) |
| void | setup_semiring (int semiring, int add_mode) |
| double | multi_in_semiring (double x, double y) |
| double | add_in_semiring (double x, double y) |
| double | multi_in_log_semiring (double x, double y) |
| double | add_in_log_semiring (double x, double y) |
Private Attributes | |
| HashMap< HGNode, Double > | tbl_inside_prob = new HashMap<HGNode, Double>() |
| HashMap< HGNode, Double > | tbl_outside_prob = new HashMap<HGNode, Double>() |
| HashMap< HGNode, Integer > | tbl_num_parent_deductions = new HashMap<HGNode, Integer>() |
| HashMap< HGNode, Integer > | tbl_for_sanity_check = null |
to use the functions here, one need to extend the class to provide a way to calculate the transitionLogP based on feature set
| double joshua.decoder.hypergraph.DefaultInsideOutside.add_in_log_semiring | ( | double | x, |
| double | y | ||
| ) | [private] |
| double joshua.decoder.hypergraph.DefaultInsideOutside.add_in_semiring | ( | double | x, |
| double | y | ||
| ) | [private] |
Reimplemented in joshua.decoder.hypergraph.HyperGraphPruning.
| double joshua.decoder.hypergraph.DefaultInsideOutside.getEdgePosteriorProb | ( | HyperEdge | dt, |
| HGNode | parent | ||
| ) |
| double joshua.decoder.hypergraph.DefaultInsideOutside.getEdgeUnormalizedPosteriorLogProb | ( | HyperEdge | dt, |
| HGNode | parent | ||
| ) |
| abstract double joshua.decoder.hypergraph.DefaultInsideOutside.getHyperedgeLogProb | ( | HyperEdge | dt, |
| HGNode | parent_it | ||
| ) | [protected, pure virtual] |
Implemented in joshua.decoder.hypergraph.TrivialInsideOutside.
| double joshua.decoder.hypergraph.DefaultInsideOutside.getHyperedgeLogProb | ( | HyperEdge | dt, |
| HGNode | parent_it, | ||
| double | scaling_factor | ||
| ) | [protected] |
| double joshua.decoder.hypergraph.DefaultInsideOutside.getNodeUnnormalizedPosteriorLogProb | ( | HGNode | node | ) |
| double joshua.decoder.hypergraph.DefaultInsideOutside.inside_estimation_deduction | ( | HyperEdge | dt, |
| HGNode | parent_item | ||
| ) | [private] |
| void joshua.decoder.hypergraph.DefaultInsideOutside.inside_estimation_hg | ( | HyperGraph | hg | ) | [private] |
| double joshua.decoder.hypergraph.DefaultInsideOutside.inside_estimation_item | ( | HGNode | it | ) | [private] |
| double joshua.decoder.hypergraph.DefaultInsideOutside.multi_in_log_semiring | ( | double | x, |
| double | y | ||
| ) | [private] |
| double joshua.decoder.hypergraph.DefaultInsideOutside.multi_in_semiring | ( | double | x, |
| double | y | ||
| ) | [private] |
| void joshua.decoder.hypergraph.DefaultInsideOutside.outside_estimation_deduction | ( | HyperEdge | dt, |
| HGNode | parent_item | ||
| ) | [private] |
| void joshua.decoder.hypergraph.DefaultInsideOutside.outside_estimation_hg | ( | HyperGraph | hg | ) | [private] |
| void joshua.decoder.hypergraph.DefaultInsideOutside.outside_estimation_item | ( | HGNode | cur_it, |
| HGNode | upper_item, | ||
| HyperEdge | parent_dt, | ||
| double | parent_deduct_prob | ||
| ) | [private] |
| void joshua.decoder.hypergraph.DefaultInsideOutside.runInsideOutside | ( | HyperGraph | hg, |
| int | add_mode, | ||
| int | semiring, | ||
| double | scaling_factor_ | ||
| ) |
| void joshua.decoder.hypergraph.DefaultInsideOutside.sanity_check_deduction | ( | HyperEdge | dt | ) | [private] |
| void joshua.decoder.hypergraph.DefaultInsideOutside.sanity_check_item | ( | HGNode | it | ) | [private] |
| void joshua.decoder.hypergraph.DefaultInsideOutside.setup_semiring | ( | int | semiring, |
| int | add_mode | ||
| ) | [private] |
int joshua.decoder.hypergraph.DefaultInsideOutside.ADD_MODE = 0 [package] |
Two operations: add and multi add: different hyperedges lead to a specific item multi: prob of a derivation is a multi of all constituents
int joshua.decoder.hypergraph.DefaultInsideOutside.LOG_SEMIRING = 1 [package] |
double joshua.decoder.hypergraph.DefaultInsideOutside.normalizationConstant = ONE_IN_SEMIRING [package] |
double joshua.decoder.hypergraph.DefaultInsideOutside.ONE_IN_SEMIRING = 0 [package] |
double joshua.decoder.hypergraph.DefaultInsideOutside.scaling_factor [package] |
int joshua.decoder.hypergraph.DefaultInsideOutside.SEMIRING = LOG_SEMIRING [package] |
HashMap<HGNode, Integer> joshua.decoder.hypergraph.DefaultInsideOutside.tbl_for_sanity_check = null [private] |
HashMap<HGNode, Double> joshua.decoder.hypergraph.DefaultInsideOutside.tbl_inside_prob = new HashMap<HGNode, Double>() [private] |
HashMap<HGNode, Integer> joshua.decoder.hypergraph.DefaultInsideOutside.tbl_num_parent_deductions = new HashMap<HGNode, Integer>() [private] |
for each item, remember how many deductions pointering to me, this is needed for outside estimation during outside estimation, an item will recursive call its deductions to do outside-estimation only after it itself is done with outside estimation, this is necessary because the outside estimation of the items under its deductions require the item's outside value
HashMap<HGNode, Double> joshua.decoder.hypergraph.DefaultInsideOutside.tbl_outside_prob = new HashMap<HGNode, Double>() [private] |
double joshua.decoder.hypergraph.DefaultInsideOutside.ZERO_IN_SEMIRING = Double.NEGATIVE_INFINITY [package] |