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_dataset_loader.py 962 B

123456789101112131415161718192021222324252627
  1. import unittest
  2. from fastNLP.io.dataset_loader import Conll2003Loader, PeopleDailyCorpusLoader, ConllCWSReader, \
  3. ZhConllPOSReader, ConllxDataLoader
  4. class TestDatasetLoader(unittest.TestCase):
  5. def test_Conll2003Loader(self):
  6. """
  7. Test the the loader of Conll2003 dataset
  8. """
  9. dataset_path = "test/data_for_tests/conll_2003_example.txt"
  10. loader = Conll2003Loader()
  11. dataset_2003 = loader.load(dataset_path)
  12. def test_PeopleDailyCorpusLoader(self):
  13. data_set = PeopleDailyCorpusLoader().load("test/data_for_tests/people_daily_raw.txt")
  14. def test_ConllCWSReader(self):
  15. dataset = ConllCWSReader().load("test/data_for_tests/conll_example.txt")
  16. def test_ZhConllPOSReader(self):
  17. dataset = ZhConllPOSReader().load("test/data_for_tests/zh_sample.conllx")
  18. def test_ConllxDataLoader(self):
  19. dataset = ConllxDataLoader().load("test/data_for_tests/zh_sample.conllx")