You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_conll_loader.py 894 B

12345678910111213141516171819202122232425262728293031
  1. import unittest
  2. import os
  3. from fastNLP.io.loader.conll import MsraNERLoader, PeopleDailyNERLoader, WeiboNERLoader, \
  4. Conll2003Loader
  5. class TestMSRANER(unittest.TestCase):
  6. @unittest.skipIf('TRAVIS' in os.environ, "Skip in travis")
  7. def test_download(self):
  8. MsraNERLoader().download(re_download=False)
  9. data_bundle = MsraNERLoader().load()
  10. print(data_bundle)
  11. class TestPeopleDaily(unittest.TestCase):
  12. @unittest.skipIf('TRAVIS' in os.environ, "Skip in travis")
  13. def test_download(self):
  14. PeopleDailyNERLoader().download()
  15. class TestWeiboNER(unittest.TestCase):
  16. @unittest.skipIf('TRAVIS' in os.environ, "Skip in travis")
  17. def test_download(self):
  18. WeiboNERLoader().download()
  19. class TestConll2003Loader(unittest.TestCase):
  20. def test__load(self):
  21. Conll2003Loader()._load('test/data_for_tests/conll_2003_example.txt')