示例#1
0
    def test_conll2000(self):
        def f():
            CoNLL2000.testa('d')

        self.assertRaises(BaseException, f)

        def f():
            CoNLL2000.testb('d')

        self.assertRaises(NotImplementedError, f)

        def f():
            CoNLL2000.train('d')

        self.assertRaises(BaseException, f)

        def f():
            CoNLL2000.testa('en').baseline()

        self.assertRaises(NotImplementedError, f)

        c = CoNLL2000.testa("en")
        self._test_corpus(c)
        c = CoNLL2000.train("en")
        self._test_corpus(c)
示例#2
0
    def test_conll2000(self):
        def f(): CoNLL2000.testa('d')
        self.assertRaises(BaseException, f)
        def f(): CoNLL2000.testb('d')
        self.assertRaises(NotImplementedError, f)
        def f(): CoNLL2000.train('d')
        self.assertRaises(BaseException, f)
        def f(): CoNLL2000.testa('en').baseline()
        self.assertRaises(NotImplementedError, f)

        c = CoNLL2000.testa("en")
        self._test_corpus(c)
        c = CoNLL2000.train("en")
        self._test_corpus(c)
示例#3
0
    def test_eval(self):
        c = CoNLL2000.testa("en")
        t = [e for e in c.iob_tokens('SYN')]
        all_t = [e for e in c.tokens()]
        r = c.conlleval(t)
        self._test_self_eval_result(r, all_t, t)

        self._test_self_eval(CoNLL2002.testa("nl"))
        self._test_self_eval(CoNLL2002.testb("nl"))
        self._test_self_eval(CoNLL2002.train("nl"))

        self._test_self_eval(CoNLL2002.testa("es"))
        self._test_self_eval(CoNLL2002.testb("es"))
        self._test_self_eval(CoNLL2002.train("es"))

        self._test_self_eval(CoNLL2003.testa("en"))
        self._test_self_eval(CoNLL2003.testb("en"))
        self._test_self_eval(CoNLL2003.train("en"))
示例#4
0
    def test_eval(self):
        c = CoNLL2000.testa("en")
        t     = [ e for e in c.iob_tokens('SYN') ]
        all_t = [e for e in c.tokens() ]
        r = c.conlleval(t)
        self._test_self_eval_result(r, all_t, t)

        self._test_self_eval(CoNLL2002.testa("nl"))
        self._test_self_eval(CoNLL2002.testb("nl"))
        self._test_self_eval(CoNLL2002.train("nl"))

        self._test_self_eval(CoNLL2002.testa("es"))
        self._test_self_eval(CoNLL2002.testb("es"))
        self._test_self_eval(CoNLL2002.train("es"))

        self._test_self_eval(CoNLL2003.testa("en"))
        self._test_self_eval(CoNLL2003.testb("en"))
        self._test_self_eval(CoNLL2003.train("en"))
示例#5
0
 def f():
     CoNLL2000.testa('en').baseline()
示例#6
0
 def f():
     CoNLL2000.testa('d')
示例#7
0
 def f(): CoNLL2000.testa('en').baseline()
 self.assertRaises(NotImplementedError, f)
示例#8
0
 def f(): CoNLL2000.testa('d')
 self.assertRaises(BaseException, f)