} else { // length == 2
Tree left = tree.children()[0];
Tree right = tree.children()[1];
String parentLabel = tree.label().value();
String leftLabel = left.label().value();
String rightLabel = right.label().value();
double[][][] betas = binaryBetas.get(parentLabel, leftLabel, rightLabel);
double[] leftInside = probIn.get(left);
double[] rightInside = probIn.get(right);
double[] parentOutside = probOut.get(tree);
int parentStates = betas.length;