def do_gibbs_best(self, value): """Run Gibbs sampling to produce the best labelling for given input value""" xs = parse_line(value) ys = computeGibbsBestSequence(self.crf, getCRFBlocks, chooseGibbsCRF, xs, 10000) print pretty_format(ys)
def do_gibbs_best(self, value): """Run Gibbs sampling to produce the best labelling for given input value""" xs = parse_line(value) ys = computeGibbsBestSequence( self.crf, getCRFBlocks, chooseGibbsCRF, xs, 10000 ) print pretty_format(ys)
def do_gibbs_dist(self, value): """Run Gibbs sampling to produce the best labelling for given input value""" xs = parse_line(value) ys = computeGibbsProbabilities(self.crf, getCRFBlocks, chooseGibbsCRF, xs, 10000) for label, pr in ys.most_common(10): print pr, '\t', pretty_format(label)
def do_gibbs_dist(self, value): """Run Gibbs sampling to produce the best labelling for given input value""" xs = parse_line(value) ys = computeGibbsProbabilities( self.crf, getCRFBlocks, chooseGibbsCRF, xs, 10000 ) for label, pr in ys.most_common(10): print pr, '\t', pretty_format(label)
def do_viterbi(self, value): """Run the viterbi algorithm on input to produce the most likely labelling""" xs = parse_line(value) ys = computeViterbi(crf, xs) print pretty_format(ys)