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_cnn_text_classification.py 531 B

6 years ago
123456789101112131415161718
  1. import unittest
  2. from .model_runner import *
  3. from fastNLP.models.cnn_text_classification import CNNText
  4. class TestCNNText(unittest.TestCase):
  5. def test_case1(self):
  6. # 测试能否正常运行CNN
  7. init_emb = (VOCAB_SIZE, 30)
  8. model = CNNText(init_emb,
  9. NUM_CLS,
  10. kernel_nums=(1, 3, 5),
  11. kernel_sizes=(2, 2, 2),
  12. padding=0,
  13. dropout=0.5)
  14. RUNNER.run_model_with_task(TEXT_CLS, model)