Example #1
0
        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)
Example #2
0
        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)
Example #3
0
        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)
Example #4
0
        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)
Example #5
0
 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)
Example #6
0
 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)