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_coreference.py 782 B

123456789101112131415161718192021222324
  1. import unittest
  2. from fastNLP.io.pipe.coreference import CoreferencePipe
  3. class TestCR(unittest.TestCase):
  4. def test_load(self):
  5. class Config():
  6. max_sentences = 50
  7. filter = [3, 4, 5]
  8. char_path = None
  9. config = Config()
  10. file_root_path = "test/data_for_tests/coreference/"
  11. train_path = file_root_path + "coreference_train.json"
  12. dev_path = file_root_path + "coreference_dev.json"
  13. test_path = file_root_path + "coreference_test.json"
  14. paths = {"train": train_path, "dev": dev_path, "test": test_path}
  15. bundle1 = CoreferencePipe(config).process_from_file(paths)
  16. bundle2 = CoreferencePipe(config).process_from_file(file_root_path)
  17. print(bundle1)
  18. print(bundle2)