@@ -7,6 +7,9 @@ __all__ = [ | |||||
"QuoraBertPipe", | "QuoraBertPipe", | ||||
"QNLIBertPipe", | "QNLIBertPipe", | ||||
"MNLIBertPipe", | "MNLIBertPipe", | ||||
"XNLIBertPipe", | |||||
"BQCorpusBertPipe", | |||||
"LCQMCBertPipe", | |||||
"MatchingPipe", | "MatchingPipe", | ||||
"RTEPipe", | "RTEPipe", | ||||
"SNLIPipe", | "SNLIPipe", | ||||
@@ -15,7 +18,7 @@ __all__ = [ | |||||
"MNLIPipe", | "MNLIPipe", | ||||
"XNLIPipe", | "XNLIPipe", | ||||
"BQCorpusPipe", | "BQCorpusPipe", | ||||
"LCQMCPipe" | |||||
"LCQMCPipe", | |||||
] | ] | ||||
import warnings | import warnings | ||||
@@ -1,15 +1,12 @@ | |||||
import unittest | import unittest | ||||
from fastNLP.io import DataBundle | |||||
from fastNLP.io.loader.classification import YelpFullLoader | |||||
from fastNLP.io.loader.classification import YelpPolarityLoader | |||||
from fastNLP.io.loader.classification import IMDBLoader | |||||
from fastNLP.io.loader.classification import SST2Loader | |||||
from fastNLP.io.loader.classification import SSTLoader | |||||
from fastNLP.io.loader.classification import ChnSentiCorpLoader | |||||
import os | import os | ||||
from fastNLP.io import DataBundle | |||||
from fastNLP.io.loader.classification import YelpFullLoader, YelpPolarityLoader, IMDBLoader, \ | |||||
SSTLoader, SST2Loader, ChnSentiCorpLoader, THUCNewsLoader, WeiboSenti100kLoader | |||||
@unittest.skipIf('TRAVIS' in os.environ, "Skip in travis") | @unittest.skipIf('TRAVIS' in os.environ, "Skip in travis") | ||||
class TestDownload(unittest.TestCase): | class TestDownload(unittest.TestCase): | ||||
@@ -32,6 +29,8 @@ class TestLoad(unittest.TestCase): | |||||
'sst': ('test/data_for_tests/io/SST', SSTLoader, (6, 6, 6), False), | 'sst': ('test/data_for_tests/io/SST', SSTLoader, (6, 6, 6), False), | ||||
'imdb': ('test/data_for_tests/io/imdb', IMDBLoader, (6, 6, 6), False), | 'imdb': ('test/data_for_tests/io/imdb', IMDBLoader, (6, 6, 6), False), | ||||
'ChnSentiCorp': ('test/data_for_tests/io/ChnSentiCorp', ChnSentiCorpLoader, (6, 6, 6), False), | 'ChnSentiCorp': ('test/data_for_tests/io/ChnSentiCorp', ChnSentiCorpLoader, (6, 6, 6), False), | ||||
'THUCNews': ('test/data_for_tests/io/THUCNews', THUCNewsLoader, (9, 9, 9), False), | |||||
'WeiboSenti100k': ('test/data_for_tests/io/WeiboSenti100k', WeiboSenti100kLoader, (7, 6, 6), False), | |||||
} | } | ||||
for k, v in data_set_dict.items(): | for k, v in data_set_dict.items(): | ||||
path, loader, data_set, warns = v | path, loader, data_set, warns = v | ||||
@@ -29,6 +29,7 @@ class TestMatchingLoad(unittest.TestCase): | |||||
'SNLI': ('test/data_for_tests/io/SNLI', SNLILoader, (5, 5, 5), False), | 'SNLI': ('test/data_for_tests/io/SNLI', SNLILoader, (5, 5, 5), False), | ||||
'QNLI': ('test/data_for_tests/io/QNLI', QNLILoader, (5, 5, 5), True), | 'QNLI': ('test/data_for_tests/io/QNLI', QNLILoader, (5, 5, 5), True), | ||||
'MNLI': ('test/data_for_tests/io/MNLI', MNLILoader, (5, 5, 5, 5, 6), True), | 'MNLI': ('test/data_for_tests/io/MNLI', MNLILoader, (5, 5, 5, 5, 6), True), | ||||
'Quora': ('test/data_for_tests/io/Quora', QuoraLoader, (2, 2, 2), False), | |||||
'BQCorpus': ('test/data_for_tests/io/BQCorpus', BQCorpusLoader, (5, 5, 5), False), | 'BQCorpus': ('test/data_for_tests/io/BQCorpus', BQCorpusLoader, (5, 5, 5), False), | ||||
'XNLI': ('test/data_for_tests/io/XNLI', XNLILoader, (6, 7, 6), False), | 'XNLI': ('test/data_for_tests/io/XNLI', XNLILoader, (6, 7, 6), False), | ||||
'LCQMC': ('test/data_for_tests/io/LCQMC', LCQMCLoader, (5, 6, 6), False), | 'LCQMC': ('test/data_for_tests/io/LCQMC', LCQMCLoader, (5, 6, 6), False), | ||||
@@ -3,7 +3,7 @@ import os | |||||
from fastNLP.io import DataBundle | from fastNLP.io import DataBundle | ||||
from fastNLP.io.pipe.classification import SSTPipe, SST2Pipe, IMDBPipe, YelpFullPipe, YelpPolarityPipe | from fastNLP.io.pipe.classification import SSTPipe, SST2Pipe, IMDBPipe, YelpFullPipe, YelpPolarityPipe | ||||
from fastNLP.io.pipe.classification import ChnSentiCorpPipe | |||||
from fastNLP.io.pipe.classification import ChnSentiCorpPipe, THUCNewsPipe, WeiboSenti100kPipe | |||||
@unittest.skipIf('TRAVIS' in os.environ, "Skip in travis") | @unittest.skipIf('TRAVIS' in os.environ, "Skip in travis") | ||||
@@ -41,6 +41,8 @@ class TestRunClassificationPipe(unittest.TestCase): | |||||
'sst': ('test/data_for_tests/io/SST', SSTPipe, (6, 354, 6), (232, 5), False), | 'sst': ('test/data_for_tests/io/SST', SSTPipe, (6, 354, 6), (232, 5), False), | ||||
'imdb': ('test/data_for_tests/io/imdb', IMDBPipe, (6, 6, 6), (1670, 2), False), | 'imdb': ('test/data_for_tests/io/imdb', IMDBPipe, (6, 6, 6), (1670, 2), False), | ||||
'ChnSentiCorp': ('test/data_for_tests/io/ChnSentiCorp', ChnSentiCorpPipe, (6, 6, 6), (529, 1296, 1483, 2), False), | 'ChnSentiCorp': ('test/data_for_tests/io/ChnSentiCorp', ChnSentiCorpPipe, (6, 6, 6), (529, 1296, 1483, 2), False), | ||||
'Chn-THUCNews': ('test/data_for_tests/io/THUCNews', THUCNewsPipe, (9, 9, 9), (1864, 9), False), | |||||
'Chn-WeiboSenti100k': ('test/data_for_tests/io/WeiboSenti100k', WeiboSenti100kPipe, (7, 6, 6), (452, 2), False), | |||||
} | } | ||||
for k, v in data_set_dict.items(): | for k, v in data_set_dict.items(): | ||||
path, pipe, data_set, vocab, warns = v | path, pipe, data_set, vocab, warns = v | ||||
@@ -3,9 +3,9 @@ import unittest | |||||
import os | import os | ||||
from fastNLP.io import DataBundle | from fastNLP.io import DataBundle | ||||
from fastNLP.io.pipe.matching import SNLIPipe, RTEPipe, QNLIPipe, MNLIPipe, \ | |||||
from fastNLP.io.pipe.matching import SNLIPipe, RTEPipe, QNLIPipe, QuoraPipe, MNLIPipe, \ | |||||
XNLIPipe, BQCorpusPipe, LCQMCPipe | XNLIPipe, BQCorpusPipe, LCQMCPipe | ||||
from fastNLP.io.pipe.matching import SNLIBertPipe, RTEBertPipe, QNLIBertPipe, MNLIBertPipe, \ | |||||
from fastNLP.io.pipe.matching import SNLIBertPipe, RTEBertPipe, QNLIBertPipe, QuoraBertPipe, MNLIBertPipe, \ | |||||
XNLIBertPipe, BQCorpusBertPipe, LCQMCBertPipe | XNLIBertPipe, BQCorpusBertPipe, LCQMCBertPipe | ||||
@@ -75,7 +75,7 @@ class TestRunMatchingPipe(unittest.TestCase): | |||||
def test_spacy(self): | def test_spacy(self): | ||||
data_set_dict = { | data_set_dict = { | ||||
'RTE': ('test/data_for_tests/io/RTE', RTEPipe, RTEBertPipe, (5, 5, 5), (425, 2)), | |||||
'Quora': ('test/data_for_tests/io/Quora', QuoraPipe, QuoraBertPipe, (2, 2, 2), (93, 2)), | |||||
} | } | ||||
for k, v in data_set_dict.items(): | for k, v in data_set_dict.items(): | ||||
path, pipe1, pipe2, data_set, vocab = v | path, pipe1, pipe2, data_set, vocab = v | ||||