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_CWSDataLoader.py 552 B

1234567891011121314151617
  1. import unittest
  2. from reproduction.seqence_labelling.cws.data.CWSDataLoader import SigHanLoader
  3. from fastNLP.core.vocabulary import VocabularyOption
  4. class TestCWSDataLoader(unittest.TestCase):
  5. def test_case1(self):
  6. cws_loader = SigHanLoader(target_type='bmes')
  7. data = cws_loader.process('pku_demo.txt')
  8. print(data.datasets)
  9. def test_calse2(self):
  10. cws_loader = SigHanLoader(target_type='bmes')
  11. data = cws_loader.process('pku_demo.txt', bigram_vocab_opt=VocabularyOption())
  12. print(data.datasets)