org.allenai.nlpstack.parse.poly.decisiontree
Helper Method used to custom print a DecisionTreeJustification for Weirdness analysis.
Helper Method used to custom print a DecisionTreeJustification for Weirdness analysis.
For a Justification that looks like: [ parent1.cpos.nexus = 0, child.cpos.. = 0, parent2.cpos.. = 0, self.cpos.notFound = 0, parent2.alabel.ADVMOD = 0, child1.direction.R = 0, self.cpos.VERB = 0, parent.cpos.notFound = 0, children.card.0 = 0, children.card.1 = 1, parent.suffix.s = 0, parent.cpos.ADP = 0, self.keyword.'s = 0, child1.alabel.AMOD = 0, child1.alabel.DEP = 0, child1.alabel.NSUBJ = 0, parent.cpos.. = 0, child.keyword.was = 0, child1.alabel.TMOD = 0, child1.alabel.COP = 0, child1.alabel.POSSESSIVE = 0, child1.keyword.is = 0, child1.alabel.PRT = 0, self.cpos.CONJ = 0, child1.alabel.VMOD = 0, child.cpos.NOUN = 0, self.cpos.ADP = 1, child1.keyword.did = 0, child.keyword.are = 0, self.keyword.at = 1 ]
Explanation generated will look like: [ [ children.card = 1 ], [ self.cpos = ADP ], [ self.keyword = at ], [ child.cpos <> {NOUN, .} ], [ child.keyword <> {are, was} ], [ child1.alabel <> {VMOD, AMOD, NSUBJ, COP, DEP, POSSESSIVE, TMOD, PRT} ], [ child1.direction <> R ], [ child1.keyword <> {did, is} ], [ parent.cpos <> {., notFound, ADP} ], [ parent.suffix <> s ], [ parent1.cpos <> nexus ], [ parent2.alabel <> ADVMOD ], [ parent2.cpos <> . ] ]
Structure to represent a decision tree's justification for a certain classification outcome. Contains index of the chosen node and the breadcrumb that led to it: (feature index, feature value) tuple at each decision point.