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_matching.py 958 B

1234567891011121314151617181920212223242526
  1. import unittest
  2. import os
  3. from fastNLP.io.pipe.matching import SNLIPipe, RTEPipe, QNLIPipe, MNLIPipe
  4. from fastNLP.io.pipe.matching import SNLIBertPipe, RTEBertPipe, QNLIBertPipe, MNLIBertPipe
  5. @unittest.skipIf('TRAVIS' in os.environ, "Skip in travis")
  6. class TestPipe(unittest.TestCase):
  7. def test_process_from_file(self):
  8. for pipe in [SNLIPipe, RTEPipe, QNLIPipe, MNLIPipe]:
  9. with self.subTest(pipe=pipe):
  10. print(pipe)
  11. data_bundle = pipe(tokenizer='raw').process_from_file()
  12. print(data_bundle)
  13. @unittest.skipIf('TRAVIS' in os.environ, "Skip in travis")
  14. class TestBertPipe(unittest.TestCase):
  15. def test_process_from_file(self):
  16. for pipe in [SNLIBertPipe, RTEBertPipe, QNLIBertPipe, MNLIBertPipe]:
  17. with self.subTest(pipe=pipe):
  18. print(pipe)
  19. data_bundle = pipe(tokenizer='raw').process_from_file()
  20. print(data_bundle)